Why does bedrock2 use `Load`?
JasonGross opened this issue · comments
LiveVerif.v
ends in the middle of a section:
bedrock2/bedrock2/src/bedrock2Examples/LiveVerif/LiveVerif.v
Lines 1 to 52 in 113a3a9
This exposed a bug in my bug minimizer / coq (JasonGross/coq-tools#104, coq/coq#15497), but I'm confused why bedrock2 is set up this way.
LiveVerif.v
ends in the middle of a section:
This is intended, and therefore LifeVerif.v
is excluded from the build. You should never try to build LifeVerif.v
on its own.
LifeVerif.v
contains a lot of setup code (such as setting up a Ring
that depends on section variables) that I don't want to repeat in every file, and setup code that depends on section variables also can't be put into a file that other files then Import
, so I use Load
. The files (currently only 1) doing Load LiveVerif.
are not syntactically balanced wrt Section
and End
: The opening of the Section LiveVerif
happens through the Load
, whereas the End LiveVerif
is directly in the file, so I guess tools which want to parse or analyze this file and care about well-balanced Section
/End
need to inline Load
ed files, sorry for breaking your tool Jason... 😉
sorry for breaking your tool Jason... 😉
The biggest problem is that coqc will dump locations from the loaded file into the glob file for the file doing the loading, and of course using locations from LiveVerif.v
when dealing with swap.v
makes no sense. The secondary problem is that my tool doesn't know how to inline Load
, in large part because the .glob file contains no information about which file Coq actually picked up to inline.