SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
qe.cpp
Go to the documentation of this file.
1 #include "qe.h"
2 
3 #include "FourierMotzkinQE.h"
4 #include "FMQEStatistics.h"
5 
6 namespace smtrat::qe::fm {
7 
8 std::optional<FormulaT> qe(const FormulaT& f) {
10  // TODO: make sure more general inputs can be handled
11  if (f.type() != carl::FormulaType::EXISTS) return std::nullopt;
12  if (!f.quantified_formula().is_real_constraint_conjunction()
13  && f.quantified_formula().type() != carl::FormulaType::CONSTRAINT) return std::nullopt;
14 
15  // TODO: get rid of QEQuery
16  QEQuery q = {{QuantifierType::EXISTS, f.quantified_variables()}};
17  FourierMotzkinQE elim(f.quantified_formula(), q);
19  SMTRAT_TIME_FINISH(FMQEStatistics::get_instance().timer(), t);
21  FMQEStatistics::get_instance().output(result.is_nary() ? result.subformulas().size() : 1)
22  );
23  return result;
24 }
25 
26 } // namespace
std::optional< FormulaT > qe(const FormulaT &f)
Definition: qe.cpp:8
std::vector< std::pair< QuantifierType, std::vector< carl::Variable > >> QEQuery
Definition: QEQuery.h:17
carl::Formula< Poly > FormulaT
Definition: types.h:37
#define SMTRAT_STATISTICS_CALL(function)
Definition: Statistics.h:23
#define SMTRAT_TIME_START(variable)
Definition: Statistics.h:24
#define SMTRAT_TIME_FINISH(timer, start)
Definition: Statistics.h:25