@@ -184,15 +185,20 @@ determineFormulaEq m1@(decls1, mbody1, env1) m2@(decls2, mbody2, env2) name = do
-- variables that would make it true:
(result,model)<-isEquivalentast1ast2
caseresultof
Unsat->putStrLn"formulas are equivalent!"
Undef->putStrLn"unable to decide the satisfiablity (TODO: use QuickCheck)"-- this should happen on timeout, but the Z3 library does not function properly...
Unsat->do
putStrLn"formulas are equivalent!"
returnTrue
Undef->do
putStrLn"unable to decide the satisfiablity (TODO: use QuickCheck)"-- this should happen on timeout, but the Z3 library does not function properly...
returnFalse
Sat->do
putStrLn"formulas are NOT equivalent, model:"
casemodelof
Justm->dos<-evalZ3WithNothing(Z3.Opts.opt"timeout"(1000::Int))(modelToStringm)-- TODO: the option is set, but does not actually work :(
putStrLns
showRelevantModel$parseModels
_->return()
returnFalse
_->returnFalse
where
extractCond::MethodDef->String->Exp
extractCondmn=extractExpr(getMethodCallsmn)
...
...
@@ -201,33 +207,15 @@ determineFormulaEq m1@(decls1, mbody1, env1) m2@(decls2, mbody2, env2) name = do
-- Function that compares both the pre and the post condition for two methods.
-- It is assumed that both methods have the same environment (parameter names, class member names, etc).