summaryrefslogtreecommitdiff
path: root/Test/dafny0/Array.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2014-06-04 18:12:03 -0700
committerGravatar Rustan Leino <unknown>2014-06-04 18:12:03 -0700
commit317f84eea57ff897d830588d5893b6722a6aa2a0 (patch)
treeb28c4067ac43f54c7af1a311e53f190913313ece /Test/dafny0/Array.dfy
parent84b0dfe7c573d5bc734e14250067226592cfe7f8 (diff)
Improved axiom that knows that array-to-sequence converstion depends only on those heap location that hold the array elements
Diffstat (limited to 'Test/dafny0/Array.dfy')
-rw-r--r--Test/dafny0/Array.dfy13
1 files changed, 13 insertions, 0 deletions
diff --git a/Test/dafny0/Array.dfy b/Test/dafny0/Array.dfy
index 1b41267e..f6477708 100644
--- a/Test/dafny0/Array.dfy
+++ b/Test/dafny0/Array.dfy
@@ -137,6 +137,19 @@ class A {
a != null && 0 <= j && j <= a.Length &&
a[j..j] == []
}
+
+ predicate Q0(s: seq<int>)
+ predicate Q1(s: seq<int>)
+ method FrameTest(a: array<int>) returns (b: array<int>)
+ requires a != null && Q0(a[..]);
+ {
+ b := CreateArray(a);
+ assert Q0(a[..]); // this should still be known after the call to CreateArray
+ assert Q1(b[..]);
+ }
+ method CreateArray(a: array<int>) returns (b: array<int>)
+ requires a != null;
+ ensures fresh(b) && Q1(b[..]);
}
type B;