mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -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 Term = Sidekick_base.Term
|
||||||
module Solver = Sidekick_smtlib.Solver
|
module Solver = Sidekick_smtlib.Solver
|
||||||
module Process = Sidekick_smtlib.Process
|
module Process = Sidekick_smtlib.Process
|
||||||
|
module Proof = Sidekick_smtlib.Proof_trace
|
||||||
open E.Infix
|
open E.Infix
|
||||||
|
|
||||||
type 'a or_error = ('a, string) E.t
|
type 'a or_error = ('a, string) E.t
|
||||||
|
|
@ -121,8 +122,7 @@ let check_limits () =
|
||||||
raise Out_of_space
|
raise Out_of_space
|
||||||
|
|
||||||
let main_smt () : _ result =
|
let main_smt () : _ result =
|
||||||
let module Proof = Sidekick_smtlib.Proof in
|
let tst = Term.Store.create ~size:4_096 () in
|
||||||
let tst = Term.create ~size:4_096 () in
|
|
||||||
|
|
||||||
let enable_proof_ = !check || !p_proof || !proof_file <> "" in
|
let enable_proof_ = !check || !p_proof || !proof_file <> "" in
|
||||||
Log.debugf 1 (fun k -> k "(@[proof-enable@ %B@])" enable_proof_);
|
Log.debugf 1 (fun k -> k "(@[proof-enable@ %B@])" enable_proof_);
|
||||||
|
|
@ -144,6 +144,7 @@ let main_smt () : _ result =
|
||||||
run_with_tmp_file @@ fun temp_proof_file ->
|
run_with_tmp_file @@ fun temp_proof_file ->
|
||||||
Log.debugf 1 (fun k -> k "(@[temp-proof-file@ %S@])" temp_proof_file);
|
Log.debugf 1 (fun k -> k "(@[temp-proof-file@ %S@])" temp_proof_file);
|
||||||
|
|
||||||
|
(* FIXME
|
||||||
let config =
|
let config =
|
||||||
if enable_proof_ then
|
if enable_proof_ then
|
||||||
Proof.Config.default |> Proof.Config.enable true
|
Proof.Config.default |> Proof.Config.enable true
|
||||||
|
|
@ -154,13 +155,15 @@ let main_smt () : _ result =
|
||||||
|
|
||||||
(* main proof object *)
|
(* main proof object *)
|
||||||
let proof = Proof.create ~config () in
|
let proof = Proof.create ~config () in
|
||||||
|
*)
|
||||||
|
let proof = Proof.dummy in
|
||||||
|
|
||||||
let solver =
|
let solver =
|
||||||
let theories =
|
let theories =
|
||||||
(* TODO: probes, to load only required 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
|
in
|
||||||
Process.Solver.create ~proof ~theories tst () ()
|
Process.Solver.create_default ~proof ~theories tst
|
||||||
in
|
in
|
||||||
|
|
||||||
let finally () =
|
let finally () =
|
||||||
|
|
@ -192,15 +195,16 @@ let main_smt () : _ result =
|
||||||
res
|
res
|
||||||
|
|
||||||
let main_cnf () : _ result =
|
let main_cnf () : _ result =
|
||||||
let module Proof = Pure_sat_solver.Proof in
|
|
||||||
let module S = Pure_sat_solver in
|
let module S = Pure_sat_solver in
|
||||||
let proof, in_memory_proof =
|
let proof, in_memory_proof =
|
||||||
|
(* FIXME
|
||||||
if !check then (
|
if !check then (
|
||||||
let pr, inmp = Proof.create_in_memory () in
|
let pr, inmp = Proof.create_in_memory () in
|
||||||
pr, Some inmp
|
pr, Some inmp
|
||||||
) else if !proof_file <> "" then
|
) else if !proof_file <> "" then
|
||||||
Proof.create_to_file !proof_file, None
|
Proof.create_to_file !proof_file, None
|
||||||
else
|
else
|
||||||
|
*)
|
||||||
Proof.dummy, None
|
Proof.dummy, None
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
@ -211,9 +215,10 @@ let main_cnf () : _ result =
|
||||||
Proof.close proof
|
Proof.close proof
|
||||||
in
|
in
|
||||||
CCFun.protect ~finally @@ fun () ->
|
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
|
let r = S.solve ~check:!check ?in_memory_proof solver in
|
||||||
(* FIXME: if in memory proof and !proof_file<>"",
|
(* FIXME: if in memory proof and !proof_file<>"",
|
||||||
then dump proof into file now *)
|
then dump proof into file now *)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ type 'a or_error = ('a, string) CCResult.t
|
||||||
|
|
||||||
module E = CCResult
|
module E = CCResult
|
||||||
module Fmt = CCFormat
|
module Fmt = CCFormat
|
||||||
module Solver = Sidekick_smt_solver.Solver
|
module Solver = Sidekick_base.Solver
|
||||||
|
|
||||||
module Check_cc = struct
|
module Check_cc = struct
|
||||||
module SI = Sidekick_smt_solver.Solver_internal
|
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_data _ -> E.return ()
|
||||||
| Statement.Stmt_define _ -> Error.errorf "cannot deal with definitions yet"
|
| Statement.Stmt_define _ -> Error.errorf "cannot deal with definitions yet"
|
||||||
|
|
||||||
module Th_data = Th_data
|
module Th_data = Sidekick_base.Th_data
|
||||||
module Th_bool = Th_bool
|
module Th_bool = Sidekick_base.Th_bool
|
||||||
module Th_lra = Th_lra
|
(* FIXME
|
||||||
|
module Th_lra = Sidekick_base.Th_lra
|
||||||
|
*)
|
||||||
|
|
||||||
let th_bool : Solver.theory = Th_bool.theory
|
let th_bool : Solver.theory = Th_bool.theory
|
||||||
let th_data : Solver.theory = Th_data.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} *)
|
(** {1 Process Statements} *)
|
||||||
|
|
||||||
open Sidekick_base
|
open Sidekick_base
|
||||||
module Solver = Sidekick_smt_solver.Solver
|
module Solver = Sidekick_base.Solver
|
||||||
|
|
||||||
val th_bool : Solver.theory
|
val th_bool : Solver.theory
|
||||||
val th_data : 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
|
type 'a or_error = ('a, string) CCResult.t
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue