summaryrefslogtreecommitdiff
path: root/Binaries
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2012-10-02 14:17:15 -0700
committerGravatar Rustan Leino <leino@microsoft.com>2012-10-02 14:17:15 -0700
commit6489805cff9bc62d1933ca31a0307dbd43cd60e9 (patch)
treec9cef28cf5e59fea9c8ac519c78dbeb0c1679eeb /Binaries
parentbcf0efdf2537bb31db269a3620b6eaabe02d38ad (diff)
Dafny: incomplete snapshot of verification of iterators
Diffstat (limited to 'Binaries')
-rw-r--r--Binaries/DafnyPrelude.bpl13
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 --------------------------------------------
// ---------------------------------------------------------------