module Form : sig ... enddiff --git a/index.html b/index.html deleted file mode 100644 index d0792f55..00000000 --- a/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - -
-CDCL_tseitin.Make.1-A.Formtype tType of atomic formulas.
val neg : t ‑> tNegation of atomic formulas.
val print : Format.formatter ‑> t ‑> unitPrint the given formula.
CDCL_tseitin.Make.1-Amodule Form : sig ... endtype tState
val fresh : t ‑> Form.tGenerate fresh formulas (that are different from any other).
CDCL_tseitin.MakeThis functor provides an implementation of Tseitin's CNF conversion.
A : Argtype atom = A.Form.tThe type of atomic formulas.
type tThe type of arbitrary boolean formulas. Arbitrary boolean formulas can be built using functions in this module, and then converted to a CNF, which is a list of clauses that only use atomic formulas.
val f_true : tThe true formula, i.e a formula that is always satisfied.
val f_false : tThe false formula, i.e a formula that cannot be satisfied.
val make_atom : atom ‑> tmake_atom p builds the boolean formula equivalent to the atomic formula p.
val make_not : t ‑> tCreates the negation of a boolean formula.
val make_and : t list ‑> tCreates the conjunction of a list of formulas. An empty conjunction is always satisfied.
val make_or : t list ‑> tCreates the disjunction of a list of formulas. An empty disjunction is never satisfied.
val make_xor : t ‑> t ‑> tmake_xor p q creates the boolean formula "p xor q".
val make_imply : t ‑> t ‑> tmake_imply p q creates the boolean formula "p implies q".
val make_equiv : t ‑> t ‑> tmake_equiv p q creates the boolena formula "p is equivalent to q".
type fresh_state = A.tState used to produce fresh atoms
type stateState used for the Tseitin transformation
val create : fresh_state ‑> stateval make_cnf : state ‑> t ‑> atom list listmake_cnf f returns a conjunctive normal form of f under the form: a list (which is a conjunction) of lists (which are disjunctions) of atomic formulas.
val print : Format.formatter ‑> t ‑> unitprint fmt f prints the formula on the formatter fmt.
CDCL_tseitinTseitin CNF conversion
This modules implements Tseitin's Conjunctive Normal Form conversion, i.e. the ability to transform an arbitrary boolean formula into an equi-satisfiable CNF, that can then be fed to a SAT/SMT/McSat solver.
module type Arg = CDCL_tseitin__.Tseitin_intf.Argmodule type S = CDCL_tseitin__.Tseitin_intf.Smodule Make : functor (A : Arg) -> S with type atom = A.Form.t and type fresh_state = A.tCDCL_tseitin.Arg.Formtype tType of atomic formulas.
val neg : t ‑> tNegation of atomic formulas.
val print : Format.formatter ‑> t ‑> unitPrint the given formula.
CDCL_tseitin.ArgThe implementation of formulas required to implement Tseitin's CNF conversion.
module Form : sig ... endtype tState
val fresh : t ‑> Form.tGenerate fresh formulas (that are different from any other).
CDCL_tseitin.SThe exposed interface of Tseitin's CNF conversion.
type atomThe type of atomic formulas.
type tThe type of arbitrary boolean formulas. Arbitrary boolean formulas can be built using functions in this module, and then converted to a CNF, which is a list of clauses that only use atomic formulas.
val f_true : tThe true formula, i.e a formula that is always satisfied.
val f_false : tThe false formula, i.e a formula that cannot be satisfied.
val make_atom : atom ‑> tmake_atom p builds the boolean formula equivalent to the atomic formula p.
val make_not : t ‑> tCreates the negation of a boolean formula.
val make_and : t list ‑> tCreates the conjunction of a list of formulas. An empty conjunction is always satisfied.
val make_or : t list ‑> tCreates the disjunction of a list of formulas. An empty disjunction is never satisfied.
val make_xor : t ‑> t ‑> tmake_xor p q creates the boolean formula "p xor q".
val make_imply : t ‑> t ‑> tmake_imply p q creates the boolean formula "p implies q".
val make_equiv : t ‑> t ‑> tmake_equiv p q creates the boolena formula "p is equivalent to q".
type fresh_stateState used to produce fresh atoms
type stateState used for the Tseitin transformation
val create : fresh_state ‑> stateval make_cnf : state ‑> t ‑> atom list listmake_cnf f returns a conjunctive normal form of f under the form: a list (which is a conjunction) of lists (which are disjunctions) of atomic formulas.
val print : Format.formatter ‑> t ‑> unitprint fmt f prints the formula on the formatter fmt.
CDCL_tseitin__.Tseitin_intfmodule type Arg : sig ... endmodule type S : sig ... endCDCL_tseitin__.Tseitin_intf.Arg.Formtype tType of atomic formulas.
val neg : t ‑> tNegation of atomic formulas.
val print : Format.formatter ‑> t ‑> unitPrint the given formula.
CDCL_tseitin__.Tseitin_intf.Argmodule Form : sig ... endtype tState
val fresh : t ‑> Form.tGenerate fresh formulas (that are different from any other).
CDCL_tseitin__.Tseitin_intf.Stype atomThe type of atomic formulas.
type tThe type of arbitrary boolean formulas. Arbitrary boolean formulas can be built using functions in this module, and then converted to a CNF, which is a list of clauses that only use atomic formulas.
val f_true : tThe true formula, i.e a formula that is always satisfied.
val f_false : tThe false formula, i.e a formula that cannot be satisfied.
val make_atom : atom ‑> tmake_atom p builds the boolean formula equivalent to the atomic formula p.
val make_not : t ‑> tCreates the negation of a boolean formula.
val make_and : t list ‑> tCreates the conjunction of a list of formulas. An empty conjunction is always satisfied.
val make_or : t list ‑> tCreates the disjunction of a list of formulas. An empty disjunction is never satisfied.
val make_xor : t ‑> t ‑> tmake_xor p q creates the boolean formula "p xor q".
val make_imply : t ‑> t ‑> tmake_imply p q creates the boolean formula "p implies q".
val make_equiv : t ‑> t ‑> tmake_equiv p q creates the boolena formula "p is equivalent to q".
type fresh_stateState used to produce fresh atoms
type stateState used for the Tseitin transformation
val create : fresh_state ‑> stateval make_cnf : state ‑> t ‑> atom list listmake_cnf f returns a conjunctive normal form of f under the form: a list (which is a conjunction) of lists (which are disjunctions) of atomic formulas.
val print : Format.formatter ‑> t ‑> unitprint fmt f prints the formula on the formatter fmt.
CDCL_tseitin__module CDCL_tseitin = CDCL_tseitinmodule Tseitin_intf : sig ... endCDCL_tseitin__Tseitin_intfInterfaces for Tseitin's CNF conversion
module type Arg : sig ... endmodule type S : sig ... endCDCL_tseitin__Tseitin_intf.Arg.Formtype tType of atomic formulas.
val neg : t ‑> tNegation of atomic formulas.
val print : Format.formatter ‑> t ‑> unitPrint the given formula.
CDCL_tseitin__Tseitin_intf.Argmodule Form : sig ... endtype tState
val fresh : t ‑> Form.tGenerate fresh formulas (that are different from any other).
CDCL_tseitin__Tseitin_intf.Stype atomThe type of atomic formulas.
type tThe type of arbitrary boolean formulas. Arbitrary boolean formulas can be built using functions in this module, and then converted to a CNF, which is a list of clauses that only use atomic formulas.
val f_true : tThe true formula, i.e a formula that is always satisfied.
val f_false : tThe false formula, i.e a formula that cannot be satisfied.
val make_atom : atom ‑> tmake_atom p builds the boolean formula equivalent to the atomic formula p.
val make_not : t ‑> tCreates the negation of a boolean formula.
val make_and : t list ‑> tCreates the conjunction of a list of formulas. An empty conjunction is always satisfied.
val make_or : t list ‑> tCreates the disjunction of a list of formulas. An empty disjunction is never satisfied.
val make_xor : t ‑> t ‑> tmake_xor p q creates the boolean formula "p xor q".
val make_imply : t ‑> t ‑> tmake_imply p q creates the boolean formula "p implies q".
val make_equiv : t ‑> t ‑> tmake_equiv p q creates the boolena formula "p is equivalent to q".
type fresh_stateState used to produce fresh atoms
type stateState used for the Tseitin transformation
val create : fresh_state ‑> stateval make_cnf : state ‑> t ‑> atom list listmake_cnf f returns a conjunctive normal form of f under the form: a list (which is a conjunction) of lists (which are disjunctions) of atomic formulas.
val print : Format.formatter ‑> t ‑> unitprint fmt f prints the formula on the formatter fmt.
Backend interface
This modules defines the interface of the modules providing -export of proofs.
module type S : sig ... endProof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Coq/Make/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend/Coq/Make/argument-1-S/Atom/index.html deleted file mode 100644 index a7f8c15b..00000000 --- a/sidekick/Sidekick_backend/Coq/Make/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for Coq
val prove_hyp : Format.formatter ‑> string ‑> hyp ‑> unitval prove_lemma : Format.formatter ‑> string ‑> lemma ‑> unitval prove_assumption : Format.formatter ‑> string ‑> assumption ‑> unitProving function for hypotheses, lemmas and assumptions.
-prove_x fmt name x should prove x, and be such that after
-executing it, x is among the coq hypotheses under the name name.
-The hypothesis should be the encoding of the given clause, i.e
-for a clause a \/ not b \/ c, the proved hypothesis should be:
- ~ a -> ~ ~ b -> ~ c -> False , keeping the same order as the
-one in the atoms array of the clause.
Base functor to output Coq proofs
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Coq/Simple/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend/Coq/Simple/argument-1-S/Atom/index.html deleted file mode 100644 index a791073b..00000000 --- a/sidekick/Sidekick_backend/Coq/Simple/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for Coq
val prove_hyp : Format.formatter ‑> string ‑> hyp ‑> unitval prove_lemma : Format.formatter ‑> string ‑> lemma ‑> unitval prove_assumption : Format.formatter ‑> string ‑> assumption ‑> unitProving function for hypotheses, lemmas and assumptions.
-prove_x fmt name x should prove x, and be such that after
-executing it, x is among the coq hypotheses under the name name.
-The hypothesis should be the encoding of the given clause, i.e
-for a clause a \/ not b \/ c, the proved hypothesis should be:
- ~ a -> ~ ~ b -> ~ c -> False , keeping the same order as the
-one in the atoms array of the clause.
Simple functo to output Coq proofs
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Coq/index.html b/sidekick/Sidekick_backend/Coq/index.html deleted file mode 100644 index af15161d..00000000 --- a/sidekick/Sidekick_backend/Coq/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Coq Backend
This module provides an easy way to produce coq scripts -corresponding to the resolution proofs output by the -sat solver.
module type Arg : sig ... endmodule Make : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type hyp := S.clause and type lemma := S.clause and type assumption := S.clause) -> S with type t := S.proofBase functor to output Coq proofs
module Simple : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type hyp = S.formula list and type lemma := S.lemma and type assumption := S.formula) -> S with type t := S.proofSimple functo to output Coq proofs
Term printing for Coq
val prove_hyp : Format.formatter ‑> string ‑> hyp ‑> unitval prove_lemma : Format.formatter ‑> string ‑> lemma ‑> unitval prove_assumption : Format.formatter ‑> string ‑> assumption ‑> unitProving function for hypotheses, lemmas and assumptions.
-prove_x fmt name x should prove x, and be such that after
-executing it, x is among the coq hypotheses under the name name.
-The hypothesis should be the encoding of the given clause, i.e
-for a clause a \/ not b \/ c, the proved hypothesis should be:
- ~ a -> ~ ~ b -> ~ c -> False , keeping the same order as the
-one in the atoms array of the clause.
Interface for exporting proofs.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Dedukti/Make/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend/Dedukti/Make/argument-1-S/Atom/index.html deleted file mode 100644 index 37e1f86c..00000000 --- a/sidekick/Sidekick_backend/Dedukti/Make/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval print : Format.formatter ‑> formula ‑> unitval prove : Format.formatter ‑> lemma ‑> unitval context : Format.formatter ‑> proof ‑> unitFunctor to generate a backend to output proofs for the dedukti type checker.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Dedukti/index.html b/sidekick/Sidekick_backend/Dedukti/index.html deleted file mode 100644 index 4d598852..00000000 --- a/sidekick/Sidekick_backend/Dedukti/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Deduki backend for proofs
Work in progress...
module type S = Backend_intf.Smodule type Arg : sig ... endmodule Make : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type formula := S.formula and type lemma := S.lemma and type proof := S.proof) -> S with type t := S.proofFunctor to generate a backend to output proofs for the dedukti type checker.
val print : Format.formatter ‑> formula ‑> unitval prove : Format.formatter ‑> lemma ‑> unitval context : Format.formatter ‑> proof ‑> unitProof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Dimacs/Make/argument-1-St/Atom/index.html b/sidekick/Sidekick_backend/Dimacs/Make/argument-1-St/Atom/index.html deleted file mode 100644 index f4fc9e23..00000000 --- a/sidekick/Sidekick_backend/Dimacs/Make/argument-1-St/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endFunctor to create a module for exporting probems to the dimacs (& iCNF) formats.
val export : st ‑> Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module.
val export_icnf : Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module. -This function may be called multiple times in order to add -new clauses (and new local hyps) to the problem.
Dimacs backend for problems
This module provides functiosn to export problems to the dimacs and -iCNF formats.
module type S : sig ... endmodule Make : functor (St : Sidekick_sat.Solver_types_intf.S) -> S with type clause := St.clause and type st = St.tFunctor to create a module for exporting probems to the dimacs (& iCNF) formats.
val export : st ‑> Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module.
val export_icnf : Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module. -This function may be called multiple times in order to add -new clauses (and new local hyps) to the problem.
val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endProvides a reasonnable default to instantiate the Make functor, assuming
-the original printing functions are compatible with DOT html labels.
Term printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationFunctor for making a module to export proofs to the DOT format.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Dot/Simple/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend/Dot/Simple/argument-1-S/Atom/index.html deleted file mode 100644 index 8a3cd8db..00000000 --- a/sidekick/Sidekick_backend/Dot/Simple/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationFunctor for making a module to export proofs to the DOT format. -The substitution of the hyp type is non-destructive due to a restriction -of destructive substitutions on earlier versions of ocaml.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/Dot/index.html b/sidekick/Sidekick_backend/Dot/index.html deleted file mode 100644 index 7f7ecf73..00000000 --- a/sidekick/Sidekick_backend/Dot/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Dot backend for proofs
This module provides functions to export proofs into the dot graph format. -Graphs in dot format can be used to generates images using the graphviz tool.
module type Arg : sig ... endmodule Default : functor (S : Sidekick_sat.Res.S) -> Arg with type atom := S.atom and type hyp := S.clause and type lemma := S.clause and type assumption := S.clauseProvides a reasonnable default to instantiate the Make functor, assuming
-the original printing functions are compatible with DOT html labels.
module Make : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type atom := S.atom and type hyp := S.clause and type lemma := S.clause and type assumption := S.clause) -> S with type t := S.proofFunctor for making a module to export proofs to the DOT format.
module Simple : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type atom := S.formula and type hyp = S.formula list and type lemma := S.lemma and type assumption = S.formula) -> S with type t := S.proofFunctor for making a module to export proofs to the DOT format. -The substitution of the hyp type is non-destructive due to a restriction -of destructive substitutions on earlier versions of ocaml.
Term printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationInterface for exporting proofs.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend/index.html b/sidekick/Sidekick_backend/index.html deleted file mode 100644 index 4ac9fa30..00000000 --- a/sidekick/Sidekick_backend/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -module Backend_intf : sig ... endmodule Coq : sig ... endmodule Dedukti : sig ... endmodule Dimacs : sig ... endmodule Dot : sig ... endBackend interface
This modules defines the interface of the modules providing -export of proofs.
module type S : sig ... endProof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Coq/.jbuilder-keep b/sidekick/Sidekick_backend__Coq/.jbuilder-keep deleted file mode 100644 index e69de29b..00000000 diff --git a/sidekick/Sidekick_backend__Coq/Make/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend__Coq/Make/argument-1-S/Atom/index.html deleted file mode 100644 index a327435b..00000000 --- a/sidekick/Sidekick_backend__Coq/Make/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for Coq
val prove_hyp : Format.formatter ‑> string ‑> hyp ‑> unitval prove_lemma : Format.formatter ‑> string ‑> lemma ‑> unitval prove_assumption : Format.formatter ‑> string ‑> assumption ‑> unitProving function for hypotheses, lemmas and assumptions.
-prove_x fmt name x should prove x, and be such that after
-executing it, x is among the coq hypotheses under the name name.
-The hypothesis should be the encoding of the given clause, i.e
-for a clause a \/ not b \/ c, the proved hypothesis should be:
- ~ a -> ~ ~ b -> ~ c -> False , keeping the same order as the
-one in the atoms array of the clause.
Base functor to output Coq proofs
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Coq/Simple/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend__Coq/Simple/argument-1-S/Atom/index.html deleted file mode 100644 index c1e08f47..00000000 --- a/sidekick/Sidekick_backend__Coq/Simple/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for Coq
val prove_hyp : Format.formatter ‑> string ‑> hyp ‑> unitval prove_lemma : Format.formatter ‑> string ‑> lemma ‑> unitval prove_assumption : Format.formatter ‑> string ‑> assumption ‑> unitProving function for hypotheses, lemmas and assumptions.
-prove_x fmt name x should prove x, and be such that after
-executing it, x is among the coq hypotheses under the name name.
-The hypothesis should be the encoding of the given clause, i.e
-for a clause a \/ not b \/ c, the proved hypothesis should be:
- ~ a -> ~ ~ b -> ~ c -> False , keeping the same order as the
-one in the atoms array of the clause.
Simple functo to output Coq proofs
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Coq/index.html b/sidekick/Sidekick_backend__Coq/index.html deleted file mode 100644 index 5ff23d75..00000000 --- a/sidekick/Sidekick_backend__Coq/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Coq Backend
This module provides an easy way to produce coq scripts -corresponding to the resolution proofs output by the -sat solver.
module type Arg : sig ... endmodule Make : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type hyp := S.clause and type lemma := S.clause and type assumption := S.clause) -> S with type t := S.proofBase functor to output Coq proofs
module Simple : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type hyp = S.formula list and type lemma := S.lemma and type assumption := S.formula) -> S with type t := S.proofSimple functo to output Coq proofs
Term printing for Coq
val prove_hyp : Format.formatter ‑> string ‑> hyp ‑> unitval prove_lemma : Format.formatter ‑> string ‑> lemma ‑> unitval prove_assumption : Format.formatter ‑> string ‑> assumption ‑> unitProving function for hypotheses, lemmas and assumptions.
-prove_x fmt name x should prove x, and be such that after
-executing it, x is among the coq hypotheses under the name name.
-The hypothesis should be the encoding of the given clause, i.e
-for a clause a \/ not b \/ c, the proved hypothesis should be:
- ~ a -> ~ ~ b -> ~ c -> False , keeping the same order as the
-one in the atoms array of the clause.
Interface for exporting proofs.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Dedukti/.jbuilder-keep b/sidekick/Sidekick_backend__Dedukti/.jbuilder-keep deleted file mode 100644 index e69de29b..00000000 diff --git a/sidekick/Sidekick_backend__Dedukti/Make/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend__Dedukti/Make/argument-1-S/Atom/index.html deleted file mode 100644 index 1f43ff52..00000000 --- a/sidekick/Sidekick_backend__Dedukti/Make/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval print : Format.formatter ‑> formula ‑> unitval prove : Format.formatter ‑> lemma ‑> unitval context : Format.formatter ‑> proof ‑> unitFunctor to generate a backend to output proofs for the dedukti type checker.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Dedukti/index.html b/sidekick/Sidekick_backend__Dedukti/index.html deleted file mode 100644 index 47030547..00000000 --- a/sidekick/Sidekick_backend__Dedukti/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Deduki backend for proofs
Work in progress...
module type S = Sidekick_backend.Backend_intf.Smodule type Arg : sig ... endmodule Make : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type formula := S.formula and type lemma := S.lemma and type proof := S.proof) -> S with type t := S.proofFunctor to generate a backend to output proofs for the dedukti type checker.
val print : Format.formatter ‑> formula ‑> unitval prove : Format.formatter ‑> lemma ‑> unitval context : Format.formatter ‑> proof ‑> unitProof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Dimacs/.jbuilder-keep b/sidekick/Sidekick_backend__Dimacs/.jbuilder-keep deleted file mode 100644 index e69de29b..00000000 diff --git a/sidekick/Sidekick_backend__Dimacs/Make/argument-1-St/Atom/index.html b/sidekick/Sidekick_backend__Dimacs/Make/argument-1-St/Atom/index.html deleted file mode 100644 index 0c35beda..00000000 --- a/sidekick/Sidekick_backend__Dimacs/Make/argument-1-St/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endFunctor to create a module for exporting probems to the dimacs (& iCNF) formats.
val export : st ‑> Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module.
val export_icnf : Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module. -This function may be called multiple times in order to add -new clauses (and new local hyps) to the problem.
Dimacs backend for problems
This module provides functiosn to export problems to the dimacs and -iCNF formats.
module type S : sig ... endmodule Make : functor (St : Sidekick_sat.Solver_types_intf.S) -> S with type clause := St.clause and type st = St.tFunctor to create a module for exporting probems to the dimacs (& iCNF) formats.
val export : st ‑> Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module.
val export_icnf : Format.formatter ‑> hyps:clause Sidekick_sat.Vec.t ‑> history:clause Sidekick_sat.Vec.t ‑> local:clause Sidekick_sat.Vec.t ‑> unitExport the given clause vectors to the dimacs format. -The arguments should be transmitted directly from the corresponding -function of the module. -This function may be called multiple times in order to add -new clauses (and new local hyps) to the problem.
val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endProvides a reasonnable default to instantiate the Make functor, assuming
-the original printing functions are compatible with DOT html labels.
Term printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationFunctor for making a module to export proofs to the DOT format.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Dot/Simple/argument-1-S/Atom/index.html b/sidekick/Sidekick_backend__Dot/Simple/argument-1-S/Atom/index.html deleted file mode 100644 index d300f7b1..00000000 --- a/sidekick/Sidekick_backend__Dot/Simple/argument-1-S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endTerm printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationFunctor for making a module to export proofs to the DOT format. -The substitution of the hyp type is non-destructive due to a restriction -of destructive substitutions on earlier versions of ocaml.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_backend__Dot/index.html b/sidekick/Sidekick_backend__Dot/index.html deleted file mode 100644 index 7d98511b..00000000 --- a/sidekick/Sidekick_backend__Dot/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Dot backend for proofs
This module provides functions to export proofs into the dot graph format. -Graphs in dot format can be used to generates images using the graphviz tool.
module type Arg : sig ... endmodule Default : functor (S : Sidekick_sat.Res.S) -> Arg with type atom := S.atom and type hyp := S.clause and type lemma := S.clause and type assumption := S.clauseProvides a reasonnable default to instantiate the Make functor, assuming
-the original printing functions are compatible with DOT html labels.
module Make : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type atom := S.atom and type hyp := S.clause and type lemma := S.clause and type assumption := S.clause) -> S with type t := S.proofFunctor for making a module to export proofs to the DOT format.
module Simple : functor (S : Sidekick_sat.Res.S) -> functor (A : Arg with type atom := S.formula and type hyp = S.formula list and type lemma := S.lemma and type assumption = S.formula) -> S with type t := S.proofFunctor for making a module to export proofs to the DOT format. -The substitution of the hyp type is non-destructive due to a restriction -of destructive substitutions on earlier versions of ocaml.
Term printing for DOT
This module defines what functions are required in order to export -a proof to the DOT format.
val print_atom : Format.formatter ‑> atom ‑> unitPrint the contents of the given atomic formulas. -WARNING: this function should take care to escape and/or not output special -reserved characters for the dot format (such as quotes and so on).
val hyp_info : hyp ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval lemma_info : lemma ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listval assumption_info : assumption ‑> string * string option * (Format.formatter ‑> unit ‑> unit) listGenerate some information about the leafs of the proof tree. Currently this backend
-print each lemma/assumption/hypothesis as a single leaf of the proof tree.
-These function should return a triplet (rule, color, l), such that:
-
rule is a name for the proof (arbitrary, does not need to be unique, but
-should rather be descriptive)color is a color name (optional) understood by DOTl is a list of printers that will be called to print some additional informationInterface for exporting proofs.
Proof exporting
Currently, exporting a proof means printing it into a file -according to the conventions of a given format.
\ No newline at end of file diff --git a/sidekick/Sidekick_dimacs/.jbuilder-keep b/sidekick/Sidekick_dimacs/.jbuilder-keep deleted file mode 100644 index e69de29b..00000000 diff --git a/sidekick/Sidekick_dimacs/index.html b/sidekick/Sidekick_dimacs/index.html deleted file mode 100644 index c30f9b68..00000000 --- a/sidekick/Sidekick_dimacs/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -This library provides a parser for DIMACS files, to represent -SAT problems.
http://www.satcompetition.org/2009/format-benchmarks2009.html
\ No newline at end of file diff --git a/sidekick/Sidekick_dimacs__/.jbuilder-keep b/sidekick/Sidekick_dimacs__/.jbuilder-keep deleted file mode 100644 index e69de29b..00000000 diff --git a/sidekick/Sidekick_dimacs__/Lexer/index.html b/sidekick/Sidekick_dimacs__/Lexer/index.html deleted file mode 100644 index 0a18ee19..00000000 --- a/sidekick/Sidekick_dimacs__/Lexer/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -val token : Lexing.lexbuf ‑> Sidekick_dimacs__.Parser.tokenval __ocaml_lex_token_rec : Lexing.lexbuf ‑> int ‑> Sidekick_dimacs__.Parser.tokenval comment : Lexing.lexbuf ‑> Sidekick_dimacs__.Parser.tokenval __ocaml_lex_comment_rec : Lexing.lexbuf ‑> int ‑> Sidekick_dimacs__.Parser.tokenval file : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> int list listmodule Lexer : sig ... endmodule Parser : sig ... endmodule Sidekick_dimacs = Sidekick_dimacsval token : Lexing.lexbuf ‑> Sidekick_dimacs__.Parser.tokenval __ocaml_lex_token_rec : Lexing.lexbuf ‑> int ‑> Sidekick_dimacs__.Parser.tokenval comment : Lexing.lexbuf ‑> Sidekick_dimacs__.Parser.tokenval __ocaml_lex_comment_rec : Lexing.lexbuf ‑> int ‑> Sidekick_dimacs__.Parser.tokenval file : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> int list listval atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionval pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printermodule Tbl : sig ... endval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticstype proof_node = Sidekick_sat__Solver.Make(Sidekick_sat__.Solver_types.Make(E))(E).Proof.proof_node = {conclusion : clause; |
step : step; |
}val is_leaf : step ‑> boolval expl : step ‑> stringval expand : proof ‑> proof_nodeval fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'aval check : proof ‑> unitmodule Clause : sig ... endmodule Atom : sig ... endmodule Tbl : sig ... endval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval assume : t ‑> (formula, proof) Theory_intf.slice_actions ‑> (formula, proof) Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Theory_intf.slice_actions ‑> (formula, proof) Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
module Proof : sig ... endval create : ?size:[ `Big | `Small | `Tiny ] ‑> unit ‑> tval unsat_core : Proof.proof ‑> clause listval get_tag : clause ‑> int optionval push : t ‑> unitval pop : t ‑> unitval actions : t ‑> (formula, Proof.lemma) Theory_intf.actionsval export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Solver_types_intf.printerval pp_a : t array Solver_types_intf.printerval debug : t Solver_types_intf.printerval debug_a : t array Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Solver_types_intf.printerval pp_dimacs : t Solver_types_intf.printerval debug : t Solver_types_intf.printerval hash : t ‑> intval pp : t Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endFunctor to create a module building proofs from a sat-solver unsat trace.
include Sidekick_sat__.Res_intf.S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endResolution proofs
This modules defines functions to create and manipulate resolution proofs.
module type FULL = Sidekick_sat__.Res_intf.FULLval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Solver_types_intf.printerval pp_a : t array Solver_types_intf.printerval debug : t Solver_types_intf.printerval debug_a : t array Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Solver_types_intf.printerval pp_dimacs : t Solver_types_intf.printerval debug : t Solver_types_intf.printerval hash : t ‑> intval pp : t Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Module defining atom and clauses
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endinclude Sidekick_sat__.Res_intf.S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Interface for a module manipulating resolution proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endtype t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
Internal types (interface)
This modules defines the interface of most of the internal types -used in the core solver.
module Var_fields : Sidekick_util__BitField.Smodule C_fields : Sidekick_util__BitField.Smodule type S : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val hash : t ‑> intval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endSMT Theory
This module defines what a theory must implement in order to -be used in an SMT solver.
type ('formula, 'proof) res = Type returned by the theory. Formulas in the unsat clause must come from the -current set of assumptions, i.e must have been encountered in a slice.
type ('form, 'proof) actions = | Actions of {
} |
Actions given to the theory during initialization, to be used -at any time
type ('form, 'proof) slice_actions = val hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
Returns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
Called at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Main API
module type S = Sidekick_sat__.Solver_intf.Stype ('formula, 'proof) res = ('formula, 'proof) Theory_intf.res = | Sat | (** The current set of assumptions is satisfiable. *) |
| Unsat of 'formula list * 'proof | (** The current set of assumptions is *NOT* satisfiable, and here is a -theory tautology (with its proof), for which every literal is false -under the current assumptions. *) |
Type returned by the theory. Formulas in the unsat clause must come from the -current set of assumptions, i.e must have been encountered in a slice.
type 'form sat_state = 'form Sidekick_sat__.Solver_intf.sat_state = | Sat_state of {
} |
type ('clause, 'proof) unsat_state = ('clause, 'proof) Sidekick_sat__.Solver_intf.unsat_state = | Unsat_state of {
} |
type 'clause export = 'clause Sidekick_sat__.Solver_intf.export = {hyps : 'clause Sidekick_util.Vec.t; |
history : 'clause Sidekick_util.Vec.t; |
local : 'clause Sidekick_util.Vec.t; |
}type ('form, 'proof) actions = ('form, 'proof) Theory_intf.actions = | Actions of {
} |
type ('form, 'proof) slice_actions = ('form, 'proof) Theory_intf.slice_actions = | Slice_acts of {
} |
module Make : functor (E : Theory_intf.S) -> sig ... endval atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... end-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval create : unit ‑> tval in_heap : elt ‑> boolval size : t ‑> intval is_empty : t ‑> boolval clear : t ‑> unitval grow_to_at_least : t ‑> int ‑> unitval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printermodule Tbl : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval mark : t ‑> unitval seen : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitval empty : tval pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printermodule Tbl : sig ... endval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedval seen_both : t ‑> boolval clear : t ‑> unitval create : ?size:[ `Big | `Small | `Tiny ] ‑> unit ‑> ttype var = St.var = {vid : int; |
pa : atom; |
na : atom; |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; |
mutable v_level : int; |
mutable v_idx : int; |
mutable v_weight : float; |
mutable reason : reason option; |
}type clause = St.clause = {name : int; |
tag : int option; |
atoms : atom array; |
mutable cpremise : premise; |
mutable activity : float; |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; |
}val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsmodule St : sig ... endval is_leaf : step ‑> boolval expl : step ‑> stringval expand : proof ‑> proof_nodeval fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'aval check : proof ‑> unitmodule Clause : sig ... endmodule Atom : sig ... endmodule Tbl : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proofmodule Proof : sig ... endmodule H : sig ... endexception Conflict of St.clausetype t = {st : St.t; | |
th : Th.t lazy_t; | |
clauses_hyps : St.clause Sidekick_util.Vec.t; | |
clauses_learnt : St.clause Sidekick_util.Vec.t; | |
clauses_temp : St.clause Sidekick_util.Vec.t; | |
mutable unsat_conflict : St.clause option; | |
mutable next_decision : St.atom option; | |
trail : St.atom Sidekick_util.Vec.t; | |
elt_levels : int Sidekick_util.Vec.t; | |
user_levels : int Sidekick_util.Vec.t; | |
backtrack_levels : int Sidekick_util.Vec.t; | |
backtrack : (unit ‑> unit) Sidekick_util.Vec.t; | (** Actions to call when backtracking *) |
to_redo_after_backtrack : (unit ‑> unit) Sidekick_util.Vec.t; | (** Actions to re-do after backtracking *) |
mutable th_head : int; | |
mutable elt_head : int; | |
order : H.t; | |
mutable var_incr : float; | |
mutable clause_incr : float; | |
to_add : (bool * St.clause) CCVector.vector; | |
mutable dirty : bool; |
}val at_level_0 : t ‑> boolval on_backtrack : t ‑> (unit ‑> unit) ‑> unitval nb_clauses : t ‑> intval decision_level : t ‑> intval base_level : t ‑> intval redo_down_to_level_0 : t ‑> (unit ‑> unit) ‑> unitval is_unsat : t ‑> boolval new_atom : permanent:bool ‑> t ‑> St.formula ‑> St.atomval var_decay_activity : t ‑> unitval clause_decay_activity : t ‑> unitval eliminate_duplicates : St.Clause.t ‑> St.clauseval new_decision_level : t ‑> unitval backtrack_down_to : t ‑> int ‑> unitval cancel_until : t ‑> int ‑> unitval report_unsat : t ‑> St.Clause.t ‑> 'aval put_high_level_atoms_first : St.atom array ‑> unitval analyze_sat : t ‑> St.Clause.t ‑> conflict_resval analyze : t ‑> St.Clause.t ‑> conflict_resval record_learnt_clause : t ‑> St.clause ‑> conflict_res ‑> unitval clause_vector : t ‑> St.clause ‑> St.clause Sidekick_util.Vec.tval slice_iter : t ‑> int ‑> int ‑> (St.formula ‑> unit) ‑> unitval act_push_ : permanent:bool ‑> t ‑> St.formula Sidekick_util.IArray.t ‑> St.proof ‑> unitval act_push_local : t ‑> St.formula Sidekick_util.IArray.t ‑> St.proof ‑> unitval act_push_persistent : t ‑> St.formula Sidekick_util.IArray.t ‑> St.proof ‑> unitval act_propagate : t ‑> St.formula ‑> St.formula list ‑> St.proof ‑> unitval current_slice : t ‑> int ‑> (St.formula, 'a) Sidekick_sat.Theory_intf.slice_actionsval full_slice : t ‑> (St.formula, 'a) Sidekick_sat.Theory_intf.slice_actionsval act_at_level_0 : t ‑> unit ‑> boolval actions : t ‑> (St.formula, St.proof) Sidekick_sat.Theory_intf.actionsval propagation_fixpoint : t ‑> boolval pick_branch_lit : t ‑> unitval search : t ‑> int ‑> int ‑> unitval eval_level : t ‑> St.formula ‑> bool * intval eval : t ‑> St.formula ‑> boolval pp_trail : t ‑> unitval solve : t ‑> unitval assume : permanent:bool ‑> t ‑> ?tag:int ‑> St.formula list list ‑> unitval push : t ‑> unitval pop : t ‑> unitval local : t ‑> St.formula list ‑> unitval check_clause : St.Clause.t ‑> boolval check_vec : St.Clause.t Sidekick_util.Vec.t ‑> boolval check_stack : St.Clause.t Stack.t ‑> boolval check : t ‑> boolval hyps : t ‑> St.clause Sidekick_util.Vec.tval history : t ‑> St.clause Sidekick_util.Vec.tval temp : t ‑> St.clause Sidekick_util.Vec.tval trail : t ‑> St.atom Sidekick_util.Vec.tmodule Make : functor (St : Sidekick_sat__.Solver_types.S) -> functor (Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proof) -> sig ... endval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endFunctor to create a module building proofs from a sat-solver unsat trace.
include Sidekick_sat__.Res_intf.S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endResolution proofs
This modules defines functions to create and manipulate resolution proofs.
module type FULL = Sidekick_sat__.Res_intf.FULLval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Module defining atom and clauses
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endinclude Sidekick_sat__.Res_intf.S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Interface for a module manipulating resolution proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endInterface for proofs
module type S : sig ... endmodule type FULL : sig ... endval is_pos : t ‑> boolval name : t ‑> stringval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Module defining atom and clauses
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endinclude S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval is_pos : t ‑> boolval name : t ‑> stringSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Functor to make a safe external interface.
Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proof-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endSAT safe interface
This module defines a safe interface for the core solver. -It is the basis of the Solver and Mcsolver modules.
module Make : functor (St : Sidekick_sat__.Solver_types.S) -> functor (Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proof) -> S with type formula = St.formula and type clause = St.clause and type Proof.lemma = St.proof and type theory = Th.tFunctor to make a safe external interface.
val atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endSafe external interface of solvers.
-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endInterface 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 'form sat_state = | Sat_state of {
} | (** The type of values returned when the solver reaches a SAT state. *) |
type ('clause, 'proof) unsat_state = | Unsat_state of {
} | (** The type of values returned when the solver reaches an UNSAT state. *) |
type 'clause export = {hyps : 'clause Sidekick_util.Vec.t; |
history : 'clause Sidekick_util.Vec.t; |
local : 'clause Sidekick_util.Vec.t; |
}Export internal state
module type S : sig ... endThe external interface implemented by safe solvers, such as the one -created by the Solver.Make and Mcsolver.Make functors.
val atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endThe external interface implemented by safe solvers, such as the one -created by the Solver.Make and Mcsolver.Make functors.
-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
module Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
val hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Functor to instantiate the types of clauses for a solver.
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endInternal types (implementation)
This modules actually implements the internal types used by the solver. -Since mutation is heavily used in the solver, it is really, really, *really* -discouraged to direclty use the functions in this module if you don't know the -inner working of mSAT perfectly as even the simplest -change can have dramatic effects on the solver.
module Make : functor (E : Sidekick_sat.Theory_intf.S) -> S with type formula = E.formula and type proof = E.proofFunctor to instantiate the types of clauses for a solver.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Interface for the internal types.
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endtype t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
Internal types (interface)
This modules defines the interface of most of the internal types -used in the core solver.
module Var_fields : Sidekick_util__BitField.Smodule C_fields : Sidekick_util__BitField.Smodule type S : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val hash : t ‑> intval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endSMT Theory
This module defines what a theory must implement in order to -be used in an SMT solver.
type ('formula, 'proof) res = | Sat | (** The current set of assumptions is satisfiable. *) |
| Unsat of 'formula list * 'proof | (** The current set of assumptions is *NOT* satisfiable, and here is a -theory tautology (with its proof), for which every literal is false -under the current assumptions. *) |
Type returned by the theory. Formulas in the unsat clause must come from the -current set of assumptions, i.e must have been encountered in a slice.
type ('form, 'proof) actions = | Actions of {
} |
Actions given to the theory during initialization, to be used -at any time
type ('form, 'proof) slice_actions = | Slice_acts of {
} | (** The type for a slice. Slices are some kind of view of the current -propagation queue. They allow to look at the propagated literals, -and to add new clauses to the solver. *) |
val hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
Returns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
Called at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
module Internal : sig ... endmodule Res : sig ... endmodule Res_intf : sig ... endmodule Sidekick_sat = Sidekick_satmodule Solver : sig ... endmodule Solver_intf : sig ... endmodule Solver_types : sig ... endmodule Solver_types_intf : sig ... endmodule Theory_intf : sig ... endval create : unit ‑> tval in_heap : elt ‑> boolval size : t ‑> intval is_empty : t ‑> boolval clear : t ‑> unitval grow_to_at_least : t ‑> int ‑> unitval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printermodule Tbl : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval mark : t ‑> unitval seen : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitval empty : tval pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printermodule Tbl : sig ... endval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedval seen_both : t ‑> boolval clear : t ‑> unitval create : ?size:[ `Big | `Small | `Tiny ] ‑> unit ‑> ttype var = St.var = {vid : int; |
pa : atom; |
na : atom; |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; |
mutable v_level : int; |
mutable v_idx : int; |
mutable v_weight : float; |
mutable reason : reason option; |
}type clause = St.clause = {name : int; |
tag : int option; |
atoms : atom array; |
mutable cpremise : premise; |
mutable activity : float; |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; |
}val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval create : int ‑> 'a tval clear : 'a t ‑> unitval reset : 'a t ‑> unitval length : 'a t ‑> intval stats : 'a t ‑> Hashtbl.statisticsmodule St : sig ... endval is_leaf : step ‑> boolval expl : step ‑> stringval expand : proof ‑> proof_nodeval fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'aval check : proof ‑> unitmodule Clause : sig ... endmodule Atom : sig ... endmodule Tbl : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proofmodule Proof : sig ... endmodule H : sig ... endexception Conflict of St.clausetype t = {st : St.t; | |
th : Th.t lazy_t; | |
clauses_hyps : St.clause Sidekick_util.Vec.t; | |
clauses_learnt : St.clause Sidekick_util.Vec.t; | |
clauses_temp : St.clause Sidekick_util.Vec.t; | |
mutable unsat_conflict : St.clause option; | |
mutable next_decision : St.atom option; | |
trail : St.atom Sidekick_util.Vec.t; | |
elt_levels : int Sidekick_util.Vec.t; | |
user_levels : int Sidekick_util.Vec.t; | |
backtrack_levels : int Sidekick_util.Vec.t; | |
backtrack : (unit ‑> unit) Sidekick_util.Vec.t; | (** Actions to call when backtracking *) |
to_redo_after_backtrack : (unit ‑> unit) Sidekick_util.Vec.t; | (** Actions to re-do after backtracking *) |
mutable th_head : int; | |
mutable elt_head : int; | |
order : H.t; | |
mutable var_incr : float; | |
mutable clause_incr : float; | |
to_add : (bool * St.clause) CCVector.vector; | |
mutable dirty : bool; |
}val at_level_0 : t ‑> boolval on_backtrack : t ‑> (unit ‑> unit) ‑> unitval nb_clauses : t ‑> intval decision_level : t ‑> intval base_level : t ‑> intval redo_down_to_level_0 : t ‑> (unit ‑> unit) ‑> unitval is_unsat : t ‑> boolval new_atom : permanent:bool ‑> t ‑> St.formula ‑> St.atomval var_decay_activity : t ‑> unitval clause_decay_activity : t ‑> unitval eliminate_duplicates : St.Clause.t ‑> St.clauseval new_decision_level : t ‑> unitval backtrack_down_to : t ‑> int ‑> unitval cancel_until : t ‑> int ‑> unitval report_unsat : t ‑> St.Clause.t ‑> 'aval put_high_level_atoms_first : St.atom array ‑> unitval analyze_sat : t ‑> St.Clause.t ‑> conflict_resval analyze : t ‑> St.Clause.t ‑> conflict_resval record_learnt_clause : t ‑> St.clause ‑> conflict_res ‑> unitval clause_vector : t ‑> St.clause ‑> St.clause Sidekick_util.Vec.tval slice_iter : t ‑> int ‑> int ‑> (St.formula ‑> unit) ‑> unitval act_push_ : permanent:bool ‑> t ‑> St.formula Sidekick_util.IArray.t ‑> St.proof ‑> unitval act_push_local : t ‑> St.formula Sidekick_util.IArray.t ‑> St.proof ‑> unitval act_push_persistent : t ‑> St.formula Sidekick_util.IArray.t ‑> St.proof ‑> unitval act_propagate : t ‑> St.formula ‑> St.formula list ‑> St.proof ‑> unitval current_slice : t ‑> int ‑> (St.formula, 'a) Sidekick_sat.Theory_intf.slice_actionsval full_slice : t ‑> (St.formula, 'a) Sidekick_sat.Theory_intf.slice_actionsval act_at_level_0 : t ‑> unit ‑> boolval actions : t ‑> (St.formula, St.proof) Sidekick_sat.Theory_intf.actionsval propagation_fixpoint : t ‑> boolval pick_branch_lit : t ‑> unitval search : t ‑> int ‑> int ‑> unitval eval_level : t ‑> St.formula ‑> bool * intval eval : t ‑> St.formula ‑> boolval pp_trail : t ‑> unitval solve : t ‑> unitval assume : permanent:bool ‑> t ‑> ?tag:int ‑> St.formula list list ‑> unitval push : t ‑> unitval pop : t ‑> unitval local : t ‑> St.formula list ‑> unitval check_clause : St.Clause.t ‑> boolval check_vec : St.Clause.t Sidekick_util.Vec.t ‑> boolval check_stack : St.Clause.t Stack.t ‑> boolval check : t ‑> boolval hyps : t ‑> St.clause Sidekick_util.Vec.tval history : t ‑> St.clause Sidekick_util.Vec.tval temp : t ‑> St.clause Sidekick_util.Vec.tval trail : t ‑> St.atom Sidekick_util.Vec.tmodule Make : functor (St : Sidekick_sat__.Solver_types.S) -> functor (Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proof) -> sig ... endval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endFunctor to create a module building proofs from a sat-solver unsat trace.
include Sidekick_sat__.Res_intf.S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endResolution proofs
This modules defines functions to create and manipulate resolution proofs.
module type FULL = Sidekick_sat__.Res_intf.FULLval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Module defining atom and clauses
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endinclude Sidekick_sat__.Res_intf.S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
Interface for a module manipulating resolution proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endInterface for proofs
module type S : sig ... endmodule type FULL : sig ... endval is_pos : t ‑> boolval name : t ‑> stringval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Module defining atom and clauses
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endinclude S with type atom = St.atom and type lemma = St.proof and type clause = St.clause and type formula = St.formulaSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval is_pos : t ‑> boolval name : t ‑> stringSignature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Functor to make a safe external interface.
Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proof-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endSAT safe interface
This module defines a safe interface for the core solver. -It is the basis of the Solver and Mcsolver modules.
module Make : functor (St : Sidekick_sat__.Solver_types.S) -> functor (Th : Sidekick_sat.Theory_intf.S with type formula = St.formula and type proof = St.proof) -> S with type formula = St.formula and type clause = St.clause and type Proof.lemma = St.proof and type theory = Th.tFunctor to make a safe external interface.
val atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endSafe external interface of solvers.
-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endInterface 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 'form sat_state = | Sat_state of {
} | (** The type of values returned when the solver reaches a SAT state. *) |
type ('clause, 'proof) unsat_state = | Unsat_state of {
} | (** The type of values returned when the solver reaches an UNSAT state. *) |
type 'clause export = {hyps : 'clause Sidekick_util.Vec.t; |
history : 'clause Sidekick_util.Vec.t; |
local : 'clause Sidekick_util.Vec.t; |
}Export internal state
module type S : sig ... endThe external interface implemented by safe solvers, such as the one -created by the Solver.Make and Mcsolver.Make functors.
val atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... endThe external interface implemented by safe solvers, such as the one -created by the Solver.Make and Mcsolver.Make functors.
-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
module Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
val hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
Functor to instantiate the types of clauses for a solver.
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endInternal types (implementation)
This modules actually implements the internal types used by the solver. -Since mutation is heavily used in the solver, it is really, really, *really* -discouraged to direclty use the functions in this module if you don't know the -inner working of mSAT perfectly as even the simplest -change can have dramatic effects on the solver.
module Make : functor (E : Sidekick_sat.Theory_intf.S) -> S with type formula = E.formula and type proof = E.proofFunctor to instantiate the types of clauses for a solver.
val dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval pp : t Sidekick_sat.Solver_types_intf.printerval pp_a : t array Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval debug_a : t array Sidekick_sat.Solver_types_intf.printerval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val pp : t Sidekick_sat.Solver_types_intf.printerval pp_dimacs : t Sidekick_sat.Solver_types_intf.printerval debug : t Sidekick_sat.Solver_types_intf.printerval hash : t ‑> intval pp : t Sidekick_sat.Solver_types_intf.printerval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
Interface for the internal types.
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Sidekick_sat.Solver_types_intf.Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : Sidekick_sat.Solver_types_intf.C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endtype t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
Internal types (interface)
This modules defines the interface of most of the internal types -used in the core solver.
module Var_fields : Sidekick_util__BitField.Smodule C_fields : Sidekick_util__BitField.Smodule type S : sig ... endval dummy : tval level : t ‑> intval id : t ‑> intval is_pos : t ‑> boolval is_true : t ‑> boolval is_false : t ‑> boolval dummy : tval name : t ‑> stringval hash : t ‑> intval tag : t ‑> int optionval attached : t ‑> boolval set_attached : t ‑> bool ‑> unitval visited : t ‑> boolval set_visited : t ‑> bool ‑> unitmake_clause name atoms size premise creates a clause with
-the given attributes.
-The array's ownership is transferred to the clause, do not
-mutate it after that.
val hash : t ‑> intval dummy : tval level : t ‑> intval idx : t ‑> intval weight : t ‑> floatval set_level : t ‑> int ‑> unitval set_idx : t ‑> int ‑> unitval set_weight : t ‑> float ‑> unitval in_heap : t ‑> boolval make : state ‑> formula ‑> t * Sidekick_sat.Theory_intf.negatedReturns the variable linked with the given formula,
-and whether the atom associated with the formula
-is var.pa or var.na
The signatures of clauses used in the Solver.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> ttype var = {vid : int; | (** Unique identifier *) |
pa : atom; | (** Link for the positive atom *) |
na : atom; | (** Link for the negative atom *) |
mutable v_fields : Var_fields.t; | (** bool fields *) |
mutable v_level : int; | (** Level of decision/propagation *) |
mutable v_idx : int; | (** rank in variable heap *) |
mutable v_weight : float; | (** Variable weight (for the heap) *) |
mutable reason : reason option; | (** The reason for propagation/decision of the literal *) |
}type atom = {aid : int; | (** Unique identifier *) |
var : var; | (** Link for the parent variable *) |
neg : atom; | (** Link for the negation of the atom *) |
lit : formula; | (** Wrapped formula *) |
mutable is_true : bool; | (** Is the atom true ? Conversely, the atom -is false iff a.neg.is_true *) |
mutable watched : clause Sidekick_util.Vec.t; | (** The vector of clauses that watch this atom *) |
}Atoms and variables wrap theory formulas. They exist in the form of
-triplet: a variable and two atoms. For a formula f in normal form,
-the variable v points to the positive atom a which wraps f, while
-a.neg wraps the theory negation of f.
type clause = {name : int; | (** Clause name, mainly for printing, unique. *) |
tag : int option; | (** User-provided tag for clauses. *) |
atoms : atom array; | (** The atoms that constitute the clause. *) |
mutable cpremise : premise; | (** The premise of the clause, i.e. the justification -of why the clause must be satisfied. *) |
mutable activity : float; | (** Clause activity, used for the heap heuristics. *) |
mutable c_flags : C_fields.t; | (** Boolean flags for the clause *) |
}The type of clauses. Each clause generated should be true, i.e. enforced -by the current problem (for more information, see the cpremise field).
type reason = | Decision | (** The atom has been decided by the sat solver *) |
| Bcp of clause | (** The atom has been propagated by the given clause *) |
Reasons of propagation/decision of atoms.
type premise = | Hyp | (** The clause is a hypothesis, provided by the user. *) |
| Local | (** The clause is a 1-atom clause, -where the atom is a local assumption *) |
| Lemma of proof | (** The clause is a theory-provided tautology, with -the given proof. *) |
| History of clause list | (** The clause can be obtained by resolution of the clauses
-in the list. If the list has a single element |
Premises for clauses. Indeed each clause generated during a run of the solver -should be satisfied, the premise is the justification of why it should be -satisfied by the solver.
val nb_elt : t ‑> intmodule Var : sig ... endmodule Atom : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endSMT Theory
This module defines what a theory must implement in order to -be used in an SMT solver.
type ('formula, 'proof) res = | Sat | (** The current set of assumptions is satisfiable. *) |
| Unsat of 'formula list * 'proof | (** The current set of assumptions is *NOT* satisfiable, and here is a -theory tautology (with its proof), for which every literal is false -under the current assumptions. *) |
Type returned by the theory. Formulas in the unsat clause must come from the -current set of assumptions, i.e must have been encountered in a slice.
type ('form, 'proof) actions = | Actions of {
} |
Actions given to the theory during initialization, to be used -at any time
type ('form, 'proof) slice_actions = | Slice_acts of {
} | (** The type for a slice. Slices are some kind of view of the current -propagation queue. They allow to look at the propagated literals, -and to add new clauses to the solver. *) |
val hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
Returns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
module Form : sig ... endAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
Called at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
val prop : tval const : Sidekick_util.ID.t ‑> tval app : Sidekick_util.ID.t ‑> t list ‑> tval rat : tval int : tunfold ty will get the list of arguments, and the return type
-of any function. An atomic type is just a function with no arguments
val make : Sidekick_util.ID.t ‑> 'ty ‑> 'ty tval makef : ty:'a ‑> ('b, Format.formatter, unit, 'a t) Pervasives.format4 ‑> 'bval id : _ t ‑> Sidekick_util.ID.tval ty : 'a t ‑> 'aval pp : _ t CCFormat.printermodule Var : sig ... endmodule Ty : sig ... endtype term_cell = | Var of var | ||
| Const of Sidekick_util.ID.t | ||
| Num_z of Z.t | ||
| Num_q of Q.t | ||
| App of term * term list | ||
| If of term * term * term | ||
| Match of term * (var list * term) Sidekick_util.ID.Map.t | ||
| Select of select * term | ||
| Bind of binder * var * term | ||
| Arith of arith_op * term list | ||
| Let of (var * term) list * term | ||
| Not of term | ||
| Op of op * term list | ||
| Asserting of {
} | ||
| Undefined_value | ||
| Bool of bool |
type select = {select_name : Sidekick_util.ID.t lazy_t; |
select_cstor : Sidekick_util.ID.t; |
select_i : int; |
}type statement = | SetLogic of string |
| SetOption of string list |
| SetInfo of string list |
| Data of Ty.data list |
| TyDecl of Sidekick_util.ID.t * int |
| Decl of Sidekick_util.ID.t * Ty.t |
| Define of definition list |
| Assert of term |
| Assert_bool of int list |
| Goal of var list * term |
| CheckSat |
| Exit |
val const : Sidekick_util.ID.t ‑> Ty.t ‑> termval match_ : term ‑> (var list * term) Sidekick_util.ID.Map.t ‑> termval true_ : termval false_ : termval is_true : term ‑> boolval is_false : term ‑> boolval pp_ty : Ty.t CCFormat.printerval pp_term : term CCFormat.printerval pp_statement : statement CCFormat.printerval env_empty : envval env_find_def : env ‑> Sidekick_util.ID.t ‑> env_entry optionval env_add_def : env ‑> Sidekick_util.ID.t ‑> env_entry ‑> envA data structure where we can have duplicate elements, optimized for -fast concatenation and size.
val empty : 'a tval is_empty : _ t ‑> boolval return : 'a ‑> 'a tval to_seq : 'a t ‑> 'a Sequence.tval fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'aval iter : ('a ‑> unit) ‑> 'a t ‑> unitval create : unit ‑> 'a tmodule Key : sig ... endval empty : tval length : t ‑> intval cardinal : t ‑> inttype actions = {on_backtrack : (unit ‑> unit) ‑> unit; | (** Register a callback to be invoked upon backtracking below the current level *) |
on_merge : repr ‑> repr ‑> Solver_types.explanation ‑> unit; | (** Call this when two classes are merged *) |
raise_conflict : a. Sidekick_smt.Lit.Set.t ‑> 'a; | (** Report a conflict *) |
propagate : Lit.t ‑> Explanation.t Bag.t ‑> unit; | (** Propagate a literal *) |
}val create : ?size:int ‑> actions:actions ‑> Term.state ‑> tCreate a new congruence closure.
val union : t ‑> node ‑> node ‑> Solver_types.explanation ‑> unitMerge the two equivalence classes. Will be undone on backtracking.
val add : t ‑> Solver_types.term ‑> nodeAdd the term to the congruence closure, if not present already. -Will be backtracked.
val add_seq : t ‑> Solver_types.term Sequence.t ‑> unitAdd a sequence of terms to the congruence closure
Given a literal, assume it in the congruence closure and propagate -its consequences. Will be backtracked.
val assert_eq : t ‑> Solver_types.term ‑> Solver_types.term ‑> Solver_types.explanation ‑> unitval assert_distinct : t ‑> Solver_types.term list ‑> neq:Solver_types.term ‑> Solver_types.explanation ‑> unitassert_distinct l ~expl:u e asserts all elements of l are distinct
-with explanation e
-precond: u = distinct l
val check : t ‑> unitval final_check : t ‑> unitval explain_eq_n : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> node ‑> node ‑> Sidekick_smt.Lit.Set.texplain why the two nodes are equal
val explain_eq_t : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> Solver_types.term ‑> Solver_types.term ‑> Sidekick_smt.Lit.Set.texplain why the two terms are equal
val explain_unfold_bag : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> Solver_types.explanation Bag.t ‑> Sidekick_smt.Lit.Set.tval explain_unfold_seq : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> Solver_types.explanation Sequence.t ‑> Sidekick_smt.Lit.Set.tUnfold those explanations into a complete set of -literals implying them
val id : t ‑> Sidekick_util.ID.tval make_cstor : Sidekick_util.ID.t ‑> Ty.t ‑> Solver_types.data_cstor lazy_t ‑> tval make_proj : Sidekick_util.ID.t ‑> Ty.t ‑> Solver_types.data_cstor lazy_t ‑> int ‑> tval make_tester : Sidekick_util.ID.t ‑> Ty.t ‑> Solver_types.data_cstor lazy_t ‑> tval make_defined : Sidekick_util.ID.t ‑> Ty.t ‑> Solver_types.term lazy_t ‑> Solver_types.cst_defined_info ‑> tval make_undef : Sidekick_util.ID.t ‑> Ty.t ‑> tval arity : t ‑> intval hash : t ‑> intval is_finite_cstor : t ‑> boolval pp : t Sidekick_smt.Solver_types.Fmt.printerAn equivalence class is a set of terms that are currently equal -in the partial model built by the solver. -The class is represented by a collection of nodes, one of which is -distinguished and is called the "representative".
All information pertaining to the whole equivalence class is stored -in this representative's node.
When two classes become equal (are "merged"), one of the two -representatives is picked as the representative of the new class. -The new class contains the union of the two old classes' nodes.
We also allow theories to store additional information in the -representative. This information can be used when two classes are -merged, to detect conflicts and solve equations à la Shostak.
val field_has_expansion_lit : Sidekick_smt.Solver_types.Node_bits.fieldUpon expansion, does this term have a special literal Lit_expanded t
-that should be asserted?
val field_is_split : Sidekick_smt.Solver_types.Node_bits.fieldDid we perform case split (Split 1) on this term? -This is only relevant for terms whose type is a datatype.
val field_add_level_0 : Sidekick_smt.Solver_types.Node_bits.fieldIs the corresponding term to be re-added upon backtracking, -down to level 0?
val field_is_active : Sidekick_smt.Solver_types.Node_bits.fieldThe term is needed for evaluation. We must try to evaluate it -or to find a value for it using the theory
val term : t ‑> Solver_types.termval hash : t ‑> intval pp : t Sidekick_smt.Solver_types.Fmt.printerval make : Solver_types.term ‑> tMake a new equivalence class whose representative is the given term
Add given payload
val empty : tval is_empty : t ‑> boolval cardinal : t ‑> inttype t = Solver_types.explanation = | E_reduction | |||
| E_lit of Solver_types.lit | |||
| E_congruence of Solver_types.cc_node * Solver_types.cc_node | |||
| E_injectivity of Solver_types.cc_node * Solver_types.cc_node | |||
| E_reduce_eq of Solver_types.cc_node * Solver_types.cc_node | |||
| E_custom of {
} |
val compare : Solver_types.explanation CCOrd.tval equal : Solver_types.explanation ‑> Solver_types.explanation ‑> boolval pp : Sidekick_smt.Solver_types.Fmt.t ‑> Solver_types.explanation ‑> unitval lit : Solver_types.lit ‑> tmodule Set : sig ... endval bool : bool tval int : int tval string : string tval combine : 'a t ‑> int ‑> 'a ‑> intval iarray : 'a t ‑> 'a Sidekick_util.IArray.t tval create : unit ‑> 'a tval empty : tval length : t ‑> intval cardinal : t ‑> intval create : ?size:int ‑> unit ‑> tval length : t ‑> intmodule Key : sig ... endtype view = Solver_types.lit_view = | Lit_fresh of Sidekick_util.ID.t |
| Lit_atom of Solver_types.term |
| Lit_expanded of Solver_types.term |
val sign : t ‑> boolval view : t ‑> Solver_types.lit_viewval as_atom : t ‑> (Solver_types.term * bool) optionval fresh_with : Sidekick_util.ID.t ‑> tval fresh : unit ‑> tval dummy : tval atom : ?sign:bool ‑> Solver_types.term ‑> tval cstor_test : Term.state ‑> Solver_types.data_cstor ‑> Solver_types.term ‑> tval expanded : Solver_types.term ‑> tval hash : t ‑> intval print : t Sidekick_smt.Solver_types.Fmt.printerval pp : t Sidekick_smt.Solver_types.Fmt.printerval norm : t ‑> t * Sidekick_sat.negatedtype t = private {env : Ast.env; |
domains : domain Sidekick_smt.Ast.Ty.Map.t; |
consts : term Sidekick_util.ID.Map.t; |
}val make : env:Ast.env ‑> consts:term Sidekick_util.ID.Map.t ‑> domains:domain Sidekick_smt.Ast.Ty.Map.t ‑> tval pp : t CCFormat.printerval pp : t CCFormat.printerval atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... end-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
module Proof : Sidekick_sat.Res.S with type clause = clause and type lemma = Theory_combine.proofA module to manipulate proofs.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endThe solving algorithm, based on MCSat
module Sat_solver : Sidekick_sat.S with type formula = Lit.t and type theory = Theory_combine.t and type Proof.lemma = Theory_combine.proofmodule Proof : sig ... endval solver : t ‑> Sat_solver.tval th_combine : t ‑> Theory_combine.tval cc : t ‑> Congruence_closure.tval tst : t ‑> Term.stateval assume : t ‑> Lit.t Sidekick_util.IArray.t ‑> unitsolve s checks the satisfiability of the statement added so far to s
val pp_term_graph : t CCFormat.printerval pp_stats : t CCFormat.printerval pp_unknown : unknown CCFormat.printertype 'a term_cell = | Bool of bool | ||
| App_cst of cst * 'a Sidekick_util.IArray.t | ||
| If of 'a * 'a * 'a | ||
| Case of 'a * 'a Sidekick_util.ID.Map.t | ||
| Custom of {
} |
type term_view_tc = {tc_t_pp : a. 'a Fmt.printer ‑> 'a term_view_custom Fmt.printer; |
tc_t_equal : a. 'a CCEqual.t ‑> 'a term_view_custom CCEqual.t; |
tc_t_hash : a. 'a Hash.t ‑> 'a term_view_custom Hash.t; |
tc_t_ty : a. ('a ‑> ty) ‑> 'a term_view_custom ‑> ty; |
tc_t_is_semantic : a. 'a term_view_custom ‑> bool; |
tc_t_solve : cc_node term_view_custom ‑> cc_node term_view_custom ‑> solve_result; |
tc_t_sub : a. 'a term_view_custom ‑> 'a Sequence.t; |
tc_t_abs : self:term ‑> term term_view_custom ‑> term * bool; |
tc_t_relevant : a. 'a term_view_custom ‑> 'a Sequence.t; |
tc_t_subst : a b. ('a ‑> 'b) ‑> 'a term_view_custom ‑> 'b term_view_custom option; |
tc_t_explain : a. 'a CCEqual.t ‑> 'a term_view_custom ‑> 'a term_view_custom ‑> ('a * 'a) list; |
}Methods on the custom term view whose leaves are 'a.
-Terms must be comparable, hashable, printable, and provide
-some additional theory handles.
tc_t_sub must return all immediate subterms (all 'a contained in the term)tc_t_subst must use the function to replace all subterms (all the 'a
-returned by tc_t_sub) by 'btc_t_relevant must return a subset of tc_t_sub (possibly the same set).
-The terms it returns will be activated and evaluated whenever possible.
-Terms in tc_t_sub t \ tc_t_relevant t are considered for
-congruence but not for evaluation.t1 and t2 satisfy tc_t_is_semantic and have the same type,
-then tc_t_solve t1 t2 must succeed by returning some solve_result.tc_t_equal eq a b = true, then tc_t_explain eq a b must
-return all the pairs of equal subterms that are sufficient
-for a and b to be equal.type solve_result = | Solve_ok of {
} | (** Success, the two terms being equal is equivalent -to the given substitution *) | ||
| Solve_fail of {
} | (** Failure, because of the given explanation. -The two terms cannot be equal *) |
The result of a call to solve.
type cc_node = {n_term : term; |
mutable n_bits : Node_bits.t; |
mutable n_parents : cc_node Bag.t; |
mutable n_root : cc_node; |
mutable n_expl : explanation_forest_link; |
mutable n_payload : cc_node_payload list; |
mutable n_tags : (cc_node * explanation) Sidekick_util.Util.Int_map.t; |
}A node of the congruence closure. -An equivalence class is represented by its "root" element, -the representative.
If there is a normal form in the congruence class, then the -representative is a normal form
type explanation = | E_reduction | ||||
| E_lit of lit | ||||
| E_congruence of cc_node * cc_node | ||||
| E_injectivity of cc_node * cc_node | ||||
| E_reduce_eq of cc_node * cc_node | ||||
| E_custom of {
} | (** Custom explanation, typically for theories *) |
type cst_kind = | Cst_undef of ty |
| Cst_cstor of data_cstor lazy_t |
| Cst_proj of ty * data_cstor lazy_t * int |
| Cst_test of ty * data_cstor lazy_t |
| Cst_defined of ty * term lazy_t * cst_defined_info |
type data_cstor = {cstor_ty : ty; |
cstor_args : ty Sidekick_util.IArray.t; |
cstor_proj : cst Sidekick_util.IArray.t lazy_t; |
cstor_test : cst lazy_t; |
cstor_cst : cst; |
cstor_card : ty_card; |
}val term_hash_ : term ‑> intval hash_lit : lit ‑> intval cmp_exp : explanation CCOrd.tval pp_cst : CCFormat.t ‑> cst ‑> unitval id_of_cst : cst ‑> Sidekick_util.ID.tval pp_ty : ty Sidekick_util.Util.printerval pp_term_top : ids:bool ‑> CCFormat.t ‑> term ‑> unitval pp_term : CCFormat.t ‑> term ‑> unitval pp_lit : CCFormat.t ‑> lit ‑> unitval pp_cc_node : CCFormat.t ‑> cc_node ‑> unitval pp_explanation : Fmt.t ‑> explanation ‑> unitval create : unit ‑> ttype t = Solver_types.term = {mutable term_id : int; |
mutable term_ty : Solver_types.ty; |
term_cell : t Solver_types.term_cell; |
}type 'a cell = 'a Solver_types.term_cell = | Bool of bool | ||
| App_cst of Solver_types.cst * 'a Sidekick_util.IArray.t | ||
| If of 'a * 'a * 'a | ||
| Case of 'a * 'a Sidekick_util.ID.Map.t | ||
| Custom of {
} |
type tc = Solver_types.term_view_tc = {tc_t_pp : a. 'a Sidekick_smt.Solver_types.Fmt.printer ‑> 'a custom Sidekick_smt.Solver_types.Fmt.printer; |
tc_t_equal : a. 'a CCEqual.t ‑> 'a custom CCEqual.t; |
tc_t_hash : a. 'a Hash.t ‑> 'a custom Hash.t; |
tc_t_ty : a. ('a ‑> Solver_types.ty) ‑> 'a custom ‑> Solver_types.ty; |
tc_t_is_semantic : a. 'a custom ‑> bool; |
tc_t_solve : Solver_types.cc_node custom ‑> Solver_types.cc_node custom ‑> Solver_types.solve_result; |
tc_t_sub : a. 'a custom ‑> 'a Sequence.t; |
tc_t_abs : self:Solver_types.term ‑> Solver_types.term custom ‑> Solver_types.term * bool; |
tc_t_relevant : a. 'a custom ‑> 'a Sequence.t; |
tc_t_subst : a b. ('a ‑> 'b) ‑> 'a custom ‑> 'b custom option; |
tc_t_explain : a. 'a CCEqual.t ‑> 'a custom ‑> 'a custom ‑> ('a * 'a) list; |
}val id : t ‑> intval cell : t ‑> Solver_types.term Solver_types.term_cellval hash : t ‑> intval create : ?size:int ‑> unit ‑> stateval make : state ‑> t Solver_types.term_cell ‑> tval const : state ‑> Solver_types.cst ‑> tval app_cst : state ‑> Solver_types.cst ‑> t Sidekick_util.IArray.t ‑> tval case : state ‑> t ‑> t Sidekick_util.ID.Map.t ‑> tval cstor_test : state ‑> Solver_types.data_cstor ‑> Solver_types.term ‑> tval cstor_proj : state ‑> Solver_types.data_cstor ‑> int ‑> Solver_types.term ‑> tval pp : t Sidekick_smt.Solver_types.Fmt.printerval is_true : t ‑> boolval is_false : t ‑> boolval is_const : t ‑> boolval is_custom : t ‑> boolval as_cst_undef : t ‑> (Solver_types.cst * Ty.t) optionval as_cstor_app : t ‑> (Solver_types.cst * Solver_types.data_cstor * t Sidekick_util.IArray.t) optiontype unif_form = | Unif_cst of Solver_types.cst * Ty.t |
| Unif_cstor of Solver_types.cst * Solver_types.data_cstor * Solver_types.term Sidekick_util.IArray.t |
| Unif_none |
val hash : t ‑> intval equal : X.t Solver_types.term_cell ‑> X.t Solver_types.term_cell ‑> boolval hash : X.t Solver_types.term_cell ‑> inttype 'a cell = 'a Solver_types.term_cell = | Bool of bool | ||
| App_cst of Solver_types.cst * 'a Sidekick_util.IArray.t | ||
| If of 'a * 'a * 'a | ||
| Case of 'a * 'a Sidekick_util.ID.Map.t | ||
| Custom of {
} |
type tc = Solver_types.term_view_tc = {tc_t_pp : a. 'a Sidekick_smt.Solver_types.Fmt.printer ‑> 'a Solver_types.term_view_custom Sidekick_smt.Solver_types.Fmt.printer; |
tc_t_equal : a. 'a CCEqual.t ‑> 'a Solver_types.term_view_custom CCEqual.t; |
tc_t_hash : a. 'a Hash.t ‑> 'a Solver_types.term_view_custom Hash.t; |
tc_t_ty : a. ('a ‑> Solver_types.ty) ‑> 'a Solver_types.term_view_custom ‑> Solver_types.ty; |
tc_t_is_semantic : a. 'a Solver_types.term_view_custom ‑> bool; |
tc_t_solve : Solver_types.cc_node Solver_types.term_view_custom ‑> Solver_types.cc_node Solver_types.term_view_custom ‑> Solver_types.solve_result; |
tc_t_sub : a. 'a Solver_types.term_view_custom ‑> 'a Sequence.t; |
tc_t_abs : self:Solver_types.term ‑> Solver_types.term custom ‑> Solver_types.term * bool; |
tc_t_relevant : a. 'a Solver_types.term_view_custom ‑> 'a Sequence.t; |
tc_t_subst : a b. ('a ‑> 'b) ‑> 'a Solver_types.term_view_custom ‑> 'b Solver_types.term_view_custom option; |
tc_t_explain : a. 'a CCEqual.t ‑> 'a Solver_types.term_view_custom ‑> 'a Solver_types.term_view_custom ‑> ('a * 'a) list; |
}val hash : t ‑> intval true_ : tval false_ : tval const : Solver_types.cst ‑> tval app_cst : Solver_types.cst ‑> Solver_types.term Sidekick_util.IArray.t ‑> tval cstor_test : Solver_types.data_cstor ‑> Solver_types.term ‑> tval cstor_proj : Solver_types.data_cstor ‑> int ‑> Solver_types.term ‑> tval case : Solver_types.term ‑> Solver_types.term Sidekick_util.ID.Map.t ‑> tval if_ : Solver_types.term ‑> Solver_types.term ‑> Solver_types.term ‑> tval custom : tc:Solver_types.term_view_tc ‑> Solver_types.term Solver_types.term_view_custom ‑> tmodule type ARG : sig ... endval hash : t ‑> intval pp : t CCFormat.printermodule Clause : sig ... endtype state = | State : {
} ‑> state |
Runtime state of a theory, with all the operations it provides.
-'a is the internal state
type actions = {on_backtrack : (unit ‑> unit) ‑> unit; | (** Register an action to do when we backtrack *) |
raise_conflict : a. conflict ‑> 'a; | (** Give a conflict clause to the solver *) |
propagate_eq : Term.t ‑> Term.t ‑> Explanation.t ‑> unit; | (** Propagate an equality |
propagate_distinct : Term.t list ‑> neq:Term.t ‑> Explanation.t ‑> unit; | (** Propagate a |
propagate : Lit.t ‑> Explanation.t Bag.t ‑> unit; | (** Propagate a boolean using a unit clause.
- |
add_local_axiom : Lit.t Sidekick_util.IArray.t ‑> unit; | (** Add local clause to the SAT solver. This clause will be -removed when the solver backtracks. *) |
add_persistent_axiom : Lit.t Sidekick_util.IArray.t ‑> unit; | (** Add toplevel clause to the SAT solver. This clause will -not be backtracked. *) |
find : Term.t ‑> Equiv_class.t; | (** Find representative of this term *) |
all_classes : Equiv_class.t Sequence.t; | (** All current equivalence classes -(caution: linear in the number of terms existing in the solver) *) |
}Actions available to a theory during its lifetime
val make : name:string ‑> make:(Term.state ‑> actions ‑> state) ‑> unit ‑> tval make_st : ?on_merge:('a ‑> Equiv_class.t ‑> Equiv_class.t ‑> Explanation.t ‑> unit) ‑> ?on_assert:('a ‑> Lit.t ‑> unit) ‑> final_check:('a ‑> Lit.t Sequence.t ‑> unit) ‑> st:'a ‑> unit ‑> stateval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
Combine the congruence closure with a number of plugins
module Proof : sig ... endinclude Sidekick_sat.Theory_intf.S with type formula = Lit.t and type proof = Proof.tmodule Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
val cc : t ‑> Congruence_closure.tval tst : t ‑> Term.stateval theories : t ‑> Theory.state Sequence.ttype cell = Solver_types.ty_cell = | Prop |
| Atomic of Sidekick_util.ID.t * Solver_types.ty_def |
| Arrow of Solver_types.ty * Solver_types.ty |
type data_cstor = Solver_types.data_cstor = {cstor_ty : Solver_types.ty; |
cstor_args : Solver_types.ty Sidekick_util.IArray.t; |
cstor_proj : Solver_types.cst Sidekick_util.IArray.t lazy_t; |
cstor_test : Solver_types.cst lazy_t; |
cstor_cst : Solver_types.cst; |
cstor_card : Solver_types.ty_card; |
}val prop : tval atomic : Sidekick_util.ID.t ‑> def ‑> card:Ty_card.t lazy_t ‑> tval is_prop : t ‑> boolval is_data : t ‑> boolval is_uninterpreted : t ‑> boolval is_arrow : t ‑> boolval mangle : t ‑> stringval finite : tval infinite : tval pp : t Sidekick_util.Intf.printermodule Ast : sig ... endmodule Bag : sig ... endmodule Config : sig ... endmodule Congruence_closure : sig ... endmodule Cst : sig ... endmodule Equiv_class : sig ... endmodule Explanation : sig ... endmodule Hash : sig ... endmodule Het_map : sig ... endmodule Lit : sig ... endmodule Model : sig ... endmodule Solver : sig ... endmodule Solver_types : sig ... endmodule Stat : sig ... endmodule Term : sig ... endmodule Term_cell : sig ... endmodule Theory : sig ... endmodule Theory_combine : sig ... endmodule Ty : sig ... endmodule Ty_card : sig ... endval prop : tval const : Sidekick_util.ID.t ‑> tval app : Sidekick_util.ID.t ‑> t list ‑> tval rat : tval int : tunfold ty will get the list of arguments, and the return type
-of any function. An atomic type is just a function with no arguments
val make : Sidekick_util.ID.t ‑> 'ty ‑> 'ty tval makef : ty:'a ‑> ('b, Format.formatter, unit, 'a t) Pervasives.format4 ‑> 'bval id : _ t ‑> Sidekick_util.ID.tval ty : 'a t ‑> 'aval pp : _ t CCFormat.printermodule Var : sig ... endmodule Ty : sig ... endtype term_cell = | Var of var | ||
| Const of Sidekick_util.ID.t | ||
| Num_z of Z.t | ||
| Num_q of Q.t | ||
| App of term * term list | ||
| If of term * term * term | ||
| Match of term * (var list * term) Sidekick_util.ID.Map.t | ||
| Select of select * term | ||
| Bind of binder * var * term | ||
| Arith of arith_op * term list | ||
| Let of (var * term) list * term | ||
| Not of term | ||
| Op of op * term list | ||
| Asserting of {
} | ||
| Undefined_value | ||
| Bool of bool |
type select = {select_name : Sidekick_util.ID.t lazy_t; |
select_cstor : Sidekick_util.ID.t; |
select_i : int; |
}type statement = | SetLogic of string |
| SetOption of string list |
| SetInfo of string list |
| Data of Ty.data list |
| TyDecl of Sidekick_util.ID.t * int |
| Decl of Sidekick_util.ID.t * Ty.t |
| Define of definition list |
| Assert of term |
| Assert_bool of int list |
| Goal of var list * term |
| CheckSat |
| Exit |
val const : Sidekick_util.ID.t ‑> Ty.t ‑> termval match_ : term ‑> (var list * term) Sidekick_util.ID.Map.t ‑> termval true_ : termval false_ : termval is_true : term ‑> boolval is_false : term ‑> boolval pp_ty : Ty.t CCFormat.printerval pp_term : term CCFormat.printerval pp_statement : statement CCFormat.printerval env_empty : envval env_find_def : env ‑> Sidekick_util.ID.t ‑> env_entry optionval env_add_def : env ‑> Sidekick_util.ID.t ‑> env_entry ‑> envA data structure where we can have duplicate elements, optimized for -fast concatenation and size.
val empty : 'a tval is_empty : _ t ‑> boolval return : 'a ‑> 'a tval to_seq : 'a t ‑> 'a Sequence.tval fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'aval iter : ('a ‑> unit) ‑> 'a t ‑> unitval create : unit ‑> 'a tmodule Key : sig ... endval empty : tval length : t ‑> intval cardinal : t ‑> inttype actions = {on_backtrack : (unit ‑> unit) ‑> unit; | (** Register a callback to be invoked upon backtracking below the current level *) |
on_merge : repr ‑> repr ‑> Sidekick_smt.Solver_types.explanation ‑> unit; | (** Call this when two classes are merged *) |
raise_conflict : a. Sidekick_smt.Lit.Set.t ‑> 'a; | (** Report a conflict *) |
propagate : Sidekick_smt.Lit.t ‑> Sidekick_smt.Explanation.t Sidekick_smt.Bag.t ‑> unit; | (** Propagate a literal *) |
}val create : ?size:int ‑> actions:actions ‑> Sidekick_smt.Term.state ‑> tCreate a new congruence closure.
val union : t ‑> node ‑> node ‑> Sidekick_smt.Solver_types.explanation ‑> unitMerge the two equivalence classes. Will be undone on backtracking.
val mem : t ‑> Sidekick_smt.Solver_types.term ‑> boolIs the term properly added to the congruence closure?
val add : t ‑> Sidekick_smt.Solver_types.term ‑> nodeAdd the term to the congruence closure, if not present already. -Will be backtracked.
val add_seq : t ‑> Sidekick_smt.Solver_types.term Sequence.t ‑> unitAdd a sequence of terms to the congruence closure
val assert_lit : t ‑> Sidekick_smt.Lit.t ‑> unitGiven a literal, assume it in the congruence closure and propagate -its consequences. Will be backtracked.
val assert_eq : t ‑> Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.explanation ‑> unitval assert_distinct : t ‑> Sidekick_smt.Solver_types.term list ‑> neq:Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.explanation ‑> unitassert_distinct l ~expl:u e asserts all elements of l are distinct
-with explanation e
-precond: u = distinct l
val check : t ‑> unitval final_check : t ‑> unitval explain_eq_n : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> node ‑> node ‑> Sidekick_smt.Lit.Set.texplain why the two nodes are equal
val explain_eq_t : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Lit.Set.texplain why the two terms are equal
val explain_unfold_bag : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> Sidekick_smt.Solver_types.explanation Sidekick_smt.Bag.t ‑> Sidekick_smt.Lit.Set.tval explain_unfold_seq : ?init:Sidekick_smt.Lit.Set.t ‑> t ‑> Sidekick_smt.Solver_types.explanation Sequence.t ‑> Sidekick_smt.Lit.Set.tUnfold those explanations into a complete set of -literals implying them
val id : t ‑> Sidekick_util.ID.tval ty : t ‑> Sidekick_smt.Ty.tval make_cstor : Sidekick_util.ID.t ‑> Sidekick_smt.Ty.t ‑> Sidekick_smt.Solver_types.data_cstor lazy_t ‑> tval make_proj : Sidekick_util.ID.t ‑> Sidekick_smt.Ty.t ‑> Sidekick_smt.Solver_types.data_cstor lazy_t ‑> int ‑> tval make_tester : Sidekick_util.ID.t ‑> Sidekick_smt.Ty.t ‑> Sidekick_smt.Solver_types.data_cstor lazy_t ‑> tval make_defined : Sidekick_util.ID.t ‑> Sidekick_smt.Ty.t ‑> Sidekick_smt.Solver_types.term lazy_t ‑> Sidekick_smt.Solver_types.cst_defined_info ‑> tval make_undef : Sidekick_util.ID.t ‑> Sidekick_smt.Ty.t ‑> tval arity : t ‑> intval hash : t ‑> intval as_undefined : t ‑> (t * Sidekick_smt.Ty.t) optionval as_undefined_exn : t ‑> t * Sidekick_smt.Ty.tval is_finite_cstor : t ‑> boolval pp : t Sidekick_smt.Solver_types.Fmt.printerAn equivalence class is a set of terms that are currently equal -in the partial model built by the solver. -The class is represented by a collection of nodes, one of which is -distinguished and is called the "representative".
All information pertaining to the whole equivalence class is stored -in this representative's node.
When two classes become equal (are "merged"), one of the two -representatives is picked as the representative of the new class. -The new class contains the union of the two old classes' nodes.
We also allow theories to store additional information in the -representative. This information can be used when two classes are -merged, to detect conflicts and solve equations à la Shostak.
val field_has_expansion_lit : Sidekick_smt.Solver_types.Node_bits.fieldUpon expansion, does this term have a special literal Lit_expanded t
-that should be asserted?
val field_is_split : Sidekick_smt.Solver_types.Node_bits.fieldDid we perform case split (Split 1) on this term? -This is only relevant for terms whose type is a datatype.
val field_add_level_0 : Sidekick_smt.Solver_types.Node_bits.fieldIs the corresponding term to be re-added upon backtracking, -down to level 0?
val field_is_active : Sidekick_smt.Solver_types.Node_bits.fieldThe term is needed for evaluation. We must try to evaluate it -or to find a value for it using the theory
val term : t ‑> Sidekick_smt.Solver_types.termval hash : t ‑> intval pp : t Sidekick_smt.Solver_types.Fmt.printerval make : Sidekick_smt.Solver_types.term ‑> tMake a new equivalence class whose representative is the given term
Add given payload
val empty : tval is_empty : t ‑> boolval cardinal : t ‑> inttype t = Sidekick_smt.Solver_types.explanation = | E_reduction | |||
| E_lit of Sidekick_smt.Solver_types.lit | |||
| E_congruence of Sidekick_smt.Solver_types.cc_node * Sidekick_smt.Solver_types.cc_node | |||
| E_injectivity of Sidekick_smt.Solver_types.cc_node * Sidekick_smt.Solver_types.cc_node | |||
| E_reduce_eq of Sidekick_smt.Solver_types.cc_node * Sidekick_smt.Solver_types.cc_node | |||
| E_custom of {
} |
val compare : Sidekick_smt.Solver_types.explanation CCOrd.tval equal : Sidekick_smt.Solver_types.explanation ‑> Sidekick_smt.Solver_types.explanation ‑> boolval pp : Sidekick_smt.Solver_types.Fmt.t ‑> Sidekick_smt.Solver_types.explanation ‑> unitval lit : Sidekick_smt.Solver_types.lit ‑> tmodule Set : sig ... endval bool : bool tval int : int tval string : string tval combine : 'a t ‑> int ‑> 'a ‑> intval iarray : 'a t ‑> 'a Sidekick_util.IArray.t tval create : unit ‑> 'a tval empty : tval length : t ‑> intval cardinal : t ‑> intval create : ?size:int ‑> unit ‑> tval length : t ‑> intmodule Key : sig ... endtype t = Sidekick_smt.Solver_types.lit = {lit_view : Sidekick_smt.Solver_types.lit_view; |
lit_sign : bool; |
}type view = Sidekick_smt.Solver_types.lit_view = | Lit_fresh of Sidekick_util.ID.t |
| Lit_atom of Sidekick_smt.Solver_types.term |
| Lit_expanded of Sidekick_smt.Solver_types.term |
val sign : t ‑> boolval view : t ‑> Sidekick_smt.Solver_types.lit_viewval as_atom : t ‑> (Sidekick_smt.Solver_types.term * bool) optionval fresh_with : Sidekick_util.ID.t ‑> tval fresh : unit ‑> tval dummy : tval atom : ?sign:bool ‑> Sidekick_smt.Solver_types.term ‑> tval cstor_test : Sidekick_smt.Term.state ‑> Sidekick_smt.Solver_types.data_cstor ‑> Sidekick_smt.Solver_types.term ‑> tval expanded : Sidekick_smt.Solver_types.term ‑> tval hash : t ‑> intval print : t Sidekick_smt.Solver_types.Fmt.printerval pp : t Sidekick_smt.Solver_types.Fmt.printerval norm : t ‑> t * Sidekick_sat.negatedtype t = private {env : Sidekick_smt.Ast.env; |
domains : domain Sidekick_smt.Ast.Ty.Map.t; |
consts : term Sidekick_util.ID.Map.t; |
}val make : env:Sidekick_smt.Ast.env ‑> consts:term Sidekick_util.ID.Map.t ‑> domains:domain Sidekick_smt.Ast.Ty.Map.t ‑> tval pp : t CCFormat.printerval pp : t CCFormat.printerval atoms : t ‑> atom Sidekick_util.IArray.tval tag : t ‑> int optionMake a clause from this array of SAT literals. -The array's ownership is transferred to the clause, do not mutate it
val pp : t Sidekick_sat__.Solver_intf.printerval pp : t Sidekick_sat__.Solver_intf.printerval pp : t CCFormat.printerval is_pos : t ‑> boolval pp : t Sidekick_sat__.Res_intf.printerval name : t ‑> stringval pp : t Sidekick_sat__.Res_intf.printerA nice looking printer for clauses, which sort the atoms before printing.
A module to manipulate proofs.
Signature for a module handling proof by resolution from sat solving traces
exception Insufficient_hypsRaised when a complete resolution derivation cannot be found using the current hypotheses.
type proofLazy type for proof trees. Proofs are persistent objects, and can be -extended to proof nodes using functions defined later.
type proof_node = {conclusion : clause; | (** The conclusion of the proof *) |
step : step; | (** The reasoning step used to prove the conclusion *) |
}A proof can be expanded into a proof node, which show the first step of the proof.
type step = | Hypothesis | (** The conclusion is a user-provided hypothesis *) |
| Assumption | (** The conclusion has been locally assumed by the user *) |
| Lemma of lemma | (** The conclusion is a tautology provided by the theory, with associated proof *) |
| Duplicate of proof * atom list | (** The conclusion is obtained by eliminating multiple occurences of the atom in -the conclusion of the provided proof. *) |
| Resolution of proof * proof * atom | (** The conclusion can be deduced by performing a resolution between the conclusions -of the two given proofs. The atom on which to perform the resolution is also given. *) |
The type of reasoning steps allowed in a proof.
Given a conflict clause c, returns a proof of the empty clause.
val is_leaf : step ‑> boolReturns wether the the proof node is a leaf, i.e. an hypothesis,
-an assumption, or a lemma.
-true if and only if returns the empty list.
val expl : step ‑> stringReturns a short string description for the proof step; for instance
-"hypothesis" for a Hypothesis
-(it currently returns the variant name in lowercase).
val fold : ('a ‑> proof_node ‑> 'a) ‑> 'a ‑> proof ‑> 'afold f acc p, fold f over the proof p and all its node. It is guaranteed that
-f is executed exactly once on each proof node in the tree, and that the execution of
-f on a proof node happens after the execution on the parents of the nodes.
Returns the unsat_core of the given proof, i.e the lists of conclusions
-of all leafs of the proof.
-More efficient than using the fold function since it has
-access to the internal representation of proofs
module Clause : sig ... endmodule Atom : sig ... end-These are the internal modules used, you should probably not use them -if you're not familiar with the internals of mSAT.
module Proof : Sidekick_sat.Res.S with type clause = clause and type lemma = Sidekick_smt.Theory_combine.proofA module to manipulate proofs.
val create : ?size:[ `Tiny | `Small | `Big ] ‑> unit ‑> tCreate new solver
The type of atoms given by the module argument for formulas. -An atom is a user-defined atomic formula whose truth value is -picked by Msat.
type res = | Sat of formula Sidekick_sat__.Solver_intf.sat_state | (** Returned when the solver reaches SAT, with a model *) |
| Unsat of (clause, Proof.proof) Sidekick_sat__.Solver_intf.unsat_state | (** Returned when the solver reaches UNSAT, with a proof *) |
Result type for the solver
exception UndecidedLitException raised by the evaluating functions when a literal -has not yet been assigned a value.
Add the list of clauses to the current set of assumptions. -Modifies the sat solver state in place.
Lower level addition of clauses. See Clause to create clauses.
Try and solves the current set of clauses.
solve, they are
-not saved in the solver's state.Add a new atom (i.e propositional formula) to the solver. -This formula will be decided on at some point during solving, -whether it appears in clauses or not.
val unsat_core : Proof.proof ‑> clause listReturns the unsat core of a given proof, ie a subset of all the added -clauses that is sufficient to establish unsatisfiability.
val push : t ‑> unitPush a new save point. Clauses added after this call to push will
-be added as normal, but the corresponding call to pop will
-remove these clauses.
val export : t ‑> clause Sidekick_sat__.Solver_intf.exportmodule Lit : sig ... endmodule Clause : sig ... endmodule Formula : sig ... endThe solving algorithm, based on MCSat
module Sat_solver : Sidekick_sat.S with type formula = Sidekick_smt.Lit.t and type theory = Sidekick_smt.Theory_combine.t and type Proof.lemma = Sidekick_smt.Theory_combine.proofmodule Proof : sig ... endval create : ?size:[ `Big | `Tiny | `Small ] ‑> ?config:Sidekick_smt.Config.t ‑> theories:Sidekick_smt.Theory.t list ‑> unit ‑> tval solver : t ‑> Sat_solver.tval th_combine : t ‑> Sidekick_smt.Theory_combine.tval add_theory : t ‑> Sidekick_smt.Theory.t ‑> unitval cc : t ‑> Sidekick_smt.Congruence_closure.tval stats : t ‑> Sidekick_smt.Stat.tval tst : t ‑> Sidekick_smt.Term.stateval assume : t ‑> Sidekick_smt.Lit.t Sidekick_util.IArray.t ‑> unitval assume_eq : t ‑> Sidekick_smt.Term.t ‑> Sidekick_smt.Term.t ‑> Sidekick_smt.Lit.t ‑> unitval assume_distinct : t ‑> Sidekick_smt.Term.t list ‑> neq:Sidekick_smt.Term.t ‑> Sidekick_smt.Lit.t ‑> unitval solve : ?on_exit:(unit ‑> unit) list ‑> ?check:bool ‑> assumptions:Sidekick_smt.Lit.t list ‑> t ‑> ressolve s checks the satisfiability of the statement added so far to s
val pp_term_graph : t CCFormat.printerval pp_stats : t CCFormat.printerval pp_unknown : unknown CCFormat.printertype 'a term_cell = | Bool of bool | ||
| App_cst of cst * 'a Sidekick_util.IArray.t | ||
| If of 'a * 'a * 'a | ||
| Case of 'a * 'a Sidekick_util.ID.Map.t | ||
| Custom of {
} |
type term_view_tc = {tc_t_pp : a. 'a Fmt.printer ‑> 'a term_view_custom Fmt.printer; |
tc_t_equal : a. 'a CCEqual.t ‑> 'a term_view_custom CCEqual.t; |
tc_t_hash : a. 'a Sidekick_smt.Hash.t ‑> 'a term_view_custom Sidekick_smt.Hash.t; |
tc_t_ty : a. ('a ‑> ty) ‑> 'a term_view_custom ‑> ty; |
tc_t_is_semantic : a. 'a term_view_custom ‑> bool; |
tc_t_solve : cc_node term_view_custom ‑> cc_node term_view_custom ‑> solve_result; |
tc_t_sub : a. 'a term_view_custom ‑> 'a Sequence.t; |
tc_t_abs : self:term ‑> term term_view_custom ‑> term * bool; |
tc_t_relevant : a. 'a term_view_custom ‑> 'a Sequence.t; |
tc_t_subst : a b. ('a ‑> 'b) ‑> 'a term_view_custom ‑> 'b term_view_custom option; |
tc_t_explain : a. 'a CCEqual.t ‑> 'a term_view_custom ‑> 'a term_view_custom ‑> ('a * 'a) list; |
}Methods on the custom term view whose leaves are 'a.
-Terms must be comparable, hashable, printable, and provide
-some additional theory handles.
tc_t_sub must return all immediate subterms (all 'a contained in the term)tc_t_subst must use the function to replace all subterms (all the 'a
-returned by tc_t_sub) by 'btc_t_relevant must return a subset of tc_t_sub (possibly the same set).
-The terms it returns will be activated and evaluated whenever possible.
-Terms in tc_t_sub t \ tc_t_relevant t are considered for
-congruence but not for evaluation.t1 and t2 satisfy tc_t_is_semantic and have the same type,
-then tc_t_solve t1 t2 must succeed by returning some solve_result.tc_t_equal eq a b = true, then tc_t_explain eq a b must
-return all the pairs of equal subterms that are sufficient
-for a and b to be equal.type solve_result = | Solve_ok of {
} | (** Success, the two terms being equal is equivalent -to the given substitution *) | ||
| Solve_fail of {
} | (** Failure, because of the given explanation. -The two terms cannot be equal *) |
The result of a call to solve.
type cc_node = {n_term : term; |
mutable n_bits : Node_bits.t; |
mutable n_parents : cc_node Sidekick_smt.Bag.t; |
mutable n_root : cc_node; |
mutable n_expl : explanation_forest_link; |
mutable n_payload : cc_node_payload list; |
mutable n_tags : (cc_node * explanation) Sidekick_util.Util.Int_map.t; |
}A node of the congruence closure. -An equivalence class is represented by its "root" element, -the representative.
If there is a normal form in the congruence class, then the -representative is a normal form
type explanation = | E_reduction | ||||
| E_lit of lit | ||||
| E_congruence of cc_node * cc_node | ||||
| E_injectivity of cc_node * cc_node | ||||
| E_reduce_eq of cc_node * cc_node | ||||
| E_custom of {
} | (** Custom explanation, typically for theories *) |
type cst_kind = | Cst_undef of ty |
| Cst_cstor of data_cstor lazy_t |
| Cst_proj of ty * data_cstor lazy_t * int |
| Cst_test of ty * data_cstor lazy_t |
| Cst_defined of ty * term lazy_t * cst_defined_info |
type data_cstor = {cstor_ty : ty; |
cstor_args : ty Sidekick_util.IArray.t; |
cstor_proj : cst Sidekick_util.IArray.t lazy_t; |
cstor_test : cst lazy_t; |
cstor_cst : cst; |
cstor_card : ty_card; |
}val term_hash_ : term ‑> intval hash_lit : lit ‑> intval cmp_exp : explanation CCOrd.tval pp_cst : CCFormat.t ‑> cst ‑> unitval id_of_cst : cst ‑> Sidekick_util.ID.tval pp_ty : ty Sidekick_util.Util.printerval pp_term_top : ids:bool ‑> CCFormat.t ‑> term ‑> unitval pp_term : CCFormat.t ‑> term ‑> unitval pp_lit : CCFormat.t ‑> lit ‑> unitval pp_cc_node : CCFormat.t ‑> cc_node ‑> unitval pp_explanation : Fmt.t ‑> explanation ‑> unitval create : unit ‑> ttype t = Sidekick_smt.Solver_types.term = {mutable term_id : int; |
mutable term_ty : Sidekick_smt.Solver_types.ty; |
term_cell : t Sidekick_smt.Solver_types.term_cell; |
}type 'a cell = 'a Sidekick_smt.Solver_types.term_cell = | Bool of bool | ||
| App_cst of Sidekick_smt.Solver_types.cst * 'a Sidekick_util.IArray.t | ||
| If of 'a * 'a * 'a | ||
| Case of 'a * 'a Sidekick_util.ID.Map.t | ||
| Custom of {
} |
type tc = Sidekick_smt.Solver_types.term_view_tc = {tc_t_pp : a. 'a Sidekick_smt.Solver_types.Fmt.printer ‑> 'a custom Sidekick_smt.Solver_types.Fmt.printer; |
tc_t_equal : a. 'a CCEqual.t ‑> 'a custom CCEqual.t; |
tc_t_hash : a. 'a Sidekick_smt.Hash.t ‑> 'a custom Sidekick_smt.Hash.t; |
tc_t_ty : a. ('a ‑> Sidekick_smt.Solver_types.ty) ‑> 'a custom ‑> Sidekick_smt.Solver_types.ty; |
tc_t_is_semantic : a. 'a custom ‑> bool; |
tc_t_solve : Sidekick_smt.Solver_types.cc_node custom ‑> Sidekick_smt.Solver_types.cc_node custom ‑> Sidekick_smt.Solver_types.solve_result; |
tc_t_sub : a. 'a custom ‑> 'a Sequence.t; |
tc_t_abs : self:Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.term custom ‑> Sidekick_smt.Solver_types.term * bool; |
tc_t_relevant : a. 'a custom ‑> 'a Sequence.t; |
tc_t_subst : a b. ('a ‑> 'b) ‑> 'a custom ‑> 'b custom option; |
tc_t_explain : a. 'a CCEqual.t ‑> 'a custom ‑> 'a custom ‑> ('a * 'a) list; |
}val id : t ‑> intval ty : t ‑> Sidekick_smt.Ty.tval hash : t ‑> intval create : ?size:int ‑> unit ‑> stateval make : state ‑> t Sidekick_smt.Solver_types.term_cell ‑> tval const : state ‑> Sidekick_smt.Solver_types.cst ‑> tval app_cst : state ‑> Sidekick_smt.Solver_types.cst ‑> t Sidekick_util.IArray.t ‑> tval case : state ‑> t ‑> t Sidekick_util.ID.Map.t ‑> tval cstor_test : state ‑> Sidekick_smt.Solver_types.data_cstor ‑> Sidekick_smt.Solver_types.term ‑> tval cstor_proj : state ‑> Sidekick_smt.Solver_types.data_cstor ‑> int ‑> Sidekick_smt.Solver_types.term ‑> tval pp : t Sidekick_smt.Solver_types.Fmt.printerval is_true : t ‑> boolval is_false : t ‑> boolval is_const : t ‑> boolval is_custom : t ‑> boolval as_cst_undef : t ‑> (Sidekick_smt.Solver_types.cst * Sidekick_smt.Ty.t) optionval as_cstor_app : t ‑> (Sidekick_smt.Solver_types.cst * Sidekick_smt.Solver_types.data_cstor * t Sidekick_util.IArray.t) optiontype unif_form = | Unif_cst of Sidekick_smt.Solver_types.cst * Sidekick_smt.Ty.t |
| Unif_cstor of Sidekick_smt.Solver_types.cst * Sidekick_smt.Solver_types.data_cstor * Sidekick_smt.Solver_types.term Sidekick_util.IArray.t |
| Unif_none |
val hash : t ‑> intval equal : X.t Sidekick_smt.Solver_types.term_cell ‑> X.t Sidekick_smt.Solver_types.term_cell ‑> boolval hash : X.t Sidekick_smt.Solver_types.term_cell ‑> inttype 'a cell = 'a Sidekick_smt.Solver_types.term_cell = | Bool of bool | ||
| App_cst of Sidekick_smt.Solver_types.cst * 'a Sidekick_util.IArray.t | ||
| If of 'a * 'a * 'a | ||
| Case of 'a * 'a Sidekick_util.ID.Map.t | ||
| Custom of {
} |
type tc = Sidekick_smt.Solver_types.term_view_tc = {tc_t_pp : a. 'a Sidekick_smt.Solver_types.Fmt.printer ‑> 'a Sidekick_smt.Solver_types.term_view_custom Sidekick_smt.Solver_types.Fmt.printer; |
tc_t_equal : a. 'a CCEqual.t ‑> 'a Sidekick_smt.Solver_types.term_view_custom CCEqual.t; |
tc_t_hash : a. 'a Sidekick_smt.Hash.t ‑> 'a Sidekick_smt.Solver_types.term_view_custom Sidekick_smt.Hash.t; |
tc_t_ty : a. ('a ‑> Sidekick_smt.Solver_types.ty) ‑> 'a Sidekick_smt.Solver_types.term_view_custom ‑> Sidekick_smt.Solver_types.ty; |
tc_t_is_semantic : a. 'a Sidekick_smt.Solver_types.term_view_custom ‑> bool; |
tc_t_solve : Sidekick_smt.Solver_types.cc_node Sidekick_smt.Solver_types.term_view_custom ‑> Sidekick_smt.Solver_types.cc_node Sidekick_smt.Solver_types.term_view_custom ‑> Sidekick_smt.Solver_types.solve_result; |
tc_t_sub : a. 'a Sidekick_smt.Solver_types.term_view_custom ‑> 'a Sequence.t; |
tc_t_abs : self:Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.term custom ‑> Sidekick_smt.Solver_types.term * bool; |
tc_t_relevant : a. 'a Sidekick_smt.Solver_types.term_view_custom ‑> 'a Sequence.t; |
tc_t_subst : a b. ('a ‑> 'b) ‑> 'a Sidekick_smt.Solver_types.term_view_custom ‑> 'b Sidekick_smt.Solver_types.term_view_custom option; |
tc_t_explain : a. 'a CCEqual.t ‑> 'a Sidekick_smt.Solver_types.term_view_custom ‑> 'a Sidekick_smt.Solver_types.term_view_custom ‑> ('a * 'a) list; |
}val hash : t ‑> intval true_ : tval false_ : tval const : Sidekick_smt.Solver_types.cst ‑> tval app_cst : Sidekick_smt.Solver_types.cst ‑> Sidekick_smt.Solver_types.term Sidekick_util.IArray.t ‑> tval cstor_test : Sidekick_smt.Solver_types.data_cstor ‑> Sidekick_smt.Solver_types.term ‑> tval cstor_proj : Sidekick_smt.Solver_types.data_cstor ‑> int ‑> Sidekick_smt.Solver_types.term ‑> tval case : Sidekick_smt.Solver_types.term ‑> Sidekick_smt.Solver_types.term Sidekick_util.ID.Map.t ‑> tmodule type ARG : sig ... endval hash : t ‑> intval pp : t CCFormat.printermodule Clause : sig ... endtype state = | State : {
} ‑> state |
Runtime state of a theory, with all the operations it provides.
-'a is the internal state
type actions = {on_backtrack : (unit ‑> unit) ‑> unit; | (** Register an action to do when we backtrack *) |
raise_conflict : a. conflict ‑> 'a; | (** Give a conflict clause to the solver *) |
propagate_eq : Sidekick_smt.Term.t ‑> Sidekick_smt.Term.t ‑> Sidekick_smt.Explanation.t ‑> unit; | (** Propagate an equality |
propagate_distinct : Sidekick_smt.Term.t list ‑> neq:Sidekick_smt.Term.t ‑> Sidekick_smt.Explanation.t ‑> unit; | (** Propagate a |
propagate : Sidekick_smt.Lit.t ‑> Sidekick_smt.Explanation.t Sidekick_smt.Bag.t ‑> unit; | (** Propagate a boolean using a unit clause.
- |
add_local_axiom : Sidekick_smt.Lit.t Sidekick_util.IArray.t ‑> unit; | (** Add local clause to the SAT solver. This clause will be -removed when the solver backtracks. *) |
add_persistent_axiom : Sidekick_smt.Lit.t Sidekick_util.IArray.t ‑> unit; | (** Add toplevel clause to the SAT solver. This clause will -not be backtracked. *) |
find : Sidekick_smt.Term.t ‑> Sidekick_smt.Equiv_class.t; | (** Find representative of this term *) |
all_classes : Sidekick_smt.Equiv_class.t Sequence.t; | (** All current equivalence classes -(caution: linear in the number of terms existing in the solver) *) |
}Actions available to a theory during its lifetime
val make : name:string ‑> make:(Sidekick_smt.Term.state ‑> actions ‑> state) ‑> unit ‑> tval make_st : ?on_merge:('a ‑> Sidekick_smt.Equiv_class.t ‑> Sidekick_smt.Equiv_class.t ‑> Sidekick_smt.Explanation.t ‑> unit) ‑> ?on_assert:('a ‑> Sidekick_smt.Lit.t ‑> unit) ‑> final_check:('a ‑> Sidekick_smt.Lit.t Sequence.t ‑> unit) ‑> st:'a ‑> unit ‑> stateval hash : t ‑> intHashing function for formulas. Should be such that two formulas equal according -to Expr_intf.S.equal have the same hash.
val norm : t ‑> t * Sidekick_sat.Theory_intf.negatedReturns a 'normalized' form of the formula, possibly negated
-(in which case return Negated). This function is used to recognize
-the link between a formula a and its negation neg a, so the goal is
-that a and neg a normalise to the same formula,
-but one returns Same_sign and the other one returns Negated
Combine the congruence closure with a number of plugins
module Proof : sig ... endinclude Sidekick_sat.Theory_intf.S with type formula = Sidekick_smt.Lit.t and type proof = Proof.tmodule Form : sig ... endval create : (formula, proof) Sidekick_sat.Theory_intf.actions ‑> tCreate a new instance of the theory
val assume : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resAssume the formulas in the slice, possibly pushing new formulas to be propagated, -and returns the result of the new assumptions.
val if_sat : t ‑> (formula, proof) Sidekick_sat.Theory_intf.slice_actions ‑> (formula, proof) Sidekick_sat.Theory_intf.resCalled at the end of the search in case a model has been found. If no new clause is -pushed, then 'sat' is returned, else search is resumed.
val cc : t ‑> Sidekick_smt.Congruence_closure.tval tst : t ‑> Sidekick_smt.Term.stateval theories : t ‑> Sidekick_smt.Theory.state Sequence.tval add_theory_l : t ‑> Sidekick_smt.Theory.t list ‑> unittype cell = Sidekick_smt.Solver_types.ty_cell = | Prop |
| Atomic of Sidekick_util.ID.t * Sidekick_smt.Solver_types.ty_def |
| Arrow of Sidekick_smt.Solver_types.ty * Sidekick_smt.Solver_types.ty |
type datatype = Sidekick_smt.Solver_types.datatype = {data_cstors : data_cstor Sidekick_util.ID.Map.t lazy_t; |
}type data_cstor = Sidekick_smt.Solver_types.data_cstor = {cstor_ty : Sidekick_smt.Solver_types.ty; |
cstor_args : Sidekick_smt.Solver_types.ty Sidekick_util.IArray.t; |
cstor_proj : Sidekick_smt.Solver_types.cst Sidekick_util.IArray.t lazy_t; |
cstor_test : Sidekick_smt.Solver_types.cst lazy_t; |
cstor_cst : Sidekick_smt.Solver_types.cst; |
cstor_card : Sidekick_smt.Solver_types.ty_card; |
}val prop : tval atomic : Sidekick_util.ID.t ‑> def ‑> card:Sidekick_smt.Ty_card.t lazy_t ‑> tval is_prop : t ‑> boolval is_data : t ‑> boolval is_uninterpreted : t ‑> boolval is_arrow : t ‑> boolval mangle : t ‑> stringval finite : tval infinite : tval pp : t Sidekick_util.Intf.printerval conv_ty : Sidekick_smt.Ast.Ty.t ‑> Sidekick_smt.Ty.tval conv_term : Sidekick_smt.Term.state ‑> Sidekick_smt.Ast.term ‑> Sidekick_smt.Term.tval process_stmt : ?gc:bool ‑> ?restarts:bool ‑> ?pp_cnf:bool ‑> ?dot_proof:string ‑> ?pp_model:bool ‑> ?check:bool ‑> ?time:float ‑> ?memory:float ‑> ?progress:bool ‑> Sidekick_smt.Solver.t ‑> Sidekick_smt.Ast.statement ‑> unit or_errorThis library provides a parser, a type-checker, and a solver interface -for processing SMTLib-2 problems.
module Ast = Sidekick_smt.Astval parse : string ‑> Ast.statement list or_errorval parse_stdin : unit ‑> Ast.statement list or_errormodule A = Sidekick_smtlib__.Parse_astmodule Loc = Sidekick_smtlib__.Locationsval token : Lexing.lexbuf ‑> Sidekick_smtlib__.Parser.tokenval __ocaml_lex_token_rec : Lexing.lexbuf ‑> int ‑> Sidekick_smtlib__.Parser.tokenval mk : string ‑> int ‑> int ‑> int ‑> int ‑> tval mk_pair : string ‑> (int * int) ‑> (int * int) ‑> tval mk_pos : Lexing.position ‑> Lexing.position ‑> tval pp : Format.formatter ‑> t ‑> unitval pp_opt : Format.formatter ‑> t option ‑> unitval to_string_opt : t option ‑> stringval of_lexbuf : Lexing.lexbuf ‑> tmodule Loc = Sidekick_smtlib__.Locationstype term = | True |
| False |
| Const of string |
| Arith of arith_op * term list |
| App of string * term list |
| HO_app of term * term |
| Match of term * match_branch list |
| If of term * term * term |
| Let of (var * term) list * term |
| Fun of typed_var * term |
| Eq of term * term |
| Imply of term * term |
| And of term list |
| Or of term list |
| Not of term |
| Xor of term * term |
| Distinct of term list |
| Cast of term * ty |
| Forall of (var * ty) list * term |
| Exists of (var * ty) list * term |
type stmt = | Stmt_decl_sort of string * int |
| Stmt_decl of ty fun_decl |
| Stmt_fun_def of fun_def |
| Stmt_fun_rec of fun_def |
| Stmt_funs_rec of funs_rec_def |
| Stmt_data of ty_var list * (string * cstor list) list |
| Stmt_assert of term |
| Stmt_lemma of term |
| Stmt_assert_not of ty_var list * term |
| Stmt_set_logic of string |
| Stmt_set_option of string list |
| Stmt_set_info of string list |
| Stmt_check_sat |
| Stmt_exit |
val ty_bool : tyval true_ : termval false_ : termval const : string ‑> termval match_ : term ‑> match_branch list ‑> termval pp_ty : ty Sidekick_util.Util.printerval pp_term : term Sidekick_util.Util.printerval pp_typed_var : typed_var Sidekick_util.Util.printerval pp_fun_decl : 'a Sidekick_util.Util.printer ‑> Format.formatter ‑> 'a fun_decl ‑> unitval pp_fr : Format.formatter ‑> fun_def ‑> unitval pp_stmt : Format.formatter ‑> statement ‑> unitexception Parse_error of Loc.t option * stringval parse_error : ?loc:Loc.t ‑> string ‑> 'aval parse_errorf : ?loc:Loc.t ‑> ('a, unit, string, 'b) Pervasives.format4 ‑> 'atype token = | XOR |
| TRUE |
| SET_OPTION |
| SET_LOGIC |
| SET_INFO |
| RIGHT_PAREN |
| QUOTED of string |
| PROD |
| PAR |
| OR |
| NOT |
| MINUS |
| MATCH |
| LT |
| LET |
| LEQ |
| LEMMA |
| LEFT_PAREN |
| IF |
| IDENT of string |
| GT |
| GEQ |
| FUN |
| FORALL |
| FALSE |
| EXIT |
| EXISTS |
| ESCAPED of string |
| EQ |
| EOI |
| DIV |
| DISTINCT |
| DEFINE_FUN_REC |
| DEFINE_FUNS_REC |
| DEFINE_FUN |
| DEFAULT |
| DECLARE_SORT |
| DECLARE_FUN |
| DECLARE_CONST |
| DATA |
| CHECK_SAT |
| CASE |
| AT |
| ASSERT_NOT |
| ASSERT |
| AS |
| ARROW |
| AND |
| ADD |
val parse_ty : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.tyval parse_term : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.termval parse_list : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.statement listval parse : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.statementval conv_ty : Sidekick_smt.Ast.Ty.t ‑> Sidekick_smt.Ty.tval conv_term : Sidekick_smt.Term.state ‑> Sidekick_smt.Ast.term ‑> Sidekick_smt.Term.tval process_stmt : ?gc:bool ‑> ?restarts:bool ‑> ?pp_cnf:bool ‑> ?dot_proof:string ‑> ?pp_model:bool ‑> ?check:bool ‑> ?time:float ‑> ?memory:float ‑> ?progress:bool ‑> Sidekick_smt.Solver.t ‑> Sidekick_smt.Ast.statement ‑> unit or_errorval create : unit ‑> tval pp : t CCFormat.printermodule Loc = Sidekick_smtlib__.Locationsmodule Ctx : sig ... endmodule PA = Sidekick_smtlib__.Parse_astmodule A = Sidekick_smt.Astval conv_statement : Ctx.t ‑> PA.statement ‑> A.statement listmodule Lexer : sig ... endmodule Locations : sig ... endmodule Parse_ast : sig ... endmodule Parser : sig ... endmodule Process : sig ... endmodule Sidekick_smtlib = Sidekick_smtlibmodule Typecheck : sig ... endmodule A = Sidekick_smtlib__.Parse_astmodule Loc = Sidekick_smtlib__.Locationsval token : Lexing.lexbuf ‑> Sidekick_smtlib__.Parser.tokenval __ocaml_lex_token_rec : Lexing.lexbuf ‑> int ‑> Sidekick_smtlib__.Parser.tokenval mk : string ‑> int ‑> int ‑> int ‑> int ‑> tval mk_pair : string ‑> (int * int) ‑> (int * int) ‑> tval mk_pos : Lexing.position ‑> Lexing.position ‑> tval pp : Format.formatter ‑> t ‑> unitval pp_opt : Format.formatter ‑> t option ‑> unitval to_string_opt : t option ‑> stringval of_lexbuf : Lexing.lexbuf ‑> tmodule Loc = Sidekick_smtlib__.Locationstype term = | True |
| False |
| Const of string |
| Arith of arith_op * term list |
| App of string * term list |
| HO_app of term * term |
| Match of term * match_branch list |
| If of term * term * term |
| Let of (var * term) list * term |
| Fun of typed_var * term |
| Eq of term * term |
| Imply of term * term |
| And of term list |
| Or of term list |
| Not of term |
| Xor of term * term |
| Distinct of term list |
| Cast of term * ty |
| Forall of (var * ty) list * term |
| Exists of (var * ty) list * term |
type stmt = | Stmt_decl_sort of string * int |
| Stmt_decl of ty fun_decl |
| Stmt_fun_def of fun_def |
| Stmt_fun_rec of fun_def |
| Stmt_funs_rec of funs_rec_def |
| Stmt_data of ty_var list * (string * cstor list) list |
| Stmt_assert of term |
| Stmt_lemma of term |
| Stmt_assert_not of ty_var list * term |
| Stmt_set_logic of string |
| Stmt_set_option of string list |
| Stmt_set_info of string list |
| Stmt_check_sat |
| Stmt_exit |
val ty_bool : tyval true_ : termval false_ : termval const : string ‑> termval match_ : term ‑> match_branch list ‑> termval pp_ty : ty Sidekick_util.Util.printerval pp_term : term Sidekick_util.Util.printerval pp_typed_var : typed_var Sidekick_util.Util.printerval pp_fun_decl : 'a Sidekick_util.Util.printer ‑> Format.formatter ‑> 'a fun_decl ‑> unitval pp_fr : Format.formatter ‑> fun_def ‑> unitval pp_stmt : Format.formatter ‑> statement ‑> unitexception Parse_error of Loc.t option * stringval parse_error : ?loc:Loc.t ‑> string ‑> 'aval parse_errorf : ?loc:Loc.t ‑> ('a, unit, string, 'b) Pervasives.format4 ‑> 'atype token = | XOR |
| TRUE |
| SET_OPTION |
| SET_LOGIC |
| SET_INFO |
| RIGHT_PAREN |
| QUOTED of string |
| PROD |
| PAR |
| OR |
| NOT |
| MINUS |
| MATCH |
| LT |
| LET |
| LEQ |
| LEMMA |
| LEFT_PAREN |
| IF |
| IDENT of string |
| GT |
| GEQ |
| FUN |
| FORALL |
| FALSE |
| EXIT |
| EXISTS |
| ESCAPED of string |
| EQ |
| EOI |
| DIV |
| DISTINCT |
| DEFINE_FUN_REC |
| DEFINE_FUNS_REC |
| DEFINE_FUN |
| DEFAULT |
| DECLARE_SORT |
| DECLARE_FUN |
| DECLARE_CONST |
| DATA |
| CHECK_SAT |
| CASE |
| AT |
| ASSERT_NOT |
| ASSERT |
| AS |
| ARROW |
| AND |
| ADD |
val parse_ty : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.tyval parse_term : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.termval parse_list : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.statement listval parse : (Lexing.lexbuf ‑> token) ‑> Lexing.lexbuf ‑> Sidekick_smtlib__.Parse_ast.statementval conv_ty : Sidekick_smt.Ast.Ty.t ‑> Sidekick_smt.Ty.tval conv_term : Sidekick_smt.Term.state ‑> Sidekick_smt.Ast.term ‑> Sidekick_smt.Term.tval process_stmt : ?gc:bool ‑> ?restarts:bool ‑> ?pp_cnf:bool ‑> ?dot_proof:string ‑> ?pp_model:bool ‑> ?check:bool ‑> ?time:float ‑> ?memory:float ‑> ?progress:bool ‑> Sidekick_smt.Solver.t ‑> Sidekick_smt.Ast.statement ‑> unit or_errorval create : unit ‑> tval pp : t CCFormat.printermodule Loc = Sidekick_smtlib__.Locationsmodule Ctx : sig ... endmodule PA = Sidekick_smtlib__.Parse_astmodule A = Sidekick_smt.Astval conv_statement : Ctx.t ‑> PA.statement ‑> A.statement listval eq : Sidekick_smt.Term.state ‑> term ‑> term ‑> tval neq : Sidekick_smt.Term.state ‑> term ‑> term ‑> tval builtin_to_seq : 'a builtin ‑> 'a Sequence.tmodule T_cell : sig ... endval builtin : Sidekick_smt.Term.state ‑> term builtin ‑> termval and_ : Sidekick_smt.Term.state ‑> term ‑> term ‑> termval or_ : Sidekick_smt.Term.state ‑> term ‑> term ‑> termval not_ : Sidekick_smt.Term.state ‑> term ‑> termval imply : Sidekick_smt.Term.state ‑> term list ‑> term ‑> termval eq : Sidekick_smt.Term.state ‑> term ‑> term ‑> termval neq : Sidekick_smt.Term.state ‑> term ‑> term ‑> termval distinct : Sidekick_smt.Term.state ‑> term list ‑> termval and_l : Sidekick_smt.Term.state ‑> term list ‑> termval or_l : Sidekick_smt.Term.state ‑> term list ‑> termmodule Lit : sig ... endval th : Sidekick_smt.Theory.tCreate a new bitfield type
type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
This module defines efficient bitfields -up to 30 or 62 bits (depending on the architecture) in -a relatively type-safe way.
module B = CCBitField.Make(struct end);;
-
- #install_printer B.pp;;
-
- let x = B.mk_field ()
- let y = B.mk_field ()
- let z = B.mk_field ()
-
- let f = B.empty |> B.set x true |> B.set y true;;
-
- assert (not (B.get z f)) ;;
-
- assert (f |> B.set z true |> B.get z);;
-
\ No newline at end of file
diff --git a/sidekick/Sidekick_util/BitField/module-type-S/index.html b/sidekick/Sidekick_util/BitField/module-type-S/index.html
deleted file mode 100644
index fd8ec84f..00000000
--- a/sidekick/Sidekick_util/BitField/module-type-S/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
decrease h x decreases the value associated to x within h,
-making it closer to the root (so, more prioritary)
val in_heap : elt ‑> boolval is_empty : t ‑> boolval grow_to_at_least : t ‑> int ‑> unitHint: augment the internal capacity of the heap until it reaches at -least the given integer
Remove and return the integer that has the lowest value from the heap
module type RANKED = Heap_intf.RANKEDmodule type S = Heap_intf.Sdecrease h x decreases the value associated to x within h,
-making it closer to the root (so, more prioritary)
val in_heap : elt ‑> boolval is_empty : t ‑> boolval grow_to_at_least : t ‑> int ‑> unitHint: augment the internal capacity of the heap until it reaches at -least the given integer
Remove and return the integer that has the lowest value from the heap
module type RANKED : sig ... endmodule type S : sig ... enddecrease h x decreases the value associated to x within h,
-making it closer to the root (so, more prioritary)
val in_heap : elt ‑> boolval is_empty : t ‑> boolval grow_to_at_least : t ‑> int ‑> unitHint: augment the internal capacity of the heap until it reaches at -least the given integer
Remove and return the integer that has the lowest value from the heap
type 'a tArray of values of type 'a. The underlying type really is -an array, but it will never be modified.
It should be covariant but OCaml will not accept it.
val empty : 'a tval is_empty : _ t ‑> boolval length : _ t ‑> intval singleton : 'a ‑> 'a tval doubleton : 'a ‑> 'a ‑> 'a tval init : int ‑> (int ‑> 'a) ‑> 'a tinit n f makes the array [| f 0; f 1; ... ; f (n-1) |].
n < 0val iter : ('a ‑> unit) ‑> 'a t ‑> unitval iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitval foldi : ('a ‑> int ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'aval fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'aval for_all : ('a ‑> bool) ‑> 'a t ‑> boolval exists : ('a ‑> bool) ‑> 'a t ‑> boolval of_list : 'a list ‑> 'a tval to_list : 'a t ‑> 'a listval of_list_map : ('a ‑> 'b) ‑> 'a list ‑> 'b tval to_list_map : ('a ‑> 'b) ‑> 'a t ‑> 'b listval of_array_map : ('a ‑> 'b) ‑> 'a array ‑> 'b tval to_array_map : ('a ‑> 'b) ‑> 'a t ‑> 'b arrayval of_array_unsafe : 'a array ‑> 'a tTake ownership of the given array. Careful, the array must NOT -be modified afterwards!
val rat : tval int : tval make : string ‑> tval makef : ('a, Format.formatter, unit, t) Pervasives.format4 ‑> 'aval id : t ‑> intval to_string : t ‑> stringval to_string_full : t ‑> stringval pp_name : t CCFormat.printermodule B : sig ... endmodule type EQ : sig ... endmodule type ORD : sig ... endmodule type HASH : sig ... endmodule type PRINT : sig ... endval hash : t ‑> intval pp : t CCFormat.printerval debugf : int ‑> ((('a, Format.formatter, unit, unit) Pervasives.format4 ‑> 'a) ‑> unit) ‑> unitEmit a debug message at the given level. If the level is lower
-than get_debug (), the message will indeed be emitted
val pp_iarray : ?sep:string ‑> 'a CCFormat.printer ‑> 'a IArray.t CCFormat.printermodule Int_set : CCSet.S with type Int_set.elt = intmodule Int_map : CCMap.S with type Int_map.key = intval make : int ‑> 'a ‑> 'a tmake cap dummy creates a new vector filled with dummy. The vector
-is initially empty but its underlying array has capacity cap.
-dummy will stay alive as long as the vector
val from_array : 'a array ‑> int ‑> 'a ‑> 'a tfrom_array arr size dummy takes ownership of data (no copy)
-to create a vector. size is the length of the slice of data that is
-used (size <= Array.length data must hold)
val from_list : 'a list ‑> 'a ‑> 'a tval shrink : 'a t ‑> int ‑> unitshrink vec sz resets size of vec to sz.
-Assumes sz >=0 && sz <= size vec
val size : 'a t ‑> intval is_empty : 'a t ‑> boolval grow_to_exact : 'a t ‑> int ‑> unitval grow_to_double_size : 'a t ‑> unitval grow_to_at_least : 'a t ‑> int ‑> unitgrow_to_at_least vec n ensures that capacity vec >= n in
-the most efficient way
val push : 'a t ‑> 'a ‑> unitval pop_last : 'a t ‑> 'aval get : 'a t ‑> int ‑> 'aget the element at the given index, or
val set : 'a t ‑> int ‑> 'a ‑> unitset the element at the given index, either already set or the first
-free slot if not (is_full vec), or
val fast_remove : 'a t ‑> int ‑> unitRemove element at index i without preserving order
-(swap with last element)
val filter_in_place : ('a ‑> bool) ‑> 'a t ‑> unitfilter_in_place f v removes from v the elements that do
-not satisfy f
val print : ?sep:string ‑> (Format.formatter ‑> 'a ‑> unit) ‑> Format.formatter ‑> 'a t ‑> unitmodule BitField : sig ... endmodule Heap : sig ... endmodule Heap_intf : sig ... endmodule IArray : sig ... endmodule ID : sig ... endmodule Intf : sig ... endmodule Log : sig ... endmodule Util : sig ... endmodule Vec : sig ... endCreate a new bitfield type
type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
This module defines efficient bitfields -up to 30 or 62 bits (depending on the architecture) in -a relatively type-safe way.
module B = CCBitField.Make(struct end);;
-
- #install_printer B.pp;;
-
- let x = B.mk_field ()
- let y = B.mk_field ()
- let z = B.mk_field ()
-
- let f = B.empty |> B.set x true |> B.set y true;;
-
- assert (not (B.get z f)) ;;
-
- assert (f |> B.set z true |> B.get z);;
-
\ No newline at end of file
diff --git a/sidekick/Sidekick_util__BitField/module-type-S/index.html b/sidekick/Sidekick_util__BitField/module-type-S/index.html
deleted file mode 100644
index 53892b66..00000000
--- a/sidekick/Sidekick_util__BitField/module-type-S/index.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-type t = private intGenerative type of bitfields. Each instantiation of the functor -should create a new, incompatible type
val freeze : unit ‑> unitPrevent new fields from being added. From now on, creating -a field will raise Frozen
decrease h x decreases the value associated to x within h,
-making it closer to the root (so, more prioritary)
val in_heap : elt ‑> boolval is_empty : t ‑> boolval grow_to_at_least : t ‑> int ‑> unitHint: augment the internal capacity of the heap until it reaches at -least the given integer
Remove and return the integer that has the lowest value from the heap
module type RANKED = Sidekick_util.Heap_intf.RANKEDmodule type S = Sidekick_util.Heap_intf.Sdecrease h x decreases the value associated to x within h,
-making it closer to the root (so, more prioritary)
val in_heap : elt ‑> boolval is_empty : t ‑> boolval grow_to_at_least : t ‑> int ‑> unitHint: augment the internal capacity of the heap until it reaches at -least the given integer
Remove and return the integer that has the lowest value from the heap
module type RANKED : sig ... endmodule type S : sig ... enddecrease h x decreases the value associated to x within h,
-making it closer to the root (so, more prioritary)
val in_heap : elt ‑> boolval is_empty : t ‑> boolval grow_to_at_least : t ‑> int ‑> unitHint: augment the internal capacity of the heap until it reaches at -least the given integer
Remove and return the integer that has the lowest value from the heap
type 'a tArray of values of type 'a. The underlying type really is -an array, but it will never be modified.
It should be covariant but OCaml will not accept it.
val empty : 'a tval is_empty : _ t ‑> boolval length : _ t ‑> intval singleton : 'a ‑> 'a tval doubleton : 'a ‑> 'a ‑> 'a tval init : int ‑> (int ‑> 'a) ‑> 'a tinit n f makes the array [| f 0; f 1; ... ; f (n-1) |].
n < 0val iter : ('a ‑> unit) ‑> 'a t ‑> unitval iteri : (int ‑> 'a ‑> unit) ‑> 'a t ‑> unitval foldi : ('a ‑> int ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'aval fold : ('a ‑> 'b ‑> 'a) ‑> 'a ‑> 'b t ‑> 'aval for_all : ('a ‑> bool) ‑> 'a t ‑> boolval exists : ('a ‑> bool) ‑> 'a t ‑> boolval of_list : 'a list ‑> 'a tval to_list : 'a t ‑> 'a listval of_list_map : ('a ‑> 'b) ‑> 'a list ‑> 'b tval to_list_map : ('a ‑> 'b) ‑> 'a t ‑> 'b listval of_array_map : ('a ‑> 'b) ‑> 'a array ‑> 'b tval to_array_map : ('a ‑> 'b) ‑> 'a t ‑> 'b arrayval of_array_unsafe : 'a array ‑> 'a tTake ownership of the given array. Careful, the array must NOT -be modified afterwards!
val rat : tval int : tval make : string ‑> tval makef : ('a, Format.formatter, unit, t) Pervasives.format4 ‑> 'aval id : t ‑> intval to_string : t ‑> stringval to_string_full : t ‑> stringval pp_name : t CCFormat.printermodule B : sig ... endmodule type EQ : sig ... endmodule type ORD : sig ... endmodule type HASH : sig ... endmodule type PRINT : sig ... endval hash : t ‑> intval pp : t CCFormat.printerval debugf : int ‑> ((('a, Format.formatter, unit, unit) Pervasives.format4 ‑> 'a) ‑> unit) ‑> unitEmit a debug message at the given level. If the level is lower
-than get_debug (), the message will indeed be emitted
val pp_iarray : ?sep:string ‑> 'a CCFormat.printer ‑> 'a Sidekick_util.IArray.t CCFormat.printermodule Int_set : CCSet.S with type Int_set.elt = intmodule Int_map : CCMap.S with type Int_map.key = intval make : int ‑> 'a ‑> 'a tmake cap dummy creates a new vector filled with dummy. The vector
-is initially empty but its underlying array has capacity cap.
-dummy will stay alive as long as the vector
val from_array : 'a array ‑> int ‑> 'a ‑> 'a tfrom_array arr size dummy takes ownership of data (no copy)
-to create a vector. size is the length of the slice of data that is
-used (size <= Array.length data must hold)
val from_list : 'a list ‑> 'a ‑> 'a tval shrink : 'a t ‑> int ‑> unitshrink vec sz resets size of vec to sz.
-Assumes sz >=0 && sz <= size vec
val size : 'a t ‑> intval is_empty : 'a t ‑> boolval grow_to_exact : 'a t ‑> int ‑> unitval grow_to_double_size : 'a t ‑> unitval grow_to_at_least : 'a t ‑> int ‑> unitgrow_to_at_least vec n ensures that capacity vec >= n in
-the most efficient way
val push : 'a t ‑> 'a ‑> unitval pop_last : 'a t ‑> 'aval get : 'a t ‑> int ‑> 'aget the element at the given index, or
val set : 'a t ‑> int ‑> 'a ‑> unitset the element at the given index, either already set or the first
-free slot if not (is_full vec), or
val fast_remove : 'a t ‑> int ‑> unitRemove element at index i without preserving order
-(swap with last element)
val filter_in_place : ('a ‑> bool) ‑> 'a t ‑> unitfilter_in_place f v removes from v the elements that do
-not satisfy f
val print : ?sep:string ‑> (Format.formatter ‑> 'a ‑> unit) ‑> Format.formatter ‑> 'a t ‑> unit-The entry point of this library is the module: -Sidekick_backend. -
-The entry point of this library is the module: -Sidekick_dimacs. -
-The entry point of this library is the module: -Sidekick_sat. -
-The entry point of this library is the module: -Sidekick_smt. -
-The entry point of this library is the module: -Sidekick_th_bool. -
-The entry point of this library is the module: -Sidekick_smtlib. -
-The entry point of this library is the module: -Sidekick_util.
\ No newline at end of file