From 51a784d487eb81b7f421975b4830d6853b4c06e8 Mon Sep 17 00:00:00 2001 From: c-cube Date: Mon, 27 Sep 2021 04:02:21 +0000 Subject: [PATCH] deploy: 5bed2d1c5f4ec2f7186baee56bd21113b1ccca8b --- .../Sidekick_base_solver/Solver/Solver_internal/index.html | 2 +- .../Sidekick_base_solver/Th_bool/A/S/Solver_internal/index.html | 2 +- .../Sidekick_base_solver/Th_data/A/S/Solver_internal/index.html | 2 +- .../Sidekick_base_solver/Th_lra/A/S/Solver_internal/index.html | 2 +- .../Sidekick_smtlib/Process/Solver/Solver_internal/index.html | 2 +- .../Sidekick_smtlib__/Process/Solver/Solver_internal/index.html | 2 +- .../Sidekick_smtlib__Process/Solver/Solver_internal/index.html | 2 +- .../Make/argument-1-A/S/Solver_internal/index.html | 2 +- .../module-type-ARG/S/Solver_internal/index.html | 2 +- .../module-type-S/A/S/Solver_internal/index.html | 2 +- .../Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html | 2 +- dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html | 2 +- .../Sidekick_core/module-type-SOLVER/Solver_internal/index.html | 2 +- .../Sidekick_core/module-type-SOLVER_INTERNAL/index.html | 2 +- dev/sidekick/Sidekick_sat/Solver/Make_cdcl_t/index.html | 2 +- dev/sidekick/Sidekick_sat/Solver/Make_pure_sat/index.html | 2 +- dev/sidekick/Sidekick_sat/Solver/module-type-S/index.html | 2 +- dev/sidekick/Sidekick_sat/Solver_intf/Clause_pool_id/index.html | 2 ++ dev/sidekick/Sidekick_sat/Solver_intf/index.html | 2 +- .../Sidekick_sat/Solver_intf/module-type-ACTS/index.html | 2 +- dev/sidekick/Sidekick_sat/Solver_intf/module-type-S/index.html | 2 +- dev/sidekick/Sidekick_sat/module-type-ACTS/index.html | 2 +- dev/sidekick/Sidekick_sat/module-type-S/index.html | 2 +- dev/sidekick/Sidekick_sat__/Solver/Make_cdcl_t/index.html | 2 +- dev/sidekick/Sidekick_sat__/Solver/Make_pure_sat/index.html | 2 +- dev/sidekick/Sidekick_sat__/Solver/module-type-S/index.html | 2 +- .../Sidekick_sat__/Solver_intf/Clause_pool_id/index.html | 2 ++ dev/sidekick/Sidekick_sat__/Solver_intf/index.html | 2 +- .../Sidekick_sat__/Solver_intf/module-type-ACTS/index.html | 2 +- .../Sidekick_sat__/Solver_intf/module-type-S/index.html | 2 +- dev/sidekick/Sidekick_sat__Solver/Make_cdcl_t/index.html | 2 +- dev/sidekick/Sidekick_sat__Solver/Make_pure_sat/index.html | 2 +- dev/sidekick/Sidekick_sat__Solver/module-type-S/index.html | 2 +- .../Sidekick_sat__Solver_intf/Clause_pool_id/index.html | 2 ++ dev/sidekick/Sidekick_sat__Solver_intf/index.html | 2 +- .../Sidekick_sat__Solver_intf/module-type-ACTS/index.html | 2 +- dev/sidekick/Sidekick_sat__Solver_intf/module-type-S/index.html | 2 +- .../Sidekick_smt_solver/Make/Solver_internal/index.html | 2 +- .../module-type-S/Solver_internal/index.html | 2 +- .../Make/argument-1-A/S/Solver_internal/index.html | 2 +- .../module-type-ARG/S/Solver_internal/index.html | 2 +- .../module-type-S/A/S/Solver_internal/index.html | 2 +- .../Make/argument-1-A/S/Solver_internal/index.html | 2 +- .../module-type-ARG/S/Solver_internal/index.html | 2 +- .../module-type-S/A/S/Solver_internal/index.html | 2 +- .../Make/argument-1-A/S/Solver_internal/index.html | 2 +- .../module-type-ARG/S/Solver_internal/index.html | 2 +- .../module-type-S/A/S/Solver_internal/index.html | 2 +- dev/sidekick/Sidekick_util/VecI32/index.html | 2 +- dev/sidekick/Sidekick_util/Vec_float/index.html | 2 +- dev/sidekick/Sidekick_util/Vec_sig/module-type-S/index.html | 2 +- dev/sidekick/Sidekick_util__/VecI32/index.html | 2 +- dev/sidekick/Sidekick_util__/Vec_float/index.html | 2 +- dev/sidekick/Sidekick_util__/Vec_sig/module-type-S/index.html | 2 +- dev/sidekick/Sidekick_util__VecI32/index.html | 2 +- dev/sidekick/Sidekick_util__Vec_float/index.html | 2 +- dev/sidekick/Sidekick_util__Vec_sig/module-type-S/index.html | 2 +- 57 files changed, 60 insertions(+), 54 deletions(-) create mode 100644 dev/sidekick/Sidekick_sat/Solver_intf/Clause_pool_id/index.html create mode 100644 dev/sidekick/Sidekick_sat__/Solver_intf/Clause_pool_id/index.html create mode 100644 dev/sidekick/Sidekick_sat__Solver_intf/Clause_pool_id/index.html diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/index.html index 3e5b6083..5d1bb66b 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-base.Sidekick_base_solver.Solver.Solver_internal)

Module Solver.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file +Solver_internal (sidekick-base.Sidekick_base_solver.Solver.Solver_internal)

Module Solver.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.clause_pool
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/index.html index 05709ab0..50d54b10 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal)

Module S.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file +Solver_internal (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal)

Module S.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.clause_pool
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/index.html index 3a5c1885..e6936948 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal)

Module S.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file +Solver_internal (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal)

Module S.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.clause_pool
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/index.html index 645fee92..bf10ebdc 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal)

Module S.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file +Solver_internal (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal)

Module S.Solver_internal

