SMT-RAT
24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
|
#include <MCSATMixin.h>
Data Structures | |
struct | VarMapping |
struct | VarProperties |
Public Member Functions | |
template<typename BaseModule > | |
MCSATMixin (BaseModule &baseModule) | |
std::size_t | level () const |
const Model & | model () const |
const std::vector< Minisat::Var > & | undecidedBooleanVariables () const |
bool | isAssignedTheoryVariable (const carl::Variable &var) const |
bool | theoryAssignmentComplete () const |
const TheoryLevel & | get (std::size_t level) const |
Returns the respective theory level. More... | |
const TheoryLevel & | current () const |
Returns the current theory level. More... | |
TheoryLevel & | current () |
carl::Variable | variable (std::size_t level) const |
Retrieve already decided theory variables. More... | |
void | doBooleanAssignment (Minisat::Lit lit) |
Add a new constraint. More... | |
void | undoBooleanAssignment (Minisat::Lit lit) |
Remove the last constraint. More... | |
std::size_t | addBooleanVariable (Minisat::Var variable) |
Add a variable, return the level it was inserted on. More... | |
Minisat::Var | topSemanticPropagation () |
Getter for semantic propagations. More... | |
bool | isFormulaUnivariate (const FormulaT &formula, std::size_t level) const |
Checks whether the given formula is univariate on the given level. More... | |
void | pushTheoryDecision (const FormulaT &assignment, Minisat::Lit decisionLiteral) |
Push a theory decision. More... | |
bool | backtrackTo (Minisat::Lit literal) |
Backtracks to the theory decision represented by the given literal. More... | |
Minisat::lbool | evaluateLiteral (Minisat::Lit lit) const |
Evaluate a literal in the theory, set lastReason to last theory decision involved. More... | |
std::pair< bool, std::optional< Explanation > > | isBooleanDecisionFeasible (Minisat::Lit lit, bool always_explain=false) |
std::pair< boost::tribool, std::optional< Explanation > > | propagateBooleanDomain (Minisat::Lit lit) |
std::optional< Explanation > | isFeasible (const carl::Variable &var) |
std::variant< Explanation, FormulasT > | makeTheoryDecision (const carl::Variable &var) |
bool | is_consistent () |
Checks if any inconsistency was detected. More... | |
bool | is_consistent (Minisat::Var v) |
std::optional< Explanation > | explainInconsistency () |
Checks if the trail is consistent after the assignment on the current level. More... | |
Explanation | explainTheoryPropagation (Minisat::Lit literal) |
template<typename Constraints > | |
void | initVariables (const Constraints &c) |
bool | isTheoryVar (Minisat::Var v) const |
const carl::Variable & | carlVar (Minisat::Var v) const |
Minisat::Var | minisatVar (const carl::Variable &v) const |
std::vector< Minisat::Var > | theoryVarAbstractions () const |
bool | hasUnassignedDep (Minisat::Var v) const |
std::size_t | theoryLevel (Minisat::Var var) const |
std::size_t | computeTheoryLevel (Minisat::Var var) const |
std::size_t | computeTheoryLevel (const FormulaT &f) const |
Minisat::Lit | getDecisionLiteral (Minisat::Var var) const |
int | assignedAtTrailIndex (Minisat::Var variable) const |
int | decisionLevel (Minisat::Var v) const |
bool | fullConsistencyCheck () const |
std::size_t | maxDegree (const Minisat::Var &var) |
std::vector< Minisat::Var > | theoryVars (const Minisat::Var &var) |
void | printClause (std::ostream &os, Minisat::CRef clause) const |
Prints a single clause. More... | |
Private Types | |
using | TheoryStackT = std::vector< TheoryLevel > |
The first entry of the stack always contains an entry for the non-theory variables: the variable is set to NO_VARIABLE and the lists contain variables that do not contain any theory variables. More... | |
Private Member Functions | |
void | updateCurrentLevel () |
Updates lookup for the current level. More... | |
void | popTheoryDecision () |
Pop a theory decision. More... | |
std::size_t | varid (Minisat::Var var) const |
Private Attributes | |
InformationGetter | mGetter |
TheoryStackT | mTheoryStack |
std::vector< size_t > | mTheoryLevels |
Theory levels for Boolean variables. More... | |
std::vector< Minisat::Var > | mUndecidedVariables |
Variables that are not univariate in any variable yet. More... | |
std::vector< Minisat::Var > | mInconsistentVariables |
Variables that are inconsistent in the current theory level. More... | |
std::set< Minisat::Var > | mSemanticPropagations |
Semantically propagated variables that are not yet inserted into the trail. More... | |
std::map< Minisat::Var, std::vector< Minisat::Var > > | mVarDeps |
MCSATBackend< Settings > | mBackend |
VarMapping | mTheoryVarMapping |
std::vector< VarProperties > | mVarPropertyCache |
Cache for static information about variables. More... | |
Friends | |
template<typename Sett > | |
std::ostream & | operator<< (std::ostream &os, const MCSATMixin< Sett > &mcm) |
Definition at line 52 of file MCSATMixin.h.
|
private |
The first entry of the stack always contains an entry for the non-theory variables: the variable is set to NO_VARIABLE and the lists contain variables that do not contain any theory variables.
Definition at line 62 of file MCSATMixin.h.
|
inlineexplicit |
std::size_t smtrat::mcsat::MCSATMixin< Settings >::addBooleanVariable | ( | Minisat::Var | variable | ) |
Add a variable, return the level it was inserted on.
|
inline |
Definition at line 581 of file MCSATMixin.h.
bool smtrat::mcsat::MCSATMixin< Settings >::backtrackTo | ( | Minisat::Lit | literal | ) |
Backtracks to the theory decision represented by the given literal.
|
inline |
|
inline |
|
inline |
Definition at line 525 of file MCSATMixin.h.
|
inline |
Definition at line 232 of file MCSATMixin.h.
|
inline |
Returns the current theory level.
Definition at line 229 of file MCSATMixin.h.
|
inline |
Definition at line 590 of file MCSATMixin.h.
|
inline |
Add a new constraint.
Definition at line 248 of file MCSATMixin.h.
Minisat::lbool smtrat::mcsat::MCSATMixin< Settings >::evaluateLiteral | ( | Minisat::Lit | lit | ) | const |
Evaluate a literal in the theory, set lastReason to last theory decision involved.
|
inline |
Checks if the trail is consistent after the assignment on the current level.
The trail must be consistent on the previous level.
Returns std::nullopt if consistent and an explanation.
Definition at line 396 of file MCSATMixin.h.
|
inline |
|
inline |
|
inline |
Returns the respective theory level.
Definition at line 224 of file MCSATMixin.h.
|
inline |
Definition at line 571 of file MCSATMixin.h.
|
inline |
Definition at line 506 of file MCSATMixin.h.
|
inline |
|
inline |
Checks if any inconsistency was detected.
Definition at line 382 of file MCSATMixin.h.
|
inline |
|
inline |
std::pair<bool, std::optional<Explanation> > smtrat::mcsat::MCSATMixin< Settings >::isBooleanDecisionFeasible | ( | Minisat::Lit | lit, |
bool | always_explain = false |
||
) |
|
inline |
bool smtrat::mcsat::MCSATMixin< Settings >::isFormulaUnivariate | ( | const FormulaT & | formula, |
std::size_t | level | ||
) | const |
Checks whether the given formula is univariate on the given level.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 498 of file MCSATMixin.h.
|
inline |
|
private |
Pop a theory decision.
void smtrat::mcsat::MCSATMixin< Settings >::printClause | ( | std::ostream & | os, |
Minisat::CRef | clause | ||
) | const |
Prints a single clause.
std::pair<boost::tribool, std::optional<Explanation> > smtrat::mcsat::MCSATMixin< Settings >::propagateBooleanDomain | ( | Minisat::Lit | lit | ) |
void smtrat::mcsat::MCSATMixin< Settings >::pushTheoryDecision | ( | const FormulaT & | assignment, |
Minisat::Lit | decisionLiteral | ||
) |
Push a theory decision.
|
inline |
Definition at line 220 of file MCSATMixin.h.
|
inline |
Definition at line 517 of file MCSATMixin.h.
|
inline |
|
inline |
|
inline |
Getter for semantic propagations.
Definition at line 298 of file MCSATMixin.h.
|
inline |
Definition at line 214 of file MCSATMixin.h.
|
inline |
Remove the last constraint.
f must be the same as the one passed to the last call of pushConstraint().
Definition at line 275 of file MCSATMixin.h.
|
private |
Updates lookup for the current level.
|
inline |
Retrieve already decided theory variables.
Definition at line 236 of file MCSATMixin.h.
|
inlineprivate |
Definition at line 175 of file MCSATMixin.h.
|
friend |
|
private |
Definition at line 79 of file MCSATMixin.h.
|
private |
Definition at line 55 of file MCSATMixin.h.
|
private |
Variables that are inconsistent in the current theory level.
Definition at line 72 of file MCSATMixin.h.
|
private |
Semantically propagated variables that are not yet inserted into the trail.
Definition at line 75 of file MCSATMixin.h.
|
private |
Theory levels for Boolean variables.
Definition at line 66 of file MCSATMixin.h.
|
private |
Definition at line 63 of file MCSATMixin.h.
|
private |
Definition at line 114 of file MCSATMixin.h.
|
private |
Variables that are not univariate in any variable yet.
Definition at line 69 of file MCSATMixin.h.
|
private |
Definition at line 77 of file MCSATMixin.h.
|
private |
Cache for static information about variables.
Definition at line 165 of file MCSATMixin.h.