Skip to content

Commit 742ddac

Browse files
committed
Add fix for passing trec and erec to mergeCalls
1 parent 65072cc commit 742ddac

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/main/scala/inox/solvers/unrolling/TemplateGenerator.scala

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ trait TemplateGenerator { self: Templates =>
132132
))
133133

134134
val newBlocker: Variable = Variable.fresh("bm", BooleanType(), true)
135-
// TODO: make this a method in Builder similar to storeCond
136135
builder.storeConds(thenBlockers ++ elseBlockers, newBlocker)
137136
builder.iff(orJoin((thenBlockers ++ elseBlockers).toSeq), newBlocker)
138137

@@ -450,16 +449,16 @@ trait TemplateGenerator { self: Templates =>
450449
storeExpr(condVar)
451450

452451
val crec = rec(pathVar, cond, None)
453-
val (trec, tClauses) = mkExprClauses(newBool1, thenn, localSubst, pol)
454-
val (erec, eClauses) = mkExprClauses(newBool2, elze, localSubst, pol)
455-
builder ++= mergeCalls(pathVar, condVar, localSubst, tClauses, eClauses)
456-
457452
storeGuarded(pathVar, Equals(condVar, crec))
458453
iff(and(pathVar, condVar), newBool1)
459454
iff(and(pathVar, not(condVar)), newBool2)
460455

461-
storeGuarded(newBool1, Equals(newExpr, trec))
462-
storeGuarded(newBool2, Equals(newExpr, erec))
456+
val (trec, tClauses) = mkExprClauses(newBool1, thenn, localSubst, pol)
457+
val (erec, eClauses) = mkExprClauses(newBool2, elze, localSubst, pol)
458+
builder ++= mergeCalls(pathVar, condVar, localSubst,
459+
tClauses + (newBool1 -> Equals(newExpr, trec)),
460+
eClauses + (newBool2 -> Equals(newExpr, erec)))
461+
463462
newExpr
464463
}
465464
}

0 commit comments

Comments
 (0)