package mc2
Install
Dune Dependency
Authors
Maintainers
Sources
md5=92de696251ec76fbf3eba6ee917fd80f
sha512=e88ba0cfc23186570a52172a0bd7c56053273941eaf3cda0b80fb6752e05d1b75986b01a4e4d46d9711124318e57cba1cd92d302e81d34f9f1ae8b49f39114f0
doc/mc2.core/Mc2_core/index.html
Module Mc2_core
Source
Core Library
This 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_tauto
(*tautology
*)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 neitherx
nory
are assigned to a valueValued (true, [x])
ifx
is assigned to0
Valued (true, [y])
ify
is assigned to0
Valued (false, [x; y])
ifx
andy
are assigned to 1 (or any non-zero number)
Result of checking satisfiability of a problem