dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
SmtSolver.h
1
7#pragma once
8
9#include <string>
10
11#include "dlinear/solver/Context.h"
12#include "dlinear/solver/SmtSolverOutput.h"
13#include "dlinear/symbolic/symbolic.h"
14#include "dlinear/util/Box.h"
15#include "dlinear/util/Config.h"
16
17namespace dlinear {
18
41class SmtSolver {
42 public:
47 explicit SmtSolver(Config config = Config{});
52 explicit SmtSolver(const std::string &filename);
53 SmtSolver(const SmtSolver &) = delete;
54 SmtSolver(SmtSolver &&) noexcept = default;
55 SmtSolver &operator=(const SmtSolver &) = delete;
56 SmtSolver &operator=(SmtSolver &&) = delete;
57
58 [[nodiscard]] std::string GetInfo(const std::string &key) const;
59 [[nodiscard]] std::string GetOption(const std::string &key) const;
60 [[nodiscard]] SmtResult GetExpected() const;
61
69 void Assert(const Formula &f);
70
81 const SmtSolverOutput &Parse();
82
95 const SmtSolverOutput &Parse(const std::string &filename);
96
101 const SmtSolverOutput &CheckSat();
102
111 [[nodiscard]] bool Verify(const Box &model) const;
112
113 private:
124 bool ParseInput();
125
129};
130
131} // namespace dlinear
Collection of variables with associated intervals.
Definition Box.h:31
Simple dataclass used to store the configuration of the program.
Definition Config.h:38
Context class that holds the set of constraints and provide Assert/Push/Pop/CheckSat functionalities.
Definition Context.h:31
This class provides an easy interface for using the underling solver.
Definition SmtSolver.h:41
SmtSolver(Config config=Config{})
Construct a new SmtSolver object with the given config .
Definition SmtSolver.cpp:42
const SmtSolverOutput & Parse()
Parse the problem from the input indicated in the configuration.
Definition SmtSolver.cpp:73
Context context_
Context obtained from the input file and passed to the SAT and SMT solvers.
Definition SmtSolver.h:128
SmtSolverOutput output_
Output of the solver.
Definition SmtSolver.h:127
const SmtSolverOutput & CheckSat()
Check the satisfiability of the current context.
Definition SmtSolver.cpp:44
bool ParseInput()
Parse the problem from the input indicated in the configuration.
void Assert(const Formula &f)
Assert a formula to the current context.
Definition SmtSolver.cpp:94
bool Verify(const Box &model) const
Check whether the model satisfies all the assertions loaded in the context.
Definition SmtSolver.cpp:66
Config config_
Configuration of the solver.
Definition SmtSolver.h:126
Represents a symbolic form of a first-order logic formula.
Global namespace for the dlinear library.
SmtResult
SmtSolver Result based on the result of the solver.
Data struct containing the output of the solver, such as the result of the computation as well as som...