mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-05 19:00:33 -05:00
rename to cdcl
This commit is contained in:
parent
8c8209c08c
commit
ac396e8cf5
30 changed files with 54 additions and 64 deletions
5
Makefile
5
Makefile
|
|
@ -22,13 +22,14 @@ build-dev:
|
|||
jbuilder build $(OPTS) @install --dev
|
||||
|
||||
build-test: build
|
||||
jbuilder build $(OPTS) src/main_test/msat_test.exe
|
||||
jbuilder build $(OPTS) src/main_test/main_test.exe
|
||||
|
||||
test: build-test
|
||||
@echo "run API tests…"
|
||||
jbuilder runtest
|
||||
@echo "run benchmarks…"
|
||||
@/usr/bin/time -f "%e" ./tests/run smt
|
||||
@/usr/bin/time -f "%e" ./tests/run sat
|
||||
#@/usr/bin/time -f "%e" ./tests/run smt
|
||||
# @/usr/bin/time -f "%e" ./tests/run mcsat
|
||||
|
||||
enable_log:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
opam-version: "1.2"
|
||||
name: "msat"
|
||||
name: "cdcl"
|
||||
license: "Apache"
|
||||
version: "dev"
|
||||
author: ["Sylvain Conchon" "Alain Mebsout" "Stephane Lecuyer" "Simon Cruanes" "Guillaume Bury"]
|
||||
|
|
@ -19,7 +19,7 @@ available: [
|
|||
ocaml-version >= "4.03.0"
|
||||
]
|
||||
tags: [ "sat" "smt" ]
|
||||
homepage: "https://github.com/Gbury/mSAT"
|
||||
dev-repo: "https://github.com/Gbury/mSAT.git"
|
||||
bug-reports: "https://github.com/Gbury/mSAT/issues/"
|
||||
homepage: "https://github.com/c-cube/cdcl"
|
||||
dev-repo: "https://github.com/c-cube/cdcl.git"
|
||||
bug-reports: "https://github.com/c-cube/cdcl/issues/"
|
||||
|
||||
1
main.exe
Symbolic link
1
main.exe
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
_build/default/src/main_test/main_test.exe
|
||||
1
msat.exe
1
msat.exe
|
|
@ -1 +0,0 @@
|
|||
_build/default/src/main_test/msat_test.exe
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
MSAT is free software, using the Apache license, see file LICENSE
|
||||
Copyright 2015 Guillaume Bury
|
||||
*)
|
||||
open Msat
|
||||
|
||||
module type S = Backend_intf.S
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ Copyright 2015 Guillaume Bury
|
|||
This module provides an easy way to produce coq scripts
|
||||
corresponding to the resolution proofs output by the
|
||||
sat solver. *)
|
||||
open Msat
|
||||
|
||||
module type S = Backend_intf.S
|
||||
(** Interface for exporting proofs. *)
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ MSAT is free software, using the Apache license, see file LICENSE
|
|||
Copyright 2015 Guillaume Bury
|
||||
*)
|
||||
|
||||
open Msat
|
||||
|
||||
module type S = Backend_intf.S
|
||||
|
||||
module type Arg = sig
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ Copyright 2014 Simon Cruanes
|
|||
Work in progress...
|
||||
*)
|
||||
|
||||
open Msat
|
||||
|
||||
module type S = Backend_intf.S
|
||||
|
||||
module type Arg = sig
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ Copyright 2014 Guillaume Bury
|
|||
Copyright 2014 Simon Cruanes
|
||||
*)
|
||||
|
||||
open Msat
|
||||
|
||||
module type S = sig
|
||||
type st
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ Copyright 2014 Simon Cruanes
|
|||
iCNF formats.
|
||||
*)
|
||||
|
||||
open Msat
|
||||
|
||||
module type S = sig
|
||||
type st
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ Copyright 2014 Guillaume Bury
|
|||
Copyright 2014 Simon Cruanes
|
||||
*)
|
||||
|
||||
open Msat
|
||||
|
||||
(** Output interface for the backend *)
|
||||
module type S = Backend_intf.S
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ Copyright 2014 Simon Cruanes
|
|||
This module provides functions to export proofs into the dot graph format.
|
||||
Graphs in dot format can be used to generates images using the graphviz tool.
|
||||
*)
|
||||
open Msat
|
||||
|
||||
module type S = Backend_intf.S
|
||||
(** Interface for exporting proofs. *)
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
; main binary
|
||||
(library
|
||||
((name msat_backend)
|
||||
(public_name msat.backend)
|
||||
(synopsis "proof backends for msat")
|
||||
(libraries (msat))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string))
|
||||
((name CDCL_backend)
|
||||
(public_name cdcl.backend)
|
||||
(synopsis "proof backends for cdcl")
|
||||
(libraries (cdcl))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string -open CDCL))
|
||||
(ocamlopt_flags (:standard -O3 -bin-annot
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
; vim:ft=lisp:
|
||||
|
||||
(library
|
||||
((name msat)
|
||||
(public_name msat)
|
||||
(synopsis "core data structures and algorithms for msat")
|
||||
((name CDCL)
|
||||
(public_name cdcl)
|
||||
(synopsis "core data structures and algorithms for cdcl")
|
||||
(libraries ())
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string))
|
||||
(ocamlopt_flags (:standard -O3 -bin-annot
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
; vim:ft=lisp:
|
||||
|
||||
(executable
|
||||
((name msat_test)
|
||||
(libraries (msat msat.backend msat.tseitin msat.sat dolmen))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string -open Msat))
|
||||
((name main_test)
|
||||
(libraries (cdcl cdcl.backend cdcl.tseitin cdcl.sat dolmen))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string -open CDCL))
|
||||
(ocamlopt_flags (:standard -O3 -bin-annot
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
))
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ module type S = sig
|
|||
end
|
||||
|
||||
module Make
|
||||
(S : Msat.S)
|
||||
(S : CDCL.S)
|
||||
(Th : sig
|
||||
include Msat.Theory_intf.S with type t = S.theory
|
||||
include CDCL.Theory_intf.S with type t = S.theory
|
||||
end)
|
||||
(T : sig
|
||||
include Type.S with type atom := S.atom
|
||||
|
|
@ -37,7 +37,7 @@ module Make
|
|||
val do_task : Dolmen.Statement.t -> unit
|
||||
end = struct
|
||||
|
||||
module D = Msat_backend.Dot.Make(S.Proof)(Msat_backend.Dot.Default(S.Proof))
|
||||
module D = CDCL_backend.Dot.Make(S.Proof)(CDCL_backend.Dot.Default(S.Proof))
|
||||
|
||||
let hyps = ref []
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ module Make
|
|||
let th = S.theory st
|
||||
let t_st = T.create th
|
||||
|
||||
let check_model (Msat.Sat_state sat) =
|
||||
let check_model (CDCL.Sat_state sat) =
|
||||
let check_clause c =
|
||||
let l = List.map (function a ->
|
||||
Log.debugf 99
|
||||
|
|
@ -66,7 +66,7 @@ module Make
|
|||
raise Incorrect_model;
|
||||
let t' = Sys.time () -. t in
|
||||
Format.printf "Sat (%f/%f)@." t t'
|
||||
| S.Unsat (Msat.Unsat_state us) ->
|
||||
| S.Unsat (CDCL.Unsat_state us) ->
|
||||
if !p_check then begin
|
||||
let p = us.get_proof () in
|
||||
S.Proof.check p;
|
||||
|
|
@ -113,9 +113,9 @@ module Make
|
|||
Dolmen.Statement.print s
|
||||
end
|
||||
|
||||
module Sat = Make(Msat_sat)(Msat_sat.Th)(Type_sat)
|
||||
module Sat = Make(CDCL_sat)(CDCL_sat.Th)(Type_sat)
|
||||
(*
|
||||
module Smt = Make(Minismt_smt)(Msat_sat.Th)(Minismt_smt.Type)
|
||||
module Smt = Make(Minismt_smt)(CDCL_sat.Th)(Minismt_smt.Type)
|
||||
*)
|
||||
|
||||
let solver = ref (module Sat : S)
|
||||
|
|
@ -10,7 +10,7 @@ Copyright 2014 Simon Cruanes
|
|||
module Id = Dolmen.Id
|
||||
module Ast = Dolmen.Term
|
||||
module H = Hashtbl.Make(Id)
|
||||
module Formula = Msat_tseitin.Make(Msat_sat.Th)
|
||||
module Formula = CDCL_tseitin.Make(CDCL_sat.Th)
|
||||
|
||||
(* Exceptions *)
|
||||
(* ************************************************************************ *)
|
||||
|
|
@ -36,7 +36,7 @@ let find_id st id =
|
|||
try
|
||||
H.find st.symbols id
|
||||
with Not_found ->
|
||||
let res = Msat_sat.Th.fresh st.fresh in
|
||||
let res = CDCL_sat.Th.fresh st.fresh in
|
||||
H.add st.symbols id res;
|
||||
res
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Copyright 2014 Simon Cruanes
|
|||
This module provides functions to parse terms from the untyped syntax tree
|
||||
defined in Dolmen, and generate formulas as defined in the Expr_sat module. *)
|
||||
|
||||
include Type.S with type atom := Msat_sat.Th.formula
|
||||
include Type.S with type atom := CDCL_sat.Th.formula
|
||||
|
||||
val create : Msat_sat.Th.t -> t
|
||||
val create : CDCL_sat.Th.t -> t
|
||||
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@ Copyright 2016 Guillaume Bury
|
|||
|
||||
module Th = Th_sat
|
||||
|
||||
include Msat.Make(Th)
|
||||
include CDCL.Make(Th)
|
||||
|
||||
|
|
@ -11,6 +11,6 @@ Copyright 2016 Guillaume Bury
|
|||
|
||||
module Th = Th_sat
|
||||
|
||||
include module type of Msat.Make(Th)
|
||||
include module type of CDCL.Make(Th)
|
||||
(** A functor that can generate as many solvers as needed. *)
|
||||
|
||||
|
|
@ -8,7 +8,7 @@ type proof = unit
|
|||
type formula = int
|
||||
|
||||
type t = {
|
||||
actions: (formula, proof) Msat.actions;
|
||||
actions: (formula, proof) CDCL.actions;
|
||||
mutable max_index: int;
|
||||
mutable max_fresh: int;
|
||||
}
|
||||
|
|
@ -49,9 +49,9 @@ module Form = struct
|
|||
|
||||
let norm a =
|
||||
abs a, if a < 0 then
|
||||
Msat.Negated
|
||||
CDCL.Negated
|
||||
else
|
||||
Msat.Same_sign
|
||||
CDCL.Same_sign
|
||||
|
||||
let print fmt a =
|
||||
Format.fprintf fmt "%s%s%d"
|
||||
|
|
@ -82,6 +82,6 @@ let iter: (t -> unit) -> unit = fun f ->
|
|||
done
|
||||
*)
|
||||
|
||||
let assume _ _ = Msat.Theory_intf.Sat
|
||||
let assume _ _ = CDCL.Theory_intf.Sat
|
||||
|
||||
let if_sat _ _ = Msat.Theory_intf.Sat
|
||||
let if_sat _ _ = CDCL.Theory_intf.Sat
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
near optimal efficiency (both in terms of space and time).
|
||||
*)
|
||||
|
||||
open Msat
|
||||
open CDCL
|
||||
|
||||
include Theory_intf.S with type formula = int and type proof = unit
|
||||
(** This modules implements the requirements for implementing an SAT Solver. *)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
; vim:ft=lisp:
|
||||
|
||||
(library
|
||||
((name msat_sat)
|
||||
(public_name msat.sat)
|
||||
(libraries (msat msat.tseitin))
|
||||
((name CDCL_sat)
|
||||
(public_name cdcl.sat)
|
||||
(libraries (cdcl cdcl.tseitin))
|
||||
(synopsis "sat interface")
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string -open Msat))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string -open CDCL))
|
||||
(ocamlopt_flags (:standard -O3 -bin-annot
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
; vim:ft=lisp:
|
||||
|
||||
(library
|
||||
((name msat_tseitin)
|
||||
(public_name msat.tseitin)
|
||||
(synopsis "Tseitin transformation for msat")
|
||||
((name CDCL_tseitin)
|
||||
(public_name cdcl.tseitin)
|
||||
(synopsis "Tseitin transformation for CDCL")
|
||||
(libraries ())
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string))
|
||||
(ocamlopt_flags (:standard -O3 -bin-annot
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
(executable
|
||||
((name test_api)
|
||||
(libraries (msat msat.tseitin msat.backend msat.sat))
|
||||
(libraries (cdcl cdcl.tseitin cdcl.backend cdcl.sat))
|
||||
(flags (:standard -w +a-4-42-44-48-50-58-32-60@8 -color always -safe-string))
|
||||
(ocamlopt_flags (:standard -O3 -color always
|
||||
-unbox-closures -unbox-closures-factor 20))
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
CURDIR=`dirname $0`
|
||||
SOLVER="$CURDIR/../msat.exe"
|
||||
SOLVER="$CURDIR/../main.exe"
|
||||
|
||||
solvertest () {
|
||||
for f in `find -L $1 -type f -name '*.cnf' -o -name '*.smt2'`
|
||||
# FIXME
|
||||
#for f in `find -L $1 -type f -name '*.cnf' -o -name '*.smt2'`
|
||||
for f in `find -L $1 -type f -name '*.cnf'`
|
||||
do
|
||||
echo -ne "\r\033[KTesting $f..."
|
||||
"$SOLVER" -s $3 -time 30s -size 1G -check $f | grep $2
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ Copyright 2014 Simon Cruanes
|
|||
|
||||
(* Tests that require the API *)
|
||||
|
||||
open Msat
|
||||
open CDCL
|
||||
|
||||
module Th = Msat_sat.Th
|
||||
module F = Msat_tseitin.Make(Th)
|
||||
module Th = CDCL_sat.Th
|
||||
module F = CDCL_tseitin.Make(Th)
|
||||
|
||||
let (|>) x f = f x
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ end
|
|||
|
||||
let mk_solver (): (module BASIC_SOLVER) =
|
||||
let module S = struct
|
||||
include Msat_sat
|
||||
include CDCL_sat
|
||||
let create() = create()
|
||||
let solve st ?assumptions () =
|
||||
match solve st ?assumptions() with
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue