SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
MixedSignEncoder.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "PseudoBoolEncoder.h"
4 #include "PseudoBoolNormalizer.h"
5 #include "LongFormulaEncoder.h"
6 #include "ShortFormulaEncoder.h"
7 #include "CardinalityEncoder.h"
8 
9 namespace smtrat {
11  public:
13 
14  bool canEncode(const ConstraintT& constraint);
15  Rational encodingSize(const ConstraintT& constraint);
16 
17  std::string name() { return "MixedSignEncoder"; }
18 
19 
20  protected:
21  std::optional<FormulaT> doEncode(const ConstraintT& constraint);
22 
23  private:
28 
29 
30  FormulaT findSubEncoding(const ConstraintT& constraint);
31  std::vector<Rational> calculateSubsetsums(const std::vector<TermT>& terms);
32  void calculateSubsetsums(const std::vector<TermT>& terms, size_t leftIndex, std::set<Rational>& result, Rational sum = 0);
33 
34 
35  };
36 }
CardinalityEncoder mCardinalityEncoder
std::optional< FormulaT > doEncode(const ConstraintT &constraint)
Rational encodingSize(const ConstraintT &constraint)
PseudoBoolNormalizer mNormalizer
FormulaT findSubEncoding(const ConstraintT &constraint)
ShortFormulaEncoder mShortFormulaEncoder
std::vector< Rational > calculateSubsetsums(const std::vector< TermT > &terms)
bool canEncode(const ConstraintT &constraint)
LongFormulaEncoder mLongFormulaEncoder
Base class for a PseudoBoolean Encoder.
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
Definition: types.h:37
carl::Constraint< Poly > ConstraintT
Definition: types.h:29
mpq_class Rational
Definition: types.h:19