Skip to content

Commit

Permalink
Remove sendSolver
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed Dec 13, 2022
1 parent f59ae05 commit 1e2711a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/SMTLIB/Backends.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ data Solver = Solver
queue :: Maybe Queue
}

-- | Send a command in bytestring builder format to the solver.
sendSolver :: Solver -> Builder -> IO LBS.ByteString
sendSolver solver cmd = send (backend solver) cmd

-- | 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 lazy mode. This should
Expand Down Expand Up @@ -97,7 +93,7 @@ initSolver solverBackend lazy = do
-- *not* checked for correctness.
command :: Solver -> Builder -> IO LBS.ByteString
command solver cmd = do
sendSolver solver
send (backend solver)
=<< case queue solver of
Nothing -> return $ cmd
Just q -> (<> cmd) <$> flushQueue q
Expand All @@ -111,7 +107,7 @@ ackCommand :: Solver -> Builder -> IO ()
ackCommand solver cmd =
case queue solver of
Nothing -> do
res <- sendSolver solver cmd
res <- send (backend solver) cmd
if trim res == "success"
then return ()
else
Expand Down

0 comments on commit 1e2711a

Please sign in to comment.