Skip to content
Snippets Groups Projects
Commit a75a8f12 authored by Régis Blanc's avatar Régis Blanc
Browse files

Printing the loop invariant

parent cf3813d2
Branches
Tags
No related merge requests found
......@@ -110,7 +110,18 @@ object PrettyPrinter {
sb
}
case Assignment(lhs, rhs) => ppBinary(sb, lhs.toVariable, rhs, " = ", lvl)
case While(cond, body) => {
case wh@While(cond, body) => {
wh.invariant match {
case Some(inv) => {
sb.append("\n")
ind(sb, lvl)
sb.append("@invariant: ")
pp(inv, sb, lvl)
sb.append("\n")
ind(sb, lvl)
}
case None =>
}
sb.append("while(")
pp(cond, sb, lvl)
sb.append(")\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment