12#include "dlinear/solver/Context.h"
13#include "dlinear/solver/Logic.h"
14#include "dlinear/symbolic/symbolic.h"
15#include "dlinear/util/Stats.h"
16#include "dlinear/util/Timer.h"
39 bool ParseStream(std::istream &in,
const std::string &sname =
"stream input");
48 bool ParseString(
const std::string &input,
const std::string &sname =
"string stream");
58 virtual bool ParseFile(
const std::string &filename);
61 static void Error(
const std::string &m);
96 void GetOption(
const std::string &key)
const;
102 void GetInfo(
const std::string &key)
const;
Context class that holds the set of constraints and provide Assert/Push/Pop/CheckSat functionalities.
void Push(int n)
Push n stacks.
void SetInfo(const std::string &key, const std::string &val)
Set an info key with a value val.
void Assert(const Formula &f)
Assert a formula f.
void SetLogic(Logic logic)
Set the current logic to logic.
void SetOption(const std::string &key, const std::string &val)
Set an option key with a value val.
void Pop(int n)
Pop n stacks.
void Exit()
Exit the context.
The Driver is the base class for all the parsers.
std::string & m_stream_name()
Get read-write access to the stream name of the input being parsed.
const Stats & stats() const
Statistics for the driver.
bool debug_scanning_
Enable debug output in the flex scanner.
void CheckSat()
Call context_.CheckSat() and print proper output messages to the standard output.
void Exit()
Callback for the command exit.
Timer * timer_
Pointer to the timer for the driver. Used to Pause the timer when checking sat.
const Context & context() const
Get read-only access to the enabled of the Driver.
void GetInfo(const std::string &key) const
Callback for the command get-info.
bool debug_parsing_
Enable debug output in the bison parser.
void SetLogic(const Logic logic)
Callback for the command set-logic.
bool trace_scanning() const
Check whether the scanner debugger is enabled.
bool ParseString(const std::string &input, const std::string &sname="string stream")
Invoke the scanner and parser on an input string.
void SetOption(const std::string &key, const std::string &value)
Callback for the command set-option.
static void Error(const std::string &m)
General error handling.
Context & context_
The context filled during parsing of the expressions.
void Push(int n)
Push the current context to the stack.
bool trace_parsing() const
Check whether the trace debugger is enabled.
void GetModel()
Return a model computed by the solver in response to an invocation of the check-sat.
Stats stats_
Statistics for the driver.
void SetInfo(const std::string &key, const std::string &value)
Callback for the command set-info.
void Minimize(const Expression &f)
Minimize the objective function f.
Driver(Context &context, const std::string &class_name="Driver")
construct a new parser driver context
virtual bool ParseFile(const std::string &filename)
Invoke the scanner and parser on a file.
void GetAssertions() const
Callback for the command get-assertions.
void GetOption(const std::string &key) const
Callback for the command get-option.
void Maximize(const Expression &f)
Maximize the objective function f.
std::string stream_name_
The name of the stream being parsed.
const std::string & stream_name() const
Get read-only access to the stream name of the input being parsed.
virtual bool ParseStreamCore(std::istream &in)=0
Parse the stream.
bool ParseStream(std::istream &in, const std::string &sname="stream input")
Invoke the scanner and parser for a stream.
void Pop(int n)
Restore a previously pushed context from the stack.
Dataclass collecting statistics about some operation or process.
Timer class using the a steady clock.
Represents a symbolic form of an expression.
Global namespace for the dlinear library.
Logic
The SMT-LIB logic the SMT2 file is using.