module T : sig ... end
module Lit : sig ... end
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.clause_pool
type proof = proof
type dproof = proof -> unit
module P : sig ... end
type t = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.t
type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit
type theory_actions = Sidekick_smt_solver.Make(Solver_arg).Solver_internal.theory_actions
type lit = Lit.t
val define_const : t -> const:term -> rhs:term -> unit
module CC : sig ... end
val cc : t -> CC.t
module Simplify : sig ... end
type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit
val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option
val simp_t : t -> term -> term
module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)
type preprocess_hook = t -> preprocess_actions -> term -> term option
val on_preprocess : t -> preprocess_hook -> unit
val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions
val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a
val push_decision : t -> theory_actions -> lit -> unit
val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit
val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit
val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit
val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit
val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit
val preprocess_term : t -> preprocess_actions -> term -> term
val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit
val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit
val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a
val cc_find : t -> CC.N.t -> CC.N.t
val cc_are_equal : t -> term -> term -> bool
val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit
val cc_merge_t : t -> theory_actions -> term -> term -> CC.Expl.t -> unit
val cc_add_term : t -> term -> CC.N.t
val cc_mem_term : t -> term -> bool
val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit
val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit
val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit
val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit
val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit
val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit
val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit
type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option
val on_model_gen : t -> model_hook -> unit
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html index f610f43d..09adcaf0 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html index 22cd5034..3f134af0 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-bin.Sidekick_smtlib__.Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick-bin.Sidekick_smtlib__.Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html index d0b0b5ed..2db6a5bd 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-bin.Sidekick_smtlib__Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick-bin.Sidekick_smtlib__Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/index.html index 4759c608..ab80050b 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html index 3d26600c..5dc181e3 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html index c387f7f3..e5043282 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html index 64390e80..83d5cd2c 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html @@ -1,2 +1,2 @@ -SI (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI)

Module 1-M.SI

module T : TERM
module Lit : LIT with module T = T
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P : PROOF with type lit = Lit.t and type term = term and type t = proof
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +SI (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI)

Module 1-M.SI

module T : TERM
module Lit : LIT with module T = T
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P : PROOF with type lit = Lit.t and type term = term and type t = proof
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html index 747f829c..4d2c87d0 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html @@ -1,2 +1,2 @@ -SI (sidekick.Sidekick_core.MONOID_ARG.SI)

Module MONOID_ARG.SI

module T : TERM
module Lit : LIT with module T = T
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P : PROOF with type lit = Lit.t and type term = term and type t = proof
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +SI (sidekick.Sidekick_core.MONOID_ARG.SI)

Module MONOID_ARG.SI

module T : TERM
module Lit : LIT with module T = T
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P : PROOF with type lit = Lit.t and type term = term and type t = proof
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html index e9185b5e..81631897 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_core.SOLVER.Solver_internal)

Module SOLVER.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_core.SOLVER.Solver_internal)

Module SOLVER.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html index 6ac50467..924c735e 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html @@ -1,2 +1,2 @@ -SOLVER_INTERNAL (sidekick.Sidekick_core.SOLVER_INTERNAL)

Module type Sidekick_core.SOLVER_INTERNAL

A view of the solver from a theory's point of view.

Theories should interact with the solver via this module, to assert new lemmas, propagate literals, access the congruence closure, etc.

module T : TERM
module Lit : LIT with module T = T
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P : PROOF with type lit = Lit.t and type term = term and type t = proof
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +SOLVER_INTERNAL (sidekick.Sidekick_core.SOLVER_INTERNAL)

Module type Sidekick_core.SOLVER_INTERNAL

A view of the solver from a theory's point of view.

Theories should interact with the solver via this module, to assert new lemmas, propagate literals, access the congruence closure, etc.

module T : TERM
module Lit : LIT with module T = T
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P : PROOF with type lit = Lit.t and type term = term and type t = proof
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver/Make_cdcl_t/index.html b/dev/sidekick/Sidekick_sat/Solver/Make_cdcl_t/index.html index ff6ddcb8..db9b7488 100644 --- a/dev/sidekick/Sidekick_sat/Solver/Make_cdcl_t/index.html +++ b/dev/sidekick/Sidekick_sat/Solver/Make_cdcl_t/index.html @@ -1,2 +1,2 @@ -Make_cdcl_t (sidekick.Sidekick_sat.Solver.Make_cdcl_t)

Module Solver.Make_cdcl_t

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type theory = Th.t
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +Make_cdcl_t (sidekick.Sidekick_sat.Solver.Make_cdcl_t)

Module Solver.Make_cdcl_t

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory = Th.t
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver/Make_pure_sat/index.html b/dev/sidekick/Sidekick_sat/Solver/Make_pure_sat/index.html index 7749b079..022dbbcc 100644 --- a/dev/sidekick/Sidekick_sat/Solver/Make_pure_sat/index.html +++ b/dev/sidekick/Sidekick_sat/Solver/Make_pure_sat/index.html @@ -1,2 +1,2 @@ -Make_pure_sat (sidekick.Sidekick_sat.Solver.Make_pure_sat)

Module Solver.Make_pure_sat

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type theory = unit
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +Make_pure_sat (sidekick.Sidekick_sat.Solver.Make_pure_sat)

Module Solver.Make_pure_sat

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory = unit
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver/module-type-S/index.html b/dev/sidekick/Sidekick_sat/Solver/module-type-S/index.html index c19fc2ec..e29ea201 100644 --- a/dev/sidekick/Sidekick_sat/Solver/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat/Solver/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat.Solver.S)

Module type Solver.S

Safe external interface of solvers.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Solver_intf.LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat.Solver.S)

Module type Solver.S

Safe external interface of solvers.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Solver_intf.LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver_intf/Clause_pool_id/index.html b/dev/sidekick/Sidekick_sat/Solver_intf/Clause_pool_id/index.html new file mode 100644 index 00000000..758a5fea --- /dev/null +++ b/dev/sidekick/Sidekick_sat/Solver_intf/Clause_pool_id/index.html @@ -0,0 +1,2 @@ + +Clause_pool_id (sidekick.Sidekick_sat.Solver_intf.Clause_pool_id)

Module Solver_intf.Clause_pool_id

