Skip to content

Commit

Permalink
basic smt checking plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalecha committed Feb 5, 2016
0 parents commit 1ce71f4
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
*~
*.vo
*.v.d
*.glob
*.cmi
*.cmo
*.cmx
*.cmxs
*.ml4.d
*.o
Makefile.coq
*.aux
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2016 Gregory Malecha

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: coq clean

coq: Makefile.coq
$(MAKE) -f Makefile.coq

Makefile.coq: Makefile $(MODULES)
$(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq

clean:: Makefile.coq
$(MAKE) -f Makefile.coq clean
rm -f Makefile.coq
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
coq-smt-check
=============

This is a simple way to invoke an SMT solver (currently Z3) on Coq goals.
It does *NOT* generate proof objects. It is meant purely for sanity checking
goals.

The main tactic is 'z3 solve' which invokes z3 on the current goal. The
core of the plugin is the conversion from Coq to SMT2 format. At the moment,
the conversion handles the following:

- boolean connectives, /\, \/, not
- equality
- variables
- real numbers, +, -, /, constants

If your problem fits in this fragment (it can contain other facts as well), then
you can run:

z3 solve.

If the tactic succees then the solver solved the tactic. If it fails it will
display an error message. To get more information about the problem that was
passed to the smt solver, run 'z3 solve debug'.

See the test-suite directory for examples.

Install from OPAM
-----------------
Make sure you added the [Coq repository](coq.io/opam/):

opam repo add coq-released https://coq.inria.fr/opam/released

and run:

opam install coq-smt-check

Contributors
------------

This plugin was started by Vignesh Gowada at UCSD as part of the [VeriDrone](http://veridrone.ucsd.edu/) project. It was updated and is currently maintained by Gregory Malecha.

External contributions are always welcome.
7 changes: 7 additions & 0 deletions _CoqProject
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-I src
-R theories SMT

-I $(COQLIB)/user-contrib/PluginUtils/

src/smtTactic.ml4
theories/Tactic.v
Loading

0 comments on commit 1ce71f4

Please sign in to comment.