Problem
I have a function leb
defined in one of the (transitively) imported file: Types.v
. However, calling it in my current file (Structures.v
) doesn't "evaluate" to a value. Instead, it expands to itself, which is unexpected.
To illustrate what I mean, here is the layout of the Coq project directory: (Note: Relevant file content are quoted as strings.)
$PROJECT_ROOT
|- _Coqproject
"-Q . DMFP"
|- Types.v
"Fixpoint leb (n m : nat) : bool := ..."
|- Recursion.v
"Require Export DMFP.Types. ..."
|- Structures.v
"Require Export DMFP.Recursion. ..."
As you can see, the function leb
is defined in Types.v
. But when I tried to use it in Structures.v
, it computes
to itself:
Compute (leb 2 3).
gives this:
= leb 2 3
: bool
Then,
Print leb.
gives this:
*** [ leb : nat -> nat -> bool ]
Arguments leb (n m)%nat_scope
Questions
- Why does
leb
expands to itself? - What does
*** [ leb : nat -> nat -> bool ]
mean withPrint leb.
? - How to make
leb
available inStructures.v
, such that I can useleb
as inTypes.v
where it is defined?
Thank you!
leb
as expected. The main difference was that I also added aMakefile
(this one, that I copied from somewhere but I don't remember where) and included the file names in the_CoqProject
so thatmake
could compile everything. Then I obtained the expected outputs inStructures.v
, not the ones you did. Question: what happens when youCompute
andPrint
inTypes.v
? Are you sure this is related to doing it on a different file? $\endgroup$Compute
andPrint
are indeed working fine inTypes.v
. $\endgroup$