5 #include "dreal/dr/location.hh" 6 #include "dreal/dr/scanner.h" 7 #include "dreal/solver/context.h" 8 #include "dreal/util/scoped_unordered_map.h" 31 const std::string& sname =
"stream input");
39 const std::string& sname =
"string stream");
54 static void error(
const location& l,
const std::string& m);
58 static void error(
const std::string& m);
97 std::vector<Formula> constraints_;
98 std::vector<Expression> objectives_;
Context class that holds a set of constraints and provide Assert/Push/Pop/CheckSat functionalities...
Definition: context.h:23
void Assert(const Formula &f)
Asserts a formula f.
Definition: driver.cc:80
static void error(const location &l, const std::string &m)
Error handling with associated line number.
Definition: driver.cc:55
The DrDriver class brings together all components.
Definition: driver.h:19
bool parse_file(const std::string &filename)
Invoke the scanner and parser on a file.
Definition: driver.cc:38
void Minimize(const Expression &f)
Asserts a formula maximizing a cost function f.
Definition: driver.cc:82
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
bool parse_string(const std::string &input, const std::string &sname="string stream")
Invoke the scanner and parser on an input string.
Definition: driver.cc:50
Represents a symbolic variable.
Definition: symbolic_variable.h:16
bool parse_stream(std::istream &in, const std::string &sname="stream input")
Invoke the scanner and parser for a stream.
Definition: driver.cc:26
Backtrackable map.
Definition: scoped_unordered_map.h:19
DrScanner * scanner_
Pointer to the current scanenr instance, this is used to connect the parser to the scanner...
Definition: driver.h:92
const Variable & lookup_variable(const std::string &name)
Returns a variable associated with a name name.
Definition: driver.cc:61
DrDriver()=default
construct a new parser driver context
std::string streamname_
stream name (file or input stream) used for error messages.
Definition: driver.h:88
void Solve()
Solves the constructed problem.
Definition: driver.cc:84
void DeclareVariable(const Variable &v)
Declare a variable v.
Definition: driver.cc:69
Represents a symbolic form of an expression.
Definition: symbolic_expression.h:164
DrScanner is a derived class to add some extra function to the scanner class.
Definition: scanner.h:34
bool trace_scanning_
enable debug output in the flex scanner
Definition: driver.h:82
bool trace_parsing_
enable debug output in the bison parser
Definition: driver.h:85