mirror of
https://github.com/c-cube/sidekick.git
synced 2026-01-28 12:24:50 -05:00
wip: feat(lra): expose state via a registry key
This commit is contained in:
parent
f7195bf980
commit
fb0668e7ba
2 changed files with 24 additions and 0 deletions
|
|
@ -2,5 +2,6 @@
|
||||||
(library
|
(library
|
||||||
(name sidekick_arith_lra)
|
(name sidekick_arith_lra)
|
||||||
(public_name sidekick.arith-lra)
|
(public_name sidekick.arith-lra)
|
||||||
|
(synopsis "Solver for LRA (real arithmetic)")
|
||||||
(flags :standard -warn-error -a+8 -w -32 -open Sidekick_util)
|
(flags :standard -warn-error -a+8 -w -32 -open Sidekick_util)
|
||||||
(libraries containers sidekick.core sidekick.arith))
|
(libraries containers sidekick.core sidekick.arith))
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ open Sidekick_core
|
||||||
module Simplex2 = Simplex2
|
module Simplex2 = Simplex2
|
||||||
module Predicate = Predicate
|
module Predicate = Predicate
|
||||||
module Linear_expr = Linear_expr
|
module Linear_expr = Linear_expr
|
||||||
|
module Linear_expr_intf = Linear_expr_intf
|
||||||
|
|
||||||
module type RATIONAL = Sidekick_arith.RATIONAL
|
module type RATIONAL = Sidekick_arith.RATIONAL
|
||||||
|
|
||||||
|
|
@ -79,6 +80,15 @@ end
|
||||||
module type S = sig
|
module type S = sig
|
||||||
module A : ARG
|
module A : ARG
|
||||||
|
|
||||||
|
(*
|
||||||
|
module SimpVar : Simplex2.VAR with type lit = A.S.Lit.t
|
||||||
|
module LE_ : Linear_expr_intf.S with module Var = SimpVar
|
||||||
|
module LE = LE_.Expr
|
||||||
|
*)
|
||||||
|
|
||||||
|
(** Simplexe *)
|
||||||
|
module SimpSolver : Simplex2.S
|
||||||
|
|
||||||
type state
|
type state
|
||||||
|
|
||||||
val create : ?stat:Stat.t ->
|
val create : ?stat:Stat.t ->
|
||||||
|
|
@ -87,6 +97,16 @@ module type S = sig
|
||||||
A.S.T.Ty.store ->
|
A.S.T.Ty.store ->
|
||||||
state
|
state
|
||||||
|
|
||||||
|
(* TODO: be able to declare some variables as ints *)
|
||||||
|
|
||||||
|
(*
|
||||||
|
val simplex : state -> Simplex.t
|
||||||
|
*)
|
||||||
|
|
||||||
|
val k_state : state A.S.Solver_internal.Registry.key
|
||||||
|
(** Key to access the state from outside,
|
||||||
|
available when the theory has been setup *)
|
||||||
|
|
||||||
val theory : A.S.theory
|
val theory : A.S.theory
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -638,10 +658,13 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
T.Tbl.add self.needs_th_combination t ()
|
T.Tbl.add self.needs_th_combination t ()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let k_state = SI.Registry.create_key ()
|
||||||
|
|
||||||
let create_and_setup si =
|
let create_and_setup si =
|
||||||
Log.debug 2 "(th-lra.setup)";
|
Log.debug 2 "(th-lra.setup)";
|
||||||
let stat = SI.stats si in
|
let stat = SI.stats si in
|
||||||
let st = create ~stat (SI.proof si) (SI.tst si) (SI.ty_st si) in
|
let st = create ~stat (SI.proof si) (SI.tst si) (SI.ty_st si) in
|
||||||
|
SI.Registry.set (SI.registry si) k_state st;
|
||||||
SI.add_simplifier si (simplify st);
|
SI.add_simplifier si (simplify st);
|
||||||
SI.on_preprocess si (preproc_lra st);
|
SI.on_preprocess si (preproc_lra st);
|
||||||
SI.on_final_check si (final_check_ st);
|
SI.on_final_check si (final_check_ st);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue