1

I am very new to Coq.

In our project, we switched to using the coq_makefile utility and came across the following problem.

Stepping through a proof script would result in this error:

Require Import comparable.

Error:
The file /Users/ayman/open-source/regex-reexamined-coq/comparable.vo contains library
Top.comparable and not library comparable

Our _CoqProject file is very simple (maybe that is the problem), it just lists all the files in the project https://github.com/awalterschulze/regex-reexamined-coq/blob/2c865aecc00276e0a926c1729cc35553c1cc6767/_CoqProject.

1 Answers1

2

Coq libraries have a logical path. For example, files from the standard library all have a logical path starting with Coq. In your case, you did not specify anything about the logical path, so Coq arbitrarily puts the compiled files into a path starting with Top. Later, when trying to load the file, Coq compares the logical path Top to the physical path . and complains about the discrepancy.

The simplest fix is to add the following line to your _CoqProject file: -R . Top. Option -R maps a physical path (here .) to a logical path (here Top), which will fix the discrepancy.

But Top is a poor name for a library, so you should replace it with something else. Moreover, that name will serve as the installation path for your library, so choose a meaningful name (e.g., RegexDerivatives), as that is the name users will be using.

Guillaume Melquiond
  • 1,243
  • 4
  • 11