Skip to content
Some scripts to help construct small reproducing examples of bugs, implement [Proof using], etc.
Python Other
  1. Python 99.7%
  2. Other 0.3%
Branch: master
Clone or download
JasonGross Allow 8.4pl6 to fail on travis
Apparently travis no longer supports Precise
(https://travis-ci.org/JasonGross/coq-tools/jobs/575163759), and I can't
get a working OCaml 3 package for Trusty, so I'm going to give up on Coq
8.4 compatibility testing.
Latest commit 9d61249 Aug 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
etc [travis] Do not fail on W: ... Signature by key ... uses weak digest … Jan 23, 2018
examples
.gitignore
.travis.yml Allow 8.4pl6 to fail on travis Aug 22, 2019
LICENSE Add MIT license Jun 21, 2016
Makefile
Popen_noblock.py Revert "Reorganize files into subtrees" Feb 7, 2015
README.md Update README.md May 21, 2018
TODO.md Add a TODO Dec 15, 2014
absolutize-imports.py Make python2 explicit Dec 20, 2017
admit_abstract.py
argparse.py
binding_util.py Handle no file_name in deduplicate_trailing_dir_bindings Jul 6, 2017
coq_version.py
coqtop-as-coqc.sh
coqtop.bat
custom_arguments.py Emit a warning on --arg "-w ..." Feb 20, 2018
diagnose_error.py Add get-admitted-names.py Jul 6, 2017
file_util.py Add minimize-requires.py Jun 5, 2016
find-bug.py Update error message Dec 18, 2018
get-admitted-names.py Don't raw_input on no overlap Jul 6, 2017
import_util.py minimize-requires: --all: read from _CoqProject May 21, 2018
inline-imports.py Factor out logging argument logic Jun 4, 2016
memoize.py Revert "Reorganize files into subtrees" Feb 7, 2015
minimize-requires.py minimize-requires: --all: read from _CoqProject May 21, 2018
minimizer_drivers.py Handle --absolutize without --no-keep-exports Jun 5, 2016
move-requires.py
move-vernaculars.py Make python2 explicit Dec 20, 2017
proof-using-helper.py Update proof-using-helper Apr 4, 2017
replace_imports.py
split_definitions.py
split_definitions_old.py
split_file.py
strip_comments.py Fix example 12 Jan 28, 2016
strip_newlines.py Revert "Reorganize files into subtrees" Feb 7, 2015
util.py

README.md

Build Status

coq-tools

Some scripts to help manipulate Coq developments

coq-bug-minimizer

Some scripts to help construct small reproducing examples of bugs.

The script find-bug.py is the main program; run find-bug.py -h to see the options. The script will ask you two questions: whether or not it successfully determined the error you're seeking to reproduce, and whether or not it created a regular expression which captures that error. After that, it will run without user input until it finishes.

Usage

Standard usage is to invoke with the buggy file name and the output (minimized) file name:

python2 find-bug.py BUGGY_FILE.v OUTPUT_FILE.v

You can add -v for a more verbose output.

If you are using a non-system version of Coq, you can pass --coqtop /path/to/coqtop and --coqc /path/to/coqc. If you pass -R . Foo to, say, coq_makefile, you can inform find-bug.py of this fact using -R . Foo.

Examples

There is an example in the examples directory. You can run run-example-01.sh to see how the program works. You can pass this script the arguments -v, -vv, or -vvv for different levels of verbosity. Look at the contents of run-example-01.sh to see how to invoke the program.

Known Bugs

Note that this program can fail in mysterious ways when run using Windows Python 2.7 under cygwin; it seems that buffering and stdin and stderr and Popen are screwed up. To work around this, there is a coqtop.bat file which is chosen as the default coqtop program. Somehow running via a .bat file makes things work. You will probably have to use a similar wrapper if you use a custom coqtop executable.

Additionally, quirks in module name resolution can result in inlining failures (see https://github.com/JasonGross/coq-tools/issues/16), and global side effects of Require can also result in failures (see https://github.com/JasonGross/coq-tools/issues/41).

minimize-requires

The script minimize-requires.py can be used to remove unneeded Require statements. Run minimize-requires.py -h to see the options.

Usage

Standard usage is to run

minimize-requires.py some-file1.v some-file2.v ... --in-place .bak

or, if you want to minimize an entire project,

minimize-requires.py --all -f _CoqProject

(you can add --in-place .bak if you want to save backup files)

proof-using-helper

The script proof-using-helper.py is the main program; run proof-using-helper.py -h to see the options.

Usage

Standard usage is to invoke with the any -R arguments passed to Coq, and either pipe the output of make quick with Global Set Suggest Proof Using on, to this script, or to give it a file containing said output.

make quick -j -k | tee -a proof_using.log
python2 /path/to/proof-using-helper.py proof_using.log

You can add -v for a more verbose output.

You can’t perform that action at this time.