You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks to me like accumulating files is meant to be idempotent. I give an example where it is not, using Extra Dependency and accumulating into an Elpi program twice from separate Coq files. (The example uses a type abbreviation and draws the Elpi typecheck error "duplicate type abbreviation".)
There are several files:
progam.v provides a trivial Elpi program (think derive)
library.elpi provides some code we'll accumulate twice into the program
accumulate{1,2}.v each import program, accumulate the library into it, and typecheck the program
test_accumulate_twice.v requires accumulate{1,2}.v and cannot typecheck the program
dune sets up context (if you use dune, you'll also need a dune-project file)
The files follow inline. (In case it's simpler, here's a tarball: accumulate_bug.tgz.)
(I believe there are work arounds through either accumulating databases or never duplicating effects as done in this example.)
From accumulate_bug Extra Dependency "library.elpi" as library.
RequireImport accumulate_bug.program.
Elpi Accumulate program File library.
Elpi Typecheck program.
accumulate2.v
(Identical to accumulate1.v.)
test_accumulate_twice.v
RequireImport accumulate_bug.accumulate1.
RequireImport accumulate_bug.accumulate2.
Fail Elpi Typecheck program.
(*Error:File "ROOT/_build/default/fmdeps/cpp2v/elpi-extra/accumulate_bug/library.elpi", line 5, column 2, character 59:duplicate type abbreviation for cpp.bs. Previous declaration: File "ROOT/_build/default/fmdeps/cpp2v/elpi-extra/accumulate_bug/library.elpi", line 5, column 2, character 59:*)
I will check next week, but there is some code to avoid loading the same file twice. So I guess this is a bug. It is possible I do put the current v file name in the uuid of the unit one accumulates, that would explain the problem.
It looks to me like accumulating files is meant to be idempotent. I give an example where it is not, using
Extra Dependency
and accumulating into an Elpi program twice from separate Coq files. (The example uses a type abbreviation and draws the Elpi typecheck error "duplicate type abbreviation".)There are several files:
progam.v
provides a trivial Elpi program (thinkderive
)library.elpi
provides some code we'll accumulate twice into the programaccumulate{1,2}.v
each importprogram
, accumulate the library into it, and typecheck the programtest_accumulate_twice.v
requiresaccumulate{1,2}.v
and cannot typecheck the programdune
sets up context (if you use dune, you'll also need a dune-project file)The files follow inline. (In case it's simpler, here's a tarball: accumulate_bug.tgz.)
(I believe there are work arounds through either accumulating databases or never duplicating effects as done in this example.)
program.v
library.elpi
accumulate1.v
accumulate2.v
(Identical to
accumulate1.v
.)test_accumulate_twice.v
dune
The text was updated successfully, but these errors were encountered: