I usually work under a Linux machine, but here something I did using a virtual machine.
- I downloaded the windows installer from https://github.com/coq/coq/releases/tag/V8.9.1
- I downladed the lf.tgz file from https://softwarefoundations.cis.upenn.edu/lf-current/index.html
- I ran the windows installer for Coq. It placed the coq system in C:\coq
- I used
cygwin
tools to expand the file lf.tgz
so that I had a directory C:\Users\user\foundations\lf
containing Basics.v
, _CoqProject
etc.
Then I used the search command to find coqide
as an installed app. I then proceeded with the following steps:
- start coqide
- open the file
Basics.v
- use the option Compile->Compile buffer
I could then observe that the directory C:\Users\user\foundations\lf
contained a file named Basics.vo
- Then I opened a new buffer, and wrote
From LF Require Export Basics.
and did not try to execute this line
- I saved this buffer in a file in directory
C:\Users\user\foundations\lf
. Let's assume this file is named toto.v
- I closed the
toto.v
buffer.
- I re-opened the
toto.v
using the option File->Open
- I executed the file contents.
This process is the result of trial-and-error. What I know is that Require Export ...
only works if there are ...vo
files on you disk, but coqide needs to know where to look for these files. For this it maintains a "load path". When opening a file from a given directory, coqide looks in this directory (and ancestors) to find a _CoqProject
file, and the latter may contain directives to modify the load path. It is the case here "-Q . LF" indicates that all .vo files in the current directory should be considered, and that their symbolic name should start with the prefix "LF."
The problem is that when you start from an empty buffer, no _CoqProject
file gets read and coqide does not where to look for your data. This is why I did the steps 5-6-7: when reading the file toto.v
, I provoked the reading of the _CoqProject
file.
Takeaway lesson: Make sure the Basics.vo
file exists, and then make sure the buffer you are working on was obtained through a reading operation from the same directory. If needed, save, close, and re-open to make sure this is the case.