Skip to content

Commit

Permalink
adding a testcase for #194
Browse files Browse the repository at this point in the history
  • Loading branch information
mattulbrich committed Oct 21, 2020
1 parent 8988c15 commit 360fa85
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### project:
class C { var f : int; }

### decls:
o : C
a : array<int>

### sequent:
|- o.f == o.f@$heap[a[0] := 0]

### result:
prove

### translation:
const _$heap : Heap;
const _a : ref;
const _o : ref;
const unique TClass_C : Ty;
const unique _C$$f : Field (int);

axiom (forall x:ref :: $Is(x, TClass_C) <==> dtype(x) == TClass_C || x == null);
axiom $Is(_$heap, THeap);
axiom $Is(_o, TClass_C);
axiom $Is(_C$$f, TField(TInt));
axiom $Is(_a, TArray(TInt));

procedure Sequent()
ensures false;
{
assume !((read(_$heap, _o, _C$$f) == read(update(_$heap, _a, IndexField(0) : Field int, 0), _o, _C$$f)));
}

### comments:
was a bug : IndexField(0) could alias with _C$$f

0 comments on commit 360fa85

Please sign in to comment.