SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
PseudoBoolEncoder.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
4 
6 
7 namespace smtrat {
8 
9  /**
10  * Base class for a PseudoBoolean Encoder. It takes a arithmetic constraint and
11  * converts it to a boolean Formula
12  */
14  public:
15  /**
16  * Encodes an arbitrary constraint
17  * @return encoded formula
18  */
19  std::optional<FormulaT> encode(const ConstraintT& constraint);
20  std::size_t problem_size;
21 
22  virtual Rational encodingSize(const ConstraintT& constraint);
23  virtual bool canEncode(const ConstraintT& constraint) = 0;
24 
25  virtual std::string name() { return "unspecified PseudoBoolEncoder"; }
26 
27  protected:
28  virtual std::optional<FormulaT> doEncode(const ConstraintT& constraint) = 0;
29 
30  FormulaT generateVarChain(const std::set<carl::Variable>& vars, carl::FormulaType type);
31 
32  private:
34 
35  };
36 }
Base class for a PseudoBoolean Encoder.
virtual Rational encodingSize(const ConstraintT &constraint)
std::optional< FormulaT > encode(const ConstraintT &constraint)
Encodes an arbitrary constraint.
FormulaT generateVarChain(const std::set< carl::Variable > &vars, carl::FormulaType type)
virtual std::optional< FormulaT > doEncode(const ConstraintT &constraint)=0
virtual bool canEncode(const ConstraintT &constraint)=0
virtual std::string name()
ConstraintT normalizeLessConstraint(const ConstraintT &constraint)
QuantifierType type(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Definition: QEQuery.h:39
std::vector< carl::Variable > vars(const std::pair< QuantifierType, std::vector< carl::Variable >> &p)
Definition: QEQuery.h:43
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