type t = private int
val _unsafe_of_int : int -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver_intf/index.html b/dev/sidekick/Sidekick_sat/Solver_intf/index.html index ee2acfeb..d60556c7 100644 --- a/dev/sidekick/Sidekick_sat/Solver_intf/index.html +++ b/dev/sidekick/Sidekick_sat/Solver_intf/index.html @@ -1,2 +1,2 @@ -Solver_intf (sidekick.Sidekick_sat.Solver_intf)

Module Sidekick_sat.Solver_intf

Interface for Solvers

This modules defines the safe external interface for solvers. Solvers that implements this interface can be obtained using the Make functor in Solver or Mcsolver.

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type SAT_STATE = sig ... end
type 'form sat_state = (module SAT_STATE with type lit = 'form)

The type of values returned when the solver reaches a SAT state.

module type UNSAT_STATE = sig ... end
type ('lit, 'clause) unsat_state = (module UNSAT_STATE with type clause = 'clause and type lit = 'lit)

The type of values returned when the solver reaches an UNSAT state.

type same_sign = bool

This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.

type ('lit, 'proof) reason =
| Consequence of unit -> 'lit list * 'proof

The type of reasons for propagations of a lit f.

Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".

invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.

note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.

type lbool =
| L_true
| L_false
| L_undefined

Valuation of an atom

module type ACTS = sig ... end
type ('lit, 'proof) acts = (module ACTS with type lit = 'lit and type proof = 'proof)

The type for a slice of assertions to assume/propagate in the theory.

exception No_proof
module type LIT = sig ... end
module type PLUGIN_CDCL_T = sig ... end

Signature for theories to be given to the CDCL(T) solver

module type PLUGIN_SAT = sig ... end

Signature for pure SAT solvers

module type S = sig ... end

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

\ No newline at end of file +Solver_intf (sidekick.Sidekick_sat.Solver_intf)

Module Sidekick_sat.Solver_intf

Interface for Solvers

This modules defines the safe external interface for solvers. Solvers that implements this interface can be obtained using the Make functor in Solver or Mcsolver.

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type SAT_STATE = sig ... end
type 'form sat_state = (module SAT_STATE with type lit = 'form)

The type of values returned when the solver reaches a SAT state.

module type UNSAT_STATE = sig ... end
type ('lit, 'clause) unsat_state = (module UNSAT_STATE with type clause = 'clause and type lit = 'lit)

The type of values returned when the solver reaches an UNSAT state.

type same_sign = bool

This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.

type ('lit, 'proof) reason =
| Consequence of unit -> 'lit list * 'proof

The type of reasons for propagations of a lit f.

Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".

invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.

note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.

type lbool =
| L_true
| L_false
| L_undefined

Valuation of an atom

module Clause_pool_id : sig ... end
module type ACTS = sig ... end

Actions available to the Plugin

type ('lit, 'proof) acts = (module ACTS with type lit = 'lit and type proof = 'proof)

The type for a slice of assertions to assume/propagate in the theory.

exception No_proof
module type LIT = sig ... end
module type PLUGIN_CDCL_T = sig ... end

Signature for theories to be given to the CDCL(T) solver

module type PLUGIN_SAT = sig ... end

Signature for pure SAT solvers

module type S = sig ... end

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver_intf/module-type-ACTS/index.html b/dev/sidekick/Sidekick_sat/Solver_intf/module-type-ACTS/index.html index 4c3ffd1b..7df8541b 100644 --- a/dev/sidekick/Sidekick_sat/Solver_intf/module-type-ACTS/index.html +++ b/dev/sidekick/Sidekick_sat/Solver_intf/module-type-ACTS/index.html @@ -1,2 +1,2 @@ -ACTS (sidekick.Sidekick_sat.Solver_intf.ACTS)

Module type Solver_intf.ACTS

type lit
type proof
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file +ACTS (sidekick.Sidekick_sat.Solver_intf.ACTS)

Module type Solver_intf.ACTS

Actions available to the Plugin

The plugin provides callbacks for the SAT solver to use. These callbacks are provided with a (module ACTS) so they can modify the SAT solver by adding new lemmas, raise conflicts, etc.

type lit
type proof
type clause_pool_id = Clause_pool_id.t
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

  • C_use_allocator alloc puts the clause in the given allocator.
val add_clause_in_pool : pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but uses a custom clause pool for the clause, with its own lifetime.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/Solver_intf/module-type-S/index.html b/dev/sidekick/Sidekick_sat/Solver_intf/module-type-S/index.html index 0d6a56d1..609f6b66 100644 --- a/dev/sidekick/Sidekick_sat/Solver_intf/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat/Solver_intf/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat.Solver_intf.S)

Module type Solver_intf.S

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat.Solver_intf.S)

Module type Solver_intf.S

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/module-type-ACTS/index.html b/dev/sidekick/Sidekick_sat/module-type-ACTS/index.html index d12d6474..caf9884b 100644 --- a/dev/sidekick/Sidekick_sat/module-type-ACTS/index.html +++ b/dev/sidekick/Sidekick_sat/module-type-ACTS/index.html @@ -1,2 +1,2 @@ -ACTS (sidekick.Sidekick_sat.ACTS)

Module type Sidekick_sat.ACTS

type lit
type proof
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> Solver_intf.lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) Solver_intf.reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file +ACTS (sidekick.Sidekick_sat.ACTS)

Module type Sidekick_sat.ACTS

type lit
type proof
type clause_pool_id = Solver_intf.Clause_pool_id.t
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> Solver_intf.lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

  • C_use_allocator alloc puts the clause in the given allocator.
val add_clause_in_pool : pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but uses a custom clause pool for the clause, with its own lifetime.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) Solver_intf.reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat/module-type-S/index.html b/dev/sidekick/Sidekick_sat/module-type-S/index.html index 8e5c5cc8..4bfbd7fc 100644 --- a/dev/sidekick/Sidekick_sat/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat.S)

Module type Sidekick_sat.S

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Solver_intf.LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat.S)

