Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file Mc2_core.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157(** {1 Core Library} *)(** This library contains the core structures and algorithms of mc2.
It defines terms, types, values, the main solver, plugins, etc.
*)moduleAtom=AtommoduleTerm=TermmoduleType=TypemoduleValue=ValuemoduleActions=ActionsmoduleBuiltins=BuiltinsmoduleClause=ClausemoduleProof=ProofmoduleSolver=SolvermoduleService=ServicemodulePlugin=PluginmoduleTseitin=TseitinmoduleID=IDmoduleLemma=LemmamoduleStatement=StatementmoduleBound_var=Bound_varmoduleError=Error(**/**)moduleUtil=UtilmoduleLog=Log(**/**)moduleFmt=CCFormatmoduleInt_map=Util.Int_maptypelevel=Solver_types.level(** Backtracking level *)typety_view=Solver_types.ty_view=..(** Extensible view on types *)typeterm_view=Solver_types.term_view=..(** Extensible view on terms (generalized variables).
Each plugin might declare its own terms. *)typevalue_view=Solver_types.value_view=..(** Extensible view on values. *)typelemma_view=Solver_types.lemma_view=..(** Extensible proof object *)typedecide_state=Solver_types.decide_state=..(** State carried by a given term, depending on its type, and used
for decisions and propagations related to the term.
Typically it contains a set of constraints on the values this
term can have (lower/upper bounds, etc.)
*)typetc_ty=Solver_types.tc_tytypetc_term=Solver_types.tc_term(** type class for terms, packing all operations on terms *)typetc_value=Solver_types.tc_valuetypetc_lemma=Solver_types.tc_lemmatypeterm=Solver_types.term(** Main term representation.
It is worth noting that terms are also (generalized) {i variables}
and behave mostly the same as boolean variables for the main
solver, meaning that they need to be assigned a value in the model.
*)typeatom=Solver_types.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]. *)typeclause=Solver_types.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). *)typelemma=Solver_types.lemma=|Lemma_bool_tauto(** tautology [a ∨ ¬a] *)|Lemma_customof{view:lemma_view;(** The lemma content *)tc:tc_lemma;(** Methods on the lemma *)}(** A lemma belonging to some plugin. Must be a tautology of the theory. *)typeactions=Solver_types.actions(** Actions available to terms/plugins when doing propagation/model building,
including adding clauses, registering actions to do upon
backtracking, etc. *)(** Types *)typety=Solver_types.ty=|Bool(** Builtin type of booleans *)|Tyof{mutableid:int;view:ty_view;tc:tc_ty;}(** An atomic type, with some attached data *)(** A value, either boolean or semantic *)typevalue=Solver_types.value=|V_true|V_false|V_valueof{view:value_view;tc:tc_value;}(** A semantic value, part of the model's domain.
For arithmetic, it would
be a number; for arrays, a finite map + default value; etc.
Note that terms map to values in the model but that values are
not necessarily normal "terms" (i.e. generalized variables in
the MCSat sense).
*)(** The "generalized variable" part of a term, containing the
current assignment, watched literals/terms, etc. *)typevar=Solver_types.var(** The type of evaluation results for a given formula.
For instance, let's suppose we want to evaluate the formula [x * y = 0], the
following result are correct:
- [Unknown] if neither [x] nor [y] are assigned to a value
- [Valued (true, [x])] if [x] is assigned to [0]
- [Valued (true, [y])] if [y] is assigned to [0]
- [Valued (false, [x; y])] if [x] and [y] are assigned to 1 (or any non-zero number)
*)typeeval_res=Solver_types.eval_res=|Eval_unknown|Eval_intoofvalue*termlisttypeassignment_view=Solver_types.assignment_view=|A_boolofterm*bool|A_semanticofterm*valuetypewatch_res=Solver_types.watch_res=|Watch_keep|Watch_removetypepremise_step=Solver_types.premise_step=|Step_resolveof{c:clause;pivot:term;}(** Result of checking satisfiability of a problem *)typecheck_res=Solver_types.check_res=|Sat(** The current set of assumptions is satisfiable. *)|Unsatofatomlist*lemma(** 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. *)typestatement=Statement.t