-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathapplying-twice-qp-fields.vpr
49 lines (39 loc) · 1.51 KB
/
applying-twice-qp-fields.vpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
field f: Int
// based on test7 in QPFields.vpr
method test14a(x: Ref)
requires forall y: Ref :: true ==> acc(y.f)
{
package (forall y: Ref :: true ==> acc(y.f)) --* (forall y: Ref :: true ==> acc(y.f))
x.f := 0
assert applying ((forall y: Ref :: true ==> acc(y.f)) --* (forall y: Ref :: true ==> acc(y.f))) in true
x.f := 1
assert applying ((forall y: Ref :: true ==> acc(y.f)) --* (forall y: Ref :: true ==> acc(y.f))) in true
//:: ExpectedOutput(assert.failed:assertion.false)
assert false
}
// based on test9 in QPFields.vpr
method test14b(x: Ref)
requires forall y: Ref :: true ==> acc(y.f)
{
package (forall y: Ref :: true ==> acc(y.f)) --* acc(x.f)
x.f := 0
assert applying ((forall y: Ref :: true ==> acc(y.f)) --* acc(x.f)) in true
x.f := 1
assert applying ((forall y: Ref :: true ==> acc(y.f)) --* acc(x.f)) in true
//:: ExpectedOutput(assert.failed:assertion.false)
assert false
}
// based on test11 in QPFields.vpr
method test14c(x: Ref, z: Ref)
requires acc(x.f) && z != x
{
package (forall y: Ref :: y != x ==> acc(y.f)) --* (forall y: Ref :: true ==> acc(y.f))
inhale forall y: Ref :: y != x ==> acc(y.f)
assert acc(z.f)
z.f := 0
assert applying ((forall y: Ref :: y != x ==> acc(y.f)) --* (forall y: Ref :: true ==> acc(y.f))) in true
z.f := 1
assert applying ((forall y: Ref :: y != x ==> acc(y.f)) --* (forall y: Ref :: true ==> acc(y.f))) in true
//:: ExpectedOutput(assert.failed:assertion.false)
assert false
}