SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
FourierMotzkinQE.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../QEQuery.h"
4 
6 
7 #include <eigen3/Eigen/Core>
8 #include <eigen3/Eigen/Dense>
9 #include <eigen3/Eigen/StdVector>
10 
11 #include "FMQEStatistics.h"
12 #include "../util/VariableIndex.h"
13 
14 
15 namespace smtrat::qe::fm {
16 
17 using vector_t = Eigen::Matrix<Rational, Eigen::Dynamic, 1>;
18 using matrix_t = Eigen::Matrix<Rational, Eigen::Dynamic, Eigen::Dynamic>;
19 
20 
22 private:
23  QEQuery m_query; /// The quantifiers to eliminate
24  FormulaT m_formula; /// The logical representation of the solution space
27 
28 public:
29  FourierMotzkinQE(const FormulaT &qfree, const QEQuery &quantifiers)
30  : m_query(quantifiers), m_formula(qfree) {
31 
32  assert(
33  qfree.type() == carl::FormulaType::CONSTRAINT ||
34  qfree.is_real_constraint_conjunction()
35  );
36  }
37 
39 
40 private:
41 
42  std::pair<matrix_t, vector_t> eliminateCol(const matrix_t& constraints,
43  const vector_t& constants,
44  std::size_t col,
45  bool conservative = true);
46 
47  std::pair<matrix_t, vector_t> eliminateCols(const matrix_t &constraints,
48  const vector_t constants,
49  const std::vector<std::size_t> &cols,
50  bool conservative = true);
51 };
52 
53 } // smtrat
std::pair< matrix_t, vector_t > eliminateCols(const matrix_t &constraints, const vector_t constants, const std::vector< std::size_t > &cols, bool conservative=true)
std::pair< matrix_t, vector_t > eliminateCol(const matrix_t &constraints, const vector_t &constants, std::size_t col, bool conservative=true)
FourierMotzkinQE(const FormulaT &qfree, const QEQuery &quantifiers)
FormulaT m_formula
The quantifiers to eliminate.
qe::util::VariableIndex m_var_idx
The logical representation of the solution space.
Eigen::Matrix< Rational, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: eigen_helpers.h:10
Eigen::Matrix< Rational, Eigen::Dynamic, 1 > vector_t
Definition: eigen_helpers.h:9
std::vector< std::pair< QuantifierType, std::vector< carl::Variable > >> QEQuery
Definition: QEQuery.h:17
carl::FormulaSet< Poly > FormulaSetT
Definition: types.h:41
carl::Formula< Poly > FormulaT
Definition: types.h:37