SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
RNSEncoder.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
6 #include "PseudoBoolEncoder.h"
7 
8 namespace smtrat {
9  class RNSEncoder : public PseudoBoolEncoder {
10  public:
12 
13  bool canEncode(const ConstraintT& constraint);
14 
15  protected:
16  std::optional<FormulaT> doEncode(const ConstraintT& constraint);
17 
18  private:
19  const std::vector<std::vector<Integer>> mPrimesTable;
20 
21  bool isNonRedundant(const std::vector<Integer>& base, const ConstraintT& formula);
22  std::vector<Integer> integerFactorization(const Integer& coeff);
23  std::vector<std::vector<Integer>> primesTable();
24  std::vector<Integer> calculateRNSBase(const ConstraintT& formula);
25  FormulaT rnsTransformation(const ConstraintT& formula, const Integer& prime);
26 
27  };
28 }
Base class for a PseudoBoolean Encoder.
std::vector< Integer > integerFactorization(const Integer &coeff)
Definition: RNSEncoder.cpp:158
std::optional< FormulaT > doEncode(const ConstraintT &constraint)
Definition: RNSEncoder.cpp:7
std::vector< Integer > calculateRNSBase(const ConstraintT &formula)
Definition: RNSEncoder.cpp:94
bool canEncode(const ConstraintT &constraint)
Definition: RNSEncoder.cpp:230
std::vector< std::vector< Integer > > primesTable()
Definition: RNSEncoder.cpp:234
const std::vector< std::vector< Integer > > mPrimesTable
Definition: RNSEncoder.h:19
FormulaT rnsTransformation(const ConstraintT &formula, const Integer &prime)
Definition: RNSEncoder.cpp:54
bool isNonRedundant(const std::vector< Integer > &base, const ConstraintT &formula)
Definition: RNSEncoder.cpp:22
Class to create the formulas for axioms.
carl::Formula< Poly > FormulaT
Definition: types.h:37
carl::Constraint< Poly > ConstraintT
Definition: types.h:29
carl::IntegralType< Rational >::type Integer
Definition: types.h:21