diff options
author | Jason Koenig <unknown> | 2012-06-13 11:54:11 -0700 |
---|---|---|
committer | Jason Koenig <unknown> | 2012-06-13 11:54:11 -0700 |
commit | 7cabbe6e10f11b90df4e4b5f5a3bb1c2253b87c5 (patch) | |
tree | 3600184e04e2deac3734da843283940361571fc6 /Test/vacid0 | |
parent | f2eb93519ffd02b775d427d2909cebd0690dc090 (diff) |
Dafny: liberalized equality to work when the types could possibly be the same
(i.e. a != b is allowed when a: array<int> and b: array<T>)
Diffstat (limited to 'Test/vacid0')
-rw-r--r-- | Test/vacid0/LazyInitArray.dfy | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Test/vacid0/LazyInitArray.dfy b/Test/vacid0/LazyInitArray.dfy index e56a8317..3e5a95ef 100644 --- a/Test/vacid0/LazyInitArray.dfy +++ b/Test/vacid0/LazyInitArray.dfy @@ -11,10 +11,10 @@ class LazyInitArray<T> { reads this, a, b, c;
{
a != null && b != null && c != null &&
- a.Length == |Contents| + 1 && // TODO: remove the "+ 1" hack, which currently serves the purpose of distinguishing 'a' from 'b' and 'c'
+ a.Length == |Contents| &&
b.Length == |Contents| &&
c.Length == |Contents| &&
- b != c &&
+ b != c && a != b && a != c &&
0 <= n && n <= c.Length &&
(forall i :: 0 <= i && i < |Contents| ==>
Contents[i] == (if 0 <= b[i] && b[i] < n && c[b[i]] == i then a[i] else Zero)) &&
@@ -41,7 +41,7 @@ class LazyInitArray<T> { ensures |Contents| == N && Zero == zero;
ensures (forall x :: x in Contents ==> x == zero);
{
- a := new T[N+1];
+ a := new T[N];
b := new int[N];
c := new int[N];
n := 0;
|