A modular library for CDCL(T) SMT solvers, with [wip] proof generation.
Find a file
Guillaume Bury 3124d55209 [bugfix?] Avoid forgetting theory conflict clauses
When theory raises a conflict, it is analysed, and the backtracck clause
that result is added to the solver, however, I didn't find yet a
satisfying answer as to wether the original clause is implied (or not)
by this backtrack clause, so in order not to lose information, we also
add the original conflict clause when it comes from the theory (because
if not, then it comes from a conflict detected during propgation, so the
conflict clause is actually already attached).
2016-11-22 17:04:18 +01:00
docs [doc] Updated inference rules 2016-10-18 19:10:31 +02:00
src [bugfix?] Avoid forgetting theory conflict clauses 2016-11-22 17:04:18 +01:00
tests Removed useless check option in test_api 2016-11-22 16:58:02 +01:00
.gitignore update some files 2016-07-22 11:31:17 +02:00
.header copyright header in .header; authors in opam file 2014-11-04 17:59:58 +01:00
.merlin [WIP] All is setup, remains to have real theories 2016-09-16 15:49:33 +02:00
.ocp-indent Everything has now been properly indented with ocp-indent. 2014-10-31 16:40:59 +01:00
.travis.yml [travis] Only build the bin for tests 2016-11-17 00:19:40 +01:00
_tags [WIP] All is setup, remains to have real theories 2016-09-16 15:49:33 +02:00
LICENSE update of license 2014-10-29 13:42:53 +01:00
Makefile update doc by merging everything into one dir 2016-11-21 15:02:35 +01:00
META wip: make SMT great again 2016-08-16 17:20:48 +02:00
opam Propagation reasons are now far more explicit 2016-04-15 12:09:23 +02:00
README.md fix url 2016-11-21 15:18:14 +01:00
TODO.md A bit of restructuring to have cleaner dependencies between fonctors 2015-07-21 19:20:40 +02:00

MSAT Build Status

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.

Documentation

See https://gbury.github.io/mSAT/

USAGE

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.

  • A dummy empty module to ensure generativity of the solver (solver modules heavily relies on side effects to their internal state)

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 = Msat.Sat.Fsat.fresh ()    (* A 'new_atom' is always distinct from any other atom *)
    let b = Msat.Sat.Fsat.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 *)

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