SMT-RAT
24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
|
A module which performs the Simplex method on the linear part of it's received formula. More...
#include <LRAModule.h>
Data Structures | |
struct | Context |
Stores a formula, being part of the received formula of this module, and the position of this formula in the passed formula. More... | |
Public Types | |
typedef Settings::BoundType | LRABoundType |
Number type of the underlying value of a bound of a variable within the LRAModule. More... | |
typedef Settings::EntryType | LRAEntryType |
Type of an entry within the tableau. More... | |
typedef lra::Bound< LRABoundType, LRAEntryType > | LRABound |
Type of a bound of a variable within the LRAModule. More... | |
typedef lra::Variable< LRABoundType, LRAEntryType > | LRAVariable |
A variable of the LRAModule, being either a original variable or a slack variable representing a linear polynomial. More... | |
typedef lra::Value< LRABoundType > | LRAValue |
The type of the assignment of a variable maintained by the LRAModule. It consists of a tuple of two value of the bound type. More... | |
typedef Settings | SettingsType |
typedef carl::FastMap< carl::Variable, LRAVariable * > | VarVariableMap |
Maps an original variable to it's corresponding LRAModule variable. More... | |
typedef carl::FastPointerMap< typename Poly::PolyType, LRAVariable * > | ExVariableMap |
Maps a linear polynomial to it's corresponding LRAModule variable. More... | |
typedef carl::FastMap< FormulaT, std::vector< const LRABound * > * > | ConstraintBoundsMap |
Maps constraint to the bounds it represents (e.g., equations represent two bounds) More... | |
typedef carl::FastMap< FormulaT, Context > | ConstraintContextMap |
Stores the position of a received formula in the passed formula. More... | |
typedef lra::Tableau< typename Settings::Tableau_settings, LRABoundType, LRAEntryType > | LRATableau |
The tableau which is the main data structure maintained by the LRAModule responsible for the pivoting steps. More... | |
enum class | LemmaType : unsigned { NORMAL = 0 , PERMANENT = 1 } |
Public Member Functions | |
std::string | moduleName () const |
LRAModule (const ModuleInput *_formula, Conditionals &_conditionals, Manager *_manager=NULL) | |
Constructs a LRAModule. More... | |
virtual | ~LRAModule () |
Destructs this LRAModule. More... | |
bool | informCore (const FormulaT &_constraint) |
Informs this module about the existence of the given constraint, which means that it could be added in future. More... | |
void | deinformCore (const FormulaT &_constraint) |
The inverse of informing about a constraint. More... | |
void | init () |
Initializes the tableau according to all linear constraints, of which this module has been informed. More... | |
bool | addCore (ModuleInput::const_iterator _subformula) |
The module has to take the given sub-formula of the received formula into account. More... | |
void | removeCore (ModuleInput::const_iterator _subformula) |
Removes everything related to the given sub-formula of the received formula. More... | |
Answer | checkCore () |
Checks the received formula for consistency. More... | |
Answer | checkCore_old () |
Answer | processResult (Answer _result) |
void | updateModel () const |
Updates the model, if the solver has detected the consistency of the received formula, beforehand. More... | |
unsigned | currentlySatisfied (const FormulaT &) const |
const RationalAssignment & | getRationalModel () const |
Gives a rational model if the received formula is satisfiable. More... | |
Answer | optimize (Answer _result) |
Answer | checkNotEqualConstraints (Answer _result) |
void | processLearnedBounds () |
void | createInfeasibleSubsets (lra::EntryID _tableauEntry) |
EvalRationalIntervalMap | getVariableBounds () const |
Returns the bounds of the variables as intervals. More... | |
void | printLinearConstraints (std::ostream &_out=std::cout, const std::string _init="") const |
Prints all linear constraints. More... | |
void | printNonlinearConstraints (std::ostream &_out=std::cout, const std::string _init="") const |
Prints all non-linear constraints. More... | |
void | printConstraintToBound (std::ostream &_out=std::cout, const std::string _init="") const |
Prints the mapping of constraints to their corresponding bounds. More... | |
void | printBoundCandidatesToPass (std::ostream &_out=std::cout, const std::string _init="") const |
Prints the strictest bounds, which have to be passed the backend in case. More... | |
void | printRationalModel (std::ostream &_out=std::cout, const std::string _init="") const |
Prints the current rational assignment. More... | |
void | printTableau (std::ostream &_out=std::cout, const std::string _init="") const |
Prints the current tableau. More... | |
void | printVariables (std::ostream &_out=std::cout, const std::string _init="") const |
Prints all lra variables and their assignments. More... | |
const VarVariableMap & | originalVariables () const |
const ExVariableMap & | slackVariables () const |
const LRAVariable * | getSlackVariable (const FormulaT &_constraint) const |
bool | inform (const FormulaT &_constraint) |
Informs the module about the given constraint. More... | |
void | deinform (const FormulaT &_constraint) |
The inverse of informing about a constraint. More... | |
bool | add (ModuleInput::const_iterator _subformula) |
The module has to take the given sub-formula of the received formula into account. More... | |
virtual Answer | check (bool _final=false, bool _full=true, carl::Variable _objective=carl::Variable::NO_VARIABLE) |
Checks the received formula for consistency. More... | |
virtual void | remove (ModuleInput::const_iterator _subformula) |
Removes everything related to the given sub-formula of the received formula. More... | |
virtual void | updateAllModels () |
Updates all satisfying models, if the solver has detected the consistency of the received formula, beforehand. More... | |
virtual std::list< std::vector< carl::Variable > > | getModelEqualities () const |
Partition the variables from the current model into equivalence classes according to their assigned value. More... | |
unsigned | currentlySatisfiedByBackend (const FormulaT &_formula) const |
bool | receivedVariable (carl::Variable::Arg _var) const |
Answer | solverState () const |
std::size_t | id () const |
void | setId (std::size_t _id) |
Sets this modules unique ID to identify itself. More... | |
thread_priority | threadPriority () const |
void | setThreadPriority (thread_priority _threadPriority) |
Sets the priority of this module to get a thread for running its check procedure. More... | |
const ModuleInput * | pReceivedFormula () const |
const ModuleInput & | rReceivedFormula () const |
const ModuleInput * | pPassedFormula () const |
const ModuleInput & | rPassedFormula () const |
const Model & | model () const |
const std::vector< Model > & | allModels () const |
const std::vector< FormulaSetT > & | infeasibleSubsets () const |
const std::vector< Module * > & | usedBackends () const |
const carl::FastSet< FormulaT > & | constraintsToInform () const |
const carl::FastSet< FormulaT > & | informedConstraints () const |
void | addLemma (const FormulaT &_lemma, const LemmaType &_lt=LemmaType::NORMAL, const FormulaT &_preferredFormula=FormulaT(carl::FormulaType::TRUE)) |
Stores a lemma being a valid formula. More... | |
bool | hasLemmas () |
Checks whether this module or any of its backends provides any lemmas. More... | |
void | clearLemmas () |
Deletes all yet found lemmas. More... | |
const std::vector< Lemma > & | lemmas () const |
ModuleInput::const_iterator | firstUncheckedReceivedSubformula () const |
ModuleInput::const_iterator | firstSubformulaToPass () const |
void | receivedFormulaChecked () |
Notifies that the received formulas has been checked. More... | |
const smtrat::Conditionals & | answerFound () const |
bool | isPreprocessor () const |
carl::Variable | objective () const |
bool | is_minimizing () const |
void | excludeNotReceivedVariablesFromModel () const |
Excludes all variables from the current model, which do not occur in the received formula. More... | |
void | updateLemmas () |
Stores all lemmas of any backend of this module in its own lemma vector. More... | |
void | collectTheoryPropagations () |
void | collectOrigins (const FormulaT &_formula, FormulasT &_origins) const |
Collects the formulas in the given formula, which are part of the received formula. More... | |
void | collectOrigins (const FormulaT &_formula, FormulaSetT &_origins) const |
bool | hasValidInfeasibleSubset () const |
void | checkInfSubsetForMinimality (std::vector< FormulaSetT >::const_iterator _infsubset, const std::string &_filename="smaller_muses", unsigned _maxSizeDifference=1) const |
Checks the given infeasible subset for minimality by storing all subsets of it, which have a smaller size which differs from the size of the infeasible subset not more than the given threshold. More... | |
virtual std::pair< bool, FormulaT > | getReceivedFormulaSimplified () |
void | print (const std::string &_initiation="***") const |
Prints everything relevant of the solver. More... | |
void | printReceivedFormula (const std::string &_initiation="***") const |
Prints the vector of the received formula. More... | |
void | printPassedFormula (const std::string &_initiation="***") const |
Prints the vector of passed formula. More... | |
void | printInfeasibleSubsets (const std::string &_initiation="***") const |
Prints the infeasible subsets. More... | |
void | printModel (std::ostream &_out=std::cout) const |
Prints the assignment of this module satisfying its received formula if it satisfiable and this module could find an assignment. More... | |
void | printAllModels (std::ostream &_out=std::cout) |
Prints all assignments of this module satisfying its received formula if it satisfiable and this module could find an assignment. More... | |
Static Public Member Functions | |
static void | freeSplittingVariable (const FormulaT &_splittingVariable) |
Static Public Attributes | |
static size_t | mNumOfBranchVarsToStore = 5 |
The number of different variables to consider for a probable infinite loop of branchings. More... | |
static std::vector< Branching > | mLastBranches = std::vector<Branching>(mNumOfBranchVarsToStore, Branching(typename Poly::PolyType(), 0)) |
Stores the last branches in a cycle buffer. More... | |
static size_t | mFirstPosInLastBranches = 0 |
The beginning of the cyclic buffer storing the last branches. More... | |
static std::vector< FormulaT > | mOldSplittingVariables |
Reusable splitting variables. More... | |
Protected Member Functions | |
virtual bool | informCore ([[maybe_unused]] const FormulaT &_constraint) |
Informs the module about the given constraint. More... | |
virtual void | deinformCore ([[maybe_unused]] const FormulaT &_constraint) |
The inverse of informing about a constraint. More... | |
virtual bool | addCore ([[maybe_unused]] ModuleInput::const_iterator formula) |
The module has to take the given sub-formula of the received formula into account. More... | |
virtual void | removeCore ([[maybe_unused]] ModuleInput::const_iterator formula) |
Removes everything related to the given sub-formula of the received formula. More... | |
bool | anAnswerFound () const |
Checks for all antecedent modules and those which run in parallel with the same antecedent modules, whether one of them has determined a result. More... | |
void | clearModel () const |
Clears the assignment, if any was found. More... | |
void | clearModels () const |
Clears all assignments, if any was found. More... | |
void | cleanModel () const |
Substitutes variable occurrences by its model value in the model values of other variables. More... | |
ModuleInput::iterator | passedFormulaBegin () |
ModuleInput::iterator | passedFormulaEnd () |
void | addOrigin (ModuleInput::iterator _formula, const FormulaT &_origin) |
Adds the given set of formulas in the received formula to the origins of the given passed formula. More... | |
const FormulaT & | getOrigins (ModuleInput::const_iterator _formula) const |
Gets the origins of the passed formula at the given position. More... | |
void | getOrigins (const FormulaT &_formula, FormulasT &_origins) const |
void | getOrigins (const FormulaT &_formula, FormulaSetT &_origins) const |
std::pair< ModuleInput::iterator, bool > | removeOrigin (ModuleInput::iterator _formula, const FormulaT &_origin) |
std::pair< ModuleInput::iterator, bool > | removeOrigins (ModuleInput::iterator _formula, const std::shared_ptr< std::vector< FormulaT >> &_origins) |
void | informBackends (const FormulaT &_constraint) |
Informs all backends of this module about the given constraint. More... | |
virtual void | addConstraintToInform (const FormulaT &_constraint) |
Adds a constraint to the collection of constraints of this module, which are informed to a freshly generated backend. More... | |
std::pair< ModuleInput::iterator, bool > | addReceivedSubformulaToPassedFormula (ModuleInput::const_iterator _subformula) |
Copies the given sub-formula of the received formula to the passed formula. More... | |
bool | originInReceivedFormula (const FormulaT &_origin) const |
std::pair< ModuleInput::iterator, bool > | addSubformulaToPassedFormula (const FormulaT &_formula) |
Adds the given formula to the passed formula with no origin. More... | |
std::pair< ModuleInput::iterator, bool > | addSubformulaToPassedFormula (const FormulaT &_formula, const std::shared_ptr< std::vector< FormulaT >> &_origins) |
Adds the given formula to the passed formula. More... | |
std::pair< ModuleInput::iterator, bool > | addSubformulaToPassedFormula (const FormulaT &_formula, const FormulaT &_origin) |
Adds the given formula to the passed formula. More... | |
void | generateTrivialInfeasibleSubset () |
Stores the trivial infeasible subset being the set of received formulas. More... | |
void | receivedFormulasAsInfeasibleSubset (ModuleInput::const_iterator _subformula) |
Stores an infeasible subset consisting only of the given received formula. More... | |
std::vector< FormulaT >::const_iterator | findBestOrigin (const std::vector< FormulaT > &_origins) const |
void | getInfeasibleSubsets () |
Copies the infeasible subsets of the passed formula. More... | |
std::vector< FormulaSetT > | getInfeasibleSubsets (const Module &_backend) const |
Get the infeasible subsets the given backend provides. More... | |
const Model & | backendsModel () const |
Stores the model of a backend which determined satisfiability of the passed formula in the model of this module. More... | |
void | getBackendsModel () const |
void | getBackendsAllModels () const |
Stores all models of a backend in the list of all models of this module. More... | |
virtual Answer | runBackends (bool _final, bool _full, carl::Variable _objective) |
Runs the backend solvers on the passed formula. More... | |
virtual Answer | runBackends () |
virtual ModuleInput::iterator | eraseSubformulaFromPassedFormula (ModuleInput::iterator _subformula, bool _ignoreOrigins=false) |
Removes everything related to the sub-formula to remove from the passed formula in the backends of this module. More... | |
void | clearPassedFormula () |
std::vector< FormulaT > | merge (const std::vector< FormulaT > &, const std::vector< FormulaT > &) const |
Merges the two vectors of sets into the first one. More... | |
size_t | determine_smallest_origin (const std::vector< FormulaT > &origins) const |
bool | probablyLooping (const typename Poly::PolyType &_branchingPolynomial, const Rational &_branchingValue) const |
Checks whether given the current branching value and branching variable/polynomial it is (highly) probable that this branching is part of an infinite loop of branchings. More... | |
bool | branchAt (const Poly &_polynomial, bool _integral, const Rational &_value, std::vector< FormulaT > &&_premise, bool _leftCaseWeak=true, bool _preferLeftCase=true, bool _useReceivedFormulaAsPremise=false) |
Adds a lemmas which provoke a branching for the given variable at the given value, if this module returns Unknown and there exists a preceding SATModule. More... | |
bool | branchAt (const Poly &_polynomial, bool _integral, const Rational &_value, bool _leftCaseWeak=true, bool _preferLeftCase=true, bool _useReceivedFormulaAsPremise=false, const std::vector< FormulaT > &_premise=std::vector< FormulaT >()) |
bool | branchAt (carl::Variable::Arg _var, const Rational &_value, std::vector< FormulaT > &&_premise, bool _leftCaseWeak=true, bool _preferLeftCase=true, bool _useReceivedFormulaAsPremise=false) |
bool | branchAt (carl::Variable::Arg _var, const Rational &_value, bool _leftCaseWeak=true, bool _preferLeftCase=true, bool _useReceivedFormulaAsPremise=false, const std::vector< FormulaT > &_premise=std::vector< FormulaT >()) |
void | splitUnequalConstraint (const FormulaT &) |
Adds the following lemmas for the given constraint p!=0. More... | |
unsigned | checkModel () const |
void | addInformationRelevantFormula (const FormulaT &formula) |
Adds a formula to the InformationRelevantFormula. More... | |
const std::set< FormulaT > & | getInformationRelevantFormulas () |
Gets all InformationRelevantFormulas. More... | |
bool | isLemmaLevel (LemmaLevel level) |
Checks if current lemma level is greater or equal to given level. More... | |
Static Protected Member Functions | |
static bool | modelsDisjoint (const Model &_modelA, const Model &_modelB) |
Checks whether there is no variable assigned by both models. More... | |
Protected Attributes | |
std::vector< FormulaSetT > | mInfeasibleSubsets |
Stores the infeasible subsets. More... | |
Manager *const | mpManager |
A reference to the manager. More... | |
Model | mModel |
Stores the assignment of the current satisfiable result, if existent. More... | |
std::vector< Model > | mAllModels |
Stores all satisfying assignments. More... | |
bool | mModelComputed |
True, if the model has already been computed. More... | |
bool | mFinalCheck |
true, if the check procedure should perform a final check which especially means not to postpone splitting decisions More... | |
bool | mFullCheck |
false, if this module should avoid too expensive procedures and rather return unknown instead. More... | |
carl::Variable | mObjectiveVariable |
Objective variable to be minimized. If set to NO_VARIABLE, a normal sat check should be performed. More... | |
std::vector< TheoryPropagation > | mTheoryPropagations |
std::atomic< Answer > | mSolverState |
States whether the received formula is known to be satisfiable or unsatisfiable otherwise it is set to unknown. More... | |
std::atomic_bool * | mBackendsFoundAnswer |
This flag is passed to any backend and if it determines an answer to a prior check call, this flag is fired. More... | |
Conditionals | mFoundAnswer |
Vector of Booleans: If any of them is true, we have to terminate a running check procedure. More... | |
std::vector< Module * > | mUsedBackends |
The backends of this module which are currently used (conditions to use this module are fulfilled for the passed formula). More... | |
std::vector< Module * > | mAllBackends |
The backends of this module which have been used. More... | |
std::vector< Lemma > | mLemmas |
Stores the lemmas being valid formulas this module or its backends made. More... | |
ModuleInput::iterator | mFirstSubformulaToPass |
Stores the position of the first sub-formula in the passed formula, which has not yet been considered for a consistency check of the backends. More... | |
carl::FastSet< FormulaT > | mConstraintsToInform |
Stores the constraints which the backends must be informed about. More... | |
carl::FastSet< FormulaT > | mInformedConstraints |
Stores the position of the first constraint of which no backend has been informed about. More... | |
ModuleInput::const_iterator | mFirstUncheckedReceivedSubformula |
Stores the position of the first (by this module) unchecked sub-formula of the received formula. More... | |
unsigned | mSmallerMusesCheckCounter |
Counter used for the generation of the smt2 files to check for smaller muses. More... | |
std::vector< std::size_t > | mVariableCounters |
Maps variables to the number of their occurrences. More... | |
Private Member Functions | |
void | learnRefinements () |
Adds the refinements learned during pivoting to the deductions. More... | |
void | learnRefinement (const typename LRATableau::LearnedBound &_learnedBound, bool _upperBound) |
FormulasT | createPremise (const std::vector< const LRABound * > &_premiseBounds, bool &_premiseOnlyEqualities) const |
void | adaptPassedFormula () |
Adapt the passed formula, such that it consists of the finite infimums and supremums of all variables and the non linear constraints. More... | |
bool | checkAssignmentForNonlinearConstraint () |
Checks whether the current assignment of the linear constraints fulfills the non linear constraints. More... | |
void | activateBound (const LRABound *_bound, const FormulaT &_formula) |
Activate the given bound and update the supremum, the infimum and the assignment of variable to which the bound belongs. More... | |
void | activateStrictBound (const FormulaT &_neqOrigin, const LRABound &_weakBound, const LRABound *_strictBound) |
Activates a strict bound as a result of the two constraints p!=0 and p<=0 resp. More... | |
void | setBound (const FormulaT &_constraint) |
Creates a bound corresponding to the given constraint. More... | |
void | simpleTheoryPropagation () |
Adds simple deduction being lemmas of the form (=> c_1 c_2) with, e.g. More... | |
void | simpleTheoryPropagation (const LRABound *_bound) |
void | propagate (const LRABound *_premise, const FormulaT &_conclusion) |
void | propagateLowerBound (const LRABound *_bound) |
void | propagateUpperBound (const LRABound *_bound) |
void | propagateEqualBound (const LRABound *_bound) |
bool | gomoryCut () |
bool | mostInfeasibleVar (bool _tryGomoryCut, carl::Variables &_varsToExclude) |
bool | branch_and_bound () |
Creates a branch and bound lemma. More... | |
bool | assignmentConsistentWithTableau (const RationalAssignment &_assignment, const LRABoundType &_delta) const |
Checks whether the found assignment is consistent with the tableau, hence replacing the original variables in the expressions represented by the slack variables equals their assignment. More... | |
bool | assignmentCorrect () const |
std::pair< ModuleInput::iterator, bool > | addSubformulaToPassedFormula (const FormulaT &_formula, bool _hasSingleOrigin, const FormulaT &_origin, const std::shared_ptr< std::vector< FormulaT >> &_origins, bool _mightBeConjunction) |
This method actually implements the adding of a formula to the passed formula. More... | |
Answer | foundAnswer (Answer _answer) |
Sets the solver state to the given answer value. More... | |
Private Attributes | |
bool | mInitialized |
A flag, which is true if this module has already set all bounds corresponding to the constraint, of which this module has been informed. More... | |
bool | mAssignmentFullfilsNonlinearConstraints |
A flag which is true, if the non-linear constraints fulfill the current assignment. More... | |
bool | mStrongestBoundsRemoved |
A flag which is set, if a supremum or infimum of a LRAModule variable has been changed. More... | |
bool | mOptimumComputed |
bool | mRationalModelComputed |
bool | mCheckedWithBackends |
LRATableau | mTableau |
Contains the main data structures of this module. More... | |
carl::FastSet< FormulaT > | mLinearConstraints |
Stores all linear constraints of which this module has been once informed. More... | |
carl::FastSet< FormulaT > | mNonlinearConstraints |
Stores all non-linear constraints which are currently added (by assertSubformula) to this module. More... | |
ConstraintContextMap | mActiveResolvedNEQConstraints |
Those constraints p!=0, which are added to this module (part of the received formula), which are resolved by a constraints as p<0, p<=0, p>=0 or p>0. More... | |
ConstraintContextMap | mActiveUnresolvedNEQConstraints |
Those constraints p!=0, which are added to this module (part of the received formula), which are not yet resolved by a constraints as p<0, p<=0, p>=0 or p>0. More... | |
carl::Variable | mDelta |
The delta value, which influencing the assignment such that it also fulfills all strict inequalities (cf. More... | |
std::vector< const LRABound * > | mBoundCandidatesToPass |
Stores the bounds, which would influence a backend call because of recent changes. More... | |
RationalAssignment | mRationalAssignment |
friend | Manager |
std::size_t | mId |
A unique ID to identify this module instance. (Could be useful but currently nowhere used) More... | |
thread_priority | mThreadPriority |
The priority of this module to get a thread for running its check procedure. More... | |
const ModuleInput * | mpReceivedFormula |
The formula passed to this module. More... | |
ModuleInput * | mpPassedFormula |
The formula passed to the backends of this module. More... | |
std::string | mModuleName |
ModuleStatistics & | mStatistics = statistics_get<ModuleStatistics>(moduleName()) |
A module which performs the Simplex method on the linear part of it's received formula.
Definition at line 28 of file LRAModule.h.
typedef carl::FastMap<FormulaT, std::vector<const LRABound*>*> smtrat::LRAModule< Settings >::ConstraintBoundsMap |
Maps constraint to the bounds it represents (e.g., equations represent two bounds)
Definition at line 69 of file LRAModule.h.
typedef carl::FastMap<FormulaT, Context> smtrat::LRAModule< Settings >::ConstraintContextMap |
Stores the position of a received formula in the passed formula.
Definition at line 71 of file LRAModule.h.
typedef carl::FastPointerMap<typename Poly::PolyType, LRAVariable*> smtrat::LRAModule< Settings >::ExVariableMap |
Maps a linear polynomial to it's corresponding LRAModule variable.
Definition at line 67 of file LRAModule.h.
typedef lra::Bound<LRABoundType, LRAEntryType> smtrat::LRAModule< Settings >::LRABound |
Type of a bound of a variable within the LRAModule.
Definition at line 37 of file LRAModule.h.
typedef Settings::BoundType smtrat::LRAModule< Settings >::LRABoundType |
Number type of the underlying value of a bound of a variable within the LRAModule.
Definition at line 33 of file LRAModule.h.
typedef Settings::EntryType smtrat::LRAModule< Settings >::LRAEntryType |
Type of an entry within the tableau.
Definition at line 35 of file LRAModule.h.
typedef lra::Tableau<typename Settings::Tableau_settings, LRABoundType, LRAEntryType> smtrat::LRAModule< Settings >::LRATableau |
The tableau which is the main data structure maintained by the LRAModule responsible for the pivoting steps.
Definition at line 73 of file LRAModule.h.
typedef lra::Value<LRABoundType> smtrat::LRAModule< Settings >::LRAValue |
The type of the assignment of a variable maintained by the LRAModule. It consists of a tuple of two value of the bound type.
Definition at line 41 of file LRAModule.h.
typedef lra::Variable<LRABoundType, LRAEntryType> smtrat::LRAModule< Settings >::LRAVariable |
A variable of the LRAModule, being either a original variable or a slack variable representing a linear polynomial.
Definition at line 39 of file LRAModule.h.
typedef Settings smtrat::LRAModule< Settings >::SettingsType |
Definition at line 42 of file LRAModule.h.
typedef carl::FastMap<carl::Variable, LRAVariable*> smtrat::LRAModule< Settings >::VarVariableMap |
Maps an original variable to it's corresponding LRAModule variable.
Definition at line 65 of file LRAModule.h.
|
stronginherited |
smtrat::LRAModule< Settings >::LRAModule | ( | const ModuleInput * | _formula, |
Conditionals & | _conditionals, | ||
Manager * | _manager = NULL |
||
) |
Constructs a LRAModule.
_type | The type of this module being LRAModule. |
_formula | The formula passed to this module, called received formula. |
_settings | [Not yet used.] |
_conditionals | Vector of Booleans: If any of them is true, we have to terminate a running check procedure. |
_manager | A reference to the manager of the solver using this module. |
|
virtual |
Destructs this LRAModule.
|
private |
Activate the given bound and update the supremum, the infimum and the assignment of variable to which the bound belongs.
_bound | The bound to activate. |
_formula | The constraints which form this bound. |
|
private |
Activates a strict bound as a result of the two constraints p!=0 and p<=0 resp.
p>=0.
_neqOrigin | The constraint with != as relation symbol. |
_weakBound | The bound corresponding to either a constraint with <= resp. >= as relation symbol. |
_strictBound | The bound to activate corresponding to either a constraint with < or > as relation symbol. |
|
private |
Adapt the passed formula, such that it consists of the finite infimums and supremums of all variables and the non linear constraints.
|
inherited |
The module has to take the given sub-formula of the received formula into account.
_subformula | The sub-formula to take additionally into account. |
Definition at line 138 of file Module.cpp.
|
protectedvirtualinherited |
Adds a constraint to the collection of constraints of this module, which are informed to a freshly generated backend.
_constraint | The constraint to add. |
Reimplemented in smtrat::SATModule< Settings >.
Definition at line 877 of file Module.cpp.
|
inlineprotectedvirtualinherited |
The module has to take the given sub-formula of the received formula into account.
formula | The sub-formula to take additionally into account. |
Definition at line 706 of file Module.h.
bool smtrat::LRAModule< Settings >::addCore | ( | ModuleInput::const_iterator | _subformula | ) |
The module has to take the given sub-formula of the received formula into account.
_subformula | The sub-formula to take additionally into account. |
|
protectedinherited |
Adds a formula to the InformationRelevantFormula.
formula | Formula to add |
Definition at line 1068 of file Module.cpp.
|
inlineinherited |
|
inlineprotectedinherited |
Adds the given set of formulas in the received formula to the origins of the given passed formula.
_formula | The passed formula to set the origins for. |
_origin | A set of formulas in the received formula of this module. |
Definition at line 798 of file Module.h.
|
inlineprotectedinherited |
Copies the given sub-formula of the received formula to the passed formula.
Note, that there is always a link between sub-formulas of the passed formulas to sub-formulas of the received formulas, which are responsible for its occurrence.
_subformula | The sub-formula of the received formula to copy. |
Definition at line 857 of file Module.h.
|
inlineprotectedinherited |
Adds the given formula to the passed formula with no origin.
Note that in the next call of this module's removeSubformula, all formulas in the passed formula without origins will be removed.
_formula | The formula to add to the passed formula. |
Definition at line 873 of file Module.h.
|
privateinherited |
This method actually implements the adding of a formula to the passed formula.
_formula | The formula to add to the passed formula. |
_hasSingleOrigin | true, if the next argument contains the formula being the single origin. |
_origin | The sub-formula of the received formula being responsible for the occurrence of the formula to add to the passed formula. |
_origins | The link of the formula to add to the passed formula to sub-formulas of the received formulas, which are responsible for its occurrence |
_mightBeConjunction | true, if the formula to add might be a conjunction. |
Definition at line 341 of file Module.cpp.
|
inlineprotectedinherited |
Adds the given formula to the passed formula.
_formula | The formula to add to the passed formula. |
_origin | The sub-formula of the received formula being responsible for the occurrence of the formula to add to the passed formula. |
Definition at line 901 of file Module.h.
|
inlineprotectedinherited |
Adds the given formula to the passed formula.
_formula | The formula to add to the passed formula. |
_origins | The link of the formula to add to the passed formula to sub-formulas of the received formulas, which are responsible for its occurrence |
Definition at line 887 of file Module.h.
|
inlineinherited |
|
inlineprotectedinherited |
|
inlineinherited |
|
private |
Checks whether the found assignment is consistent with the tableau, hence replacing the original variables in the expressions represented by the slack variables equals their assignment.
_assignment | The assignment of the original variables. |
_delta | The calculated delta for the given assignment. |
|
private |
|
protectedinherited |
Stores the model of a backend which determined satisfiability of the passed formula in the model of this module.
Definition at line 630 of file Module.cpp.
|
private |
Creates a branch and bound lemma.
|
protectedinherited |
Adds a lemmas which provoke a branching for the given variable at the given value, if this module returns Unknown and there exists a preceding SATModule.
Note that the given value is rounded down and up, if the given variable is integer-valued.
_polynomial | The variable to branch for. |
_integral | A flag being true, if all variables in the polynomial to branch for are integral. |
_value | The value to branch at. |
_premise | The sub-formulas of the received formula from which the branch is followed. Note, that a premise is not necessary, as every branch is a valid formula. But a premise can prevent from branching unnecessarily. |
_leftCaseWeak | true, if a branching in the form of (or (<= p b) (> p b)) is desired. false, if a branching in the form of (or (< p b) (>= p b)) is desired. |
_preferLeftCase | true, if the left case (polynomial less(or equal) 0 shall be chosen first. false, otherwise. |
_useReceivedFormulaAsPremise | true, if the whole received formula should be used as premise |
Definition at line 478 of file Module.cpp.
|
virtualinherited |
Checks the received formula for consistency.
Note, that this is an implementation of the satisfiability check of the conjunction of the so far received formulas, which does actually nothing but passing the problem to its backends. This implementation is only used internally and must be overwritten by any derived module.
_final | true, if this satisfiability check will be the last one (for a global sat-check), if its result is SAT |
_full | false, if this module should avoid too expensive procedures and rather return unknown instead. |
_objective | if not set to NO_VARIABLE, the module should find an assignment minimizing this objective variable; otherwise any assignment is good. |
Reimplemented in smtrat::PModule.
Definition at line 86 of file Module.cpp.
|
private |
Checks whether the current assignment of the linear constraints fulfills the non linear constraints.
|
virtual |
Checks the received formula for consistency.
Reimplemented from smtrat::Module.
Answer smtrat::LRAModule< Settings >::checkCore_old | ( | ) |
|
inherited |
Checks the given infeasible subset for minimality by storing all subsets of it, which have a smaller size which differs from the size of the infeasible subset not more than the given threshold.
_infsubset | The infeasible subset to check for minimality. |
_filename | The name of the file to store the infeasible subsets in order to be able to check their infeasibility. |
_maxSizeDifference | The maximal difference between the sizes of the subsets compared to the size of the infeasible subset. |
Definition at line 1018 of file Module.cpp.
|
protectedinherited |
Definition at line 588 of file Module.cpp.
Answer smtrat::LRAModule< Settings >::checkNotEqualConstraints | ( | Answer | _result | ) |
|
inlineprotectedinherited |
|
inlineinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
Collects the formulas in the given formula, which are part of the received formula.
If the given formula directly occurs in the received formula, it is inserted into the given set. Otherwise, the given formula must be of type AND and all its sub-formulas part of the received formula. Hence, they will be added to the given set.
_formula | The formula from which to collect the formulas being sub-formulas of the received formula (origins). |
_origins | The set in which to store the origins. |
Definition at line 960 of file Module.cpp.
|
inherited |
Definition at line 928 of file Module.cpp.
|
inlineinherited |
void smtrat::LRAModule< Settings >::createInfeasibleSubsets | ( | lra::EntryID | _tableauEntry | ) |
|
private |
|
virtual |
Reimplemented from smtrat::Module.
|
inherited |
Definition at line 296 of file Module.cpp.
|
inherited |
The inverse of informing about a constraint.
All data structures which were kept regarding this constraint are going to be removed. Note, that this makes only sense if it is not likely enough that a formula with this constraint must be solved again.
_constraint | The constraint to remove from internal data structures. |
Definition at line 124 of file Module.cpp.
|
inlineprotectedvirtualinherited |
The inverse of informing about a constraint.
All data structures which were kept regarding this constraint are going to be removed. Note, that this makes only sense if it is not likely enough that a formula with this constraint must be solved again.
_constraint | The constraint to remove from internal data structures. |
Definition at line 695 of file Module.h.
void smtrat::LRAModule< Settings >::deinformCore | ( | const FormulaT & | _constraint | ) |
The inverse of informing about a constraint.
All data structures which were kept regarding this constraint are going to be removed. Note, that this makes only sense if it is not likely enough that a formula with this constraint must be solved again.
_constraint | The constraint to remove from internal data structures. |
|
protectedinherited |
origins | A vector of sets of origins. |
Definition at line 403 of file Module.cpp.
|
protectedvirtualinherited |
Removes everything related to the sub-formula to remove from the passed formula in the backends of this module.
Afterwards the sub-formula is removed from the passed formula.
_subformula | The sub-formula to remove from the passed formula. |
_ignoreOrigins | True, if the sub-formula shall be removed regardless of its origins (should only be applied with expertise). |
Reimplemented in smtrat::ICPModule< Settings >, smtrat::ICPModule< smtrat::ICPSettings1 >, and smtrat::ICPModule< smtrat::ICPSettings4 >.
Definition at line 807 of file Module.cpp.
|
inherited |
Excludes all variables from the current model, which do not occur in the received formula.
Definition at line 884 of file Module.cpp.
|
protectedinherited |
_origins |
Definition at line 691 of file Module.cpp.
|
inlineinherited |
|
inlineinherited |
Sets the solver state to the given answer value.
This method also fires the flag given by the antecessor module of this module to true, if the given answer value is not Unknown.
_answer | The found answer. |
Definition at line 856 of file Module.cpp.
|
inlinestaticinherited |
|
inlineprotectedinherited |
|
protectedinherited |
Stores all models of a backend in the list of all models of this module.
Definition at line 669 of file Module.cpp.
|
protectedinherited |
|
protectedinherited |
Copies the infeasible subsets of the passed formula.
Definition at line 596 of file Module.cpp.
|
protectedinherited |
Get the infeasible subsets the given backend provides.
Note, that an infeasible subset in a backend contains sub formulas of the passed formula and an infeasible subset of this module contains sub formulas of the received formula. In this method the LATTER is returned.
_backend | The backend from which to obtain the infeasible subsets. |
Definition at line 709 of file Module.cpp.
|
protectedinherited |
Gets all InformationRelevantFormulas.
Definition at line 1074 of file Module.cpp.
|
virtualinherited |
Partition the variables from the current model into equivalence classes according to their assigned value.
The result is a set of equivalence classes of variables where all variables within one class are assigned the same value. Note that the number of classes may not be minimal, i.e. two classes may actually be equivalent.
Definition at line 308 of file Module.cpp.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
Gets the origins of the passed formula at the given position.
_formula | The position of a formula in the passed formulas. |
Definition at line 808 of file Module.h.
const RationalAssignment& smtrat::LRAModule< Settings >::getRationalModel | ( | ) | const |
Gives a rational model if the received formula is satisfiable.
Note, that it is calculated from scratch every time you call this method.
|
virtualinherited |
Reimplemented in smtrat::PModule.
Definition at line 945 of file Module.cpp.
|
inline |
_constraint | The constraint to get the slack variable for. |
Definition at line 298 of file LRAModule.h.
EvalRationalIntervalMap smtrat::LRAModule< Settings >::getVariableBounds | ( | ) | const |
Returns the bounds of the variables as intervals.
|
private |
|
inlineinherited |
|
inherited |
Definition at line 1000 of file Module.cpp.
|
inlineinherited |
|
inlineinherited |
|
inherited |
Informs the module about the given constraint.
It should be tried to inform this module about any constraint it could receive eventually before assertSubformula is called (preferably for the first time, but at least before adding a formula containing that constraint).
_constraint | The constraint to inform about. |
Definition at line 117 of file Module.cpp.
|
inlineprotectedinherited |
|
inlineprotectedvirtualinherited |
Informs the module about the given constraint.
It should be tried to inform this module about any constraint it could receive eventually before assertSubformula is called (preferably for the first time, but at least before adding a formula containing that constraint).
_constraint | The constraint to inform about. |
Definition at line 684 of file Module.h.
bool smtrat::LRAModule< Settings >::informCore | ( | const FormulaT & | _constraint | ) |
Informs this module about the existence of the given constraint, which means that it could be added in future.
_constraint | The constraint to inform about. |
|
inlineinherited |
|
virtual |
Initializes the tableau according to all linear constraints, of which this module has been informed.
Reimplemented from smtrat::Module.
|
inlineinherited |
|
protectedinherited |
Checks if current lemma level is greater or equal to given level.
level | Level to check. |
Definition at line 1079 of file Module.cpp.
|
inlineinherited |
|
private |
|
private |
Adds the refinements learned during pivoting to the deductions.
|
inlineinherited |
|
protectedinherited |
Merges the two vectors of sets into the first one.
({a,b},{a,c}) and ({b,d},{b}) -> ({a,b,d},{a,b},{a,b,c,d},{a,b,c})
_vecSetA | A vector of sets of constraints. |
_vecSetB | A vector of sets of constraints. |
Definition at line 377 of file Module.cpp.
|
inlineinherited |
|
staticprotectedinherited |
Checks whether there is no variable assigned by both models.
_modelA | The first model to check for. |
_modelB | The second model to check for. |
Definition at line 611 of file Module.cpp.
|
inlinevirtual |
Reimplemented from smtrat::Module.
Definition at line 43 of file LRAModule.h.
|
private |
_varsToExclude | The variable on which we do not want to branch. |
|
inlineinherited |
Answer smtrat::LRAModule< Settings >::optimize | ( | Answer | _result | ) |
|
inline |
Definition at line 281 of file LRAModule.h.
|
protectedinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
Prints everything relevant of the solver.
_initiation | The line initiation. |
Definition at line 1085 of file Module.cpp.
|
inherited |
Prints all assignments of this module satisfying its received formula if it satisfiable and this module could find an assignment.
_out | The stream to print the assignment on. |
Definition at line 1161 of file Module.cpp.
void smtrat::LRAModule< Settings >::printBoundCandidatesToPass | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints the strictest bounds, which have to be passed the backend in case.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
void smtrat::LRAModule< Settings >::printConstraintToBound | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints the mapping of constraints to their corresponding bounds.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
|
inherited |
Prints the infeasible subsets.
_initiation | The line initiation. |
Definition at line 1136 of file Module.cpp.
void smtrat::LRAModule< Settings >::printLinearConstraints | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints all linear constraints.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
|
inherited |
Prints the assignment of this module satisfying its received formula if it satisfiable and this module could find an assignment.
_out | The stream to print the assignment on. |
Definition at line 1151 of file Module.cpp.
void smtrat::LRAModule< Settings >::printNonlinearConstraints | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints all non-linear constraints.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
|
inherited |
Prints the vector of passed formula.
_initiation | The line initiation. |
Definition at line 1118 of file Module.cpp.
void smtrat::LRAModule< Settings >::printRationalModel | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints the current rational assignment.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
|
inherited |
Prints the vector of the received formula.
_initiation | The line initiation. |
Definition at line 1105 of file Module.cpp.
void smtrat::LRAModule< Settings >::printTableau | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints the current tableau.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
void smtrat::LRAModule< Settings >::printVariables | ( | std::ostream & | _out = std::cout , |
const std::string | _init = "" |
||
) | const |
Prints all lra variables and their assignments.
_out | The output stream to print on. |
_init | The beginning of each line to print. |
|
protectedinherited |
Checks whether given the current branching value and branching variable/polynomial it is (highly) probable that this branching is part of an infinite loop of branchings.
_branchingPolynomial | The polynomial to branch at (in most branching strategies this is just a variable). |
_branchingValue | The value to branch at. |
Definition at line 426 of file Module.cpp.
void smtrat::LRAModule< Settings >::processLearnedBounds | ( | ) |
Answer smtrat::LRAModule< Settings >::processResult | ( | Answer | _result | ) |
|
private |
|
private |
|
private |
|
private |
|
inlineinherited |
|
inlineprotectedinherited |
|
inlineinherited |
|
virtualinherited |
Removes everything related to the given sub-formula of the received formula.
However, it is desired not to lose track of search spaces where no satisfying assignment can be found for the remaining sub-formulas.
_subformula | The sub formula of the received formula to remove. |
Reimplemented in smtrat::PModule.
Definition at line 159 of file Module.cpp.
|
inlineprotectedvirtualinherited |
Removes everything related to the given sub-formula of the received formula.
However, it is desired not to lose track of search spaces where no satisfying assignment can be found for the remaining sub-formulas.
formula | The sub formula of the received formula to remove. |
Definition at line 729 of file Module.h.
void smtrat::LRAModule< Settings >::removeCore | ( | ModuleInput::const_iterator | _subformula | ) |
Removes everything related to the given sub-formula of the received formula.
_subformula | The sub formula of the received formula to remove. |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprotectedvirtualinherited |
Reimplemented in smtrat::PModule.
Definition at line 1012 of file Module.h.
|
protectedvirtualinherited |
Runs the backend solvers on the passed formula.
_final | true, if this satisfiability check will be the last one (for a global sat-check), if its result is SAT |
_full | false, if this module should avoid too expensive procedures and rather return unknown instead. |
_objective | if not set to NO_VARIABLE, the module should find an assignment minimizing this objective variable; otherwise any assignment is good. |
Reimplemented in smtrat::PModule.
Definition at line 727 of file Module.cpp.
|
private |
Creates a bound corresponding to the given constraint.
_constraint | The constraint corresponding to the bound to create. |
|
inlineinherited |
|
inlineinherited |
|
private |
Adds simple deduction being lemmas of the form (=> c_1 c_2) with, e.g.
c_1 being p>=1 and c_2 being p>0.
|
private |
|
inline |
Definition at line 289 of file LRAModule.h.
|
inlineinherited |
Definition at line 388 of file Module.h.
|
protectedinherited |
Adds the following lemmas for the given constraint p!=0.
(p!=0 <-> (p<0 or p>0))
and not(p<0 and p>0)
_unequalConstraint | A constraint having the relation symbol !=. |
Definition at line 565 of file Module.cpp.
|
inlineinherited |
|
virtualinherited |
Updates all satisfying models, if the solver has detected the consistency of the received formula, beforehand.
Reimplemented in smtrat::SATModule< Settings >.
Definition at line 261 of file Module.cpp.
|
inherited |
Stores all lemmas of any backend of this module in its own lemma vector.
Definition at line 919 of file Module.cpp.
|
virtual |
Updates the model, if the solver has detected the consistency of the received formula, beforehand.
Reimplemented from smtrat::Module.
|
inlineinherited |
|
private |
Those constraints p!=0, which are added to this module (part of the received formula), which are resolved by a constraints as p<0, p<=0, p>=0 or p>0.
Definition at line 105 of file LRAModule.h.
|
private |
Those constraints p!=0, which are added to this module (part of the received formula), which are not yet resolved by a constraints as p<0, p<=0, p>=0 or p>0.
Definition at line 110 of file LRAModule.h.
|
protectedinherited |
|
mutableprotectedinherited |
|
private |
A flag which is true, if the non-linear constraints fulfill the current assignment.
Definition at line 83 of file LRAModule.h.
|
protectedinherited |
|
private |
Stores the bounds, which would influence a backend call because of recent changes.
Definition at line 117 of file LRAModule.h.
|
private |
Definition at line 91 of file LRAModule.h.
|
protectedinherited |
|
private |
The delta value, which influencing the assignment such that it also fulfills all strict inequalities (cf.
Integrating Simplex with DPLL(T ) by B. Dutertre and L. de Moura).
Definition at line 115 of file LRAModule.h.
|
protectedinherited |
|
staticinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
privateinherited |
|
protectedinherited |
|
protectedinherited |
|
private |
A flag, which is true if this module has already set all bounds corresponding to the constraint, of which this module has been informed.
Definition at line 81 of file LRAModule.h.
|
staticinherited |
|
protectedinherited |
|
private |
Stores all linear constraints of which this module has been once informed.
Definition at line 98 of file LRAModule.h.
|
mutableprotectedinherited |
|
mutableprotectedinherited |
|
private |
Stores all non-linear constraints which are currently added (by assertSubformula) to this module.
Definition at line 100 of file LRAModule.h.
|
staticinherited |
|
protectedinherited |
|
staticinherited |
|
private |
Definition at line 87 of file LRAModule.h.
|
protectedinherited |
|
privateinherited |
|
privateinherited |
|
mutableprivate |
Definition at line 119 of file LRAModule.h.
|
mutableprivate |
Definition at line 89 of file LRAModule.h.
|
mutableprotectedinherited |
|
protectedinherited |
|
privateinherited |
|
private |
A flag which is set, if a supremum or infimum of a LRAModule variable has been changed.
Definition at line 85 of file LRAModule.h.
|
private |
Contains the main data structures of this module.
It maintains for each LRAModule variable a row or a column. On this tableau pivoting can be performed as the well known Simplex method performs.
Definition at line 96 of file LRAModule.h.
|
protectedinherited |
|
privateinherited |
|
protectedinherited |
|
protectedinherited |