SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
ICPModule.h
Go to the documentation of this file.
1 /*
2  * @file ICPModule.h
3  * @author Stefan Schupp <stefan.schupp@cs.rwth-aachen.de>
4  * @author Florian Corzilius <corzilius@cs.rwth-aachen.de>
5  *
6  * Created on October 16, 2012, 1:07 PM
7  */
8 #pragma once
9 
10 #ifdef SMTRAT_DEVOPTION_Validation
11 #define SMTRAT_DEVOPTION_VALIDATION_ICP
12 #endif
13 
14 
15 #include <smtrat-solver/Module.h>
17 #include "IcpVariable.h"
18 #include "../LRAModule/LRAModule.h"
19 #include "../LRAModule/LRASettings.h"
22 #include "IcpVariable.h"
23 #include "ICPSettings.h"
24 #include "utils.h"
25 #include "HistoryNode.h"
26 #include <fstream>
27 #include <queue>
28 
29 namespace smtrat
30 {
31  template<class Settings>
32  class ICPModule:
33  public Module
34  {
35  template<template<typename> class Operator>
36  using Contractor = carl::Contraction<Operator, Poly>;
37 
38  public:
39 
40  /**
41  * Typedefs:
42  */
43  struct comp
44  {
45  // ATTENTION: When weights are equal the _LOWER_ id is preferred
46  bool operator ()( std::pair<double, unsigned> lhs, std::pair<double, unsigned> rhs ) const
47  {
48  return lhs.first < rhs.first || ((lhs.first == rhs.first) && lhs.second > rhs.second);
49  }
50  };
51 
53  {
54  bool operator ()(const FormulaT& _lhs, const FormulaT& _rhs ) const
55  {
56  assert(_lhs.type() == carl::FormulaType::CONSTRAINT);
57  assert(_rhs.type() == carl::FormulaType::CONSTRAINT);
58  return _lhs.constraint() < _rhs.constraint();
59  }
60  };
61 
63  {
66  };
67 
68  struct weights
69  {
70  std::list<linearVariable*> origins;
71  double weight;
72  };
73 
74  typedef carl::FastPointerMap<Poly*, weights> WeightMap;
75 
76  private:
77 
78  /**
79  * Members:
80  */
81  carl::FastMap<Poly, Contractor<carl::SimpleNewton>> mContractors;
83  std::set<icp::ContractionCandidate*, icp::contractionCandidateComp> mActiveNonlinearConstraints; // nonlinear candidates considered
84  std::set<icp::ContractionCandidate*, icp::contractionCandidateComp> mActiveLinearConstraints; // linear candidates considered
85  std::map<const icp::LRAVariable*, ContractionCandidates> mLinearConstraints; // all linear candidates
86  std::map<ConstraintT, ContractionCandidates> mNonlinearConstraints; // all nonlinear candidates
88 
89  std::map<carl::Variable, icp::IcpVariable*> mVariables; // list of occurring variables
90  EvalDoubleIntervalMap mIntervals; // actual intervals relevant for contraction
91  EvalRationalIntervalMap mInitialIntervals; // intervals after linear check
93  std::set<std::pair<double, unsigned>, comp> mIcpRelevantCandidates; // candidates considered for contraction
94 
95  carl::FastMap<FormulaT,FormulaT> mLinearizations; // linearized constraint -> original constraint
96  carl::FastMap<FormulaT,FormulaT> mDeLinearizations; // linearized constraint -> original constraint
97  carl::FastMap<Poly, carl::Variable> mVariableLinearizations; // monome -> variable
98  std::map<carl::Variable, Poly> mSubstitutions; // variable -> monome/variable
99 
100  icp::HistoryNode* mHistoryRoot; // Root-Node of the state-tree
101  icp::HistoryNode* mHistoryActual; // Actual node of the state-tree
102 
103  ModuleInput* mValidationFormula; // ReceivedFormula of the internal LRA Module
105  LRAModule<LRASettingsICP> mLRA; // internal LRA module
106 
107  std::queue<FormulasT> mBoxStorage; // keeps the box before contraction
108  bool mIsIcpInitialized; // initialized ICPModule?
120  #ifdef SMTRAT_DEVOPTION_VALIDATION_ICP
121  FormulaT mCheckContraction;
122  #endif
127 
128  /*
129  * Constants
130  */
131  static const unsigned mSplittingStrategy = 0;
132 
133  public:
135 std::string moduleName() const {
136 return SettingsType::moduleName;
137 }
138 
139  /**
140  * Constructors:
141  */
142  ICPModule( const ModuleInput*, Conditionals&, Manager* const = NULL );
143 
144  /**
145  * Destructor:
146  */
148 
149  // Interfaces.
150  bool informCore( const FormulaT& );
153 
154  /**
155  * Checks the received formula for consistency.
156  * @param _final true, if this satisfiability check will be the last one (for a global sat-check), if its result is SAT
157  * @param _full false, if this module should avoid too expensive procedures and rather return unknown instead.
158  * @param _objective if not set to NO_VARIABLE, the module should find an assignment minimizing this objective variable; otherwise any assignment is good.
159  * @return SAT, if the received formula is satisfiable;
160  * UNSAT, if the received formula is not satisfiable;
161  * Unknown, otherwise.
162  */
164  void updateModel() const;
165 
166  protected:
167 
168  /**
169  * Removes everything related to the sub-formula to remove from the passed formula in the backends of this module.
170  * Afterwards the sub-formula is removed from the passed formula.
171  * @param _subformula The sub-formula to remove from the passed formula.
172  * @param _ignoreOrigins SAT, if the sub-formula shall be removed regardless of its origins (should only be applied with expertise).
173  * @return
174  */
176 
177  private:
178 
179  /**
180  * Methods:
181  */
182 
183  /**
184  * @brief Reset to state before application of this cc.
185  * @details Reset the current state to a state before this contraction was applied. As we only have two states, we check, if this cc has been
186  * used yet and if so, we reset the state, else the state remains unchanged.
187  *
188  * @param _cc [description]
189  */
191 
192  /**
193  *
194  * @param _splitOccurred
195  * @return
196  */
197  void addConstraint( const FormulaT& _formula );
198 
199  /**
200  *
201  * @param _var
202  * @param _original
203  * @param _lraVar
204  * @return
205  */
206  icp::IcpVariable* getIcpVariable( carl::Variable::Arg _var, bool _original, const icp::LRAVariable* _lraVar );
207 
208  /**
209  *
210  * @param _formula
211  */
212  void activateNonlinearConstraint( const FormulaT& _formula );
213 
214  /**
215  *
216  * @param _formula
217  */
218  void activateLinearConstraint( const FormulaT& _formula, const FormulaT& _origin );
219 
220  /**
221  * Performs a consistency check on the linearization of the received constraints.
222  * @param _answer The answer of the consistency check on the linearization of the received constraints.
223  * @return true, if the linear check led to a conclusive answer which should be returned by this module;
224  * false, otherwise.
225  */
226  bool initialLinearCheck( Answer& _answer );
227 
228  /**
229  *
230  * @return
231  */
233 
234  /**
235  *
236  * @param _splitOccurred
237  */
239 
240  /**
241  * @param _final true, if this satisfiability check will be the last one (for a global sat-check), if its result is SAT
242  * @param _full false, if this module should avoid too expensive procedures and rather return unknown instead.
243  * @param _objective if not set to NO_VARIABLE, the module should find an assignment minimizing this objective variable; otherwise any assignment is good.
244  * @return
245  */
246  Answer callBackends( bool _final = false, bool _full = true, carl::Variable _objective = carl::Variable::NO_VARIABLE );
247 
248  /**
249  * Creates the non-linear contraction candidates from all items in mTemporaryMonomes and empties mTemporaryMonomes.
250  */
251  Poly createNonlinearCCs( const ConstraintT& _constraint, const std::vector<Poly>& _tempMonomes );
252 
253  /**
254  * Creates the linear contraction candidates corresponding to the given linear constraint.
255  * @param _constraint
256  * @param _origin
257  */
258  void createLinearCCs( const FormulaT& _constraint, const FormulaT& _original );
259 
260  /**
261  * Fills the IcpRelevantCandidates with all nonlinear and all active linear ContractionCandidates.
262  */
264 
265  /**
266  * Adds the specific candidate to IcpRelevantCandidates.
267  * @param _candidate
268  */
270 
271  /**
272  * Removes a candidate from the icpRelevantCandidates.
273  * @param _candidate
274  */
276 
277  /**
278  * Update all affected candidates and reinsert them into icpRelevantCandidates
279  * @param _var
280  */
281  void updateRelevantCandidates(carl::Variable::Arg _var);
282 
283  /**
284  * Method to determine the next combination of variable and constraint to be contracted
285  * @param _it
286  * @return a pair of variable and constraint
287  */
289 
290  /**
291  * Calls the actual contraction function and implements threshold functionality
292  * @param _selection
293  */
295 
296  void setContraction( icp::ContractionCandidate* _selection, icp::IcpVariable& _icpVar, const DoubleInterval& _contractedInterval );
297 
298  void setContraction( const FormulaT& _constraint, icp::IcpVariable& _icpVar, const DoubleInterval& _contractedInterval, bool _allCCs );
299 
300  /**
301  *
302  * @param _interval
303  * @param _contractedInterval
304  */
305  void updateRelativeContraction( const DoubleInterval& _interval, const DoubleInterval& _contractedInterval );
306 
307  /**
308  *
309  * @param _interval
310  * @param _contractedInterval
311  */
312  void updateAbsoluteContraction( const DoubleInterval& _interval, const DoubleInterval& _contractedInterval );
313 
314  /**
315  *
316  * @param antipoint
317  * @return
318  */
319  std::map<carl::Variable, double> createModel( bool antipoint = false ) const;
320 
321  /**
322  * Selects the next splitting direction according to different heuristics.
323  * @param _targetDiameter
324  * @return
325  */
326  double sizeBasedSplittingImpact( std::map<carl::Variable, icp::IcpVariable*>::const_iterator _varIcpVarMapIter ) const;
327 
328  /**
329  *
330  * @return
331  */
333 
334  std::vector<FormulaT> createPremise();
335 
336  /**
337  *
338  * @param _onlyOriginalVariables
339  * @return
340  */
341  FormulasT createBoxFormula( bool _onlyOriginalVariables );
342 
343  /**
344  *
345  * @param _contractionApplied
346  * @param _moreConstactionFound
347  * @return If a split has happened.
348  */
349  bool performSplit( bool _contractionApplied, bool& _moreContractionFound );
350 
351  bool splitToBoundedIntervalsWithoutZero( carl::Variable& _variable, Rational& _value, bool& _leftCaseWeak, bool& _preferLeftCase, std::vector<std::map<carl::Variable, icp::IcpVariable*>::const_iterator>& _suitableVariables );
352 
353  /**
354  *
355  * @param _variable
356  * @param _value
357  * @param _leftCaseWeak
358  * @param _preferLeftCase
359  */
360  void sizeBasedSplitting( carl::Variable& _variable, Rational& _value, bool& _leftCaseWeak, bool& _preferLeftCase );
361 
362  /**
363  *
364  * @param _variable
365  * @param _value
366  * @param _leftCaseWeak
367  * @param _preferLeftCase
368  * @return
369  */
370  bool satBasedSplitting( carl::Variable& _variable, Rational& _value, bool& _leftCaseWeak, bool& _preferLeftCase );
371 
372  double satBasedSplittingImpact( icp::IcpVariable& _icpVariable, const EvalDoubleIntervalMap& _intervals, const DoubleInterval& _seperatedPart, bool _calculateImpact );
373 
374  void splittingBasedContraction( icp::IcpVariable& _icpVar, const FormulaT& _violatedConstraint, const DoubleInterval& _contractedInterval );
375 
376  /**
377  *
378  * @param _solution
379  * @return
380  */
382 
383  /**
384  * Checks the actual intervalBox with the LRASolver
385  * @return
386  */
388 
389  /**
390  * Creates Bounds and passes them to PassedFormula for the Backends.
391  */
393 
394  public:
397  private:
398  RationalInterval doubleToRationalInterval( carl::Variable::Arg _var, const DoubleInterval& _interval, EvalRationalIntervalMap::const_iterator _initialIntervalIter ) const;
399  FormulaT intervalBoundToFormula( carl::Variable::Arg _var, const DoubleInterval& _interval, EvalRationalIntervalMap::const_iterator _initialIntervalIter, bool _upper ) const;
400 
401  /**
402  * Compute hull of defining origins for set of icpVariables.
403  * @param _reasons
404  * @return
405  */
407 
408 
409  /**
410  * creates constraints for the actual bounds of the original variables.
411  * @return
412  */
413  FormulasT createConstraintsFromBounds( const EvalDoubleIntervalMap& _map, bool _isOriginal = true );
414 
415  /**
416  * Parses obtained deductions from the LRA module and maps them to original constraints or introduces new ones.
417  */
418  FormulaT getReceivedFormulas( const FormulaT& _deduction );
419 
420  /**
421  * Sets the own infeasible subset according to the infeasible subset of the internal lra module.
422  */
424 
426 
427  void addProgress( double _progress );
428 
429  /**
430  * Set all parameters of the module according to the selected HistoryNode
431  * @param _selection the Node which contains the new context
432  */
433  void setBox( icp::HistoryNode* _selection );
434 
435  bool intervalsEmpty( const EvalDoubleIntervalMap& _intervals ) const;
436 
437  bool intervalsEmpty( bool _original = false) const;
438 
440  {
441  for( auto& lcCCs : mLinearConstraints )
442  {
443  if( !contractionCandidatesHaveLegalOrigins( lcCCs.second ) )
444  return false;
445  }
446  for( auto& ncCCs : mNonlinearConstraints )
447  {
448  if( !contractionCandidatesHaveLegalOrigins( ncCCs.second ) )
449  return false;
450  }
451  return true;
452  }
453 
455  {
456  for( auto& cc : _ccs )
457  {
459  return false;
460  }
461  return true;
462  }
463 
465  {
466  for( auto& f : _cc.origin() )
467  {
468  if( !rReceivedFormula().contains( f ) )
469  {
470  std::cout << f << std::endl;
471  return false;
472  }
473  }
474  return true;
475  }
476 
478  {
479  if( fulfillsTarget(mIntervals.at(_cc.derivationVar())) )
480  {
482  {
484  return false;
485  }
486  return true;
487  }
488  return false;
489  }
490 
491  bool fulfillsTarget( const DoubleInterval& _interval ) const
492  {
493  if( _interval.lower_bound_type() == carl::BoundType::INFTY || _interval.upper_bound_type() == carl::BoundType::INFTY )
494  return false;
495  return _interval.diameter() <= mTargetDiameter;
496  }
497 
498  /**
499  * Printout of actual tables of linear constraints, active linear
500  * constraints, nonlinear constraints and active nonlinear constraints.
501  */
502  void debugPrint() const;
503 
504  /**
505  * Prints the mapping from variable to ContractionCandidates which contain this variable.
506  */
508 
509  /**
510  * Prints all icpVariables
511  */
512  void printIcpVariables() const;
513 
514  /**
515  * Prints all icpRelevant candidates with their weight and id
516  */
518 
519  /**
520  * Prints all intervals from mIntervals, should be the same intervals as in mHistoryActual->intervals().
521  */
522  void printIntervals( bool _original = false ) const;
523 
524  /**
525  * Prints all intervals from mIntervals, should be the same intervals as in mHistoryActual->intervals().
526  */
527  void printPreprocessedInput( std::string _init = "" ) const;
528 
529  void printContraction( const icp::ContractionCandidate& _cc, const DoubleInterval& _before, const DoubleInterval& _afterA, const DoubleInterval& _afterB = DoubleInterval::empty_interval(), std::ostream& _out = std::cout ) const;
530  };
531 } // namespace smtrat
Class to create a settings object for the ICPModule.
void activateLinearConstraint(const FormulaT &_formula, const FormulaT &_origin)
bool informCore(const FormulaT &)
bool mLRAFoundSolution
Definition: ICPModule.h:112
void debugPrint() const
Printout of actual tables of linear constraints, active linear constraints, nonlinear constraints and...
bool removeCandidateFromRelevant(icp::ContractionCandidate *_candidate)
Removes a candidate from the icpRelevantCandidates.
Answer callBackends(bool _final=false, bool _full=true, carl::Variable _objective=carl::Variable::NO_VARIABLE)
bool addCandidateToRelevant(icp::ContractionCandidate *_candidate)
Adds the specific candidate to IcpRelevantCandidates.
~ICPModule()
Destructor:
carl::Contraction< Operator, Poly > Contractor
Definition: ICPModule.h:36
smtrat::Conditionals mLRAFoundAnswer
Definition: ICPModule.h:104
std::vector< FormulaT > createPremise()
FormulaSetT createPremiseDeductions()
std::map< const icp::LRAVariable *, ContractionCandidates > mLinearConstraints
Definition: ICPModule.h:85
bool fulfillsTarget(const DoubleInterval &_interval) const
Definition: ICPModule.h:491
std::map< carl::Variable, icp::IcpVariable * > mVariables
Definition: ICPModule.h:89
double mInitialBoxSize
Definition: ICPModule.h:125
bool initialLinearCheck(Answer &_answer)
Performs a consistency check on the linearization of the received constraints.
EvalDoubleIntervalMap mIntervals
Definition: ICPModule.h:90
FormulaT getReceivedFormulas(const FormulaT &_deduction)
Parses obtained deductions from the LRA module and maps them to original constraints or introduces ne...
bool fulfillsTarget(icp::ContractionCandidate &_cc) const
Definition: ICPModule.h:477
bool checkBoxAgainstLinearFeasibleRegion()
Checks the actual intervalBox with the LRASolver.
void createLinearCCs(const FormulaT &_constraint, const FormulaT &_original)
Creates the linear contraction candidates corresponding to the given linear constraint.
void resetHistory(icp::ContractionCandidate *)
Methods:
std::set< icp::ContractionCandidate *, icp::contractionCandidateComp > mActiveNonlinearConstraints
Definition: ICPModule.h:83
bool contractionCandidatesHaveLegalOrigins(const ContractionCandidates &_ccs) const
Definition: ICPModule.h:454
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 th...
double mDefaultSplittingSize
Definition: ICPModule.h:115
void remapAndSetLraInfeasibleSubsets()
Sets the own infeasible subset according to the infeasible subset of the internal lra module.
void setContraction(const FormulaT &_constraint, icp::IcpVariable &_icpVar, const DoubleInterval &_contractedInterval, bool _allCCs)
icp::HistoryNode * mHistoryActual
Definition: ICPModule.h:101
bool mIsIcpInitialized
Definition: ICPModule.h:108
Settings SettingsType
Definition: ICPModule.h:134
carl::FastPointerMap< Poly *, weights > WeightMap
Definition: ICPModule.h:74
SplittingHeuristic mSplittingHeuristic
Definition: ICPModule.h:116
std::map< ConstraintT, ContractionCandidates > mNonlinearConstraints
Definition: ICPModule.h:86
double satBasedSplittingImpact(icp::IcpVariable &_icpVariable, const EvalDoubleIntervalMap &_intervals, const DoubleInterval &_seperatedPart, bool _calculateImpact)
double mTargetDiameter
Definition: ICPModule.h:113
bool intervalsEmpty(const EvalDoubleIntervalMap &_intervals) const
double mRelativeContraction
Definition: ICPModule.h:118
carl::FastMap< Poly, Contractor< carl::SimpleNewton > > mContractors
Members:
Definition: ICPModule.h:81
void printIcpRelevantCandidates() const
Prints all icpRelevant candidates with their weight and id.
FormulasT getCurrentBoxAsFormulas() const
FormulasT createBoxFormula(bool _onlyOriginalVariables)
std::set< icp::ContractionCandidate *, icp::contractionCandidateComp > mActiveLinearConstraints
Definition: ICPModule.h:84
RationalInterval doubleToRationalInterval(carl::Variable::Arg _var, const DoubleInterval &_interval, EvalRationalIntervalMap::const_iterator _initialIntervalIter) const
void contraction(icp::ContractionCandidate *_selection)
Calls the actual contraction function and implements threshold functionality.
bool performSplit(bool _contractionApplied, bool &_moreContractionFound)
Poly createNonlinearCCs(const ConstraintT &_constraint, const std::vector< Poly > &_tempMonomes)
Creates the non-linear contraction candidates from all items in mTemporaryMonomes and empties mTempor...
unsigned mNumberOfReusagesAfterTargetDiameterReached
Definition: ICPModule.h:117
carl::FastMap< FormulaT, FormulaT > mDeLinearizations
Definition: ICPModule.h:96
Model mFoundSolution
Definition: ICPModule.h:92
void printAffectedCandidates() const
Prints the mapping from variable to ContractionCandidates which contain this variable.
bool splitToBoundedIntervalsWithoutZero(carl::Variable &_variable, Rational &_value, bool &_leftCaseWeak, bool &_preferLeftCase, std::vector< std::map< carl::Variable, icp::IcpVariable * >::const_iterator > &_suitableVariables)
std::string moduleName() const
Definition: ICPModule.h:135
void updateAbsoluteContraction(const DoubleInterval &_interval, const DoubleInterval &_contractedInterval)
double mGlobalBoxSize
Definition: ICPModule.h:124
icp::ContractionCandidateManager mCandidateManager
Definition: ICPModule.h:82
FormulaSetT mNotEqualConstraints
Definition: ICPModule.h:87
void removeCore(ModuleInput::const_iterator)
void addConstraint(const FormulaT &_formula)
void splittingBasedContraction(icp::IcpVariable &_icpVar, const FormulaT &_violatedConstraint, const DoubleInterval &_contractedInterval)
void updateRelevantCandidates(carl::Variable::Arg _var)
Update all affected candidates and reinsert them into icpRelevantCandidates.
double mCovererdRegionSize
Definition: ICPModule.h:126
FormulaT intervalBoundToFormula(carl::Variable::Arg _var, const DoubleInterval &_interval, EvalRationalIntervalMap::const_iterator _initialIntervalIter, bool _upper) const
void printIcpVariables() const
Prints all icpVariables.
Answer checkCore()
Checks the received formula for consistency.
EvalRationalIntervalMap getCurrentBoxAsIntervals() const
bool intervalsEmpty(bool _original=false) const
void addProgress(double _progress)
void updateModel() const
Updates the model, if the solver has detected the consistency of the received formula,...
void setContraction(icp::ContractionCandidate *_selection, icp::IcpVariable &_icpVar, const DoubleInterval &_contractedInterval)
LRAModule< LRASettingsICP > mLRA
Definition: ICPModule.h:105
icp::HistoryNode * mHistoryRoot
Definition: ICPModule.h:100
ModuleInput * mValidationFormula
Definition: ICPModule.h:103
double calculateCurrentBoxSize()
icp::ContractionCandidate * chooseContractionCandidate()
Method to determine the next combination of variable and constraint to be contracted.
FormulasT createConstraintsFromBounds(const EvalDoubleIntervalMap &_map, bool _isOriginal=true)
creates constraints for the actual bounds of the original variables.
void printPreprocessedInput(std::string _init="") const
Prints all intervals from mIntervals, should be the same intervals as in mHistoryActual->intervals().
bool contractionCandidateHasLegalOrigins(const icp::ContractionCandidate &_cc) const
Definition: ICPModule.h:464
bool mOriginalVariableIntervalContracted
Definition: ICPModule.h:111
bool addCore(ModuleInput::const_iterator)
double mContractionThreshold
Definition: ICPModule.h:114
bool contractionCandidatesHaveLegalOrigins() const
Definition: ICPModule.h:439
carl::FastMap< Poly, carl::Variable > mVariableLinearizations
Definition: ICPModule.h:97
EvalRationalIntervalMap mInitialIntervals
Definition: ICPModule.h:91
void pushBoundsToPassedFormula()
Creates Bounds and passes them to PassedFormula for the Backends.
std::map< carl::Variable, Poly > mSubstitutions
Definition: ICPModule.h:98
std::map< carl::Variable, double > createModel(bool antipoint=false) const
ICPModule(const ModuleInput *, Conditionals &, Manager *const =NULL)
Constructors:
bool checkNotEqualConstraints()
void printIntervals(bool _original=false) const
Prints all intervals from mIntervals, should be the same intervals as in mHistoryActual->intervals().
FormulasT variableReasonHull(icp::set_icpVariable &_reasons)
Compute hull of defining origins for set of icpVariables.
carl::FastMap< FormulaT, FormulaT > mLinearizations
Definition: ICPModule.h:95
std::queue< FormulasT > mBoxStorage
Definition: ICPModule.h:107
void contractCurrentBox()
void printContraction(const icp::ContractionCandidate &_cc, const DoubleInterval &_before, const DoubleInterval &_afterA, const DoubleInterval &_afterB=DoubleInterval::empty_interval(), std::ostream &_out=std::cout) const
void setBox(icp::HistoryNode *_selection)
Set all parameters of the module according to the selected HistoryNode.
icp::IcpVariable * getIcpVariable(carl::Variable::Arg _var, bool _original, const icp::LRAVariable *_lraVar)
void sizeBasedSplitting(carl::Variable &_variable, Rational &_value, bool &_leftCaseWeak, bool &_preferLeftCase)
double sizeBasedSplittingImpact(std::map< carl::Variable, icp::IcpVariable * >::const_iterator _varIcpVarMapIter) const
Selects the next splitting direction according to different heuristics.
bool satBasedSplitting(carl::Variable &_variable, Rational &_value, bool &_leftCaseWeak, bool &_preferLeftCase)
void fillCandidates()
Fills the IcpRelevantCandidates with all nonlinear and all active linear ContractionCandidates.
static const unsigned mSplittingStrategy
Definition: ICPModule.h:131
std::set< std::pair< double, unsigned >, comp > mIcpRelevantCandidates
Definition: ICPModule.h:93
void activateNonlinearConstraint(const FormulaT &_formula)
void updateRelativeContraction(const DoubleInterval &_interval, const DoubleInterval &_contractedInterval)
double mAbsoluteContraction
Definition: ICPModule.h:119
A module which performs the Simplex method on the linear part of it's received formula.
Definition: LRAModule.h:30
Base class for solvers.
Definition: Manager.h:34
The input formula a module has to consider for it's satisfiability check.
Definition: ModuleInput.h:131
super::const_iterator const_iterator
Passing through the list::const_iterator.
Definition: ModuleInput.h:146
super::iterator iterator
Passing through the list::iterator.
Definition: ModuleInput.h:144
A base class for all kind of theory solving methods.
Definition: Module.h:70
const ModuleInput & rReceivedFormula() const
Definition: Module.h:439
carl::Variable::Arg derivationVar() const
const FormulaSetT & origin() const
std::set< const IcpVariable *, icpVariableComp > set_icpVariable
Definition: IcpVariable.h:336
bool contains(const std::vector< TagPoly > &polys, const Poly &poly)
Definition: utils.h:314
Class to create the formulas for axioms.
carl::FormulaSet< Poly > FormulaSetT
Definition: types.h:41
SplittingHeuristic
Definition: ICPSettings.h:15
std::set< icp::ContractionCandidate *, icp::contractionCandidateComp > ContractionCandidates
Definition: IcpVariable.h:18
carl::Formula< Poly > FormulaT
Definition: types.h:37
const settings::Settings & Settings()
Definition: Settings.h:96
carl::Model< Rational, Poly > Model
Definition: model.h:13
carl::Interval< double > DoubleInterval
Definition: model.h:26
std::map< carl::Variable, RationalInterval > EvalRationalIntervalMap
Definition: model.h:30
carl::Interval< Rational > RationalInterval
Definition: model.h:27
carl::MultivariatePolynomial< Rational > Poly
Definition: types.h:25
Answer
An enum with the possible answers a Module can give.
Definition: types.h:57
std::vector< std::atomic_bool * > Conditionals
A vector of atomic bool pointers.
Definition: types.h:17
carl::Constraint< Poly > ConstraintT
Definition: types.h:29
carl::Formulas< Poly > FormulasT
Definition: types.h:39
mpq_class Rational
Definition: types.h:19
std::map< carl::Variable, DoubleInterval > EvalDoubleIntervalMap
Definition: model.h:29
bool operator()(std::pair< double, unsigned > lhs, std::pair< double, unsigned > rhs) const
Definition: ICPModule.h:46
bool operator()(const FormulaT &_lhs, const FormulaT &_rhs) const
Definition: ICPModule.h:54
std::list< linearVariable * > origins
Definition: ICPModule.h:70