summaryrefslogtreecommitdiff
path: root/Test/hofs/TreeMapSimple.dfy
diff options
context:
space:
mode:
authorGravatar Dan Rosén <danr@chalmers.se>2014-08-18 13:24:57 -0700
committerGravatar Dan Rosén <danr@chalmers.se>2014-08-18 13:24:57 -0700
commit5e7d03fba113642aa1d6b181a854c684c740979e (patch)
tree11043399075689c198e6c44dcafb868445c0dc48 /Test/hofs/TreeMapSimple.dfy
parent2ead070c052fb5f506f188571e0e1bef900af9d4 (diff)
Consider lambdas literals + create literal axioms when an argument is a function
Diffstat (limited to 'Test/hofs/TreeMapSimple.dfy')
-rw-r--r--Test/hofs/TreeMapSimple.dfy8
1 files changed, 7 insertions, 1 deletions
diff --git a/Test/hofs/TreeMapSimple.dfy b/Test/hofs/TreeMapSimple.dfy
index e717b096..3c70840e 100644
--- a/Test/hofs/TreeMapSimple.dfy
+++ b/Test/hofs/TreeMapSimple.dfy
@@ -1,4 +1,4 @@
-// RUN: %dafny "%s" > "%t"
+// RUN: %dafny /compile:3 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
datatype List<A> = Nil | Cons(head: A,tail: List<A>);
@@ -47,3 +47,9 @@ function method TMap(t0 : Tree<A>, f : A -> B) : Tree<B>
=> TMap(t,f)))
}
+method Main()
+{
+ var t := TMap(Branch(1,Cons(Branch(2,Nil),Nil)), x requires x != 0 => 100 / x);
+ assert t == Branch(100,Cons(Branch(50,Nil),Nil));
+ print t, "\n";
+}