File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/main/scala/inox/solvers/unrolling Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ trait ChooseEncoder extends transformers.ProgramTransformer {
25
25
26
26
val newFds = sourceProgram.symbols.functions.values.toList.map { fd =>
27
27
def rec (e : Expr , params : Seq [ValDef ]): Expr = e match {
28
+ case l : Let =>
29
+ val free = exprOps.variablesOf(l)
30
+ l.copy(body = rec(l.body, params.filter(vd => free(vd.toVariable)) :+ l.vd)).copiedFrom(l)
31
+
28
32
case l : Lambda =>
29
33
val free = exprOps.variablesOf(l)
30
34
l.copy(body = rec(l.body, params.filter(vd => free(vd.toVariable)) ++ l.params)).copiedFrom(l)
Original file line number Diff line number Diff line change @@ -164,8 +164,15 @@ trait AbstractUnrollingSolver extends Solver { self =>
164
164
165
165
def assertCnstr (expression : Expr ): Unit = context.timers.solvers.assert.run(try {
166
166
context.timers.solvers.assert.sanity.run {
167
- symbols.ensureWellFormed // make sure that the current program is well-formed
168
- typeCheck(expression, BooleanType ()) // make sure we've asserted a boolean-typed expression
167
+ try {
168
+ symbols.ensureWellFormed // make sure that the current program is well-formed
169
+ typeCheck(expression, BooleanType ()) // make sure we've asserted a boolean-typed expression
170
+ } catch {
171
+ case _ : Throwable =>
172
+ context.reporter.internalError(
173
+ " Error while ensuring well-formedness of symbols and expression in `assertCnstr` in `UnrollingSolver`"
174
+ )
175
+ }
169
176
}
170
177
171
178
// Multiple calls to registerForInterrupts are (almost) idempotent and acceptable
You can’t perform that action at this time.
0 commit comments