I have a very long list of coq projects I want to automatically install with opam pin/install
. I'd like to install them with opam because I am using this python tool (PyCoq) that uses opam pin/install. How can I automatically create a COQ_PROJ.opam / *.opam
file given a coq project that I can install with make?
For example, a format of a coq project/package (proj/pkg) that works for me is this: https://github.com/IBM/pycoq/tree/main/pycoq/test/lf
An idea is that in pip one can easily create a pip requirements file from a python project that is already installed (Automatically create requirements.txt). Thus, one possible solution could be:
- install the coq project with make (or it's instructions)
- run the equivalent of
pip freeze > requirements.txt
but for coq.
How does one do that?
sample list of coq projs:
[
{
"project_name": "constructive-geometry",
"train_files": [
"problems.v",
"affinity.v",
"basis.v",
"orthogonality.v",
"part1.v",
"part3.v",
"part2.v"
],
"test_files": [],
"switch": "coq-8.10"
},
{
"project_name": "higman-s",
"train_files": [
"inductive_wqo.v",
"higman_aux.v",
"higman.v",
"list_embeding.v",
"tree.v"
],
"test_files": [],
"switch": "coq-8.10"
},
{
"project_name": "int-map",
"train_files": [
"Mapcanon.v",
"Mapc.v",
"Mapaxioms.v",
"Map.v",
"Adalloc.v",
"Fset.v",
"Mapsubset.v",
"Mapfold.v",
"Maplists.v",
"Lsort.v",
"Mapcard.v",
"Allmaps.v",
"FMapIntMap.v",
"Mapiter.v"
],
...
I do know about opam switch export/import/create
but I doubt it works due to this reason:
I think opam switch export assumes that everything I've installed so far was already available in your opam switch already: Save the current switch state to a file.. Thus I think it assumes that you've installed everything so far with opam which is not always true for every coq project afaik and if it were I wouldn't have this issue in the first place -- since I would have used opam pin/install in the first place to install the coq proj/pkg. I think some coq projects/packages use a coq_makefile -f _CoqProject -o CoqMakefile followed by a make command (ref: https://coq.inria.fr/refman/practical-tools/utilities.html#building-a-coq-project, https://stackoverflow.com/questions/72586352/what-is-the-best-practice-for-installing-external-dependencies-in-a-coq-project). Those that use make are my target. I know make can run arbitrary code but I am hoping there is a standard way to install things in coq that will help me connect it with opam...or python...
though I could try running make
and then opam switch export
though I don't know how opam would know how make compiled and got dependencies if make
uses only coqc
or something else that doesn't install it to opam...any ideas?
Perhaps useful self contained coq proj/pkg: https://github.com/brando90/pycoq/tree/main/debug_proj though it uses no external dependencies for now :(, help extending it for even the simplest depedency for the sake of example is welcomed!
references:
- proverbot's discussion: https://github.com/UCSD-PL/proverbot9001/issues/27
- question/discussion in the original coq-gym repo: https://github.com/princeton-vl/CoqGym/discussions/77
- coq projects: https://github.com/UCSD-PL/proverbot9001/tree/master/coq-projects
- useful reference for install coq projs: What is the best practice for installing external dependencies in a Coq project?
- gitissue in my PyCoq fork: https://github.com/brando90/pycoq/issues/4
- https://coq.zulipchat.com/#narrow/stream/252087-Machine-learning-and-automation/topic/Installation.20of.20a.20diverse.20set.20of.20Coq.20package.20for.20ML/near/294876190