CurryInfo: contract-prover-4.0.0 / ContractProver.callSMT

definition:
 
callSMT :: Options -> String -> IO (Maybe String)
callSMT opts smtinput = do
  printWhenIntermediate opts $ "SMT SCRIPT:\n" ++ showWithLineNums smtinput
  printWhenIntermediate opts $ "CALLING Z3..."
  (ecode,out,err) <- evalCmd "z3"
                             ["-smt2", "-in", "-T:" ++ show (optTimeout opts)]
                             smtinput
  when (ecode>0) $ do printWhenIntermediate opts $ "EXIT CODE: " ++ show ecode
                      writeFile "error.smt" smtinput
  printWhenIntermediate opts $ "RESULT:\n" ++ out
  unless (null err) $ printWhenIntermediate opts $ "ERROR:\n" ++ err
  let unsat = let ls = lines out in not (null ls) && head ls == "unsat"
  return $ if unsat
             then Just $ "; proved by: z3 -smt2 <SMTFILE>\n\n" ++ smtinput
             else Nothing
demand:
 no demanded arguments
deterministic:
 deterministic operation
documentation:
 
Calls the SMT solver (with a timeout of 2secs) on a given SMTLIB script.
Returns `Just` the SMT script if the result is `unsat`, otherwise `Nothing`.
failfree:
 <FAILING>
indeterministic:
 referentially transparent operation
infix:
 no fixity defined
iotype:
 {(_,_) |-> _}
name:
 callSMT
precedence:
 no precedence defined
result-values:
 _
signature:
 ToolOptions.Options -> String -> Prelude.IO (Prelude.Maybe String)
solution-complete:
 operation might suspend on free variables
terminating:
 possibly non-terminating
totally-defined:
 possibly non-reducible on same data term