Module Solver.Solver_internal
Internal solver, available to theories.
module A = Amodule CC_A = CC_Amodule CC : Sidekick_core.CC_S with module CC_A = CC_Atype ty= A.Ty.ttype term= A.Term.ttype term_state= A.Term.statetype proof= A.Proof.ttype tMain type for a solver
type solver= t
module Expl = CC.Explmodule N = CC.Nval tst : t -> term_stateval cc : t -> CC.tCongruence closure for this solver
module Lit : sig ... end
type lit= Lit.t
Simplifiers
module Simplify : sig ... endtype simplify_hook= Simplify.hook
val add_simplifier : t -> Simplify.hook -> unitval simplifier : t -> Simplify.tval simp_t : t -> term -> term
hooks for the theory
val propagate : t -> actions -> lit -> reason:(unit -> lit list) -> A.Proof.t -> unitval raise_conflict : t -> actions -> lit list -> A.Proof.t -> 'aGive a conflict clause to the solver
val propagate : t -> actions -> lit -> (unit -> lit list) -> unitPropagate a boolean using a unit clause.
expl => litmust be a theory lemma, that is, a T-tautology
val propagate_l : t -> actions -> lit -> lit list -> unitPropagate a boolean using a unit clause.
expl => litmust be a theory lemma, that is, a T-tautology
val add_clause_temp : t -> actions -> lit list -> unitAdd local clause to the SAT solver. This clause will be removed when the solver backtracks.
val add_clause_permanent : t -> actions -> lit list -> unitAdd toplevel clause to the SAT solver. This clause will not be backtracked.
val add_lit : t -> actions -> lit -> unitAdd the given literal to the SAT solver, so it gets assigned a boolean value
val add_lit_t : t -> actions -> ?sign:bool -> term -> unitAdd the given (signed) bool term to the SAT solver, so it gets assigned a boolean value
val cc_raise_conflict_expl : t -> actions -> Expl.t -> 'aRaise a conflict with the given congruence closure explanation. it must be a theory tautology that
expl ==> absurd. To be used in theories.
val cc_merge : t -> actions -> N.t -> N.t -> Expl.t -> unitMerge these two nodes in the congruence closure, given this explanation. It must be a theory tautology that
expl ==> n1 = n2. To be used in theories.
val cc_merge_t : t -> actions -> term -> term -> Expl.t -> unitMerge these two terms in the congruence closure, given this explanation. See
cc_merge
val cc_add_term : t -> term -> N.tAdd/retrieve congruence closure node for this term. To be used in theories
val on_cc_merge : t -> (CC.t -> actions -> N.t -> N.t -> Expl.t -> unit) -> unitCallback for when two classes containing data for this key are merged
val on_cc_new_term : t -> (CC.t -> N.t -> term -> unit) -> unitCallback to add data on terms when they are added to the congruence closure
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list) -> unit) -> unitCallback called on every CC propagation
val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unitRegister callbacked to be called with the slice of literals newly added on the trail.
This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.
Preprocessors
These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.
type preprocess_hook= t -> mk_lit:(term -> lit) -> add_clause:(lit list -> unit) -> term -> term optionGiven a term, try to preprocess it. Return
Noneif it didn't change. Can also add clauses to define new terms.
val add_preprocess : t -> preprocess_hook -> unit