SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
State.h
Go to the documentation of this file.
1 /**
2  * Class to create a decision tuple object.
3  * @author Florian Corzilius
4  * @since 2010-05-11
5  * @version 2013-10-24
6  */
7 
8 #pragma once
9 
10 #include <map>
11 #include <limits.h>
12 #include "Substitution.h"
13 #include <carl-common/memory/IDPool.h>
15 #include "VSSettings.h"
16 
17 #ifdef SMTRAT_DEVOPTION_Statistics
18 #include "VSStatistics.h"
19 #endif
20 
21 #define VS_STATE_DEBUG_METHODS
22 
23 namespace smtrat {
24 namespace vs
25 {
26 
27  // Type and object definitions.
28  typedef std::set< carl::PointerSet<Condition> > ConditionSetSet;
29  typedef std::set< ConditionSetSet > ConditionSetSetSet;
30  typedef std::list< const Condition* > ConditionList;
31  typedef std::vector< ConditionList > DisjunctionOfConditionConjunctions;
32 
33  typedef std::pair<size_t, std::pair<size_t, size_t> > UnsignedTriple;
34 
35  // Forward declaration.
36  class State;
37 
39  {
41  {
42  if( n1.first > n2.first )
43  return true;
44  else if( n1.first == n2.first )
45  {
46  if( n1.first != 1 )
47  return n1.second.first > n2.second.first;
48  else
49  {
50  if( n1.second.second < n2.second.second )
51  return true;
52  else if( n1.second.second == n2.second.second )
53  return n1.second.first > n2.second.first;
54  return false;
55  }
56  }
57  else
58  return false;
59  }
60  };
61  typedef std::pair<UnsignedTriple, vs::State*> ValStatePair;
62  typedef std::map<UnsignedTriple, vs::State*, unsignedTripleCmp> ValuationMap;
63 
64  class State
65  {
66  public:
67  // Internal type definitions.
69 
70  typedef carl::FastPointerMapB<Substitution,ConditionSetSetSet> ConflictSets;
71  typedef std::vector<std::pair< ConditionList, bool>> SubstitutionResult;
72  typedef std::vector<SubstitutionResult> SubstitutionResults;
73  typedef std::vector<std::pair< unsigned, unsigned>> SubResultCombination;
75  private:
76 
77  // Members:
78 
79  /// A flag indicating whether the conditions this state considers are simplified.
81  /// A flag indicating whether there are states that are children of this state and must
82  /// be still considered in the further progress of finding a solution.
84  /// A flag that indicates whether this state has conditions in its considered list of
85  /// conditions, which were recently added and, hence, must be propagated further.
87  /// A flag that indicates whether this state is already inconsistent. Note that if it
88  /// is set to false, it does not necessarily mean that this state is consistent.
90  /// A flag indicating whether this state has already marked as deleted, which means
91  /// that there is no need to consider it in the further progress of finding a solution.
93  /// A flag indicating whether the substitution results this state are simplified.
95  /// A flag indicating whether to take the current combination of substitution results
96  /// once again.
98  /// A flag indicating whether the test candidate contained by this state has already been
99  /// check for the bounds of the variables.
101  /// A flag indicating whether this state has been progressed until a point where a condition
102  /// must be involved having a too high degree to tackle with virtual substitution. Note, that
103  /// this flag is also set to true if heuristics decide that the combinatorial blow up using
104  /// virtual substitution for the considered list of conditions of this state is too high.
105  /// If this flag is set to true, it the state is delayed until a point where only such state
106  /// remain and a backend must be involved.
108  ///
110  /// A flag indicating whether the index (the variable to eliminate in this state) should be
111  /// reconsidered and maybe changed.
113  /// A heuristically determined value stating the expected difficulty of this state's considered
114  /// conditions to be solved by a backend. The higher this value, the easier it should be to
115  /// solve this state's considered conditions.
117  /// A unique id identifying this state.
118  size_t mID;
119  /// A heuristically determined value stating the expected difficulty of this state's considered
120  /// conditions to be solved by virtual substitution. The higher this value, the easier it should be to
121  /// solve this state's considered conditions. Furthermore, this value enforces currently a depth first
122  /// search, as a child has always a higher valuation than its father.
123  size_t mValuation;
124  /// The type of this state, which states whether this state has still a substitution to apply or either
125  /// test candidates shall be generated or a new combination of the substitution results must be found
126  /// in order to consider it next.
128  /// The variable which is going to be eliminated from this state's considered conditions. That means,
129  /// this variable won't occur in the children of this state.
130  carl::Variable mIndex;
131  /// If the test candidate considered by this state stems from a condition for which it is enough to
132  /// consider it only for test candidate generation for finding the satisfiability of the conditions
133  /// it occurs in, this member stores that condition. It is necessary, as it must be part of the origins
134  /// (conditions in the father of this state) of any conflict found in this state.
136  /// The father state of this state.
138  /// The substitution this state considers. Note that it is NULL if this state is the root.
140  /// The vector storing the substitution results, that is for each application of the substitution in
141  /// this state to one of its considered conditions a disjunction of conjunctions of constraints.
143  /// The currently considered combination of conjunctions of constraints in the substitution
144  /// result vector, which form the currently considered conditions of this state (store in mpConditions).
146  /// The currently considered conditions of this state, for which the satisfiability must be checked.
148  /// Stores for each already considered and failed test candidate all conflicts which have been found for it.
150  /// The children states of this state. For each test candidate we generate for the conditions this state
151  /// considers such a child is created.
152  std::list< State* >* mpChildren;
153  /// The conditions of this state, which cannot be solved by the virtual substitution.
154  carl::PointerSet<Condition>* mpTooHighDegreeConditions;
155  /// A pointer to an object which manages and stores the bounds on the variables occurring in this state.
156  /// These bounds are filtered from the conditions this state considers. Note that if we do not use
157  /// optimizations based on variable bounds.
159  ///
161  ///
163  ///
165  ///
167  ///
168  carl::IDPool* mpConditionIdAllocator;
169  ///
170  std::vector<std::pair<carl::Variable,std::multiset<double>>> mRealVarVals;
171  ///
172  std::vector<std::pair<carl::Variable,std::multiset<double>>> mIntVarVals;
173  ///
174  std::vector<size_t> mBestVarVals;
175 
176  #ifdef SMTRAT_DEVOPTION_Statistics
177  /// Stores all collected statistics during solving.
178  smtrat::VSStatistics* mpStatistics;
179  #endif
180 
181  public:
182 
183  /**
184  * Constructs an empty state (no conditions yet) being the root (hence neither a substitution) of the state
185  * tree which is going to be formed when applying the satisfiability check based on virtual substitution.
186  * @param _withVariableBounds A flag that indicates whether to use optimizations based on variable bounds.
187  */
188  State( carl::IDPool* _conditionIdAllocator, bool _withVariableBounds );
189 
190  /**
191  * Constructs a state being a child of the given state and containing the given substitution, which maps
192  * from the index variable of the given state.
193  * @param _father The father of the state to be constructed.
194  * @param _substitution The substitution of the state to be constructed.
195  * @param _withVariableBounds A flag that indicates whether to use optimizations based on variable bounds.
196  */
197  State( State* const _father, const Substitution& _substitution, carl::IDPool* _conditionIdAllocator, bool _withVariableBounds );
198 
199  State( const State& ) = delete;
200 
201  /**
202  * Destructor.
203  */
204  ~State();
205 
206  /**
207  * @return The root of the state tree where this state is part from.
208  */
209  bool isRoot() const
210  {
211  return mpFather == NULL;
212  }
213 
214  /**
215  * @return A constant reference to the flag indicating whether a condition with too high degree for
216  * the virtual substitution method must be considered.
217  */
218  bool cannotBeSolved( bool _lazy ) const
219  {
220  return mCannotBeSolved || (_lazy && mCannotBeSolvedLazy);
221  }
222 
223  /**
224  * @return A reference to the flag indicating whether a condition with too high degree for
225  * the virtual substitution method must be considered.
226  */
228  {
229  return mCannotBeSolved;
230  }
231 
232  /**
233  * @return A reference to the flag indicating whether a condition with too high degree for
234  * the virtual substitution method must be considered.
235  */
237  {
238  return mCannotBeSolvedLazy;
239  }
240 
241  /**
242  * @return A constant reference to the flag indicating whether this state is marked as deleted, which
243  * means that there is no need to consider it in the further progress of finding a solution.
244  */
245  bool markedAsDeleted() const
246  {
247  return mMarkedAsDeleted;
248  }
249 
250  /**
251  * @return A reference to the flag indicating whether this state is marked as deleted, which
252  * means that there is no need to consider it in the further progress of finding a solution.
253  */
255  {
256  return mMarkedAsDeleted;
257  }
258 
259  /**
260  * @return A constant reference to the flag indicating whether there are states that are children
261  * of this state and must be still considered in the further progress of finding a solution.
262  */
263  bool hasChildrenToInsert() const
264  {
265  return mHasChildrenToInsert;
266  }
267 
268  /**
269  * @return A reference to the flag indicating whether there are states that are children
270  * of this state and must be still considered in the further progress of finding a solution.
271  */
273  {
274  return mHasChildrenToInsert;
275  }
276 
277  /**
278  * @return A constant reference to the variable which is going to be eliminated from this state's
279  * considered conditions. Note, if there is no variable decided to be eliminated, this
280  * method will fail.
281  */
282  carl::Variable::Arg index() const
283  {
284  return mIndex;
285  }
286 
287  /**
288  * @return The heuristically determined valuation of this state (see for the description of the
289  * corresponding member).
290  */
291  size_t valuation() const
292  {
293  return mValuation;
294  }
295 
296  /**
297  * @return The valuation of the state's considered conditions for a possible backend call.
298  */
299  size_t backendCallValuation() const
300  {
301  return mBackendCallValuation;
302  }
303 
304  /**
305  * @return The id of this state.
306  */
307  size_t id() const
308  {
309  return mID;
310  }
311 
312  /**
313  * @return A reference to the id of this state.
314  */
315  size_t& rID()
316  {
317  return mID;
318  }
319 
320  /**
321  * @return A reference to the vector of the children of this state.
322  */
323  std::list<State*>& rChildren()
324  {
325  return *mpChildren;
326  }
327 
328  /**
329  * @return A constant reference to the vector of the children of this state.
330  */
331  const std::list<State*>& children() const
332  {
333  return *mpChildren;
334  }
335 
336  /**
337  * @return A pointer to the father of this state. It is NULL if this state is the root.
338  */
339  State* pFather() const
340  {
341  return mpFather;
342  }
343 
344  /**
345  * @return A constant reference to the father of this state. This method fails if this state is the root.
346  */
347  const State& father() const
348  {
349  return *mpFather;
350  }
351 
352  /**
353  * @return A reference to the father of this state. This method fails if this state is the root.
354  */
356  {
357  return *mpFather;
358  }
359 
360  /**
361  * @return A reference to the conflict sets of this state.
362  */
364  {
365  return *mpConflictSets;
366  }
367 
368  /**
369  * @return A constant reference to the conflict sets of this state.
370  */
371  const ConflictSets& conflictSets() const
372  {
373  return *mpConflictSets;
374  }
375 
376  /**
377  * @return A reference to the flag indicating that this state has a recently added condition in
378  * its considered conditions.
379  */
381  {
383  }
384 
385  /**
386  * @return true, if this state has a recently added condition in its considered conditions.
387  */
389  {
391  }
392 
393  /**
394  * @return A reference to the flag indicating whether this state's considered conditions are inconsistent.
395  * Note that if it is false, it does not necessarily mean that this state is consistent.
396  */
398  {
399  return mInconsistent;
400  }
401 
402  /**
403  * @return true if this state's considered conditions are inconsistent;
404  * false, otherwise, which does not necessarily mean that this state is consistent.
405  */
406  bool isInconsistent() const
407  {
408  return mInconsistent;
409  }
410 
411  /**
412  * @return A reference to the currently considered conditions of this state.
413  */
415  {
416  return *mpConditions;
417  }
418 
419  /**
420  * @return A constant reference to the currently considered conditions of this state.
421  */
422  const ConditionList& conditions() const
423  {
424  return *mpConditions;
425  }
426 
427  /**
428  * @return A reference to the substitution this state considers. Note that this method fails,
429  * if this state is the root.
430  */
432  {
433  return *mpSubstitution;
434  }
435 
436  /**
437  * @return A constant reference to the substitution this state considers. Note that this method fails,
438  * if this state is the root.
439  */
440  const Substitution& substitution() const
441  {
442  return *mpSubstitution;
443  }
444 
445  /**
446  * @return A reference to the substitution results of this state. Make sure that the substitution
447  * results exist when calling this method. (using, e.g., hasSubstitutionResults())
448  */
450  {
451  return *mpSubstitutionResults;
452  }
453 
454  /**
455  * @return A constant reference to the substitution results of this state. Make sure that the substitution
456  * results exist when calling this method. (using, e.g., hasSubstitutionResults())
457  */
459  {
460  return *mpSubstitutionResults;
461  }
462 
463  /**
464  * @return A reference to the current combination of conjunction of constraints within the substitution
465  * results of this state. Make sure that a substitution result combination exists when calling
466  * this method. (using, e.g., hasSubResultsCombination())
467  */
469  {
470  return *mpSubResultCombination;
471  }
472 
473  /**
474  * @return A constant reference to the current combination of conjunction of constraints within the substitution
475  * results of this state. Make sure that a substitution result combination exists when calling
476  * this method. (using, e.g., hasSubResultsCombination())
477  */
479  {
480  return *mpSubResultCombination;
481  }
482 
483  /**
484  * @return A pointer to the substitution of this state, which is NULL, if this state is the root.
485  */
487  {
488  return mpSubstitution;
489  }
490 
491  /**
492  * @return true, if the considered conditions of this state are already simplified.
493  */
494  bool conditionsSimplified() const
495  {
496  return mConditionsSimplified;
497  }
498 
499  /**
500  * @return true, if the substitution results of this state are already simplified.
501  */
502  bool subResultsSimplified() const
503  {
504  return mSubResultsSimplified;
505  }
506 
507  /**
508  * @return A reference to the flag indicating whether the substitution results of this state are already simplified.
509  */
511  {
512  return mSubResultsSimplified;
513  }
514 
515  /**
516  * @return true, if the current substitution result combination has to be consider once again before considering
517  * the next one.
518  */
520  {
522  }
523 
524  /**
525  * @return A reference to the flag indicating whether the current substitution result combination has to be consider
526  * once again before considering the next one.
527  */
529  {
531  }
532 
533  /**
534  * @return true, if the index variable of this state shall be recalculated.
535  */
536  bool tryToRefreshIndex() const
537  {
538  return mTryToRefreshIndex;
539  }
540 
541  /**
542  * @return true, if this state has a substitution result combination.
543  */
545  {
546  return (mpSubResultCombination!=NULL && !mpSubResultCombination->empty());
547  }
548 
549  /**
550  * @return true, if this state has substitution results.
551  */
553  {
554  return mpSubstitutionResults!=NULL;
555  }
556 
557  /**
558  * @return true, if the currently considered substitution result combination can be extended by
559  * taking further substitution results into account.
560  */
561  bool unfinished() const
562  {
563  return (mpSubstitutionResults->size()>mpSubResultCombination->size());
564  }
565 
566  /**
567  * @return The type of this state: This state has still a substitution to apply or either
568  * test candidates shall be generated or a new combination of the substitution results must be found
569  * in order to consider it next.
570  */
571  Type type() const
572  {
573  return mType;
574  }
575 
576  /**
577  * @return A constant reference to the type of this state: This state has still a substitution to
578  * apply or either test candidates shall be generated or a new combination of the substitution
579  * results must be found in order to consider it next.
580  */
582  {
583  return mType;
584  }
585 
586  /**
587  * @return A pointer to the original condition of this state or NULL, if there is no such condition.
588  * For further information see the description of the corresponding member.
589  */
591  {
592  return mpOriginalCondition;
593  }
594 
595  /**
596  * @return A reference to the original conditions of this state. Note that if there is no such condition,
597  * this method fails. For further information see the description of the corresponding member.
598  */
600  {
601  return *mpOriginalCondition;
602  }
603 
604  /**
605  * @return A constant reference to the conditions of those this state currently considers, which have a
606  * too high degree to be tackled of the virtual substitution method.
607  */
608  const carl::PointerSet<Condition>& tooHighDegreeConditions() const
609  {
611  }
612 
613  /**
614  * @return A reference to the conditions of those this state currently considers, which have a
615  * too high degree to be tackled of the virtual substitution method.
616  */
617  carl::PointerSet<Condition>& rTooHighDegreeConditions()
618  {
620  }
621 
622  /**
623  * @return A constant reference to the object managing and storing the variable's bounds which were
624  * extracted from the currently considered conditions of this state.
625  */
627  {
628  assert( mpVariableBounds != NULL );
629  return *mpVariableBounds;
630  }
631 
632  /**
633  * @return A reference to the object managing and storing the variable's bounds which were
634  * extracted from the currently considered conditions of this state.
635  */
637  {
638  assert( mpVariableBounds != NULL );
639  return *mpVariableBounds;
640  }
641 
642  /**
643  * Sets the pointer of the original condition of this state to the given pointer to a condition.
644  * @param _pOCondition The pointer to set the original condition to.
645  */
646  void setOriginalCondition( const Condition* _pOCondition )
647  {
648  mpOriginalCondition = _pOCondition;
649  }
650 
651  /**
652  *
653  */
654  size_t currentRangeSize() const
655  {
656  return mCurrentIntRange;
657  }
658 
659  /**
660  *
661  */
663  {
665  mCurrentIntRange = 0;
667  }
668 
669  /**
670  *
671  */
673  {
674  return mMinIntTestCanidate;
675  }
676 
677  /**
678  * .
679  */
681  {
682  return mMaxIntTestCanidate;
683  }
684 
685  bool hasInfinityChild() const
686  {
687  return mpInfinityChild != NULL;
688  }
689 
690  void resetInfinityChild( const State* _state )
691  {
692  if( mpInfinityChild == _state )
693  mpInfinityChild = NULL;
694  }
695 
696  void setInfinityChild( State* _state )
697  {
698  assert( mpInfinityChild == NULL );
699  mpInfinityChild = _state;
700  }
701 
702  #ifdef SMTRAT_DEVOPTION_Statistics
703  void setStatistics( smtrat::VSStatistics* _stats )
704  {
705  assert( mpStatistics == nullptr );
706  mpStatistics = _stats;
707  }
708 
709  carl::uint numberOfUnusedConditions() const
710  {
711  carl::uint result = 0;
712  for( const Condition* cond : conditions() )
713  {
714  if( !cond->flag() )
715  ++result;
716  }
717  return result;
718  }
719  #endif
720 
721  static void removeStatesFromRanking( const State& toRemove, ValuationMap& _ranking );
722 
724 
725  /**
726  * @return The depth of the subtree with this state as root node.
727  */
728  unsigned treeDepth() const;
729 
730  /**
731  * Checks if a substitution can be applied.
732  * @return true, if a substitution can be applied.
733  * false, else.
734  */
735  bool substitutionApplicable() const;
736 
737  /**
738  * Checks if the substitution of this state can be applied to the given constraint.
739  * @param _constraint The constraint, for which we want to know, if the substitution is applicable.
740  * @return true, if the substitution can be applied;
741  * false, otherwise.
742  */
743  bool substitutionApplicable( const smtrat::ConstraintT& _constraint ) const;
744 
745  /**
746  * Checks whether a condition exists, which was not involved in an elimination step.
747  * @return true, if there exists a condition in the state, which was not already involved in an elimination step;
748  * false, otherwise.
749  */
750  bool hasNoninvolvedCondition() const;
751 
752  /**
753  * @param A condition, which is one of the currently considered constraints to check for satisfiability.
754  * @return true, if all test candidates provided by the given condition are no solution of the currently considered
755  * conjunction of constraints to check for satisfiability.
756  */
757  bool allTestCandidatesInvalidated( const Condition* _condition ) const;
758 
759  /**
760  * Checks whether a child exists, which has no ID (!=0).
761  * @return true, if there exists a child with ID (!=0);
762  * false, otherwise.
763  */
764  bool hasChildWithID() const;
765 
766  /**
767  * @return true, if the given state is a node in the state tree starting at this node;
768  * false, otherwise.
769  */
770  bool containsState( const State* _state ) const;
771 
772  /**
773  * Checks whether a child exists, which is not yet marked as inconsistent.
774  * @return true, if there exists such a child;
775  * false, otherwise.
776  */
777  bool hasOnlyInconsistentChildren() const;
778 
779  /**
780  * Checks whether the given variable occurs in a equation.
781  * @return true, if the given variable occurs in a equation;
782  * false, otherwise.
783  */
784  bool occursInEquation( const carl::Variable& ) const;
785 
786  /**
787  * Checks whether there exist more than one test candidate, which has still not been checked.
788  *
789  * @return true, if there exist more than one test candidate, which has still not been checked;
790  * false, otherwise.
791  */
793 
794  /**
795  * Finds the variables, which occur in this state.
796  * @param _variables The variables which occur in this state.
797  */
798  void variables( carl::Variables& _variables ) const;
799 
800  /**
801  * Determines the number of nodes in the tree with this state as root.
802  * @return The number of nodes in the tree with this state as root.
803  */
804  unsigned numberOfNodes() const;
805 
806  /**
807  * @return The root of the tree, in which this state is located.
808  */
809  State& root();
810 
811  /**
812  */
813  bool getNextIntTestCandidate( smtrat::Rational& _nextIntTestCandidate, size_t _maxIntRange );
814 
815  /**
816  *
817  */
819 
820  /**
821  * Determines (if it exists) a ancestor node, which is unfinished, that is
822  * it has still substitution results to consider.
823  * @param _unfinAnt The unfinished ancestor node.
824  * @return true, if it has a unfinished ancestor;
825  * false, otherwise.
826  */
827  bool unfinishedAncestor( State*& _unfinAnt );
828 
829  /**
830  * Determines the most adequate condition and in it the most adequate variable in
831  * the state to generate test candidates for.
832  * @param _bestCondition The most adequate condition to be the next test candidate provider.
833  * @param _numberOfAllVariables The number of all globally known variables.
834  * @param _preferEquation A flag that indicates to prefer equations in the heuristics of this method.
835  * @return true, if it has a condition and a variable in it to generate test candidates for;
836  * false, otherwise.
837  */
838  bool bestCondition( const Condition*& _bestCondition, size_t _numberOfAllVariables, bool _preferEquation );
839 
840  /**
841  * Checks if the given constraint already exists as condition in the state.
842  * @param _constraint The constraint, for which we want to know, if it already
843  * exists as condition in the state.
844  * @return An iterator to the condition, which involves the constraint or an iterator
845  * to the end of the vector of conditions of this state.
846  */
847  ConditionList::iterator constraintExists( const smtrat::ConstraintT& _constraint );
848 
849  /**
850  * Cleans up all conditions in this state according to comparison between the corresponding constraints.
851  */
852  void simplify( ValuationMap& _ranking );
853 
854  /**
855  * Simplifies the given conditions according to comparison between the corresponding constraints.
856  * @param _conditionVectorToSimplify The conditions to simplify. Note, that this method can change these conditions.
857  * @param _conflictSet All conflicts this method detects in the given conditions are stored in here.
858  * @param _stateConditions A flag indicating whether the conditions to simplify are from the considered
859  * condition vector of this state and not, e.g., from somewhere in its
860  * substitution results.
861  * @return true, if the conditions are not obviously conflicting;
862  * false, otherwise.
863  */
864  bool simplify( ConditionList& _conditionVectorToSimplify, ConditionSetSet& _conflictSet, ValuationMap& _ranking, bool _stateConditions = false );
865 
866  /**
867  * Sets the index of this state.
868  * @param _index The string to which the index should be set.
869  */
870  void setIndex( const carl::Variable& _index );
871 
872  /**
873  * Adds a conflict set to the map of substitutions to conflict sets.
874  * @param _substitution The corresponding substitution generated the conflict.
875  * (NULL in the case a detected conflict without substitution)
876  * @param _condSetSet The conflicts to add.
877  */
878  void addConflictSet( const Substitution* _substitution, ConditionSetSet&& _condSetSet );
879 
880  /**
881  * Adds all conflicts to all sets of the conflict set of the given substitution.
882  * @param _substitution The corresponding substitution generated the conflict.
883  * (NULL in the case a detected conflict without substitution)
884  * @param _condSetSet The conflicts to add.
885  */
886  void addConflicts( const Substitution* _substitution, ConditionSetSet&& _condSetSet );
887 
888  /**
889  * Clears the conflict sets.
890  */
891  void resetConflictSets();
892 
893  /**
894  * Updates the original conditions of substitutions having the same test candidate as the given.
895  * @param _substitution The substitution containing the test candidate to check for.
896  * @param _reactivatedStates
897  * @return true, if the test candidate of the given substitution was already generated;
898  * false, otherwise.
899  */
900  bool updateOCondsOfSubstitutions( const Substitution& _substitution, std::vector<State*>& _reactivatedStates );
901 
902  /**
903  * Adds the given substitution results to this state.
904  * @param _disjunctionsOfCondConj The substitution results given by a vector
905  * of disjunctions of conjunctions of conditions.
906  */
907  void addSubstitutionResults( std::vector< DisjunctionOfConditionConjunctions >&& _disjunctionsOfCondConj );
908 
909  /**
910  * Extends the currently considered combination of conjunctions in the substitution results.
911  */
913 
914  /**
915  * If the state contains a substitution result, which is a conjunction of disjunctions of
916  * conjunctions of conditions, this method sets the current combination to the disjunctions
917  * to the next combination.
918  * @return true, if there is a next combination;
919  * false, otherwise.
920  */
922 
923  /**
924  * @return The number of the current substitution result combination.
925  */
927 
928  /**
929  * Gets the current substitution result combination as condition vector.
930  * @return The current substitution result combination as condition vector.
931  */
933 
934  /**
935  * Determines the condition vector corresponding to the current combination of the
936  * conjunctions of conditions.
937  * @return true, if there has been a change in the currently considered condition vector.
938  * false, otherwise.
939  */
940  bool refreshConditions( ValuationMap& _ranking );
941 
942  /**
943  * Sets all flags of the conditions to true, if it contains the variable given by the states index.
944  */
945  void initConditionFlags();
946 
947  /**
948  * Sets, if it has not already happened, the index of the state to the name of the
949  * most adequate variable. Which variable is taken depends on heuristics.
950  * @param _allVariables All globally known variables.
951  * @param _vvstrat The strategy according which we choose the variable.
952  * @param _preferEquation A flag that indicates to prefer equations in the heuristics of this method.
953  * @param _tryDifferentVarOrder
954  */
955  bool initIndex( const carl::Variables& _allVariables, const smtrat::VariableValuationStrategy& _vvstrat, bool _preferEquation, bool _tryDifferentVarOrder = false, bool _useFixedVariableOrder = false );
956  void bestConstraintValuation( const std::vector<std::pair<carl::Variable, std::multiset<double>>>& _varVals );
957  void averageConstraintValuation( const std::vector<std::pair<carl::Variable, std::multiset<double>>>& _varVals );
958  void worstConstraintValuation( const std::vector<std::pair<carl::Variable, std::multiset<double>>>& _varVals );
959 
960  /**
961  * Adds a constraint to the conditions of this state.
962  * @param _constraint The constraint of the condition to add.
963  * @param _originalConditions The original conditions of the condition to add.
964  * @param _valutation The valuation of the condition to add.
965  * @param _recentlyAdded Is the condition a recently added one.
966  * @sideeffect The state can obtain a new condition.
967  */
968  void addCondition( const smtrat::ConstraintT& _constraint, const carl::PointerSet<Condition>& _originalConditions, size_t _valutation, bool _recentlyAdded, ValuationMap& _ranking );
969 
970  /**
971  * This is just for debug purpose.
972  * @return true, if no subresult combination is illegal.
973  */
974  bool checkSubresultCombinations() const;
975 
976  /**
977  * Removes everything in this state originated by the given vector of conditions.
978  * @param _originsToDelete The conditions for which everything in this state which
979  * has been originated by them must be removed.
980  * @return 0, if this state got invalid and must be deleted afterwards;
981  * -1, if this state got invalid and must be deleted afterwards
982  * and made other states unnecessary to consider;
983  * 1, otherwise.
984  */
985  int deleteOrigins( carl::PointerSet<Condition>& _originsToDelete, ValuationMap& _ranking );
986 
987  /**
988  * Deletes everything originated by the given conditions in the children of this state.
989  * @param _originsToDelete The condition for which to delete everything originated by them.
990  */
991  void deleteOriginsFromChildren( carl::PointerSet<Condition>& _originsToDelete, ValuationMap& _ranking );
992 
993  /**
994  * Deletes everything originated by the given conditions in the conflict sets of this state.
995  * @param _originsToDelete The condition for which to delete everything originated by them.
996  * @param _originsAreCurrentConditions A flag indicating whether the origins to remove stem from
997  * conditions of the currently considered condition vector of the father
998  * of this state and not, e.g., from somewhere in its substitution results.
999  */
1000  void deleteOriginsFromConflictSets( carl::PointerSet<Condition>& _originsToDelete, bool _originsAreCurrentConditions );
1001 
1002  /**
1003  * Deletes everything originated by the given conditions in the substitution results of this state.
1004  * @param _originsToDelete The conditions for which to delete everything originated by them.
1005  */
1006  void deleteOriginsFromSubstitutionResults( carl::PointerSet<Condition>& _originsToDelete );
1007 
1008  /**
1009  * Delete everything originated by the given conditions from the entire subtree with this state as root.
1010  * @param _conditionsToDelete The conditions to delete.
1011  */
1012  void deleteConditions( carl::PointerSet<Condition>& _conditionsToDelete, ValuationMap& _ranking );
1013 
1014  /**
1015  * Adds a state as child to this state with the given substitution.
1016  * @param _substitution The substitution to generate the state for.
1017  * @return true, if a state has been added as child to this state;
1018  * false, otherwise.
1019  */
1020  std::vector<State*> addChild( const Substitution& _substitution );
1021 
1022  /**
1023  * Updates the valuation of this state.
1024  */
1025  void updateValuation( bool _lazy );
1026 
1027  /**
1028  * Valuates the state's currently considered conditions according to a backend call.
1029  * Note: The settings are currently optimized for CAD backend calls.
1030  */
1032 
1033  /**
1034  * Passes the original conditions of the covering set of the conflicts of this state to its father.
1035  * @param _checkConflictForSideCondition If this flag is set to false it might save some computations
1036  * but leads to an over-approximative behavior. Recommendation: set it to true.
1037  * @param _includeInconsistentTestCandidates If this flag is set to true the conflict analysis takes also the
1038  * invalid test candidates' conflict sets into account. Recommendation: set
1039  * it to false.
1040  * @param _useBackjumping If true, we use the backjumping technique.
1041  */
1042  void passConflictToFather( bool _checkConflictForSideCondition, bool _useBackjumping = true, bool _includeInconsistentTestCandidates = false );
1043 
1044  /**
1045  * Checks whether the currently considered conditions, which have been considered for test candidate
1046  * construction, form already a conflict.
1047  * @return true, if they form a conflict;
1048  * false, otherwise.
1049  */
1050  bool hasLocalConflict();
1051 
1052  /**
1053  * Checks whether the test candidate of this state is valid against the variable intervals
1054  * in the father of this state.
1055  * @return true, if the test candidate of this state is valid against the variable intervals;
1056  * false, otherwise.
1057  */
1059 
1060  /**
1061  * Determines the solution space of the test candidate of this state regarding to
1062  * the variable bounds of the father. The solution space consists of one or two
1063  * disjoint intervals.
1064  * @param _conflictReason If the solution space is empty, the conditions being
1065  * responsible for this conflict are stored in here.
1066  * @return The disjoint intervals representing the solution space.
1067  */
1068  std::vector< smtrat::DoubleInterval > solutionSpace( carl::PointerSet<Condition>& _conflictReason ) const;
1069 
1070  /**
1071  * Checks whether there are no zeros for the left-hand side of the constraint of the given condition.
1072  * @param _condition The condition to check.
1073  * @param A flag that indicates whether to include Sturm's sequences and root counting in this method.
1074  * @return true, if the constraint of the left-hand side of the given condition has no roots
1075  * in the variable bounds of this state;
1076  * false, otherwise.
1077  */
1078  bool hasRootsInVariableBounds( const Condition* _condition, bool _useSturmSequence );
1079 
1080  #ifdef VS_STATE_DEBUG_METHODS
1081 
1082  /**
1083  * Prints the conditions, the substitution and the substitution results of this state and
1084  * all its children.
1085  * @param _initiation A string which is printed in the beginning of every row.
1086  * @param _out The stream to print on.
1087  */
1088  void print( const std::string _initiation = "***", std::ostream& _out = std::cout ) const;
1089 
1090  /**
1091  * Prints the conditions, the substitution and the substitution results of this state.
1092  * @param _initiation A string which is printed in the beginning of every row.
1093  * @param _out The stream to print on.
1094  */
1095  void printAlone( const std::string = "***", std::ostream& _out = std::cout ) const;
1096 
1097  /**
1098  * Prints the conditions of this state.
1099  * @param _initiation A string which is printed in the beginning of every row.
1100  * @param _out The stream to print on.
1101  */
1102  void printConditions( const std::string _initiation = "***", std::ostream& _out = std::cout, bool = false ) const;
1103 
1104  /**
1105  * Prints the substitution results of this state.
1106  * @param _initiation A string which is printed in the beginning of every row.
1107  * @param _out The stream to print on.
1108  */
1109  void printSubstitutionResults( const std::string _initiation = "***", std::ostream& _out = std::cout ) const;
1110 
1111  /**
1112  * Prints the combination of substitution results used in this state.
1113  * @param _initiation A string which is printed in the beginning of every row.
1114  * @param _out The stream to print on.
1115  */
1116  void printSubstitutionResultCombination( const std::string _initiation = "***", std::ostream& _out = std::cout ) const;
1117 
1118  /**
1119  * Prints the combination of substitution results, expressed in numbers, used in this state.
1120  * @param _initiation A string which is printed in the beginning of every row.
1121  * @param _out The stream to print on.
1122  */
1123  void printSubstitutionResultCombinationAsNumbers( const std::string _initiation = "***", std::ostream& _out = std::cout ) const;
1124 
1125  /**
1126  * Prints the conflict sets of this state.
1127  * @param _initiation A string which is printed in the beginning of every row.
1128  * @param _out The stream to print on.
1129  */
1130  void printConflictSets( const std::string _initiation = "***", std::ostream& _out = std::cout ) const;
1131 
1132  #endif
1133 
1134  /**
1135  * Finds a covering set of a vector of sets of sets due to some heuristics.
1136  * @param _conflictSets The vector of sets of sets, for which the method finds all minimum covering sets.
1137  * @param _minCovSet The found mininum covering set.
1138  * @param _currentTreeDepth The tree depth of the state from which this method is invoked.
1139  * @return The greatest level, where a condition of the covering set has been created.
1140  */
1141  static size_t coveringSet( const ConditionSetSetSet& _conflictSets, carl::PointerSet<Condition>& _minCovSet, unsigned _currentTreeDepth );
1142  };
1143 } // end namspace vs
1144 }
Class to manage the bounds of a variable.
void printSubstitutionResults(const std::string _initiation="***", std::ostream &_out=std::cout) const
Prints the substitution results of this state.
Definition: State.cpp:2680
const std::list< State * > & children() const
Definition: State.h:331
bool hasSubstitutionResults() const
Definition: State.h:552
const Substitution * pSubstitution() const
Definition: State.h:486
ConditionList & rConditions()
Definition: State.h:414
bool refreshConditions(ValuationMap &_ranking)
Determines the condition vector corresponding to the current combination of the conjunctions of condi...
Definition: State.cpp:1096
ConflictSets * mpConflictSets
Stores for each already considered and failed test candidate all conflicts which have been found for ...
Definition: State.h:149
bool hasFurtherUncheckedTestCandidates() const
Checks whether there exist more than one test candidate, which has still not been checked.
Definition: State.cpp:285
State(const State &)=delete
size_t currentRangeSize() const
Definition: State.h:654
const smtrat::Rational & minIntTestCandidate() const
Definition: State.h:672
void printSubstitutionResultCombination(const std::string _initiation="***", std::ostream &_out=std::cout) const
Prints the combination of substitution results used in this state.
Definition: State.cpp:2712
void resetCurrentRangeSize()
Definition: State.h:662
void deleteOriginsFromSubstitutionResults(carl::PointerSet< Condition > &_originsToDelete)
Deletes everything originated by the given conditions in the substitution results of this state.
Definition: State.cpp:1846
SubResultCombination * mpSubResultCombination
The currently considered combination of conjunctions of constraints in the substitution result vector...
Definition: State.h:145
bool mMarkedAsDeleted
A flag indicating whether this state has already marked as deleted, which means that there is no need...
Definition: State.h:92
size_t mID
A unique id identifying this state.
Definition: State.h:118
smtrat::Rational mMinIntTestCanidate
Definition: State.h:162
bool mInconsistent
A flag that indicates whether this state is already inconsistent.
Definition: State.h:89
bool hasNoninvolvedCondition() const
Checks whether a condition exists, which was not involved in an elimination step.
Definition: State.cpp:217
bool isRoot() const
Definition: State.h:209
size_t mValuation
A heuristically determined value stating the expected difficulty of this state's considered condition...
Definition: State.h:123
smtrat::vb::VariableBounds< const Condition * > VariableBoundsCond
Definition: State.h:74
bool mSubResultsSimplified
A flag indicating whether the substitution results this state are simplified.
Definition: State.h:94
bool mHasRecentlyAddedConditions
A flag that indicates whether this state has conditions in its considered list of conditions,...
Definition: State.h:86
unsigned treeDepth() const
Definition: State.cpp:185
Type type() const
Definition: State.h:571
smtrat::Rational mMaxIntTestCanidate
Definition: State.h:164
size_t mCurrentIntRange
Definition: State.h:166
size_t & rID()
Definition: State.h:315
bool mHasChildrenToInsert
A flag indicating whether there are states that are children of this state and must be still consider...
Definition: State.h:83
std::list< State * > & rChildren()
Definition: State.h:323
VariableBoundsCond & rVariableBounds()
Definition: State.h:636
void printConflictSets(const std::string _initiation="***", std::ostream &_out=std::cout) const
Prints the conflict sets of this state.
Definition: State.cpp:2749
bool unfinished() const
Definition: State.h:561
void variables(carl::Variables &_variables) const
Finds the variables, which occur in this state.
Definition: State.cpp:298
const SubResultCombination & subResultCombination() const
Definition: State.h:478
void updateBackendCallValuation()
Valuates the state's currently considered conditions according to a backend call.
Definition: State.cpp:2060
State * pFather() const
Definition: State.h:339
bool hasChildWithID() const
Checks whether a child exists, which has no ID (!=0).
Definition: State.cpp:242
bool hasInfinityChild() const
Definition: State.h:685
void setIndex(const carl::Variable &_index)
Sets the index of this state.
Definition: State.cpp:812
State * mpFather
The father state of this state.
Definition: State.h:137
std::vector< size_t > mBestVarVals
Definition: State.h:174
std::vector< std::pair< unsigned, unsigned > > SubResultCombination
Definition: State.h:73
SubstitutionResults * mpSubstitutionResults
The vector storing the substitution results, that is for each application of the substitution in this...
Definition: State.h:142
bool hasLocalConflict()
Checks whether the currently considered conditions, which have been considered for test candidate con...
Definition: State.cpp:2201
bool unfinishedAncestor(State *&_unfinAnt)
Determines (if it exists) a ancestor node, which is unfinished, that is it has still substitution res...
Definition: State.cpp:386
void setInfinityChild(State *_state)
Definition: State.h:696
bool & rInconsistent()
Definition: State.h:397
static void removeStatesFromRanking(const State &toRemove, ValuationMap &_ranking)
Definition: State.cpp:170
Type mType
The type of this state, which states whether this state has still a substitution to apply or either t...
Definition: State.h:127
bool mTryToRefreshIndex
A flag indicating whether the index (the variable to eliminate in this state) should be reconsidered ...
Definition: State.h:112
bool mCannotBeSolvedLazy
Definition: State.h:109
void simplify(ValuationMap &_ranking)
Cleans up all conditions in this state according to comparison between the corresponding constraints.
Definition: State.cpp:443
carl::PointerSet< Condition > & rTooHighDegreeConditions()
Definition: State.h:617
bool getNextIntTestCandidate(smtrat::Rational &_nextIntTestCandidate, size_t _maxIntRange)
Definition: State.cpp:322
bool & rTakeSubResultCombAgain()
Definition: State.h:528
SubResultCombination & rSubResultCombination()
Definition: State.h:468
bool mTakeSubResultCombAgain
A flag indicating whether to take the current combination of substitution results once again.
Definition: State.h:97
bool hasSubResultsCombination() const
Definition: State.h:544
bool nextSubResultCombination()
If the state contains a substitution result, which is a conjunction of disjunctions of conjunctions o...
Definition: State.cpp:992
carl::Variable::Arg index() const
Definition: State.h:282
void worstConstraintValuation(const std::vector< std::pair< carl::Variable, std::multiset< double >>> &_varVals)
Definition: State.cpp:1379
bool conditionsSimplified() const
Definition: State.h:494
const ConflictSets & conflictSets() const
Definition: State.h:371
ConditionList getCurrentSubresultCombination() const
Gets the current substitution result combination as condition vector.
Definition: State.cpp:1079
bool hasOnlyInconsistentChildren() const
Checks whether a child exists, which is not yet marked as inconsistent.
Definition: State.cpp:264
const smtrat::Rational & maxIntTestCandidate() const
Definition: State.h:680
const VariableBoundsCond & variableBounds() const
Definition: State.h:626
void printAlone(const std::string="***", std::ostream &_out=std::cout) const
Prints the conditions, the substitution and the substitution results of this state.
Definition: State.cpp:2580
std::vector< std::pair< carl::Variable, std::multiset< double > > > mRealVarVals
Definition: State.h:170
void initConditionFlags()
Sets all flags of the conditions to true, if it contains the variable given by the states index.
Definition: State.cpp:1182
~State()
Destructor.
Definition: State.cpp:110
bool & rMarkedAsDeleted()
Definition: State.h:254
std::vector< std::pair< ConditionList, bool > > SubstitutionResult
Definition: State.h:71
bool extendSubResultCombination()
Extends the currently considered combination of conjunctions in the substitution results.
Definition: State.cpp:933
bool & rCannotBeSolvedLazy()
Definition: State.h:236
unsigned numberOfNodes() const
Determines the number of nodes in the tree with this state as root.
Definition: State.cpp:306
std::vector< SubstitutionResult > SubstitutionResults
Definition: State.h:72
State(carl::IDPool *_conditionIdAllocator, bool _withVariableBounds)
Constructs an empty state (no conditions yet) being the root (hence neither a substitution) of the st...
Definition: State.cpp:30
State & rFather()
Definition: State.h:355
Type & rType()
Definition: State.h:581
carl::IDPool * mpConditionIdAllocator
Definition: State.h:168
bool & rCannotBeSolved()
Definition: State.h:227
bool takeSubResultCombAgain() const
Definition: State.h:519
void bestConstraintValuation(const std::vector< std::pair< carl::Variable, std::multiset< double >>> &_varVals)
Definition: State.cpp:1291
const Substitution & substitution() const
Definition: State.h:440
void deleteConditions(carl::PointerSet< Condition > &_conditionsToDelete, ValuationMap &_ranking)
Delete everything originated by the given conditions from the entire subtree with this state as root.
Definition: State.cpp:1610
void resetCannotBeSolvedLazyFlags()
Definition: State.cpp:178
bool markedAsDeleted() const
Definition: State.h:245
void deleteOriginsFromConflictSets(carl::PointerSet< Condition > &_originsToDelete, bool _originsAreCurrentConditions)
Deletes everything originated by the given conditions in the conflict sets of this state.
Definition: State.cpp:1714
bool updateIntTestCandidates()
Definition: State.cpp:343
carl::FastPointerMapB< Substitution, ConditionSetSetSet > ConflictSets
Definition: State.h:70
static size_t coveringSet(const ConditionSetSetSet &_conflictSets, carl::PointerSet< Condition > &_minCovSet, unsigned _currentTreeDepth)
Finds a covering set of a vector of sets of sets due to some heuristics.
Definition: State.cpp:2817
std::vector< State * > addChild(const Substitution &_substitution)
Adds a state as child to this state with the given substitution.
Definition: State.cpp:1957
State * mpInfinityChild
Definition: State.h:160
void resetConflictSets()
Clears the conflict sets.
Definition: State.cpp:862
bool subResultsSimplified() const
Definition: State.h:502
ConditionList * mpConditions
The currently considered conditions of this state, for which the satisfiability must be checked.
Definition: State.h:147
void printConditions(const std::string _initiation="***", std::ostream &_out=std::cout, bool=false) const
Prints the conditions of this state.
Definition: State.cpp:2666
const State & father() const
Definition: State.h:347
bool isInconsistent() const
Definition: State.h:406
size_t getNumberOfCurrentSubresultCombination() const
Definition: State.cpp:1052
void updateValuation(bool _lazy)
Updates the valuation of this state.
Definition: State.cpp:2023
const Condition * pOriginalCondition() const
Definition: State.h:590
bool bestCondition(const Condition *&_bestCondition, size_t _numberOfAllVariables, bool _preferEquation)
Determines the most adequate condition and in it the most adequate variable in the state to generate ...
Definition: State.cpp:398
bool containsState(const State *_state) const
Definition: State.cpp:255
std::vector< smtrat::DoubleInterval > solutionSpace(carl::PointerSet< Condition > &_conflictReason) const
Determines the solution space of the test candidate of this state regarding to the variable bounds of...
Definition: State.cpp:2324
bool & rHasRecentlyAddedConditions()
Definition: State.h:380
size_t backendCallValuation() const
Definition: State.h:299
size_t id() const
Definition: State.h:307
Substitution & rSubstitution()
Definition: State.h:431
carl::Variable mIndex
The variable which is going to be eliminated from this state's considered conditions.
Definition: State.h:130
SubstitutionResults & rSubstitutionResults()
Definition: State.h:449
void print(const std::string _initiation="***", std::ostream &_out=std::cout) const
Prints the conditions, the substitution and the substitution results of this state and all its childr...
Definition: State.cpp:2570
void resetInfinityChild(const State *_state)
Definition: State.h:690
void addConflictSet(const Substitution *_substitution, ConditionSetSet &&_condSetSet)
Adds a conflict set to the map of substitutions to conflict sets.
Definition: State.cpp:818
void addCondition(const smtrat::ConstraintT &_constraint, const carl::PointerSet< Condition > &_originalConditions, size_t _valutation, bool _recentlyAdded, ValuationMap &_ranking)
Adds a constraint to the conditions of this state.
Definition: State.cpp:1438
Substitution * mpSubstitution
The substitution this state considers. Note that it is NULL if this state is the root.
Definition: State.h:139
void addSubstitutionResults(std::vector< DisjunctionOfConditionConjunctions > &&_disjunctionsOfCondConj)
Adds the given substitution results to this state.
Definition: State.cpp:915
bool tryToRefreshIndex() const
Definition: State.h:536
void setOriginalCondition(const Condition *_pOCondition)
Sets the pointer of the original condition of this state to the given pointer to a condition.
Definition: State.h:646
bool checkTestCandidatesForBounds()
Checks whether the test candidate of this state is valid against the variable intervals in the father...
Definition: State.cpp:2297
bool occursInEquation(const carl::Variable &) const
Checks whether the given variable occurs in a equation.
Definition: State.cpp:277
bool updateOCondsOfSubstitutions(const Substitution &_substitution, std::vector< State * > &_reactivatedStates)
Updates the original conditions of substitutions having the same test candidate as the given.
Definition: State.cpp:873
carl::PointerSet< Condition > * mpTooHighDegreeConditions
The conditions of this state, which cannot be solved by the virtual substitution.
Definition: State.h:154
void passConflictToFather(bool _checkConflictForSideCondition, bool _useBackjumping=true, bool _includeInconsistentTestCandidates=false)
Passes the original conditions of the covering set of the conflicts of this state to its father.
Definition: State.cpp:2082
const Condition * mpOriginalCondition
If the test candidate considered by this state stems from a condition for which it is enough to consi...
Definition: State.h:135
void averageConstraintValuation(const std::vector< std::pair< carl::Variable, std::multiset< double >>> &_varVals)
Definition: State.cpp:1350
bool substitutionApplicable() const
Checks if a substitution can be applied.
Definition: State.cpp:197
bool mConditionsSimplified
A flag indicating whether the conditions this state considers are simplified.
Definition: State.h:80
bool mTestCandidateCheckedForBounds
A flag indicating whether the test candidate contained by this state has already been check for the b...
Definition: State.h:100
void addConflicts(const Substitution *_substitution, ConditionSetSet &&_condSetSet)
Adds all conflicts to all sets of the conflict set of the given substitution.
Definition: State.cpp:839
const SubstitutionResults & substitutionResults() const
Definition: State.h:458
std::list< State * > * mpChildren
The children states of this state.
Definition: State.h:152
void deleteOriginsFromChildren(carl::PointerSet< Condition > &_originsToDelete, ValuationMap &_ranking)
Deletes everything originated by the given conditions in the children of this state.
Definition: State.cpp:1682
int deleteOrigins(carl::PointerSet< Condition > &_originsToDelete, ValuationMap &_ranking)
Removes everything in this state originated by the given vector of conditions.
Definition: State.cpp:1510
bool hasChildrenToInsert() const
Definition: State.h:263
bool & rSubResultsSimplified()
Definition: State.h:510
bool checkSubresultCombinations() const
This is just for debug purpose.
Definition: State.cpp:1495
ConditionList::iterator constraintExists(const smtrat::ConstraintT &_constraint)
Checks if the given constraint already exists as condition in the state.
Definition: State.cpp:435
bool initIndex(const carl::Variables &_allVariables, const smtrat::VariableValuationStrategy &_vvstrat, bool _preferEquation, bool _tryDifferentVarOrder=false, bool _useFixedVariableOrder=false)
Sets, if it has not already happened, the index of the state to the name of the most adequate variabl...
Definition: State.cpp:1191
size_t mBackendCallValuation
A heuristically determined value stating the expected difficulty of this state's considered condition...
Definition: State.h:116
const Condition & originalCondition() const
Definition: State.h:599
bool hasRootsInVariableBounds(const Condition *_condition, bool _useSturmSequence)
Checks whether there are no zeros for the left-hand side of the constraint of the given condition.
Definition: State.cpp:2423
void printSubstitutionResultCombinationAsNumbers(const std::string _initiation="***", std::ostream &_out=std::cout) const
Prints the combination of substitution results, expressed in numbers, used in this state.
Definition: State.cpp:2735
bool hasRecentlyAddedConditions() const
Definition: State.h:388
State & root()
Definition: State.cpp:314
const ConditionList & conditions() const
Definition: State.h:422
ConflictSets & rConflictSets()
Definition: State.h:363
@ SUBSTITUTION_TO_APPLY
Definition: State.h:68
@ TEST_CANDIDATE_TO_GENERATE
Definition: State.h:68
@ COMBINE_SUBRESULTS
Definition: State.h:68
const carl::PointerSet< Condition > & tooHighDegreeConditions() const
Definition: State.h:608
bool cannotBeSolved(bool _lazy) const
Definition: State.h:218
bool mCannotBeSolved
A flag indicating whether this state has been progressed until a point where a condition must be invo...
Definition: State.h:107
size_t valuation() const
Definition: State.h:291
bool allTestCandidatesInvalidated(const Condition *_condition) const
Definition: State.cpp:230
bool & rHasChildrenToInsert()
Definition: State.h:272
VariableBoundsCond * mpVariableBounds
A pointer to an object which manages and stores the bounds on the variables occurring in this state.
Definition: State.h:158
std::vector< std::pair< carl::Variable, std::multiset< double > > > mIntVarVals
Definition: State.h:172
std::pair< size_t, std::pair< size_t, size_t > > UnsignedTriple
Definition: State.h:33
std::set< ConditionSetSet > ConditionSetSetSet
Definition: State.h:29
std::pair< UnsignedTriple, vs::State * > ValStatePair
Definition: State.h:61
std::list< const Condition * > ConditionList
Definition: State.h:30
std::vector< ConditionList > DisjunctionOfConditionConjunctions
Definition: State.h:31
std::set< carl::PointerSet< Condition > > ConditionSetSet
Definition: State.h:28
std::map< UnsignedTriple, vs::State *, unsignedTripleCmp > ValuationMap
Definition: State.h:62
Class to create the formulas for axioms.
VariableValuationStrategy
Definition: VSSettings.h:14
carl::Constraint< Poly > ConstraintT
Definition: types.h:29
mpq_class Rational
Definition: types.h:19
bool operator()(UnsignedTriple n1, UnsignedTriple n2) const
Definition: State.h:40