18 template <
typename T>
class Variable;
23 template <
typename T>
class Bound
72 template <
typename T1>
friend std::ostream&
operator<<( std::ostream& _out,
const Bound<T1>& _bound );
79 void print( std::ostream& _out,
bool _withRelation =
false )
const;
189 const std::set<T,carl::less<T,false>>&
origins()
const
212 return (*pBoundA) < (*pBoundB);
504 void print( std::ostream& _out = std::cout,
const std::string _init =
"",
bool _printAllBounds =
false )
const;
522 std::set<T> conflict;
535 template<
typename Type>
Class for the bound of a variable.
Type
The type of a bounds.
bool isLowerBound() const
void print(std::ostream &_out, bool _withRelation=false) const
Prints this bound on the given stream.
Rational * mpLimit
A pointer to bound value, which is plus or minus infinity if the pointer is NULL.
const Rational * pLimit() const
Variable< T > * pVariable() const
Variable< T > *const mpVariable
The variable for which the bound is declared.
bool isUpperBound() const
bool activate(const T &_origin) const
Adds an origin to this bound.
const Variable< T > & variable() const
~Bound()
Destructs this bound.
bool deactivate(const T &_origin) const
Removes an origin from this bound.
Type mType
The type of this bound.
friend std::ostream & operator<<(std::ostream &_out, const Bound< T1 > &_bound)
Prints the bound on the given output stream.
Bound(Rational *const _limit, Variable< T > *const _variable, Type _type)
Constructs this bound.
std::set< T, carl::less< T, false > > *const mpOrigins
A set of origins of the bound, e.g., x-3<0 is the origin of the bound <3.
bool operator<(const Bound< T > &_bound) const
Checks whether the this bound is smaller than the given one.
const Rational & limit() const
const std::set< T, carl::less< T, false > > & origins() const
Class to manage the bounds of a variable.
std::set< T > getOriginSetOfBounds(const carl::Variable &_var) const
EvalRationalIntervalMap mEvalIntervalMap
The stored exact interval map representing the currently tightest bounds.
std::set< T > getOriginSetOfBounds() const
std::vector< T > getOriginsOfBounds(const carl::Variables &_variables) const
bool addBound(const FormulaT &_formula, const T &_origin)
VariableMap * mpVariableMap
A mapping from arithmetic variables to the variable objects storing the bounds.
const EvalRationalIntervalMap & getEvalIntervalMap() const
Creates an evalintervalmap corresponding to the variable bounds.
std::unordered_set< std::vector< ConstraintT > > mBoundDeductions
Stores deductions which this variable bounds manager has detected.
unsigned removeBound(const FormulaT &_formula, const T &_origin)
VariableBounds()
Constructs a variable bounds manager.
Variable< T > * mpConflictingVariable
A pointer to one of the conflicting variables (its supremum is smaller than its infimum) or NULL if t...
ConstraintsT mNonBoundConstraints
Stores the constraints which cannot be used to infer a bound for a variable.
void print(std::ostream &_out=std::cout, const std::string _init="", bool _printAllBounds=false) const
Prints the variable bounds.
std::set< T > getOriginSetOfBounds(const carl::Variables &_variables) const
std::map< ConstraintT, const Bound< T > * > ConstraintBoundMap
A map from Constraint pointers to Bound pointers.
const smtrat::EvalDoubleIntervalMap & getIntervalMap() const
Creates an interval map corresponding to the variable bounds.
unsigned removeBound(const ConstraintT &_constraint, const T &_origin)
Removes all effects the given constraint has on the variable bounds.
const carl::Interval< double > & getDoubleInterval(const carl::Variable &_var) const
Creates a double interval corresponding to the variable bounds of the given variable.
std::vector< std::pair< std::vector< ConstraintT >, ConstraintT > > getBoundDeductions() const
RationalInterval getInterval(const TermT &_term) const
Creates an interval corresponding to the bounds of the given term.
std::vector< T > getOriginsOfBounds() const
Collect the origins to the supremums and infimums of all variables.
unsigned removeBound(const ConstraintT &_constraint, const T &_origin, carl::Variable *&_changedVariable)
Removes all effects the given constraint has on the variable bounds.
bool isConflicting() const
ConstraintBoundMap * mpConstraintBoundMap
A mapping from constraint pointer to the corresponding bounds.
carl::FastMap< carl::Variable, Variable< T > * > VariableMap
A hash-map from arithmetic variables to variables managing the bounds.
EvalDoubleIntervalMap mDoubleIntervalMap
The stored double interval map representing the currently tightest bounds.
std::set< T > getConflict() const
~VariableBounds()
Destructs a variable bounds manager.
RationalInterval getInterval(carl::Monomial::Arg _mon) const
Creates an interval corresponding to the bounds of the given monomial.
bool addBound(const ConstraintT &_constraint, const T &_origin)
Updates the variable bounds by the given constraint.
const RationalInterval & getInterval(const carl::Variable &_var) const
Creates an interval corresponding to the variable bounds of the given variable.
std::vector< T > getOriginsOfBounds(const carl::Variable &_var) const
std::set< const Bound< T > *, boundPointerComp > BoundSet
A set of bounds.
bool updatedExactInterval() const
const Bound< T > * pInfimum() const
const Bound< T > & infimum() const
bool updateBounds(const Bound< T > &_changedBound)
Updates the infimum and supremum of this variable.
BoundSet mLowerbounds
The set of all lower bounds of this variable.
BoundSet mUpperbounds
The set of all upper bounds of this variable.
const Bound< T > * mpInfimum
The greatest lower bound of this variable.
const Bound< T > * addBound(const ConstraintT &_constraint, const carl::Variable &_var, const T &_origin)
Adds the bound corresponding to the constraint to the given variable.
bool mUpdatedDoubleInterval
A flag that indicates that the stored double interval of this variable is up to date.
void doubleIntervalHasBeenUpdated() const
Sets the flag indicating that the stored double interval representing the variable's bounds is up to ...
const Bound< T > & supremum() const
Variable()
Constructs this variable.
const Bound< T > * mpSupremum
The least upper bound of this variable.
bool mUpdatedExactInterval
A flag that indicates that the stored exact interval of this variable is up to date.
const BoundSet & upperbounds() const
const Bound< T > * pSupremum() const
void exactIntervalHasBeenUpdated() const
Sets the flag indicating that the stored exact interval representing the variable's bounds is up to d...
bool updatedDoubleInterval() const
const BoundSet & lowerbounds() const
std::ostream & operator<<(std::ostream &_os, const VariableBounds< Type > &_vs)
Prints the contents of the given variable bounds manager to the given stream.
Class to create the formulas for axioms.
carl::Constraints< Poly > ConstraintsT
carl::Term< Rational > TermT
carl::Formula< Poly > FormulaT
std::map< carl::Variable, RationalInterval > EvalRationalIntervalMap
carl::Interval< Rational > RationalInterval
carl::Constraint< Poly > ConstraintT
std::map< carl::Variable, DoubleInterval > EvalDoubleIntervalMap
Compares two pointers showing to bounds.
bool operator()(const Bound< T > *const pBoundA, const Bound< T > *const pBoundB) const