Skip to content
Snippets Groups Projects
Commit 59980f32 authored by Nicolas Voirol's avatar Nicolas Voirol
Browse files

Added nesting to normalizeStructure

Disabled nested quantification for BigInts in Predicate testcase
parent bf0b98f3
No related branches found
No related tags found
No related merge requests found
......@@ -323,6 +323,14 @@ object ExprOps extends GenTreeOps[Expr] {
override def transform(e: Expr)(implicit bindings: Map[Identifier, Identifier]): Expr = e match {
case expr if (isSimple(expr) || !onlySimple) && (variablesOf(expr) & vars).isEmpty => getId(expr).toVariable
case f: Forall =>
val (args, body, newSubst) = normalizeStructure(f.args.map(_.id), f.body, onlySimple)
subst ++= newSubst
Forall(args.map(ValDef(_)), body)
case l: Lambda =>
val (args, body, newSubst) = normalizeStructure(l.args.map(_.id), l.body, onlySimple)
subst ++= newSubst
Lambda(args.map(ValDef(_)), body)
case _ => super.transform(e)
}
}
......
......@@ -43,8 +43,11 @@ object Predicate {
equals(map(map(p, f), g), map(p, (a: A) => g(f(a))))
}.holds
/* Disabled
* Nested quantification is not really a supported feature anyway...
def testInt(p: BigInt => Boolean, f: BigInt => BigInt, g: BigInt => BigInt): Boolean = {
equals(map(map(p, f), g), map(p, (x: BigInt) => g(f(x))))
}.holds
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment