diff options
author | Rustan Leino <leino@microsoft.com> | 2012-10-02 14:17:15 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2012-10-02 14:17:15 -0700 |
commit | cb24e4e69da6283835cc5f42c7b0f50dc604568d (patch) | |
tree | 4646c1a614bfbf8a4f643fd9d651073c4a95e043 /Binaries | |
parent | 42c116169feb1019824d43be376acded2b491a0c (diff) |
Dafny: incomplete snapshot of verification of iterators
Diffstat (limited to 'Binaries')
-rw-r--r-- | Binaries/DafnyPrelude.bpl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Binaries/DafnyPrelude.bpl b/Binaries/DafnyPrelude.bpl index ca526173..572a1e29 100644 --- a/Binaries/DafnyPrelude.bpl +++ b/Binaries/DafnyPrelude.bpl @@ -603,6 +603,19 @@ axiom (forall h: HeapType, k: HeapType :: { $HeapSucc(h,k) } $HeapSucc(h,k) ==> (forall o: ref :: { read(k, o, alloc) } read(h, o, alloc) ==> read(k, o, alloc)));
// ---------------------------------------------------------------
+// -- Useful macros ----------------------------------------------
+// ---------------------------------------------------------------
+
+// havoc $Heap \ {this} \ S
+procedure {:inline} $YieldHavoc(this: ref, S: Set BoxType);
+ modifies $Heap;
+ ensures (forall<alpha> $o: ref, $f: Field alpha :: { read($Heap, $o, $f) }
+ $o != null && read(old($Heap), $o, alloc) ==>
+ read($Heap, $o, $f) == read(old($Heap), $o, $f) ||
+ $o == this ||
+ S[$Box($o)]);
+
+// ---------------------------------------------------------------
// -- Non-determinism --------------------------------------------
// ---------------------------------------------------------------
|