summaryrefslogtreecommitdiff
path: root/Test/hofs/Renaming.dfy
diff options
context:
space:
mode:
Diffstat (limited to 'Test/hofs/Renaming.dfy')
-rw-r--r--Test/hofs/Renaming.dfy25
1 files changed, 25 insertions, 0 deletions
diff --git a/Test/hofs/Renaming.dfy b/Test/hofs/Renaming.dfy
new file mode 100644
index 00000000..7a3f69a5
--- /dev/null
+++ b/Test/hofs/Renaming.dfy
@@ -0,0 +1,25 @@
+// RUN: %dafny /compile:0 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+function OnId(f : (bool -> bool) -> int) : int
+ reads f.reads(x => x);
+ requires f.requires(y => y);
+{
+ f(z => z)
+}
+
+method Equal() {
+ var id1 : bool -> bool := x => x;
+ var id2 := y => y;
+ assert forall x :: id1(x) == id2(x);
+ assert id1 == id2;
+}
+
+method K<A,B>(P : (A -> A) -> bool)
+{
+ assume P.requires(x => x);
+ assume P(y => y);
+ assert P(z => z);
+ assert (x => y => x) == ((a : A) => (b : B) => a);
+}
+