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

also apply the transformation to precondition and postcondition

parent 82c4e093
No related branches found
No related tags found
No related merge requests found
...@@ -30,8 +30,8 @@ object ArrayTransformation extends Pass { ...@@ -30,8 +30,8 @@ object ArrayTransformation extends Pass {
val freshFunDef = new FunDef(freshFunName, fd.returnType, newArgs) val freshFunDef = new FunDef(freshFunName, fd.returnType, newArgs)
freshFunDef.fromLoop = fd.fromLoop freshFunDef.fromLoop = fd.fromLoop
freshFunDef.parent = fd.parent freshFunDef.parent = fd.parent
freshFunDef.precondition = fd.precondition freshFunDef.precondition = fd.precondition.map(transform)
freshFunDef.postcondition = fd.postcondition freshFunDef.postcondition = fd.postcondition.map(transform)
freshFunDef.addAnnotation(fd.annotations.toSeq:_*) freshFunDef.addAnnotation(fd.annotations.toSeq:_*)
fd2fd += (fd -> freshFunDef) fd2fd += (fd -> freshFunDef)
freshFunDef freshFunDef
...@@ -160,8 +160,8 @@ object ArrayTransformation extends Pass { ...@@ -160,8 +160,8 @@ object ArrayTransformation extends Pass {
val freshFunDef = new FunDef(freshFunName, fd.returnType, newArgs) val freshFunDef = new FunDef(freshFunName, fd.returnType, newArgs)
freshFunDef.fromLoop = fd.fromLoop freshFunDef.fromLoop = fd.fromLoop
freshFunDef.parent = fd.parent freshFunDef.parent = fd.parent
freshFunDef.precondition = fd.precondition freshFunDef.precondition = fd.precondition.map(transform)
freshFunDef.postcondition = fd.postcondition freshFunDef.postcondition = fd.postcondition.map(transform)
freshFunDef.addAnnotation(fd.annotations.toSeq:_*) freshFunDef.addAnnotation(fd.annotations.toSeq:_*)
fd2fd += (fd -> freshFunDef) fd2fd += (fd -> freshFunDef)
freshFunDef freshFunDef
......
import leon.Utils._ import leon.Utils._
object Array4 { object Array5 {
def foo(a: Array[Int]): Int = { def foo(a: Array[Int]): Int = {
var i = 0 var i = 0
......
import leon.Utils._
object Array6 {
def foo(a: Array[Int]): Int = {
require(a.length > 2 && a(2) == 5)
a(2)
} ensuring(_ == 5)
def bar(): Int = {
val a = Array.fill(5)(5)
foo(a)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment