package alt-ergo-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=df56045a3af79fbcfbd1deeaf09012d5bc390b4c2223e1d9c25c11c301d9eeba
sha512=ff83e5ce7598bc30509be8ca2c14d791856b0269f852903f81216ae1cbc27737d90b6313176fa24768944433b875811ee19b51fc821948634ea678dbcca4befb
doc/alt-ergo-lib/AltErgoLib/Th_util/index.html
Module AltErgoLib.Th_util
type answer = (Explanation.t * Expr.Set.t list) optionval pp_theory :
Ppx_deriving_runtime.Format.formatter ->
theory ->
Ppx_deriving_runtime.unitval show_theory : theory -> Ppx_deriving_runtime.stringtype lit_origin = | Subst(*Only equalities can be
Substliterals, and they are oriented: the left-hand side is always an uninterpreted term or AC symbol application. Effectively,Substliterals are the substitutions generated by calls toX.solveand propagated through the CC(X) and AC(X) algorithms.In practice, a
*)Substequalityr = rris generated when the corresponding substitution is performed by CC(X), i.e. whenrrbecomes the class representative forr.| CS of theory * Numbers.Q.t(*Literals of
CSorigin come from the case splits performed by a specific theory. Usually, they are equalities of the shapex = vwherexis an uninterpreted term andva value; however, this is not necessarily the case (e.g.CSliterals from the theory of arrays are often disequalities).Depending on the theory, the shape of
CSliterals can be restricted. In particular,CSliterals of theTh_UFtheory: those come from model generation in the union-find, and are assignments, i.e. equalitiesx = vwherexis uninterpreted andvis a value.The rational argument estimates the size of the split -- usually, the number of possible values the theory could choose for this specific uninterpreted term.
*)| NCS of theory * Numbers.Q.t| Other
Indicates where asserted literals come from.
Note that literals are deduplicated before being propagated to the relations. Subst literals are preserved, but other kinds of literals may be subsumed.
type case_split = Shostak.Combine.r Xliteral.view * bool * lit_originA case split is a triple (a, is_cs, origin).
The literal a is simply the literal that is the source of the split, or its negation (depending on origin).
The origin should be either CS or NCS. Case splits returned by relations have an origin of CS, which is then flipped to NCS if a contradiction is found involving a.
The is_cs flag should *always* be true, unless the literal a is a *unit fact*, i.e. a fact that is true in all possible environments, not merely the current one. Note that it is acceptable for unit facts to be returned with is_cs = true; but if the is_cs flag is false, the solver *will* assume that the literal can't take part in any conflict. Returning is_cs = false if the literal is not an unit fact **is unsound**.
TL;DR: When in doubt, just set is_cs to true.
type optimized_split = {value : Objective.Value.t;case_split : case_split;(*The underlying case-split. Notice that the value propagate by this case-split doesn't always agree with the objective value
*)value. Indeed,valueisn't always a proper model value when the problem is unbounded or some objective functions involved strict inequalities.
}type 'literal acts = {acts_add_decision_lit : 'literal -> unit;(*Ask the SAT solver to decide on the given formula before it can answer
SAT. The order of decisions among multiple calls ofacts_add_decision_litis unspecified.Decisions added using
*)acts_add_decision_litare forgotten when backtracking.acts_add_split : 'literal -> unit;(*Let the SAT solver know about a case split. The SAT solver should decide on the provided formula before answering
Sat, although it is not required to do so. The order of decisions among multiple calls ofacts_add_splitis unspecified, and the solver is allowed to drop some of them.Splits added using
*)acts_add_splitare forgotten when backtracking.acts_add_objective : Objective.Function.t -> Objective.Value.t -> 'literal -> unit;(*Ask the SAT solver to optimistically select the appropriate value for the given objective function (encoded as a decision in the
'literal). If the solver backtracks on that decision, the theory will have an opportunity to select another value in a context where the'literalis negated.In case multiple objectives are added before the solver gets to make a decision, only the *last* objective is taken into consideration; you cannot assume that the objective has been optimized until the objective is sent back to the theory through
add_objective.Objectives added using
*)acts_add_objectiveare forgotten when backtracking.
}The type of actions that a theory can take.
Inspired by mSAT's equivalent type 1.
1 : https://github.com/Gbury/mSAT/blob/ \ 1496a48bc8b948e4d5a2bc20edaec33a6901c8fa/src/core/Solver_intf.ml#L104