Skip to content

Commit 6773117

Browse files
committed
changes testcases that use 'heap', which is now a keyword
1 parent df4c538 commit 6773117

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

Diff for: src/test/resources/all/basic/many_conjuncts.vpr

+17-17
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ field acq: Bool
1515
predicate AcqConjunct(x: Ref, idx: Int)
1616

1717
domain parallelHeaps {
18-
function heap(x: Ref) : Int
18+
function heap_lookup(x: Ref) : Int
1919
function is_ghost(x:Ref) : Bool
2020
}
2121

@@ -28,25 +28,25 @@ domain reads {
2828

2929

3030
method read(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
31-
requires heap(data) == 0 && (heap(count) == 0 && (heap(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard))))))))
32-
ensures heap(data) == 0 && (heap(count) == 0 && (heap(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard)))))))) && (data.val == v && [true, perm(data.val) == none])
31+
requires heap_lookup(data) == 0 && (heap_lookup(count) == 0 && (heap_lookup(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard))))))))
32+
ensures heap_lookup(data) == 0 && (heap_lookup(count) == 0 && (heap_lookup(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard)))))))) && (data.val == v && [true, perm(data.val) == none])
3333
{
3434
v := data.val
3535
}
3636

3737
method read_erroneous(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
38-
requires heap(data) == 0 && (heap(count) == 0 && (heap(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard))))))))
38+
requires heap_lookup(data) == 0 && (heap_lookup(count) == 0 && (heap_lookup(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard))))))))
3939
//:: ExpectedOutput(postcondition.violated:assertion.false)
40-
ensures heap(data) == 0 && (heap(count) == 0 && (heap(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard)))))))) && (data.val == v && [true, perm(data.val) == none] && false)
40+
ensures heap_lookup(data) == 0 && (heap_lookup(count) == 0 && (heap_lookup(ghost) == 0 && (is_ghost(ghost) && (acc(data.val, rd()) && (acc(ghost.val, rd()) && (acc(count.acq, wildcard) && count.acq == false && acc(AcqConjunct(count, 0), wildcard) && (acc(count.rel, wildcard) && count.rel == 0 && acc(count.init, wildcard)))))))) && (data.val == v && [true, perm(data.val) == none] && false)
4141
{
4242
v := data.val
4343
}
4444

4545
method read2(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
4646
requires
47-
heap(data) == 0 &&
48-
heap(count) == 0 &&
49-
heap(ghost) == 0 &&
47+
heap_lookup(data) == 0 &&
48+
heap_lookup(count) == 0 &&
49+
heap_lookup(ghost) == 0 &&
5050
is_ghost(ghost) &&
5151
acc(data.val, rd()) &&
5252
acc(ghost.val, rd()) &&
@@ -58,9 +58,9 @@ method read2(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
5858
acc(count.init, wildcard)
5959

6060
ensures
61-
heap(data) == 0 &&
62-
heap(count) == 0 &&
63-
heap(ghost) == 0 &&
61+
heap_lookup(data) == 0 &&
62+
heap_lookup(count) == 0 &&
63+
heap_lookup(ghost) == 0 &&
6464
is_ghost(ghost) &&
6565
acc(data.val, rd()) &&
6666
acc(ghost.val, rd()) &&
@@ -78,9 +78,9 @@ method read2(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
7878

7979
method read2_erroneous(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
8080
requires
81-
heap(data) == 0 &&
82-
heap(count) == 0 &&
83-
heap(ghost) == 0 &&
81+
heap_lookup(data) == 0 &&
82+
heap_lookup(count) == 0 &&
83+
heap_lookup(ghost) == 0 &&
8484
is_ghost(ghost) &&
8585
acc(data.val, rd()) &&
8686
acc(ghost.val, rd()) &&
@@ -93,9 +93,9 @@ method read2_erroneous(data: Ref, count: Ref, ghost: Ref) returns (v: Int)
9393

9494
ensures
9595
//:: ExpectedOutput(postcondition.violated:assertion.false)
96-
heap(data) == 0 &&
97-
heap(count) == 0 &&
98-
heap(ghost) == 0 &&
96+
heap_lookup(data) == 0 &&
97+
heap_lookup(count) == 0 &&
98+
heap_lookup(ghost) == 0 &&
9999
is_ghost(ghost) &&
100100
acc(data.val, rd()) &&
101101
acc(ghost.val, rd()) &&

Diff for: src/test/resources/all/issues/silicon/0365.vpr

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function tokCountRef(r:Ref): Ref
1616
domain parallelHeaps {
1717
function temp(x: Ref): Ref
1818
function temp_inv(x: Ref): Ref
19-
function heap(x: Ref): Int
19+
function heap_lookup(x: Ref): Int
2020
function is_ghost(x: Ref): Bool
2121

2222
// WARNING: The two axioms can cause a matching loop
2323
axiom inv_temp {
24-
(forall r: Ref :: { temp(r) } temp_inv(temp(r)) == r && (is_ghost(r) ? temp(r) == r : heap(temp(r)) == heap(r) - 3))
24+
(forall r: Ref :: { temp(r) } temp_inv(temp(r)) == r && (is_ghost(r) ? temp(r) == r : heap_lookup(temp(r)) == heap_lookup(r) - 3))
2525
}
2626
axiom inv_temp_inv {
27-
(forall r: Ref :: { temp_inv(r) } temp(temp_inv(r)) == r && (is_ghost(r) ? temp_inv(r) == r : heap(temp_inv(r)) == heap(r) + 3))
27+
(forall r: Ref :: { temp_inv(r) } temp(temp_inv(r)) == r && (is_ghost(r) ? temp_inv(r) == r : heap_lookup(temp_inv(r)) == heap_lookup(r) + 3))
2828
}
2929
}
3030

Diff for: src/test/resources/quantifiedpermissions/misc/misc1.vpr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Any copyright is dedicated to the Public Domain.
2-
// http://creativecommons.org/publicdomain/zero/1.0/
3-
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
44
field val : Int
55

66
domain parallelHeaps {
@@ -12,10 +12,10 @@ domain parallelHeaps {
1212
function temp(x: Ref) : Ref
1313
function temp_inv(x: Ref) : Ref
1414

15-
function heap(x: Ref) : Int
15+
function heap_lookup(x: Ref) : Int
1616
function is_ghost(x:Ref) : Bool
1717

18-
axiom inv_temp { forall r:Ref :: {temp(r)} temp_inv(temp(r)) == r && (is_ghost(r) ? temp(r) == r : heap(temp(r)) == -3) }
18+
axiom inv_temp { forall r:Ref :: {temp(r)} temp_inv(temp(r)) == r && (is_ghost(r) ? temp(r) == r : heap_lookup(temp(r)) == -3) }
1919
}
2020

2121
domain reads {
@@ -31,9 +31,9 @@ domain reads {
3131

3232

3333
method clone(data: Ref, count: Ref, ghost: Ref)
34-
requires heap(data) == 0
35-
&& heap(count) == 0
36-
&& heap(ghost) == 0
34+
requires heap_lookup(data) == 0
35+
&& heap_lookup(count) == 0
36+
&& heap_lookup(ghost) == 0
3737
&& is_ghost(ghost)
3838
&& acc(data.val, rd())
3939
&& acc(ghost.val, rd())

0 commit comments

Comments
 (0)