-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | An SMT-LIB backend running solvers as external processes.
--
-- This library implements an SMT-LIB backend (in the sense of the
-- smtlib-backends package) using by running solvers as external
-- processes.
@package smtlib-backends-process
@version 0.2
-- | A module providing a backend that launches solvers as external
-- processes.
module SMTLIB.Backends.Process
data Config
Config :: String -> [String] -> (ByteString -> IO ()) -> Config
-- | The command to call to run the solver.
[exe] :: Config -> String
-- | Arguments to pass to the solver's command.
[args] :: Config -> [String]
-- | A function for logging the solver process' messages on stderr and file
-- handle exceptions. If you want line breaks between each log message,
-- you need to implement it yourself, e.g use putStr .
-- (<> "n").
[reportError] :: Config -> ByteString -> IO ()
data Handle
Handle :: Process Handle Handle Handle -> Async () -> Handle
-- | The process running the solver.
[process] :: Handle -> Process Handle Handle Handle
-- | A process reading the solver's error messages and logging them.
[errorReader] :: Handle -> Async ()
-- | Run a solver as a process. Failures relative to terminating the
-- process are logged and discarded.
new :: Config -> IO Handle
-- | Wait for the process to exit and cleanup its resources.
wait :: Handle -> IO ExitCode
-- | Terminate the process, wait for it to actually exit and cleanup its
-- resources. Don't use this if you're manually stopping the solver
-- process by sending an (exit) command. Use wait
-- instead.
close :: Handle -> IO ()
-- | Create a solver process, use it to make a computation and stop it.
-- Don't use this if you're manually stopping the solver process by
-- sending an (exit) command. Use \config ->
-- bracket (new config) wait instead.
with :: Config -> (Handle -> IO a) -> IO a
-- | Make the solver process into an SMT-LIB backend.
toBackend :: Handle -> Backend
instance Data.Default.Class.Default SMTLIB.Backends.Process.Config