Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
SMTLIB.Backends
Synopsis
- data Backend = Backend {}
- data QueuingFlag
- data Solver
- initSolver :: QueuingFlag -> Backend -> IO Solver
- command :: Solver -> Builder -> IO ByteString
- command_ :: Solver -> Builder -> IO ()
- flushQueue :: Solver -> IO ()
Documentation
The type of solver backends. SMTLib2 commands are sent to a backend which processes them and outputs the solver's response.
Constructors
Backend | |
Fields
|
data QueuingFlag Source #
Whether to enable queuing for a Solver
.
Constructors
NoQueuing | In In this mode, the option |
Queuing | In It is the responsibility of the caller to identify these commands and
sent them through the When a command is sent whose output is actually necessary, the queue is flushed and sent as a batch to the backend.
For parsing to work properly, at most one of the commands in the batch
can produce an output. Hence the |
A solver is essentially a wrapper around a solver backend. It also comes an optional queue of commands to send to the backend.
Arguments
:: QueuingFlag | whether to enable |
-> Backend | the solver backend |
-> IO Solver |
Create a new solver and initialize it with some options so that it behaves
correctly for our use.
In particular, the "print-success" option is disabled in Queuing
mode. This
should not be overriden manually.
command :: Solver -> Builder -> IO ByteString Source #
Have the solver evaluate a SMT-LIB command. This forces the queued commands to be evaluated as well, but their results are *not* checked for correctness.
Concurrent calls to different solvers are thread-safe, but not concurrent calls on the same solver or the same backend.
Only one command must be given per invocation, or the multiple commands must together produce the output of one command only.
command_ :: Solver -> Builder -> IO () Source #
A command with no interesting result.
In NoQueuing
mode, the result is checked for correctness. In Queuing
mode, (unless the queue is flushed and evaluated right after) the command
must not produce any output when evaluated, and its output is thus in
particular not checked for correctness.
Concurrent calls to different solvers are thread-safe, but not concurrent calls on the same solver or the same backend.
Only one command must be given per invocation, or the multiple commands must together produce the output of one command only.
flushQueue :: Solver -> IO () Source #
Force the content of the queue to be sent to the solver. Only useful in queuing mode, does nothing in non-queuing mode.