SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
CardinalityEncoder.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "PseudoBoolEncoder.h"
4 
5 namespace smtrat {
7  public:
9 
10  Rational encodingSize(const ConstraintT& constraint);
11 
12  bool canEncode(const ConstraintT& constraint);
13 
14  std::string name() { return "CardinalityEncoder"; }
15 
16  protected:
17  std::optional<FormulaT> doEncode(const ConstraintT& constraint);
18 
19  private:
20  std::optional<FormulaT> encodeExactly(const ConstraintT& constraint);
21  FormulaT encodeExactly(const std::vector<carl::Variable>& variables, const Rational constant);
22  std::optional<FormulaT> encodeAtLeast(const ConstraintT& constraint);
23  std::optional<FormulaT> encodeAtMost(const ConstraintT& constraint);
24 
25  };
26 }
std::optional< FormulaT > encodeAtMost(const ConstraintT &constraint)
std::optional< FormulaT > encodeAtLeast(const ConstraintT &constraint)
Rational encodingSize(const ConstraintT &constraint)
bool canEncode(const ConstraintT &constraint)
std::optional< FormulaT > doEncode(const ConstraintT &constraint)
std::optional< FormulaT > encodeExactly(const ConstraintT &constraint)
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