summaryrefslogtreecommitdiff
path: root/Test/irondafny0/Queue.dfyi
diff options
context:
space:
mode:
authorGravatar Michael Lowell Roberts <mirobert@microsoft.com>2015-07-08 11:01:11 -0700
committerGravatar Michael Lowell Roberts <mirobert@microsoft.com>2015-07-08 11:01:11 -0700
commitfad74b96e5d9367960358b1c4cc9c2cce79e961a (patch)
tree805771f13c38cc2206ee9f6d6226651db5b61573 /Test/irondafny0/Queue.dfyi
parent85d4456ccf1e1d8c456dffa012d3f3d724f50a4a (diff)
added unit tests for exclusive refinement.
Diffstat (limited to 'Test/irondafny0/Queue.dfyi')
-rw-r--r--Test/irondafny0/Queue.dfyi22
1 files changed, 22 insertions, 0 deletions
diff --git a/Test/irondafny0/Queue.dfyi b/Test/irondafny0/Queue.dfyi
new file mode 100644
index 00000000..9f7eb534
--- /dev/null
+++ b/Test/irondafny0/Queue.dfyi
@@ -0,0 +1,22 @@
+// Queue.dfyi
+
+abstract module Queue {
+ type Item
+ type Queue = seq<Item>
+
+ method Init() returns (q: Queue)
+ ensures |q| == 0;
+
+ method Push(item: Item, q: Queue) returns (q': Queue)
+ ensures |q'| == |q| + 1;
+
+ method Pop(q: Queue) returns (item: Item, q': Queue)
+ requires |q| > 0;
+ ensures item in q;
+ ensures |q'| == |q| - 1;
+}
+
+abstract module MainSpec {
+ import Q as Queue
+}
+