27 template<
class Settings>
45 return SettingsType::moduleName;
67 typedef carl::FastPointerMap<typename Poly::PolyType, LRAVariable*>
ExVariableMap;
120 #ifdef SMTRAT_DEVOPTION_Statistics
122 LRAModuleStatistics&
mStatistics = statistics_get<LRAModuleStatistics>(
moduleName() +
"_" + std::to_string(
id()));
269 void printTableau( std::ostream& _out = std::cout,
const std::string _init =
"" )
const;
276 void printVariables( std::ostream& _out = std::cout,
const std::string _init =
"" )
const;
302 return (*iter->second->begin())->pVariable();
313 void learnRefinement(
const typename LRATableau::LearnedBound& _learnedBound,
bool _upperBound );
Class to create a settings object for the LRAModule.
A module which performs the Simplex method on the linear part of it's received formula.
void printNonlinearConstraints(std::ostream &_out=std::cout, const std::string _init="") const
Prints all non-linear constraints.
bool mAssignmentFullfilsNonlinearConstraints
A flag which is true, if the non-linear constraints fulfill the current assignment.
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...
bool informCore(const FormulaT &_constraint)
Informs this module about the existence of the given constraint, which means that it could be added i...
const RationalAssignment & getRationalModel() const
Gives a rational model if the received formula is satisfiable.
carl::FastMap< carl::Variable, LRAVariable * > VarVariableMap
Maps an original variable to it's corresponding LRAModule variable.
void adaptPassedFormula()
Adapt the passed formula, such that it consists of the finite infimums and supremums of all variables...
const LRAVariable * getSlackVariable(const FormulaT &_constraint) const
void removeCore(ModuleInput::const_iterator _subformula)
Removes everything related to the given sub-formula of the received formula.
void processLearnedBounds()
const ExVariableMap & slackVariables() const
Answer checkNotEqualConstraints(Answer _result)
bool mRationalModelComputed
const VarVariableMap & originalVariables() const
void init()
Initializes the tableau according to all linear constraints, of which this module has been informed.
carl::Variable mDelta
The delta value, which influencing the assignment such that it also fulfills all strict inequalities ...
RationalAssignment mRationalAssignment
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.
Answer checkCore()
Checks the received formula for consistency.
void learnRefinements()
Adds the refinements learned during pivoting to the deductions.
lra::Value< LRABoundType > LRAValue
The type of the assignment of a variable maintained by the LRAModule. It consists of a tuple of two v...
void learnRefinement(const typename LRATableau::LearnedBound &_learnedBound, bool _upperBound)
EvalRationalIntervalMap getVariableBounds() const
Returns the bounds of the variables as intervals.
lra::Bound< LRABoundType, LRAEntryType > LRABound
Type of a bound of a variable within the LRAModule.
void setBound(const FormulaT &_constraint)
Creates a bound corresponding to the given constraint.
carl::FastSet< FormulaT > mLinearConstraints
Stores all linear constraints of which this module has been once informed.
Answer processResult(Answer _result)
void propagateLowerBound(const LRABound *_bound)
void simpleTheoryPropagation(const LRABound *_bound)
ConstraintContextMap mActiveUnresolvedNEQConstraints
Those constraints p!=0, which are added to this module (part of the received formula),...
void simpleTheoryPropagation()
Adds simple deduction being lemmas of the form (=> c_1 c_2) with, e.g.
ConstraintContextMap mActiveResolvedNEQConstraints
Those constraints p!=0, which are added to this module (part of the received formula),...
bool branch_and_bound()
Creates a branch and bound lemma.
FormulasT createPremise(const std::vector< const LRABound * > &_premiseBounds, bool &_premiseOnlyEqualities) const
void printRationalModel(std::ostream &_out=std::cout, const std::string _init="") const
Prints the current rational assignment.
std::string moduleName() const
bool assignmentCorrect() const
bool mCheckedWithBackends
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...
lra::Variable< LRABoundType, LRAEntryType > LRAVariable
A variable of the LRAModule, being either a original variable or a slack variable representing a line...
bool mostInfeasibleVar(bool _tryGomoryCut, carl::Variables &_varsToExclude)
virtual ~LRAModule()
Destructs this LRAModule.
Settings::BoundType LRABoundType
Number type of the underlying value of a bound of a variable within the LRAModule.
bool mStrongestBoundsRemoved
A flag which is set, if a supremum or infimum of a LRAModule variable has been changed.
void propagateUpperBound(const LRABound *_bound)
void propagateEqualBound(const LRABound *_bound)
bool checkAssignmentForNonlinearConstraint()
Checks whether the current assignment of the linear constraints fulfills the non linear constraints.
void printConstraintToBound(std::ostream &_out=std::cout, const std::string _init="") const
Prints the mapping of constraints to their corresponding bounds.
carl::FastMap< FormulaT, Context > ConstraintContextMap
Stores the position of a received formula in the passed formula.
void createInfeasibleSubsets(lra::EntryID _tableauEntry)
void deinformCore(const FormulaT &_constraint)
The inverse of informing about a constraint.
unsigned currentlySatisfied(const FormulaT &) const
void propagate(const LRABound *_premise, const FormulaT &_conclusion)
Answer optimize(Answer _result)
std::vector< const LRABound * > mBoundCandidatesToPass
Stores the bounds, which would influence a backend call because of recent changes.
void updateModel() const
Updates the model, if the solver has detected the consistency of the received formula,...
Settings::EntryType LRAEntryType
Type of an entry within the tableau.
void printTableau(std::ostream &_out=std::cout, const std::string _init="") const
Prints the current tableau.
void printVariables(std::ostream &_out=std::cout, const std::string _init="") const
Prints all lra variables and their assignments.
LRAModule(const ModuleInput *_formula, Conditionals &_conditionals, Manager *_manager=NULL)
Constructs a LRAModule.
bool assignmentConsistentWithTableau(const RationalAssignment &_assignment, const LRABoundType &_delta) const
Checks whether the found assignment is consistent with the tableau, hence replacing the original vari...
bool addCore(ModuleInput::const_iterator _subformula)
The module has to take the given sub-formula of the received formula into account.
carl::FastMap< FormulaT, std::vector< const LRABound * > * > ConstraintBoundsMap
Maps constraint to the bounds it represents (e.g., equations represent two bounds)
void printLinearConstraints(std::ostream &_out=std::cout, const std::string _init="") const
Prints all linear constraints.
LRATableau mTableau
Contains the main data structures of this module.
bool mInitialized
A flag, which is true if this module has already set all bounds corresponding to the constraint,...
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.
carl::FastSet< FormulaT > mNonlinearConstraints
Stores all non-linear constraints which are currently added (by assertSubformula) to this module.
carl::FastPointerMap< typename Poly::PolyType, LRAVariable * > ExVariableMap
Maps a linear polynomial to it's corresponding LRAModule variable.
A base class for all kind of theory solving methods.
ModuleStatistics & mStatistics
Stores a bound, which could be an upper "<= b" or a lower bound ">= b" for a bound value b.
const carl::FastMap< FormulaT, std::vector< const Bound< T1, T2 > * > * > & constraintToBound() const
const carl::FastPointerMap< typename Poly::PolyType, Variable< T1, T2 > * > & slackVars() const
const carl::FastMap< carl::Variable, Variable< T1, T2 > * > & originalVars() const
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
carl::Assignment< Rational > RationalAssignment
const settings::Settings & Settings()
std::map< carl::Variable, RationalInterval > EvalRationalIntervalMap
Answer
An enum with the possible answers a Module can give.
std::vector< std::atomic_bool * > Conditionals
A vector of atomic bool pointers.
carl::Formulas< Poly > FormulasT
Stores a formula, being part of the received formula of this module, and the position of this formula...
Context(const FormulaT &_origin, ModuleInput::iterator _pos)
FormulaT origin
The formula in the received formula.
ModuleInput::iterator position
The position of this formula in the passed formula.