SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
InequalitiesTable.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <carl-arith/groebner/groebner.h>
4 
5 // Compile time settings structures
6 #include "GBSettings.h"
7 
8 #include "VariableRewriteRule.h"
9 #ifdef SMTRAT_DEVOPTION_Statistics
10 #include "GBModuleStatistics.h"
12 #endif
13 
14 namespace smtrat
15 {
16  template<typename Settings>
17  class GBModule;
18  /**
19  * Datastructure for the GBModule.
20  * A table of all inequalities and how they are reduced.
21  * @author Sebastian Junges
22  */
23  template<class Settings>
25  {
26  protected:
27  typedef typename Settings::PolynomialWithReasons Polynomial;
28  typedef typename Settings::MultivariateIdeal Ideal;
29  public:
30  typedef typename std::pair<unsigned, Polynomial> CellEntry;
31  typedef typename std::tuple<ModuleInput::iterator, carl::Relation, std::list<CellEntry> > RowEntry;
32  typedef typename std::map<ModuleInput::const_iterator, RowEntry, ModuleInput::IteratorCompare> Rows;
33  typedef typename std::pair<ModuleInput::const_iterator, RowEntry> Row;
34  typedef typename std::map<carl::Variable, std::pair<TermT, carl::BitVector> > RewriteRules;
35 
36 
37  protected:
38  /// A map of pointers from received iterators to rows.
40  /// The actual number of backtrackpoints
41  unsigned mBtnumber;
42  /// A pointer to the GBModule which uses this table.
44 
45  typename Rows::iterator mNewConstraints;
46 
47 
48  unsigned mLastRestart;
49 
50  public:
52 
53  typename Rows::iterator InsertReceivedFormula( ModuleInput::const_iterator received );
54 
56 
57  void popBacktrackPoint( unsigned nrBacktracks );
58 
59  Answer reduceWRTGroebnerBasis( const Ideal& gb, const RewriteRules& rules );
60  bool reduceWRTGroebnerBasis( typename Rows::iterator, const Ideal& gb, const RewriteRules& rules );
61  Answer reduceWRTGroebnerBasis( const std::list< typename Rows::iterator>& ineqToBeReduced, const Ideal& gb, const RewriteRules& rules );
62 
64  bool reduceWRTVariableRewriteRules( typename Rows::iterator it, const RewriteRules& rules );
65  Answer reduceWRTVariableRewriteRules( const std::list< typename Rows::iterator>& ineqToBeReduced, const RewriteRules& rules );
66 
67 
69 
70  void print( std::ostream& os = std::cout ) const;
71 
72 
73  private:
74  #ifdef SMTRAT_DEVOPTION_Statistics
75  GBModuleStats& mStats = GBModuleStats::getInstance(Settings::identifier);
76  #endif //SMTRAT_DEVOPTION_Statistics
77  };
78 }
A solver module based on Groebner basis.
Definition: GBModule.h:46
Datastructure for the GBModule.
Answer reduceWRTGroebnerBasis(const Ideal &gb, const RewriteRules &rules)
std::pair< unsigned, Polynomial > CellEntry
Rows mReducedInequalities
A map of pointers from received iterators to rows.
bool reduceWRTVariableRewriteRules(typename Rows::iterator it, const RewriteRules &rules)
unsigned mBtnumber
The actual number of backtrackpoints.
void popBacktrackPoint(unsigned nrBacktracks)
void print(std::ostream &os=std::cout) const
Settings::MultivariateIdeal Ideal
std::map< carl::Variable, std::pair< TermT, carl::BitVector > > RewriteRules
InequalitiesTable(GBModule< Settings > *module)
Answer reduceWRTVariableRewriteRules(const RewriteRules &rules)
bool reduceWRTGroebnerBasis(typename Rows::iterator, const Ideal &gb, const RewriteRules &rules)
std::tuple< ModuleInput::iterator, carl::Relation, std::list< CellEntry > > RowEntry
std::map< ModuleInput::const_iterator, RowEntry, ModuleInput::IteratorCompare > Rows
Answer reduceWRTVariableRewriteRules(const std::list< typename Rows::iterator > &ineqToBeReduced, const RewriteRules &rules)
GBModule< Settings > * mModule
A pointer to the GBModule which uses this table.
void removeInequality(ModuleInput::const_iterator _formula)
std::pair< ModuleInput::const_iterator, RowEntry > Row
Settings::PolynomialWithReasons Polynomial
Answer reduceWRTGroebnerBasis(const std::list< typename Rows::iterator > &ineqToBeReduced, const Ideal &gb, const RewriteRules &rules)
Rows::iterator InsertReceivedFormula(ModuleInput::const_iterator received)
super::const_iterator const_iterator
Passing through the list::const_iterator.
Definition: ModuleInput.h:146
Class to create the formulas for axioms.
Answer
An enum with the possible answers a Module can give.
Definition: types.h:57