Is there any way to extract to OCaml so that a particular type is completely abstract in the resulting .mli file?
Or is there a way to structure Coq developments (preferably without modules) so that this occurs?
For example, say we have the following .v file:
Inductive foo = | A | B.
Definition isA (f: foo) : bool :=
match f with
| A => true
| B => false
end.
From which we want to produce the following .mli file:
type foo
val isA : foo -> bool
to my knowledge, there is no way to control the design of the .mli
file except by hacking the extraction plugin (not recommended). It can also turn out that .mli
file is essentially wrong/invalid and won't compile, due to impedance mismatches between the Coq and OCaml typesystems. Probably our best hope for the future is https://github.com/yforster/coq-malfunction rather than an overhaul of the existing direct-to-OCaml extraction
I see, thanks for the info
what people do in practice is that they post-process the .mli
file, typically, e.g., with sed
Yep, post process is the way to go, in any case.
and in the coq-malfunction workflow, one would typically write an .mli
from scratch, right?
Last updated: Oct 13 2024 at 01:02 UTC