Skip to content
Snippets Groups Projects
Commit c0b4ac13 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Fix Asserts in VCs in fairz3

parent dc5e5158
Branches
Tags
No related merge requests found
...@@ -171,7 +171,7 @@ class TemplateGenerator[T](val encoder: TemplateEncoder[T], ...@@ -171,7 +171,7 @@ class TemplateGenerator[T](val encoder: TemplateEncoder[T],
rec(pathVar, body) rec(pathVar, body)
case e @ Ensuring(_, _) => case e @ Ensuring(_, _) =>
rec(pathVar, e.toAssert) rec(pathVar, e.toAssert)
case l @ Let(i, e : Lambda, b) => case l @ Let(i, e : Lambda, b) =>
val re = rec(pathVar, e) // guaranteed variable! val re = rec(pathVar, e) // guaranteed variable!
......
...@@ -361,6 +361,9 @@ trait AbstractZ3Solver ...@@ -361,6 +361,9 @@ trait AbstractZ3Solver
} }
case Waypoint(_, e, _) => rec(e) case Waypoint(_, e, _) => rec(e)
case a @ Assert(cond, err, body) =>
rec(IfExpr(cond, body, Error(a.getType, err.getOrElse("Assertion failed")).setPos(a.getPos)).setPos(a.getPos))
case e @ Error(tpe, _) => { case e @ Error(tpe, _) => {
val newAST = z3.mkFreshConst("errorValue", typeToSort(tpe)) val newAST = z3.mkFreshConst("errorValue", typeToSort(tpe))
// Might introduce dupplicates (e), but no worries here // Might introduce dupplicates (e), but no worries here
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment