SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
IntBlastModule.h
Go to the documentation of this file.
1 /**
2  * @file IntBlastModule.h
3  * @author Andreas Krueger <andreas.krueger@rwth-aachen.de>
4  * @author Florian Corzilius <corzilius@cs.rwth-aachen.de>
5  */
6 
7 #pragma once
8 
11 #include <smtrat-solver/Module.h>
12 #include "../ICPModule/ICPModule.h"
13 #include "IntBlastSettings.h"
14 #include "PolyTreePool.h"
15 
16 namespace smtrat
17 {
19  {
20  private:
21  std::size_t mWidth;
22  bool mSigned;
24  carl::Interval<Integer> mBounds;
25 
26  public:
28  mWidth(0), mSigned(false), mBounds(0, 0)
29  {}
30 
31  BVAnnotation(std::size_t _width, bool _signed, Integer _offset = 0) :
32  mWidth(_width), mSigned(_signed), mOffset(_offset),
33  mBounds(_offset + (_signed ? carl::pow(Integer(2), _width-1)*(-1) : Integer(0)), _offset + (_signed ? carl::pow(Integer(2), _width-1)-1 : carl::pow(Integer(2), _width)-1))
34  {}
35 
36  std::size_t width() const {
37  return mWidth;
38  }
39 
40  bool isSigned() const {
41  return mSigned;
42  }
43 
44  bool is_constant() const {
45  return mBounds.lower() == mBounds.upper();
46  }
47 
48  bool hasOffset() const {
49  return ! carl::is_zero(mOffset);
50  }
51 
52  BVAnnotation withOffset(Integer _newOffset) const {
53  return BVAnnotation(mWidth, mSigned, _newOffset);
54  }
55 
56  BVAnnotation withWidth(std::size_t _width) const {
57  return BVAnnotation(_width, mSigned, mOffset);
58  }
59 
60  const Integer& offset() const {
61  return mOffset;
62  }
63 
64  const carl::Interval<Integer>& bounds() const {
65  return mBounds;
66  }
67 
68  const Integer& lower_bound() const {
69  return mBounds.lower();
70  }
71 
72  const Integer& upper_bound() const {
73  return mBounds.upper();
74  }
75 
76  static BVAnnotation forSum(BVAnnotation _summand1, BVAnnotation _summand2) {
77  std::size_t safeWidth1 = _summand1.width();
78  std::size_t safeWidth2 = _summand2.width();
79  bool makeSigned = (_summand1.isSigned() || _summand2.isSigned());
80 
81  if(_summand1.isSigned() != _summand2.isSigned()) {
82  if(_summand1.isSigned()) {
83  ++safeWidth2;
84  } else {
85  ++safeWidth1;
86  }
87  }
88 
89  std::size_t width = ((safeWidth1 > safeWidth2) ? safeWidth1 : safeWidth2) + 1;
90  return BVAnnotation(width, makeSigned, _summand1.offset() + _summand2.offset());
91  }
92 
93  static BVAnnotation forProduct(BVAnnotation _factor1, BVAnnotation _factor2) {
94  assert(! _factor1.hasOffset() && ! _factor2.hasOffset());
95  bool makeSigned = _factor1.isSigned() || _factor2.isSigned();
96  std::size_t width = _factor1.width() + _factor2.width();
97  return BVAnnotation(width, makeSigned);
98  }
99 
100  friend std::ostream& operator<<( std::ostream& _out, const BVAnnotation& _type ) {
101  return (_out << "[" << (_type.mSigned ? "s" : "u") << _type.mWidth << "+" << _type.mOffset << "]");
102  }
103  };
104 
106  {
107  private:
110 
111  public:
113  mType(), mTerm()
114  {}
115 
116  AnnotatedBVTerm(const BVAnnotation& _type, const carl::BVTerm& _term) :
117  mType(_type), mTerm(_term)
118  {
119  assert(_type.width() == _term.width());
120  }
121 
122  AnnotatedBVTerm(std::size_t _width, bool _signed, Integer _offset = 0) :
123  AnnotatedBVTerm(BVAnnotation(_width, _signed, _offset))
124  { }
125 
127  mType(_type), mTerm()
128  {
129  carl::Variable var = carl::fresh_bitvector_variable();
130  carl::Sort bvSort = carl::SortManager::getInstance().getSort("BitVec", std::vector<std::size_t>({_type.width()}));
131  carl::BVVariable bvVar(var, bvSort);
132  mTerm = carl::BVTerm(carl::BVTermType::VARIABLE, bvVar);
133  }
134 
135  const BVAnnotation& type() const {
136  return mType;
137  }
138 
139  // TODO: Rename to bvTerm or similar, to distinguish from BlastedPoly::term()
140  const carl::BVTerm& term() const {
141  return mTerm;
142  }
143 
144  const carl::BVTerm& operator()() const {
145  return mTerm;
146  }
147 
148  friend std::ostream& operator<<( std::ostream& _out, const AnnotatedBVTerm& _term ) {
149  return (_out << _term.mTerm << " " << _term.mType);
150  }
151  };
152 
154  {
155  private:
160 
161  public:
163  mIsConstant(true), mConstant(), mTerm(), mConstraints()
164  { }
165 
166  BlastedPoly(Integer _constant) :
167  mIsConstant(true), mConstant(_constant), mTerm(), mConstraints()
168  { }
169 
170  BlastedPoly(Integer _constant, FormulasT _constraints) :
171  mIsConstant(true), mConstant(_constant), mTerm(), mConstraints(_constraints)
172  { }
173 
175  mIsConstant(false), mConstant(), mTerm(_term), mConstraints()
176  { }
177 
178  BlastedPoly(AnnotatedBVTerm _term, FormulasT _constraints) :
179  mIsConstant(false), mConstant(), mTerm(_term), mConstraints(_constraints)
180  { }
181 
182  bool is_constant() const {
183  return mIsConstant;
184  }
185 
186  const Integer& constant() const {
187  assert(mIsConstant);
188  return mConstant;
189  }
190 
191  const AnnotatedBVTerm& term() const {
192  assert(! mIsConstant);
193  return mTerm;
194  }
195 
196  const FormulasT& constraints() const {
197  return mConstraints;
198  }
199 
200  const Integer& lower_bound() const {
201  if(mIsConstant) {
202  return mConstant;
203  } else {
204  return mTerm.type().lower_bound();
205  }
206  }
207 
208  const Integer& upper_bound() const {
209  if(mIsConstant) {
210  return mConstant;
211  } else {
212  return mTerm.type().upper_bound();
213  }
214  }
215 
216  friend std::ostream& operator<<( std::ostream& _out, const BlastedPoly& _poly ) {
217  if(_poly.is_constant()) {
218  return (_out << _poly.constant() << " (const)");
219  } else {
220  return (_out << _poly.term());
221  }
222  }
223  };
224 
226  {
227  private:
230 
231  public:
233  { }
234 
235  BlastedConstr(const FormulaT& _formula, const FormulasT& _constraints) :
236  mFormula(_formula), mConstraints(_constraints)
237  { }
238 
239  BlastedConstr(const FormulaT& _formula) :
240  mFormula(_formula), mConstraints()
241  { }
242 
243  BlastedConstr(bool _satisfied) :
244  BlastedConstr(FormulaT(_satisfied ? carl::FormulaType::TRUE : carl::FormulaType::FALSE))
245  { }
246 
247  const FormulaT& formula() const {
248  return mFormula;
249  }
250 
251  const FormulasT& constraints() const {
252  return mConstraints;
253  }
254 
255  friend std::ostream& operator<<( std::ostream& _out, const BlastedConstr& _constr ) {
256  return (_out << _constr.formula() << " (&" << _constr.constraints().size() << "cs)");
257  }
258  };
259 
260 
262  {
263  private:
264  carl::Relation mRelation;
268 
269  public:
270  ConstrTree(const ConstraintT& _constraint) :
271  mRelation(_constraint.relation()), mpLeftPoly(nullptr), mpRightPoly(nullptr), mConstraint(_constraint)
272  {
273  Poly rightPoly(- _constraint.lhs().constant_part());
274  Poly leftPoly(_constraint.lhs() - _constraint.lhs().constant_part());
275 
276  if(leftPoly.lcoeff() < 0) {
277  rightPoly *= Rational(-1);
278  leftPoly *= Rational(-1);
279  mRelation = carl::turn_around(mRelation);
280  }
281 
282  mpLeftPoly = new PolyTree(leftPoly);
283  mpRightPoly = new PolyTree(rightPoly);
284  }
285 
287  delete mpLeftPoly;
288  delete mpRightPoly;
289  }
290 
291  carl::Relation relation() const {
292  return mRelation;
293  }
294 
295  const PolyTree& left() const {
296  return *mpLeftPoly;
297  }
298 
299  const PolyTree& right() const {
300  return *mpRightPoly;
301  }
302 
303  const ConstraintT& constraint() const {
304  return mConstraint;
305  }
306  };
307 
308  template<typename Element, typename Origin>
310  {
311  private:
312  Element mElement;
313  std::set<Origin> mOrigins;
314 
315  public:
316  ElementWithOrigins(const Element& _element) :
317  mElement(_element), mOrigins()
318  { }
319 
320  ElementWithOrigins(const Element& _element, const Origin& _origin) :
321  mElement(_element), mOrigins({ _origin })
322  { }
323 
324  const Element& element() const {
325  return mElement;
326  }
327 
328  const std::set<Origin>& origins() const {
329  return mOrigins;
330  }
331 
332  void addOrigin(const Origin& _origin) {
333  mOrigins.insert(_origin);
334  }
335 
336  bool removeOrigin(const Origin& _origin) {
337  if(mOrigins.erase(_origin) == 1 && mOrigins.empty()) {
338  return true;
339  }
340 
341  return false;
342  }
343 
344  bool hasOrigins() {
345  return ! mOrigins.empty();
346  }
347  };
348 
349  template<typename Element, typename Origin>
351  {
352  private:
354  typedef std::list<ElementWO> Super;
355 
357  std::map<Element, typename Super::iterator> mElementPositions;
358  std::map<Origin, std::list<typename Super::iterator> > mOriginOccurings;
359 
361  std::set<Element> mElementsWithoutOrigins;
362 
363  public:
364  typedef typename Super::iterator iterator;
365  typedef typename Super::const_iterator const_iterator;
366 
367  CollectionWithOrigins(bool _trackElementsWithoutOrigins = true) :
369  mTrackElementsWithoutOrigins(_trackElementsWithoutOrigins),
371  { }
372 
373  bool contains(const Element& _element) {
374  return mElementPositions.find(_element) != mElementPositions.end();
375  }
376 
377  bool add(const Element& _element, const Origin& _origin) {
378  auto lookup = mElementPositions.find(_element);
379 
380  if(lookup == mElementPositions.end()) {
381  ElementWO newElement(_element, _origin);
382  mItems.push_back(newElement);
383  auto inserted = std::prev(mItems.end());
384  mElementPositions[_element] = inserted;
385  mOriginOccurings[_origin].push_back(inserted);
386  return true;
387  } else {
388  lookup->second->addOrigin(_origin);
389  mOriginOccurings[_origin].push_back(lookup->second);
390  return false;
391  }
392  }
393 
394  bool removeOrigin(const Origin& _origin) {
395  auto originIt = mOriginOccurings.find(_origin);
396 
397  if(originIt != mOriginOccurings.end()) {
398  std::list<typename Super::iterator>& occurings = originIt->second;
399 
400  for(auto& item : occurings) {
401  if(item->removeOrigin(_origin)) {
403  mElementsWithoutOrigins.insert(item->element());
404  }
405  mElementPositions.erase(item->element());
406  mItems.erase(item);
407  }
408  }
409  mOriginOccurings.erase(originIt);
410  return true;
411  }
412  return false;
413  }
414 
415  bool removeOrigins(const std::set<Origin>& _origins) {
416  bool removedAnything = false;
417 
418  for(auto& it = _origins.begin();it != _origins.end();++it) {
419  removedAnything = removedAnything || removeOrigin(*it);
420  }
421 
422  return removedAnything;
423  }
424 
426  return mItems.begin();
427  }
428 
430  return mItems.end();
431  }
432 
434  return mItems.cbegin();
435  }
436 
438  return mItems.cend();
439  }
440 
441  const std::set<Element>& elementsWithoutOrigins() const {
444  }
445 
448  mElementsWithoutOrigins.clear();
449  }
450 
451  };
452 
453  template<class Settings>
454  class IntBlastModule : public Module
455  {
456  private:
458  typedef carl::Interval<Integer> IntegerInterval;
459  enum class SolutionOrigin : unsigned { NONE, ICP, BV, BACKEND };
460 
463 
466 
467  ModuleInput* mpICPInput; // ReceivedFormula of the internal ICP Module
468  std::vector<std::atomic_bool*> mICPFoundAnswer;
472 
473  ModuleInput* mpBVInput; // Input of the internal BV solver
476 
478 
479  std::map<Poly, BlastedPoly> mPolyBlastings; // Map from polynomials to bit-vector terms representing them in the blasted output
480  std::map<ConstraintT, BlastedConstr> mConstrBlastings;
481  std::map<Poly, carl::Variable> mSubstitutes; // Map from polynomials to integer variables representing them in the ICP input
482 
483  std::map<Poly, std::set<Poly>> mPolyParents;
484  std::set<Poly> mShrunkPolys;
485 
486  public:
488 std::string moduleName() const {
489 return SettingsType::moduleName;
490 }
491  IntBlastModule( const ModuleInput* _formula, Conditionals& _conditionals, Manager* _manager = NULL );
492 
494 
495  // Main interfaces.
496 
497  /**
498  * Informs the module about the given constraint. It should be tried to inform this
499  * module about any constraint it could receive eventually before assertSubformula
500  * is called (preferably for the first time, but at least before adding a formula
501  * containing that constraint).
502  * @param _constraint The constraint to inform about.
503  * @return false, if it can be easily decided whether the given constraint is inconsistent;
504  * true, otherwise.
505  */
506  bool informCore( const FormulaT& _constraint );
507 
508  /**
509  * Informs all backends about the so far encountered constraints, which have not yet been communicated.
510  * This method must not and will not be called more than once and only before the first runBackends call.
511  */
512  void init();
513 
514  /**
515  * The module has to take the given sub-formula of the received formula into account.
516  *
517  * @param _subformula The sub-formula to take additionally into account.
518  * @return false, if it can be easily decided that this sub-formula causes a conflict with
519  * the already considered sub-formulas;
520  * true, otherwise.
521  */
523 
524  /**
525  * Removes the subformula of the received formula at the given position to the considered ones of this module.
526  * Note that this includes every stored calculation which depended on this subformula, but should keep the other
527  * stored calculation, if possible, untouched.
528  *
529  * @param _subformula The position of the subformula to remove.
530  */
532 
533  /**
534  * Updates the current assignment into the model.
535  * Note, that this is a unique but possibly symbolic assignment maybe containing newly introduced variables.
536  */
537  void updateModel() const;
538 
539  /**
540  * Checks the received formula for consistency.
541  * @return SAT, if the received formula is satisfiable;
542  * UNSAT, if the received formula is not satisfiable;
543  * Unknown, otherwise.
544  */
546 
547  private:
548 
550  BlastedPoly blastSum(const BlastedPoly& _summand1, const BlastedPoly& _summand2);
551  BlastedPoly blastProduct(const BlastedPoly& _factor1, const BlastedPoly& _factor2);
552  bool reblastingNeeded(const BlastedPoly& _previousBlasting, const IntegerInterval& _interval, bool _linear) const;
553  void unblastVariable(const carl::Variable& _variable);
554  int blastVariable(const carl::Variable& _variable, const IntegerInterval& _interval, bool _allowOffset);
555  std::size_t chooseWidth(const Integer& _numberToCover, std::size_t _maxWidth, bool _signed) const;
557  void updateOutsideRestrictionConstraint(bool _fromICPOnly);
558  void addFormulaToICP(const FormulaT& _formula, const FormulaT& _origin);
559  void addSubstitutesToICP(const ConstraintT& _constraint, const FormulaT& _origin);
560  void addConstraintFormulaToICP(const FormulaT& _formula);
561  carl::Variable::Arg getICPSubstitute(const Poly& _poly);
562  void removeFormulaFromICP(const FormulaT& _formula, const FormulaT& _origin);
563  void removeOriginFromICP(const FormulaT& _origin);
564  void encodeFormulaToBV(const FormulaT& _formula);
565  FormulaT encodeConstraintToBV(const FormulaT& _original, FormulasT* _collectedBitvectorConstraints);
566  void addFormulaToBV(const FormulaT& _formula, const FormulaT& _origin);
567  void removeOriginFromBV(const FormulaT& _origin);
568  void updateModelFromICP() const;
569  void updateModelFromBV() const;
570  carl::BVTerm encodeBVConstant(const Integer& _constant, const BVAnnotation& _type) const;
571  Integer decodeBVConstant(const carl::BVValue& _value, const BVAnnotation& _type) const;
572  carl::BVTerm resizeBVTerm(const AnnotatedBVTerm& _term, std::size_t _width) const;
573  std::pair<BlastedPoly, bool> shrinkToRange(const BlastedPoly& _input, const IntegerInterval& _interval) const;
574  bool evaluateRelation(carl::Relation _relation, const Integer& _first, const Integer& _second) const;
575  FormulasT blastConstraint(const ConstraintT& _constraint);
576  const BlastedPoly& blastPolyTree(const PolyTree& _poly, FormulasT& _collectedFormulas);
577  const BlastedConstr& blastConstrTree(const ConstrTree& _constraint, FormulasT& _collectedFormulas);
578  void addBoundRestrictionsToICP(carl::Variable _variable, const BVAnnotation& blastedType);
579  void removeBoundRestrictionsFromICP(carl::Variable _variable);
580  IntegerInterval get_num(const RationalInterval& _interval) const;
581  void addPolyParents(const ConstraintT& _constraint);
582  void addPolyParent(const Poly& _child, const Poly& _parent);
583  std::set<Poly> parentalClosure(std::set<Poly> _children);
585  void unblastPoly(const Poly& _polys);
586  void unblastPolys(const std::set<Poly>& _polys);
587  };
588 }
const carl::BVTerm & term() const
const carl::BVTerm & operator()() const
AnnotatedBVTerm(const BVAnnotation &_type)
const BVAnnotation & type() const
friend std::ostream & operator<<(std::ostream &_out, const AnnotatedBVTerm &_term)
AnnotatedBVTerm(const BVAnnotation &_type, const carl::BVTerm &_term)
AnnotatedBVTerm(std::size_t _width, bool _signed, Integer _offset=0)
bool hasOffset() const
friend std::ostream & operator<<(std::ostream &_out, const BVAnnotation &_type)
const Integer & lower_bound() const
BVAnnotation(std::size_t _width, bool _signed, Integer _offset=0)
static BVAnnotation forSum(BVAnnotation _summand1, BVAnnotation _summand2)
BVAnnotation withOffset(Integer _newOffset) const
const Integer & offset() const
bool isSigned() const
bool is_constant() const
static BVAnnotation forProduct(BVAnnotation _factor1, BVAnnotation _factor2)
carl::Interval< Integer > mBounds
const Integer & upper_bound() const
const carl::Interval< Integer > & bounds() const
BVAnnotation withWidth(std::size_t _width) const
std::size_t width() const
Strategy description.
Definition: BVSolver.h:24
BlastedConstr(bool _satisfied)
BlastedConstr(const FormulaT &_formula, const FormulasT &_constraints)
const FormulasT & constraints() const
const FormulaT & formula() const
friend std::ostream & operator<<(std::ostream &_out, const BlastedConstr &_constr)
BlastedConstr(const FormulaT &_formula)
friend std::ostream & operator<<(std::ostream &_out, const BlastedPoly &_poly)
bool is_constant() const
const Integer & lower_bound() const
const Integer & constant() const
const AnnotatedBVTerm & term() const
BlastedPoly(Integer _constant)
BlastedPoly(AnnotatedBVTerm _term, FormulasT _constraints)
BlastedPoly(Integer _constant, FormulasT _constraints)
AnnotatedBVTerm mTerm
const FormulasT & constraints() const
BlastedPoly(AnnotatedBVTerm _term)
const Integer & upper_bound() const
std::set< Element > mElementsWithoutOrigins
std::list< ElementWO > Super
bool removeOrigin(const Origin &_origin)
std::map< Element, typename Super::iterator > mElementPositions
bool add(const Element &_element, const Origin &_origin)
std::map< Origin, std::list< typename Super::iterator > > mOriginOccurings
const_iterator cend() const
ElementWithOrigins< Element, Origin > ElementWO
CollectionWithOrigins(bool _trackElementsWithoutOrigins=true)
Super::const_iterator const_iterator
bool contains(const Element &_element)
bool removeOrigins(const std::set< Origin > &_origins)
const std::set< Element > & elementsWithoutOrigins() const
const_iterator cbegin() const
const PolyTree & right() const
const PolyTree & left() const
carl::Relation relation() const
ConstrTree(const ConstraintT &_constraint)
ConstraintT mConstraint
const ConstraintT & constraint() const
PolyTree * mpRightPoly
carl::Relation mRelation
ElementWithOrigins(const Element &_element, const Origin &_origin)
ElementWithOrigins(const Element &_element)
const Element & element() const
std::set< Origin > mOrigins
bool removeOrigin(const Origin &_origin)
const std::set< Origin > & origins() const
void addOrigin(const Origin &_origin)
IntegerInterval get_num(const RationalInterval &_interval) const
carl::Interval< Integer > IntegerInterval
ModuleInput * mpICPInput
Answer checkCore()
Checks the received formula for consistency.
std::size_t chooseWidth(const Integer &_numberToCover, std::size_t _maxWidth, bool _signed) const
carl::Variable::Arg getICPSubstitute(const Poly &_poly)
std::map< Poly, std::set< Poly > > mPolyParents
void removeFormulaFromICP(const FormulaT &_formula, const FormulaT &_origin)
std::pair< BlastedPoly, bool > shrinkToRange(const BlastedPoly &_input, const IntegerInterval &_interval) const
std::set< Poly > mShrunkPolys
void addFormulaToICP(const FormulaT &_formula, const FormulaT &_origin)
void unblastVariable(const carl::Variable &_variable)
VariableBounds mBoundsInRestriction
void addConstraintFormulaToICP(const FormulaT &_formula)
bool informCore(const FormulaT &_constraint)
Informs the module about the given constraint.
void removeOriginFromICP(const FormulaT &_origin)
IntBlastModule(const ModuleInput *_formula, Conditionals &_conditionals, Manager *_manager=NULL)
BlastedPoly blastSum(const BlastedPoly &_summand1, const BlastedPoly &_summand2)
void unblastPoly(const Poly &_polys)
void addPolyParents(const ConstraintT &_constraint)
carl::BVTerm encodeBVConstant(const Integer &_constant, const BVAnnotation &_type) const
VariableBounds mBoundsFromInput
void addSubstitutesToICP(const ConstraintT &_constraint, const FormulaT &_origin)
FormulasT blastConstraint(const ConstraintT &_constraint)
void addBoundRestrictionsToICP(carl::Variable _variable, const BVAnnotation &blastedType)
std::map< Poly, BlastedPoly > mPolyBlastings
CollectionWithOrigins< carl::Variable, FormulaT > mInputVariables
bool reblastingNeeded(const BlastedPoly &_previousBlasting, const IntegerInterval &_interval, bool _linear) const
const BlastedPoly & blastPolyTree(const PolyTree &_poly, FormulasT &_collectedFormulas)
bool evaluateRelation(carl::Relation _relation, const Integer &_first, const Integer &_second) const
void init()
Informs all backends about the so far encountered constraints, which have not yet been communicated.
void unblastPolys(const std::set< Poly > &_polys)
void updateModelFromICP() const
SolutionOrigin mSolutionOrigin
FormulaSetT mFormulasToEncode
void removeBoundRestrictionsFromICP(carl::Variable _variable)
void encodeFormulaToBV(const FormulaT &_formula)
std::map< Poly, carl::Variable > mSubstitutes
std::set< Poly > parentalClosure(std::set< Poly > _children)
void removeCore(ModuleInput::const_iterator _subformula)
Removes the subformula of the received formula at the given position to the considered ones of this m...
FormulasT mProcessedFormulasFromICP
BlastedPoly blastProduct(const BlastedPoly &_factor1, const BlastedPoly &_factor2)
std::vector< std::atomic_bool * > mICPFoundAnswer
void updateModel() const
Updates the current assignment into the model.
void updateOutsideRestrictionConstraint(bool _fromICPOnly)
bool addCore(ModuleInput::const_iterator _subformula)
The module has to take the given sub-formula of the received formula into account.
void addPolyParent(const Poly &_child, const Poly &_parent)
smtrat::vb::VariableBounds< FormulaT > VariableBounds
const BlastedConstr & blastConstrTree(const ConstrTree &_constraint, FormulasT &_collectedFormulas)
std::string moduleName() const
std::map< ConstraintT, BlastedConstr > mConstrBlastings
carl::BVTerm resizeBVTerm(const AnnotatedBVTerm &_term, std::size_t _width) const
void addFormulaToBV(const FormulaT &_formula, const FormulaT &_origin)
FormulaT encodeConstraintToBV(const FormulaT &_original, FormulasT *_collectedBitvectorConstraints)
int blastVariable(const carl::Variable &_variable, const IntegerInterval &_interval, bool _allowOffset)
void updateModelFromBV() const
void removeOriginFromBV(const FormulaT &_origin)
CollectionWithOrigins< carl::Variable, FormulaT > mNonlinearInputVariables
Integer decodeBVConstant(const carl::BVValue &_value, const BVAnnotation &_type) const
ICPModule< ICPSettings1 > mICP
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
A base class for all kind of theory solving methods.
Definition: Module.h:70
int var(Lit p)
Definition: SolverTypes.h:64
carl::BVVariable BVVariable
Definition: TheoryTypes.h:78
carl::BVTerm BVTerm
Typedef for bitvector term.
Definition: TheoryTypes.h:77
Class to create the formulas for axioms.
carl::FormulaSet< Poly > FormulaSetT
Definition: types.h:41
carl::Formula< Poly > FormulaT
Definition: types.h:37
const settings::Settings & Settings()
Definition: Settings.h:96
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
carl::IntegralType< Rational >::type Integer
Definition: types.h:21