Mc2_coreSourceThis library contains the core structures and algorithms of mc2. It defines terms, types, values, the main solver, plugins, etc.
Backtracking level
Extensible view on types
Extensible view on terms (generalized variables). Each plugin might declare its own terms.
Extensible view on values.
Extensible proof object
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.)
type class for terms, packing all operations on terms
Main term representation. It is worth noting that terms are also (generalized) 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.
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.
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 lemma = | Lemma_bool_tautotautology a ∨ ¬a
| Lemma_custom of {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.
*)Actions available to terms/plugins when doing propagation/model building, including adding clauses, registering actions to do upon backtracking, etc.
Types
type value = | V_true| V_false| V_value of {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).
*)A value, either boolean or semantic
The "generalized variable" part of a term, containing the current assignment, watched literals/terms, etc.
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 valueValued (true, [x]) if x is assigned to 0Valued (true, [y]) if y is assigned to 0Valued (false, [x; y]) if x and y are assigned to 1 (or any non-zero number)Result of checking satisfiability of a problem