mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
refactor: rush to have sidekick compile again. th-lra is commented out
This commit is contained in:
parent
1f79ee05f2
commit
d14617ca77
3 changed files with 41 additions and 30 deletions
|
|
@ -9,6 +9,7 @@ module Fmt = CCFormat
|
|||
module Term = Sidekick_base.Term
|
||||
module Solver = Sidekick_smtlib.Solver
|
||||
module Process = Sidekick_smtlib.Process
|
||||
module Proof = Sidekick_smtlib.Proof_trace
|
||||
open E.Infix
|
||||
|
||||
type 'a or_error = ('a, string) E.t
|
||||
|
|
@ -121,8 +122,7 @@ let check_limits () =
|
|||
raise Out_of_space
|
||||
|
||||
let main_smt () : _ result =
|
||||
let module Proof = Sidekick_smtlib.Proof in
|
||||
let tst = Term.create ~size:4_096 () in
|
||||
let tst = Term.Store.create ~size:4_096 () in
|
||||
|
||||
let enable_proof_ = !check || !p_proof || !proof_file <> "" in
|
||||
Log.debugf 1 (fun k -> k "(@[proof-enable@ %B@])" enable_proof_);
|
||||
|
|
@ -144,23 +144,26 @@ let main_smt () : _ result =
|
|||
run_with_tmp_file @@ fun temp_proof_file ->
|
||||
Log.debugf 1 (fun k -> k "(@[temp-proof-file@ %S@])" temp_proof_file);
|
||||
|
||||
let config =
|
||||
if enable_proof_ then
|
||||
Proof.Config.default |> Proof.Config.enable true
|
||||
|> Proof.Config.store_on_disk_at temp_proof_file
|
||||
else
|
||||
Proof.Config.empty
|
||||
in
|
||||
(* FIXME
|
||||
let config =
|
||||
if enable_proof_ then
|
||||
Proof.Config.default |> Proof.Config.enable true
|
||||
|> Proof.Config.store_on_disk_at temp_proof_file
|
||||
else
|
||||
Proof.Config.empty
|
||||
in
|
||||
|
||||
(* main proof object *)
|
||||
let proof = Proof.create ~config () in
|
||||
(* main proof object *)
|
||||
let proof = Proof.create ~config () in
|
||||
*)
|
||||
let proof = Proof.dummy in
|
||||
|
||||
let solver =
|
||||
let theories =
|
||||
(* TODO: probes, to load only required theories *)
|
||||
[ Process.th_bool; Process.th_data; Process.th_lra ]
|
||||
[ Process.th_bool; Process.th_data (* FIXME Process.th_lra *) ]
|
||||
in
|
||||
Process.Solver.create ~proof ~theories tst () ()
|
||||
Process.Solver.create_default ~proof ~theories tst
|
||||
in
|
||||
|
||||
let finally () =
|
||||
|
|
@ -192,16 +195,17 @@ let main_smt () : _ result =
|
|||
res
|
||||
|
||||
let main_cnf () : _ result =
|
||||
let module Proof = Pure_sat_solver.Proof in
|
||||
let module S = Pure_sat_solver in
|
||||
let proof, in_memory_proof =
|
||||
if !check then (
|
||||
let pr, inmp = Proof.create_in_memory () in
|
||||
pr, Some inmp
|
||||
) else if !proof_file <> "" then
|
||||
Proof.create_to_file !proof_file, None
|
||||
else
|
||||
Proof.dummy, None
|
||||
(* FIXME
|
||||
if !check then (
|
||||
let pr, inmp = Proof.create_in_memory () in
|
||||
pr, Some inmp
|
||||
) else if !proof_file <> "" then
|
||||
Proof.create_to_file !proof_file, None
|
||||
else
|
||||
*)
|
||||
Proof.dummy, None
|
||||
in
|
||||
|
||||
let stat = Stat.create () in
|
||||
|
|
@ -211,9 +215,10 @@ let main_cnf () : _ result =
|
|||
Proof.close proof
|
||||
in
|
||||
CCFun.protect ~finally @@ fun () ->
|
||||
let solver = S.SAT.create ~size:`Big ~proof ~stat () in
|
||||
let tst = Term.Store.create () in
|
||||
let solver = S.SAT.create_pure_sat ~size:`Big ~proof ~stat () in
|
||||
|
||||
S.Dimacs.parse_file solver !file >>= fun () ->
|
||||
S.Dimacs.parse_file solver tst !file >>= fun () ->
|
||||
let r = S.solve ~check:!check ?in_memory_proof solver in
|
||||
(* FIXME: if in memory proof and !proof_file<>"",
|
||||
then dump proof into file now *)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type 'a or_error = ('a, string) CCResult.t
|
|||
|
||||
module E = CCResult
|
||||
module Fmt = CCFormat
|
||||
module Solver = Sidekick_smt_solver.Solver
|
||||
module Solver = Sidekick_base.Solver
|
||||
|
||||
module Check_cc = struct
|
||||
module SI = Sidekick_smt_solver.Solver_internal
|
||||
|
|
@ -326,10 +326,14 @@ let process_stmt ?gc ?restarts ?(pp_cnf = false) ?proof_file ?pp_model
|
|||
| Statement.Stmt_data _ -> E.return ()
|
||||
| Statement.Stmt_define _ -> Error.errorf "cannot deal with definitions yet"
|
||||
|
||||
module Th_data = Th_data
|
||||
module Th_bool = Th_bool
|
||||
module Th_lra = Th_lra
|
||||
module Th_data = Sidekick_base.Th_data
|
||||
module Th_bool = Sidekick_base.Th_bool
|
||||
(* FIXME
|
||||
module Th_lra = Sidekick_base.Th_lra
|
||||
*)
|
||||
|
||||
let th_bool : Solver.theory = Th_bool.theory
|
||||
let th_data : Solver.theory = Th_data.theory
|
||||
let th_lra : Solver.theory = Th_lra.theory
|
||||
(* FIXME
|
||||
let th_lra : Solver.theory = Th_lra.theory
|
||||
*)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
(** {1 Process Statements} *)
|
||||
|
||||
open Sidekick_base
|
||||
module Solver = Sidekick_smt_solver.Solver
|
||||
module Solver = Sidekick_base.Solver
|
||||
|
||||
val th_bool : Solver.theory
|
||||
val th_data : Solver.theory
|
||||
val th_lra : Solver.theory
|
||||
(* FIXME
|
||||
val th_lra : Solver.theory
|
||||
*)
|
||||
|
||||
type 'a or_error = ('a, string) CCResult.t
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue