Skip to content

Commit f60ab15

Browse files
committed
Improve prover as per review comments
1 parent c7022aa commit f60ab15

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/src/tests/prover/Prover.scala

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object Prover {
1313
val solver = z3(state)
1414
val prover = new Prove(solver)
1515

16-
val atomNames = for (id <- (1 to atomCnt).toList) yield Name("x", Some(id))
16+
val atomNames = List.tabulate(atomCnt)(i => Name("x", Some(i)))
1717
val atoms =
1818
for (name <- atomNames)
1919
yield App(Inst(Fun(name, Nil, Nil, Sort.bool), Map.empty), Nil)
@@ -25,14 +25,12 @@ object Prover {
2525
for (phi <- Generator.propositionalExprs(atoms, depth)) {
2626
val res = prover.prove(Prop.from(phi))
2727

28-
val equiv = makeIff(phi, res.toExpr)
28+
val equiv = Eq(phi, res.toExpr)
2929
assert(
3030
solver.isTrue(equiv),
3131
f"Solver found that ${res} is not equivalent to to prover input ${phi}."
3232
)
3333
}
3434
})
3535
}
36-
37-
def makeIff(phi: Expr, psi: Expr): Expr = And(Imp(phi, psi), Imp(psi, phi))
3836
}

0 commit comments

Comments
 (0)