Module type Sidekick_sat.S

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Solver_intf.LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver/Make_cdcl_t/index.html b/dev/sidekick/Sidekick_sat__/Solver/Make_cdcl_t/index.html index 8c6a6ef7..20148429 100644 --- a/dev/sidekick/Sidekick_sat__/Solver/Make_cdcl_t/index.html +++ b/dev/sidekick/Sidekick_sat__/Solver/Make_cdcl_t/index.html @@ -1,2 +1,2 @@ -Make_cdcl_t (sidekick.Sidekick_sat__.Solver.Make_cdcl_t)

Module Solver.Make_cdcl_t

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type theory = Th.t
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +Make_cdcl_t (sidekick.Sidekick_sat__.Solver.Make_cdcl_t)

Module Solver.Make_cdcl_t

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory = Th.t
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver/Make_pure_sat/index.html b/dev/sidekick/Sidekick_sat__/Solver/Make_pure_sat/index.html index 41c327e5..37fd2d60 100644 --- a/dev/sidekick/Sidekick_sat__/Solver/Make_pure_sat/index.html +++ b/dev/sidekick/Sidekick_sat__/Solver/Make_pure_sat/index.html @@ -1,2 +1,2 @@ -Make_pure_sat (sidekick.Sidekick_sat__.Solver.Make_pure_sat)

Module Solver.Make_pure_sat

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type theory = unit
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +Make_pure_sat (sidekick.Sidekick_sat__.Solver.Make_pure_sat)

Module Solver.Make_pure_sat

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory = unit
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver/module-type-S/index.html b/dev/sidekick/Sidekick_sat__/Solver/module-type-S/index.html index 82becb3c..3fee137d 100644 --- a/dev/sidekick/Sidekick_sat__/Solver/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat__/Solver/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat__.Solver.S)

Module type Solver.S

Safe external interface of solvers.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Sidekick_sat.Solver_intf.LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Sidekick_sat.Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat__.Solver.S)

Module type Solver.S

Safe external interface of solvers.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Sidekick_sat.Solver_intf.LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Sidekick_sat.Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver_intf/Clause_pool_id/index.html b/dev/sidekick/Sidekick_sat__/Solver_intf/Clause_pool_id/index.html new file mode 100644 index 00000000..c1143265 --- /dev/null +++ b/dev/sidekick/Sidekick_sat__/Solver_intf/Clause_pool_id/index.html @@ -0,0 +1,2 @@ + +Clause_pool_id (sidekick.Sidekick_sat__.Solver_intf.Clause_pool_id)

Module Solver_intf.Clause_pool_id

type t = private int
val _unsafe_of_int : int -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver_intf/index.html b/dev/sidekick/Sidekick_sat__/Solver_intf/index.html index ff36f25f..f9028bd2 100644 --- a/dev/sidekick/Sidekick_sat__/Solver_intf/index.html +++ b/dev/sidekick/Sidekick_sat__/Solver_intf/index.html @@ -1,2 +1,2 @@ -Solver_intf (sidekick.Sidekick_sat__.Solver_intf)

Module Sidekick_sat__.Solver_intf

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type SAT_STATE = sig ... end
type 'form sat_state = (module SAT_STATE with type lit = 'form)

The type of values returned when the solver reaches a SAT state.

module type UNSAT_STATE = sig ... end
type ('lit, 'clause) unsat_state = (module UNSAT_STATE with type clause = 'clause and type lit = 'lit)

The type of values returned when the solver reaches an UNSAT state.

type same_sign = bool

This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.

type ('lit, 'proof) reason =
| Consequence of unit -> 'lit list * 'proof

The type of reasons for propagations of a lit f.

Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".

invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.

note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.

type lbool =
| L_true
| L_false
| L_undefined

Valuation of an atom

module type ACTS = sig ... end
type ('lit, 'proof) acts = (module ACTS with type lit = 'lit and type proof = 'proof)

The type for a slice of assertions to assume/propagate in the theory.

exception No_proof
module type LIT = sig ... end
module type PLUGIN_CDCL_T = sig ... end

Signature for theories to be given to the CDCL(T) solver

module type PLUGIN_SAT = sig ... end

Signature for pure SAT solvers

module type S = sig ... end

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

\ No newline at end of file +Solver_intf (sidekick.Sidekick_sat__.Solver_intf)

Module Sidekick_sat__.Solver_intf

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type SAT_STATE = sig ... end
type 'form sat_state = (module SAT_STATE with type lit = 'form)

The type of values returned when the solver reaches a SAT state.

module type UNSAT_STATE = sig ... end
type ('lit, 'clause) unsat_state = (module UNSAT_STATE with type clause = 'clause and type lit = 'lit)

The type of values returned when the solver reaches an UNSAT state.

type same_sign = bool

This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.

type ('lit, 'proof) reason =
| Consequence of unit -> 'lit list * 'proof

The type of reasons for propagations of a lit f.

Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".

invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.

note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.

type lbool =
| L_true
| L_false
| L_undefined

Valuation of an atom

module Clause_pool_id : sig ... end
module type ACTS = sig ... end

Actions available to the Plugin

type ('lit, 'proof) acts = (module ACTS with type lit = 'lit and type proof = 'proof)

The type for a slice of assertions to assume/propagate in the theory.

exception No_proof
module type LIT = sig ... end
module type PLUGIN_CDCL_T = sig ... end

Signature for theories to be given to the CDCL(T) solver

module type PLUGIN_SAT = sig ... end

Signature for pure SAT solvers

module type S = sig ... end

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-ACTS/index.html b/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-ACTS/index.html index fb7a92cc..47198a66 100644 --- a/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-ACTS/index.html +++ b/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-ACTS/index.html @@ -1,2 +1,2 @@ -ACTS (sidekick.Sidekick_sat__.Solver_intf.ACTS)

Module type Solver_intf.ACTS

type lit
type proof
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file +ACTS (sidekick.Sidekick_sat__.Solver_intf.ACTS)

Module type Solver_intf.ACTS

Actions available to the Plugin

The plugin provides callbacks for the SAT solver to use. These callbacks are provided with a (module ACTS) so they can modify the SAT solver by adding new lemmas, raise conflicts, etc.

type lit
type proof
type clause_pool_id = Clause_pool_id.t
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

  • C_use_allocator alloc puts the clause in the given allocator.
