summaryrefslogtreecommitdiff
path: root/Test/dafny4/Bug128.dfy
diff options
context:
space:
mode:
Diffstat (limited to 'Test/dafny4/Bug128.dfy')
-rw-r--r--Test/dafny4/Bug128.dfy13
1 files changed, 13 insertions, 0 deletions
diff --git a/Test/dafny4/Bug128.dfy b/Test/dafny4/Bug128.dfy
new file mode 100644
index 00000000..b7220335
--- /dev/null
+++ b/Test/dafny4/Bug128.dfy
@@ -0,0 +1,13 @@
+// RUN: %dafny /noNLarith /z3opt:pi.warnings=true /proverWarnings:1 /compile:0 /autoTriggers:1 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+function GetIndexInSequence<T>(s:seq<T>, x:T) : int
+ requires x in s;
+ ensures 0 <= GetIndexInSequence(s, x) < |s|;
+ ensures s[GetIndexInSequence(s, x)] == x; {
+ var i :| 0 <= i < |s| && s[i] == x;
+ i
+ }
+
+
+