Create a make file:
coq_makefile -f _CoqProject -o Makefile
Now run make.
Run make .merlin to create the .merlin file.
-
CWAssert string? qualid Assumes qualid*This command fails if the tested
qualiddepends on an axiom which is not listed afterAssumes:CWAssert "Testing lemma" lemma Assumes proof_irrelevance functional_extensionality.
The string argument after
CWAssertis an optional message. -
CWAssert string? qualid : termChecks if the type of
qualidis convertible to the type given byterm.CWAssert "Testing type" lemma : (forall x, x > 0).
The string argument after
CWAssertis an optional message.Note that the
termshould be in parentheses. -
CWStopOnFailure 0/1This command controls whether Coq execution should be stopped after a failed test (
1) or not (0). The default behavior is to stop after the first failed test. -
CWGroup stringBegins a group of tests (outputs
<DESCRIBE::>).Groups can be nested. But all tests should be performed after
CWTestin nested groups. -
CWEndGroupEnds a group of tests.
-
CWTest stringBegins a test case (outputs
<IT::>).Test cases cannot be nested.
-
CWEndTestEnds a test case. This command is optional before
CWTestandCWEndGroup. -
CWFile string? Size < intTests if the size of a file (the first string argument) is less than the second argument.
The file name is optional. The default file is the solution file.
-
CWFile string? Matches stringTests if the content of a file matches a regular expression (the second argument). The regular expression syntax is OCaml Str (
\should not be escaped). -
CWFile string? Does Not Match stringTests if the content of a file does not match a regular expression (the second argument).
-
CWCompileAndRun ocaml_files* Options options? Driver driver_stringCompiles and runs given
ocaml_filesand the driver codedriver_string. The compilation is performed withocamlcand with the providedoptions.Require Extraction. Extraction "out.ml" plus. CWCompileAndRun "out.mli" "out.ml" Options "-I . -verbose" Driver " open Out let () = assert (add O (S O) = (S O)) ".
See cw_example/SolutionTest.v and cw_example_extraction/SolutionTest.v
More examples are in theories/Demo.v and theories/Demo2.v.
Compiling demo files:
coqc -I src -R theories/ CW theories/Demo.v
coqc -I src -R theories/ CW theories/Demo2.v