31 std::map<carl::Variable, std::set<ConstraintT> >
mReasons;
87 EvalDoubleIntervalMap::const_iterator intervalIt;
88 for( intervalIt = _map.begin(); intervalIt != _map.end(); ++intervalIt )
92 if(
mIntervals.at((*intervalIt).first) != (*intervalIt).second )
93 mIntervals[(*intervalIt).first] = (*intervalIt).second;
96 mIntervals[(*intervalIt).first] = (*intervalIt).second;
122 for( EvalDoubleIntervalMap::const_iterator intervalIt =
mIntervals.begin(); intervalIt !=
mIntervals.end();
125 if( (*intervalIt).second.is_empty() )
141 for(
auto originIt = (*candidateIt)->origin().begin(); originIt != (*candidateIt)->origin().end(); ++originIt )
153 for(
auto originIt = (*candidateIt)->origin().begin(); originIt != (*candidateIt)->origin().end(); ++originIt )
155 _result.push_back(*originIt);
182 if(!_addOnlyConstraint)
185 for(
auto variable: _constraint.variables() )
199 if(!_addOnlyVariable)
215 for( set_icpVariable::iterator variableIt = _variables.begin(); variableIt != _variables.end(); ++variableIt )
219 assert(!_candidate->
origin().empty());
221 for(
auto originIt = _candidate->
rOrigin().begin(); originIt != _candidate->
rOrigin().end(); ++originIt )
230 std::map<carl::Variable, std::set<ConstraintT>>&
rReasons()
235 const std::map<carl::Variable, std::set<ConstraintT>>&
reasons()
const
241 std::set<ConstraintT>&
reasons( carl::Variable::Arg _variable )
250 mReasons[_variable] = std::set<ConstraintT>();
252 bool inserted =
mReasons.at( _variable ).insert( _reason ).second;
255 for(
auto var: _reason.variables() )
265 void addReasons( carl::Variable::Arg _variable,
const std::set<ConstraintT>& _reasons )
267 for( std::set<ConstraintT>::iterator reasonsIt = _reasons.begin(); reasonsIt != _reasons.end(); ++reasonsIt )
274 bool contained =
false;
275 auto minimal = _origins.begin();
276 for(
auto originIt = _origins.begin(); originIt != _origins.end(); ++originIt )
278 if(
mReasons.at( _variable ).find( originIt->constraint() ) !=
mReasons.at( _variable ).end() )
283 if( originIt->constraint().variables().size() < minimal->constraint().variables().size() )
287 addReason( _variable, minimal->constraint() );
297 for( set_icpVariable::iterator variableIt = _variables.begin(); variableIt != _variables.end(); ++variableIt )
336 for( set_icpVariable::iterator collectedVarIt =
result.begin(); collectedVarIt !=
result.end(); ++collectedVarIt )
343 void print( std::ostream& _out = std::cout )
const
345 _out <<
"Intervals: " << std::endl;
346 for( EvalDoubleIntervalMap::const_iterator intervalIt =
mIntervals.begin(); intervalIt !=
mIntervals.end();
349 _out << (*intervalIt).first <<
"\t : " << (*intervalIt).second << std::endl;
351 _out <<
"Applied Contractions: ";
355 for( std::set<const ContractionCandidate*>::iterator candidateIt =
mAppliedContractions.begin();
358 (*candidateIt)->print();
362 _out <<
"None" << std::endl;
363 _out <<
"Infeasible Variables: ";
372 _out <<
"None" << std::endl;
375 _out <<
"Infeasible Constraints: ";
380 _out << *constraintIt << std::endl;
384 _out <<
"None" << std::endl;
391 _out <<
"Reasons(" <<
mReasons.size() <<
")" << std::endl;
392 for( std::map<carl::Variable, std::set<ConstraintT> >::const_iterator variablesIt =
mReasons.begin();
393 variablesIt !=
mReasons.end(); ++variablesIt )
395 _out << (*variablesIt).first <<
":\t";
396 for( std::set<ConstraintT>::const_iterator reasonIt = (*variablesIt).second.begin(); reasonIt != (*variablesIt).second.end(); ++reasonIt )
398 _out << *reasonIt <<
", ";
407 for( std::map<carl::Variable, set_icpVariable>::const_iterator variablesIt =
mVariableReasons.begin();
410 _out << (*variablesIt).first <<
":\t";
411 for( set_icpVariable::const_iterator reasonIt = (*variablesIt).second.begin();
412 reasonIt != (*variablesIt).second.end(); ++reasonIt )
414 _out << **reasonIt <<
", ";
416 std::cout << std::endl;
441 for( set_icpVariable::iterator varIt = variables.begin(); varIt != variables.end(); ++varIt )
443 if( _result.insert( *varIt ).second )
carl::Variable::Arg derivationVar() const
const FormulaSetT & origin() const
void addVariableReasons(carl::Variable::Arg _variable, set_icpVariable _variables)
bool addInfeasibleConstraint(const ConstraintT &_constraint, bool _addOnlyConstraint=false)
std::set< const ContractionCandidate * > appliedContractions()
FormulaSetT appliedConstraints()
set_icpVariable variableReasons(carl::Variable::Arg _variable)
std::set< ConstraintT > mStateInfeasibleConstraints
std::map< carl::Variable, std::set< ConstraintT > > mReasons
std::map< carl::Variable, set_icpVariable > & rVariableReasons()
void propagateStateInfeasibleConstraints(HistoryNode *_target) const
const std::set< ConstraintT > & stateInfeasibleConstraints() const
EvalDoubleIntervalMap mIntervals
Members.
void appliedConstraints(std::vector< FormulaT > &_result)
void addVariableReason(carl::Variable::Arg _variable, const IcpVariable *_reason)
void addReasons(carl::Variable::Arg _variable, const std::set< ConstraintT > &_reasons)
void addReason(carl::Variable::Arg _variable, const ConstraintT &_reason)
HistoryNode(const EvalDoubleIntervalMap &_intervals)
bool hasEmptyInterval() const
void propagateStateInfeasibleVariables(HistoryNode *_target) const
std::set< ConstraintT > & reasons(carl::Variable::Arg _variable)
void variableHull(carl::Variable::Arg _variable, set_icpVariable &_result) const
std::set< ConstraintT > & rStateInfeasibleConstraints()
void addReasons(carl::Variable::Arg _variable, const FormulasT &_origins)
std::map< carl::Variable, std::set< ConstraintT > > & rReasons()
bool addInfeasibleVariable(const IcpVariable *_variable, bool _addOnlyVariable=false)
const std::map< carl::Variable, set_icpVariable > & variableReasons()
void printReasons(std::ostream &_out=std::cout) const
set_icpVariable mStateInfeasibleVariables
DoubleInterval & getInterval(carl::Variable::Arg _variable)
set_icpVariable stateInfeasibleVariables() const
void setIntervals(const EvalDoubleIntervalMap &_map)
const std::map< carl::Variable, std::set< ConstraintT > > & reasons() const
void addContraction(ContractionCandidate *_candidate, const set_icpVariable &_variables)
void gatherVariables(carl::Variable::Arg _var, set_icpVariable &_result) const
Functions.
EvalDoubleIntervalMap & rIntervals()
bool addInterval(carl::Variable::Arg _var, const DoubleInterval &_interval)
updates or inserts an interval into the actual map
set_icpVariable & rStateInfeasibleVariables()
const EvalDoubleIntervalMap & intervals() const
Getters and Setters.
std::map< carl::Variable, set_icpVariable > mVariableReasons
void printVariableReasons(std::ostream &_out=std::cout) const
std::set< const ContractionCandidate * > mAppliedContractions
void print(std::ostream &_out=std::cout) const
const std::set< const ContractionCandidate * > & getCandidates() const
carl::Variable::Arg var() const
std::set< const IcpVariable *, icpVariableComp > set_icpVariable
Class to create the formulas for axioms.
carl::FormulaSet< Poly > FormulaSetT
carl::Interval< double > DoubleInterval
carl::Constraint< Poly > ConstraintT
carl::Formulas< Poly > FormulasT
std::map< carl::Variable, DoubleInterval > EvalDoubleIntervalMap