Skip to content
Snippets Groups Projects
Commit d4dadcd7 authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

FunDef.postOrTrue

parent 67787aff
Branches
Tags
No related merge requests found
...@@ -394,6 +394,10 @@ object Definitions { ...@@ -394,6 +394,10 @@ object Definitions {
def postcondition_=(op: Option[Expr]) = { def postcondition_=(op: Option[Expr]) = {
fullBody = withPostcondition(fullBody, op) fullBody = withPostcondition(fullBody, op)
} }
def postOrTrue = postcondition getOrElse {
val arg = ValDef(FreshIdentifier("res", returnType, alwaysShowUniqueID = true))
Lambda(Seq(arg), BooleanLiteral(true))
}
def hasBody = body.isDefined def hasBody = body.isDefined
def hasPrecondition = precondition.isDefined def hasPrecondition = precondition.isDefined
......
...@@ -129,9 +129,7 @@ class Repairman(ctx0: LeonContext, initProgram: Program, fd: FunDef, verifTimeou ...@@ -129,9 +129,7 @@ class Repairman(ctx0: LeonContext, initProgram: Program, fd: FunDef, verifTimeou
val origBody = fd.body.get val origBody = fd.body.get
val spec = fd.postcondition.getOrElse( val spec = fd.postOrTrue
Lambda(Seq(ValDef(FreshIdentifier("res", fd.returnType))), BooleanLiteral(true))
)
val choose = Choose(spec) val choose = Choose(spec)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment