Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SmtratSmtSolver.cpp
Go to the documentation of this file.
5
6#ifdef STORM_HAVE_SMTRAT
7
8#ifdef SMTRATDOESNTWORK // Does not compile with current version of smtrat.
9#include "lib/smtrat.h"
10
11namespace storm {
12namespace solver {
13
14SmtratSmtSolver::SmtratSmtSolver(storm::expressions::ExpressionManager& manager) : SmtSolver(manager) {
15 // Construct the settingsManager.
16 // smtrat::RuntimeSettingsManager settingsManager;
17
18 // Construct solver.
19 smtrat::RatOne* solver = new smtrat::RatOne();
20
21 // std::list<std::pair<std::string, smtrat::RuntimeSettings*> > settingsObjects =
22 smtrat::addModules(solver);
23
24 // Introduce the settingsObjects from the modules to the manager.
25 // settingsManager.addSettingsObject( settingsObjects );
26 // settingsObjects.clear();
27}
28
29SmtratSmtSolver::~SmtratSmtSolver() {
30 delete solver;
31}
32
33void SmtratSmtSolver::push() {
34 this->solver->push();
35}
36
37void SmtratSmtSolver::pop() {
38 this->solver->pop();
39}
40
41void SmtratSmtSolver::pop(uint_fast64_t n) {
42 this->solver->pop(static_cast<unsigned int>(n));
43}
44
45SmtSolver::CheckResult SmtratSmtSolver::check() {
46 switch (this->solver->check()) {
47 case smtrat::Answer::True:
48 this->lastResult = SmtSolver::CheckResult::Sat;
49 break;
50 case smtrat::Answer::False:
51 this->lastResult = SmtSolver::CheckResult::Unsat;
52 break;
53 case smtrat::Answer::Unknown:
54 this->lastResult = SmtSolver::CheckResult::Unknown;
55 break;
56 default:
57 // maybe exit
58 this->lastResult = SmtSolver::CheckResult::Unknown;
59 break;
60 }
61 return this->lastResult;
62}
63void SmtratSmtSolver::add(const storm::RawPolynomial& pol, storm::CompareRelation cr) {
64 this->solver->add(smtrat::FormulaT(pol, cr));
65}
66
67template<>
68smtrat::Model SmtratSmtSolver::getModel() const {
69 return this->solver->model();
70}
71
72std::vector<smtrat::FormulasT> const& SmtratSmtSolver::getUnsatisfiableCores() const {
73 return this->solver->infeasibleSubsets();
74}
75
76} // namespace solver
77} // namespace storm
78#endif
79#endif
This class is responsible for managing a set of typed variables and all expressions using these varia...
SettingsManager const & manager()
Retrieves the settings manager.
LabParser.cpp.
Definition cli.cpp:18
carl::Relation CompareRelation
carl::MultivariatePolynomial< RationalFunctionCoefficient > RawPolynomial