A modular library for CDCL(T) SMT solvers, with [wip] proof generation.
Find a file
Guillaume Bury 9a5c23d9c5 [bugfix] termination check after full slice was wrong
When the solver finds a SAT result, it sends the whole
model to the theory, because maybe it can do something
interesting/costly to expand the proof search. After
that there must be a check to see if the theory has effectively done
something, in which case we should resume proof search, or if nothing
has been done, in which case the solver should return that the problem
is satisfiable. That check was incorrect before (checking number of
assumptions, and if the queue is all caught up), because new learnt
clauses (i.e tautologies, which are *not* assumptions) can be added that
do not immediately causes propagation, so that the number of assumptions
and the element queue is constant, but we should still resume the
search.
2016-03-04 16:30:51 +01:00
backend Res now includes solver type 2015-10-02 13:30:32 +02:00
docs added minisat paper 2014-11-03 23:28:27 +01:00
sat Update for compatibility with ocaml 4.00.1 2016-02-29 13:43:46 +01:00
smt Update for compatibility with ocaml 4.00.1 2016-02-29 13:43:46 +01:00
solver [bugfix] termination check after full slice was wrong 2016-03-04 16:30:51 +01:00
tests Cleaned makefile a bit + moved the testing binary 2016-01-30 17:02:24 +01:00
util [bugfix] termination check after full slice was wrong 2016-03-04 16:30:51 +01:00
.gitignore Cleaned makefile a bit + moved the testing binary 2016-01-30 17:02:24 +01:00
.header copyright header in .header; authors in opam file 2014-11-04 17:59:58 +01:00
.merlin Changed internal representation of proofs 2015-07-09 16:29:57 +02:00
.ocp-indent Everything has now been properly indented with ocp-indent. 2014-10-31 16:40:59 +01:00
_tags Added dummy arguments to some functors 2016-02-29 10:58:22 +01:00
LICENSE update of license 2014-10-29 13:42:53 +01:00
main.ml Small update to tool doc 2016-02-12 14:08:27 +01:00
Makefile Cleaned makefile a bit + moved the testing binary 2016-01-30 17:02:24 +01:00
META get rid of dependency on unix 2016-01-20 20:13:32 +01:00
msat.mlpack Big cleanup of interfaces. Breaks retro-compat ! 2016-01-31 02:09:16 +01:00
msat.odocl Fixed documentation generation 2016-02-05 14:32:31 +01:00
opam Update for compatibility with ocaml 4.00.1 2016-02-29 13:43:46 +01:00
README.md Added dummy arguments to some functors 2016-02-29 10:58:22 +01:00
TODO.md A bit of restructuring to have cleaner dependencies between fonctors 2015-07-21 19:20:40 +02:00

MSAT

MSAT is an OCaml library that features a modular SAT-solver and some extensions (including SMT). This is work in progress.

It derives from Alt-Ergo Zero.

This program is distributed under the Apache Software License version 2.0. See the enclosed file LICENSE.

USAGE

Sat Solver

A ready-to-use SAT solver is available in the Sat module. It can be used as shown in the following code :

    (* Module initialization *)
    module F = Msat.Sat.Tseitin
    module Sat = Msat.Sat.Make()

    (* We create here two distinct atoms *)
    let a = Sat.new_atom () (* A 'new_atom' is always distinct from any other atom *)
    let b = Sat.make 1      (* Atoms can be created from integers *)

    (* Let's create some formulas *)
    let p = F.make_atom a
    let q = F.make_atom b
    let r = F.make_and [p; q]
    let s = F.make_or [F.make_not p; F.make_not q]

    (* We can try and check the satisfiability of the given formulas *)
    Sat.assume (F.make_cnf r)
    let _ = Sat.solve ()        (* Should return Sat.Sat *)

    (* The Sat solver has an incremental mutable state, so we still have
     * the formula 'r' in our assumptions *)
    Sat.assume (F.make_cnf s)
    let _ = Sat.solve ()        (* Should return Sat.Unsat *)

Generic SAT/SMT Solver

A modular implementation of the SMT algorithm can be found in the Msat.Solver module, as a functor which takes two modules :

  • A representation of formulas (which implements the Formula_intf.S signature)

  • A theory (which implements the Theory_intf.S signature) to check consistence of assertions.

INSTALLATION

Via opam

Once the package is on opam, just opam install msat. For the development version, use:

opam pin add msat https://github.com/Gbury/mSAT.git

Manual installation

You will need ocamlfind. The command is:

make install