val add_clause_in_pool : pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but uses a custom clause pool for the clause, with its own lifetime.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-S/index.html b/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-S/index.html index c718aee8..a74c9f82 100644 --- a/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat__/Solver_intf/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat__.Solver_intf.S)

Module type Solver_intf.S

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat__.Solver_intf.S)

Module type Solver_intf.S

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver/Make_cdcl_t/index.html b/dev/sidekick/Sidekick_sat__Solver/Make_cdcl_t/index.html index 6e3f47d4..30334b1c 100644 --- a/dev/sidekick/Sidekick_sat__Solver/Make_cdcl_t/index.html +++ b/dev/sidekick/Sidekick_sat__Solver/Make_cdcl_t/index.html @@ -1,2 +1,2 @@ -Make_cdcl_t (sidekick.Sidekick_sat__Solver.Make_cdcl_t)

Module Sidekick_sat__Solver.Make_cdcl_t

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type theory = Th.t
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +Make_cdcl_t (sidekick.Sidekick_sat__Solver.Make_cdcl_t)

Module Sidekick_sat__Solver.Make_cdcl_t

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory = Th.t
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver/Make_pure_sat/index.html b/dev/sidekick/Sidekick_sat__Solver/Make_pure_sat/index.html index 6622c9f3..662d6352 100644 --- a/dev/sidekick/Sidekick_sat__Solver/Make_pure_sat/index.html +++ b/dev/sidekick/Sidekick_sat__Solver/Make_pure_sat/index.html @@ -1,2 +1,2 @@ -Make_pure_sat (sidekick.Sidekick_sat__Solver.Make_pure_sat)

Module Sidekick_sat__Solver.Make_pure_sat

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type theory = unit
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +Make_pure_sat (sidekick.Sidekick_sat__Solver.Make_pure_sat)

Module Sidekick_sat__Solver.Make_pure_sat

Parameters

Signature

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit = Th.lit

literals

module Lit = Th.Lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory = unit
type proof = Th.proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof = Th.Proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver/module-type-S/index.html b/dev/sidekick/Sidekick_sat__Solver/module-type-S/index.html index b55aa306..c66a79c5 100644 --- a/dev/sidekick/Sidekick_sat__Solver/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat__Solver/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat__Solver.S)

Module type Sidekick_sat__Solver.S

Safe external interface of solvers.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Sidekick_sat.Solver_intf.LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Sidekick_sat.Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat__Solver.S)

Module type Sidekick_sat__Solver.S

Safe external interface of solvers.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : Sidekick_sat.Solver_intf.LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : Sidekick_sat.Solver_intf.PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit Sidekick_sat.Solver_intf.sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) Sidekick_sat.Solver_intf.unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> Sidekick_sat.Solver_intf.lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver_intf/Clause_pool_id/index.html b/dev/sidekick/Sidekick_sat__Solver_intf/Clause_pool_id/index.html new file mode 100644 index 00000000..cd57b2c4 --- /dev/null +++ b/dev/sidekick/Sidekick_sat__Solver_intf/Clause_pool_id/index.html @@ -0,0 +1,2 @@ + +Clause_pool_id (sidekick.Sidekick_sat__Solver_intf.Clause_pool_id)

Module Sidekick_sat__Solver_intf.Clause_pool_id

type t = private int
val _unsafe_of_int : int -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver_intf/index.html b/dev/sidekick/Sidekick_sat__Solver_intf/index.html index f79f99ed..2f635919 100644 --- a/dev/sidekick/Sidekick_sat__Solver_intf/index.html +++ b/dev/sidekick/Sidekick_sat__Solver_intf/index.html @@ -1,2 +1,2 @@ -Sidekick_sat__Solver_intf (sidekick.Sidekick_sat__Solver_intf)

Module Sidekick_sat__Solver_intf

Interface for Solvers

This modules defines the safe external interface for solvers. Solvers that implements this interface can be obtained using the Make functor in Solver or Mcsolver.

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type SAT_STATE = sig ... end
type 'form sat_state = (module SAT_STATE with type lit = 'form)

The type of values returned when the solver reaches a SAT state.

module type UNSAT_STATE = sig ... end
type ('lit, 'clause) unsat_state = (module UNSAT_STATE with type clause = 'clause and type lit = 'lit)

The type of values returned when the solver reaches an UNSAT state.

type same_sign = bool

This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.

type ('lit, 'proof) reason =
| Consequence of unit -> 'lit list * 'proof

The type of reasons for propagations of a lit f.

Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".

invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.

note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.

type lbool =
| L_true
| L_false
| L_undefined

Valuation of an atom

module type ACTS = sig ... end
type ('lit, 'proof) acts = (module ACTS with type lit = 'lit and type proof = 'proof)

The type for a slice of assertions to assume/propagate in the theory.

exception No_proof
module type LIT = sig ... end
module type PLUGIN_CDCL_T = sig ... end

Signature for theories to be given to the CDCL(T) solver

module type PLUGIN_SAT = sig ... end

Signature for pure SAT solvers

module type S = sig ... end

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

\ No newline at end of file +Sidekick_sat__Solver_intf (sidekick.Sidekick_sat__Solver_intf)

Module Sidekick_sat__Solver_intf

Interface for Solvers

This modules defines the safe external interface for solvers. Solvers that implements this interface can be obtained using the Make functor in Solver or Mcsolver.

type 'a printer = Stdlib.Format.formatter -> 'a -> unit
module type SAT_STATE = sig ... end
type 'form sat_state = (module SAT_STATE with type lit = 'form)

The type of values returned when the solver reaches a SAT state.

module type UNSAT_STATE = sig ... end
type ('lit, 'clause) unsat_state = (module UNSAT_STATE with type clause = 'clause and type lit = 'lit)

The type of values returned when the solver reaches an UNSAT state.

type same_sign = bool

This type is used during the normalisation of lits. true means the literal stayed the same, false that its sign was flipped.

type ('lit, 'proof) reason =
| Consequence of unit -> 'lit list * 'proof

The type of reasons for propagations of a lit f.

Consequence (l, p) means that the lits in l imply the propagated lit f. The proof should be a proof of the clause "l implies f".

invariant: in Consequence (fun () -> l,p), all elements of l must be true in the current trail.

note on lazyiness: the justification is suspended (using unit -> …) to avoid potentially costly computations that might never be used if this literal is backtracked without participating in a conflict. Therefore the function that produces (l,p) needs only be safe in trails (partial models) that are conservative extensions of the current trail. If the theory isn't robust w.r.t. extensions of the trail (e.g. if its internal state undergoes significant changes), it can be easier to produce the explanation eagerly when propagating, and then use Consequence (fun () -> expl, proof) with the already produced (expl,proof) tuple.

type lbool =
| L_true
| L_false
| L_undefined

Valuation of an atom

module Clause_pool_id : sig ... end
module type ACTS = sig ... end

Actions available to the Plugin

type ('lit, 'proof) acts = (module ACTS with type lit = 'lit and type proof = 'proof)

The type for a slice of assertions to assume/propagate in the theory.

exception No_proof
module type LIT = sig ... end
module type PLUGIN_CDCL_T = sig ... end

Signature for theories to be given to the CDCL(T) solver

module type PLUGIN_SAT = sig ... end

Signature for pure SAT solvers

module type S = sig ... end

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver_intf/module-type-ACTS/index.html b/dev/sidekick/Sidekick_sat__Solver_intf/module-type-ACTS/index.html index 022b493d..22969300 100644 --- a/dev/sidekick/Sidekick_sat__Solver_intf/module-type-ACTS/index.html +++ b/dev/sidekick/Sidekick_sat__Solver_intf/module-type-ACTS/index.html @@ -1,2 +1,2 @@ -ACTS (sidekick.Sidekick_sat__Solver_intf.ACTS)

Module type Sidekick_sat__Solver_intf.ACTS

type lit
type proof
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file +ACTS (sidekick.Sidekick_sat__Solver_intf.ACTS)

Module type Sidekick_sat__Solver_intf.ACTS

Actions available to the Plugin

The plugin provides callbacks for the SAT solver to use. These callbacks are provided with a (module ACTS) so they can modify the SAT solver by adding new lemmas, raise conflicts, etc.

type lit
type proof
type clause_pool_id = Clause_pool_id.t
type dproof = proof -> unit
val iter_assumptions : (lit -> unit) -> unit

Traverse the new assumptions on the boolean trail.

val eval_lit : lit -> lbool

Obtain current value of the given literal

val add_lit : ?⁠default_pol:bool -> lit -> unit

Map the given lit to an internal atom, which will be decided by the SAT solver.

val add_clause : ?⁠keep:bool -> lit list -> dproof -> unit

Add a clause to the solver.

parameter keep

if true, the clause will be kept by the solver. Otherwise the solver is allowed to GC the clause and propose this partial model again.

  • C_use_allocator alloc puts the clause in the given allocator.
val add_clause_in_pool : pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but uses a custom clause pool for the clause, with its own lifetime.

val raise_conflict : lit list -> dproof -> 'b

Raise a conflict, yielding control back to the solver. The list of atoms must be a valid theory lemma that is false in the current trail.

val propagate : lit -> (litdproof) reason -> unit

Propagate a lit, i.e. the theory can evaluate the lit to be true (see the definition of eval_res

val add_decision_lit : lit -> bool -> unit

Ask the SAT solver to decide on the given lit with given sign before it can answer SAT. The order of decisions is still unspecified. Useful for theory combination. This will be undone on backtracking.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sat__Solver_intf/module-type-S/index.html b/dev/sidekick/Sidekick_sat__Solver_intf/module-type-S/index.html index dc5f92a9..6b870346 100644 --- a/dev/sidekick/Sidekick_sat__Solver_intf/module-type-S/index.html +++ b/dev/sidekick/Sidekick_sat__Solver_intf/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_sat__Solver_intf.S)

Module type Sidekick_sat__Solver_intf.S

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : LIT with type t = lit
type clause
type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Types

type res =
| Sat of lit sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> lbool

Evaluate atom in current state

\ No newline at end of file +S (sidekick.Sidekick_sat__Solver_intf.S)

Module type Sidekick_sat__Solver_intf.S

The external interface implemented by safe solvers, such as the one created by the Solver.Make and Mcsolver.Make functors.

Internal modules

These are the internal modules used, you should probably not use them if you're not familiar with the internals of mSAT.

type lit

literals

module Lit : LIT with type t = lit
type clause
type clause_pool_id

Pool of clauses, with its own lifetime management

type theory
type proof

A representation of a full proof

type dproof = proof -> unit
type solver

The main solver type.

type store

Stores atoms, clauses, etc.

module Clause : sig ... end
module Proof : PROOF with type lit = lit and type t = proof

A module to manipulate proofs.

type t = solver

Main solver type, containing all state for solving.

val create : ?⁠on_conflict:(t -> Clause.t -> unit) -> ?⁠on_decision:(t -> lit -> unit) -> ?⁠on_learnt:(t -> Clause.t -> unit) -> ?⁠on_gc:(t -> lit array -> unit) -> ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Tiny | `Small | `Big ] -> proof:Proof.t -> theory -> t

Create new solver

parameter theory

the theory

parameter the

proof

parameter size

the initial size of internal data structures. The bigger, the faster, but also the more RAM it uses.

val theory : t -> theory

Access the theory state

val store : t -> store

Store for the solver

val stat : t -> Sidekick_util.Stat.t

Statistics

val proof : t -> proof

Access the inner proof

Clause Pools

val clause_pool_descr : t -> clause_pool_id -> string
val new_clause_pool_gc_fixed_size : descr:string -> size:int -> t -> clause_pool_id

Allocate a new clause pool that GC's its clauses when its size goes above size. It keeps half of the clauses.

Types

type res =
| Sat of lit sat_state

Returned when the solver reaches SAT, with a model

| Unsat of (litclause) unsat_state

Returned when the solver reaches UNSAT, with a proof

Result type for the solver

exception UndecidedLit

Exception raised by the evaluating functions when a literal has not yet been assigned a value.

Base operations

val assume : t -> lit list list -> unit

Add the list of clauses to the current set of assumptions. Modifies the sat solver state in place.

val add_clause : t -> lit list -> dproof -> unit

Lower level addition of clauses

val add_clause_a : t -> lit array -> dproof -> unit

Lower level addition of clauses

val add_input_clause : t -> lit list -> unit

Like add_clause but with the justification of being an input clause

val add_input_clause_a : t -> lit array -> unit

Like add_clause_a but with justification of being an input clause

val add_clause_in_pool : t -> pool:clause_pool_id -> lit list -> dproof -> unit

Like add_clause but using a specific clause pool

val add_clause_a_in_pool : t -> pool:clause_pool_id -> lit array -> dproof -> unit

Like add_clause_a but using a specific clause pool

val solve : ?⁠assumptions:lit list -> t -> res

Try and solves the current set of clauses.

parameter assumptions

additional atomic assumptions to be temporarily added. The assumptions are just used for this call to solve, they are not saved in the solver's state.

val add_lit : t -> ?⁠default_pol:bool -> lit -> unit

Ensure the SAT solver handles this particular literal, ie add a boolean variable for it if it's not already there.

val set_default_pol : t -> lit -> bool -> unit

Set default polarity for the given boolean variable. Sign of the literal is ignored.

val true_at_level0 : t -> lit -> bool

true_at_level0 a returns true if a was proved at level0, i.e. it must hold in all models

val eval_lit : t -> lit -> lbool

Evaluate atom in current state

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/index.html index df96b67f..31cc289a 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_smt_solver.Make.Solver_internal)

Module Make.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_smt_solver.Make.Solver_internal)

Module Make.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/module-type-S/Solver_internal/index.html b/dev/sidekick/Sidekick_smt_solver/module-type-S/Solver_internal/index.html index 0aeba74b..2c12b5cd 100644 --- a/dev/sidekick/Sidekick_smt_solver/module-type-S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_smt_solver/module-type-S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_smt_solver.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_smt_solver.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html index 99354121..9909c3ab 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html index 28b5eafc..357ac46e 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html index b74fe7db..235f8676 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html index 91c72672..a14ff705 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html index 740c91e3..83e68f2d 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html index 8beadb95..3ca37e3c 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html index 6aad92b5..8a1950fb 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html index 55e63633..85863de2 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_data.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_data.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html index cc42c133..cc1ffe06 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_data.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_data.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module Lit = Lit
type ty = T.Ty.t
type term = T.Term.t
type term_store = T.Term.store
type ty_store = T.Ty.store
type clause_pool
type proof = proof
type dproof = proof -> unit

Delayed proof. This is used to build a proof step on demand.

module P = P
type t

Main type for a solver

type solver = t
val tst : t -> term_store
val ty_st : t -> ty_store
val stats : t -> Sidekick_util.Stat.t
val with_proof : t -> (proof -> unit) -> unit

Actions for the theories

type theory_actions

Handle that the theories can use to perform actions.

type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module Lit = Lit and type proof = proof and type P.t = proof and type P.lit = lit and type Actions.t = theory_actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> term option

Simplify input term, returns Some u if some simplification occurred.

val simp_t : t -> term -> term

simp_t si t returns u even if no simplification occurred (in which case t == u syntactically). It emits |- t=u. (see simplifier)

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

module type PREPROCESS_ACTS = sig ... end
type preprocess_actions = (module PREPROCESS_ACTS)

Actions available to the preprocessor

type preprocess_hook = t -> preprocess_actions -> term -> term option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u) if t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter preprocess_actions

actions available during preprocessing.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

val preprocess_acts_of_acts : t -> theory_actions -> preprocess_actions

Obtain preprocessor actions, from theory actions

hooks for the theory

val raise_conflict : t -> theory_actions -> lit list -> dproof -> 'a

Give a conflict clause to the solver

val push_decision : t -> theory_actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> theory_actions -> lit -> reason:(unit -> lit list * dproof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> theory_actions -> lit -> lit list -> dproof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> theory_actions -> lit list -> dproof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> theory_actions -> lit list -> dproof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> theory_actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> preprocess_actions -> term -> term

Preprocess a term. The preprocessing proof is automatically emitted.

val add_lit : t -> theory_actions -> ?⁠default_pol:bool -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value.

parameter default_pol

default polarity for the corresponding atom

val add_lit_t : t -> theory_actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> theory_actions -> CC.Expl.t -> 'a

Raise a conflict with the given congruence closure explanation. it must be a theory tautology that expl ==> absurd. To be used in theories.

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

Merge 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 -> theory_actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> theory_actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * dproof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register 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.

val on_final_check : t -> (t -> theory_actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/VecI32/index.html b/dev/sidekick/Sidekick_util/VecI32/index.html index 1918dfd8..2354b224 100644 --- a/dev/sidekick/Sidekick_util/VecI32/index.html +++ b/dev/sidekick/Sidekick_util/VecI32/index.html @@ -1,2 +1,2 @@ -VecI32 (sidekick.Sidekick_util.VecI32)

Module Sidekick_util.VecI32

Vectors of int32 integers

These vectors are more optimized than Vec.

include Vec_sig.S with type elt := int
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
val ensure_size : t -> int -> unit
val push_i32 : t -> int32 -> unit
val get_i32 : t -> int -> int32
val set_i32 : t -> int -> int32 -> unit
\ No newline at end of file +VecI32 (sidekick.Sidekick_util.VecI32)

Module Sidekick_util.VecI32

Vectors of int32 integers

These vectors are more optimized than Vec.

include Vec_sig.S with type elt := int
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
val ensure_size : t -> int -> unit
val push_i32 : t -> int32 -> unit
val get_i32 : t -> int -> int32
val set_i32 : t -> int -> int32 -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Vec_float/index.html b/dev/sidekick/Sidekick_util/Vec_float/index.html index cabd9d5d..3570d805 100644 --- a/dev/sidekick/Sidekick_util/Vec_float/index.html +++ b/dev/sidekick/Sidekick_util/Vec_float/index.html @@ -1,2 +1,2 @@ -Vec_float (sidekick.Sidekick_util.Vec_float)

Module Sidekick_util.Vec_float

Vectors of floats

These vectors are more optimized than Vec.

include Vec_sig.S with type elt := float
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
val ensure_size : t -> int -> unit
\ No newline at end of file +Vec_float (sidekick.Sidekick_util.Vec_float)

Module Sidekick_util.Vec_float

Vectors of floats

These vectors are more optimized than Vec.

include Vec_sig.S with type elt := float
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
val ensure_size : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Vec_sig/module-type-S/index.html b/dev/sidekick/Sidekick_util/Vec_sig/module-type-S/index.html index 505cd1a6..168bbb6c 100644 --- a/dev/sidekick/Sidekick_util/Vec_sig/module-type-S/index.html +++ b/dev/sidekick/Sidekick_util/Vec_sig/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_util.Vec_sig.S)

Module type Vec_sig.S

type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
\ No newline at end of file +S (sidekick.Sidekick_util.Vec_sig.S)

Module type Vec_sig.S

type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/VecI32/index.html b/dev/sidekick/Sidekick_util__/VecI32/index.html index 7eaa908d..ea584e12 100644 --- a/dev/sidekick/Sidekick_util__/VecI32/index.html +++ b/dev/sidekick/Sidekick_util__/VecI32/index.html @@ -1,2 +1,2 @@ -VecI32 (sidekick.Sidekick_util__.VecI32)

Module Sidekick_util__.VecI32

include Sidekick_util.Vec_sig.S with type elt := int
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
val ensure_size : t -> int -> unit
val push_i32 : t -> int32 -> unit
val get_i32 : t -> int -> int32
val set_i32 : t -> int -> int32 -> unit
\ No newline at end of file +VecI32 (sidekick.Sidekick_util__.VecI32)

Module Sidekick_util__.VecI32

include Sidekick_util.Vec_sig.S with type elt := int
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
val ensure_size : t -> int -> unit
val push_i32 : t -> int32 -> unit
val get_i32 : t -> int -> int32
val set_i32 : t -> int -> int32 -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Vec_float/index.html b/dev/sidekick/Sidekick_util__/Vec_float/index.html index 01ce5901..c833d6fe 100644 --- a/dev/sidekick/Sidekick_util__/Vec_float/index.html +++ b/dev/sidekick/Sidekick_util__/Vec_float/index.html @@ -1,2 +1,2 @@ -Vec_float (sidekick.Sidekick_util__.Vec_float)

Module Sidekick_util__.Vec_float

include Sidekick_util.Vec_sig.S with type elt := float
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
val ensure_size : t -> int -> unit
\ No newline at end of file +Vec_float (sidekick.Sidekick_util__.Vec_float)

Module Sidekick_util__.Vec_float

include Sidekick_util.Vec_sig.S with type elt := float
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
val ensure_size : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Vec_sig/module-type-S/index.html b/dev/sidekick/Sidekick_util__/Vec_sig/module-type-S/index.html index 8b6cadf2..d6b4cc14 100644 --- a/dev/sidekick/Sidekick_util__/Vec_sig/module-type-S/index.html +++ b/dev/sidekick/Sidekick_util__/Vec_sig/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_util__.Vec_sig.S)

Module type Vec_sig.S

type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
\ No newline at end of file +S (sidekick.Sidekick_util__.Vec_sig.S)

Module type Vec_sig.S

type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__VecI32/index.html b/dev/sidekick/Sidekick_util__VecI32/index.html index a296365b..ab8956eb 100644 --- a/dev/sidekick/Sidekick_util__VecI32/index.html +++ b/dev/sidekick/Sidekick_util__VecI32/index.html @@ -1,2 +1,2 @@ -Sidekick_util__VecI32 (sidekick.Sidekick_util__VecI32)

Module Sidekick_util__VecI32

Vectors of int32 integers

These vectors are more optimized than Vec.

include Sidekick_util.Vec_sig.S with type elt := int
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
val ensure_size : t -> int -> unit
val push_i32 : t -> int32 -> unit
val get_i32 : t -> int -> int32
val set_i32 : t -> int -> int32 -> unit
\ No newline at end of file +Sidekick_util__VecI32 (sidekick.Sidekick_util__VecI32)

Module Sidekick_util__VecI32

Vectors of int32 integers

These vectors are more optimized than Vec.

include Sidekick_util.Vec_sig.S with type elt := int
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
val ensure_size : t -> int -> unit
val push_i32 : t -> int32 -> unit
val get_i32 : t -> int -> int32
val set_i32 : t -> int -> int32 -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Vec_float/index.html b/dev/sidekick/Sidekick_util__Vec_float/index.html index e9e93f60..27067541 100644 --- a/dev/sidekick/Sidekick_util__Vec_float/index.html +++ b/dev/sidekick/Sidekick_util__Vec_float/index.html @@ -1,2 +1,2 @@ -Sidekick_util__Vec_float (sidekick.Sidekick_util__Vec_float)

Module Sidekick_util__Vec_float

Vectors of floats

These vectors are more optimized than Vec.

include Sidekick_util.Vec_sig.S with type elt := float
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
val ensure_size : t -> int -> unit
\ No newline at end of file +Sidekick_util__Vec_float (sidekick.Sidekick_util__Vec_float)

Module Sidekick_util__Vec_float

Vectors of floats

These vectors are more optimized than Vec.

include Sidekick_util.Vec_sig.S with type elt := float
type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
val ensure_size : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Vec_sig/module-type-S/index.html b/dev/sidekick/Sidekick_util__Vec_sig/module-type-S/index.html index 17a8feea..24a582b1 100644 --- a/dev/sidekick/Sidekick_util__Vec_sig/module-type-S/index.html +++ b/dev/sidekick/Sidekick_util__Vec_sig/module-type-S/index.html @@ -1,2 +1,2 @@ -S (sidekick.Sidekick_util__Vec_sig.S)

Module type Sidekick_util__Vec_sig.S

type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : t CCFormat.printer
\ No newline at end of file +S (sidekick.Sidekick_util__Vec_sig.S)

Module type Sidekick_util__Vec_sig.S

type elt
type t
val create : ?⁠cap:int -> unit -> t
val size : t -> int
val clear : t -> unit
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val pop : t -> elt
val get : t -> int -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val to_iter : t -> elt Iter.t
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file