Skip to content

Commit b913030

Browse files
authored
Update Submodules to '25.08-RC' (#968)
* updates to Viper '25.08-RC' * fixes verification error in test case due to new incompleteness
1 parent b573af1 commit b913030

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

silver-sif-extension

src/test/resources/regressions/features/globals/scion/monotonicset/bounded.gobra

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ func (b BoundedMonotonicSet) ContainsImpliesFContains(i uint16) {
8080
b.fcontainshelper(i)
8181
}
8282

83+
ghost
84+
opaque
85+
requires 0 <= i && i <= 256
86+
requires forall i uint16 :: 0 <= i && i < 256 ==>
87+
(i elem domain(b.valuesMap) && acc(b.valuesMap[i], _))
88+
decreases
89+
pure func (b BoundedMonotonicSet) fnotcontainshelperUpTo(i uint16) bool {
90+
return forall j uint16 :: { b.fcontainshelper(j) } 0 <= j && j < i ==>
91+
!b.fcontainshelper(j)
92+
}
93+
8394
ghost
8495
ensures res.Inv()
8596
ensures forall i uint16 :: 0 <= i && i < 256 ==>
@@ -106,23 +117,29 @@ func Alloc() (res BoundedMonotonicSet) {
106117
b.valuesMap[i] = new(bool)
107118
}
108119

120+
assert reveal b.fnotcontainshelperUpTo(0)
121+
109122
invariant 0 <= i && i <= 256
110-
invariant forall j uint16 :: 0 <= j && j < i ==>
123+
invariant forall j uint16 :: { j elem domain(b.valuesMap) } 0 <= j && j < i ==>
111124
j elem domain(b.valuesMap)
112125
// injectivity requirement
113-
invariant forall j1, j2 uint16 :: 0 <= j1 && j1 < j2 && j2 < i ==>
126+
invariant forall j1, j2 uint16 :: { b.valuesMap[j1], b.valuesMap[j2] } 0 <= j1 && j1 < j2 && j2 < i ==>
114127
b.valuesMap[j1] != b.valuesMap[j2]
115-
invariant forall j uint16 :: i <= j && j < 256 ==>
116-
acc(b.valuesMap[j]) && !(*b.valuesMap[j])
117-
invariant forall j uint16 :: 0 <= j && j < i ==>
118-
acc(b.valuesMap[j], 1/2)
119-
invariant forall j uint16 :: 0 <= j && j < i ==>
128+
invariant forall j uint16 :: { b.valuesMap[j] } i <= j && j < 256 ==>
129+
acc(b.valuesMap[j], 3/4) && !(*b.valuesMap[j])
130+
invariant forall j uint16 :: { b.valuesMap[j] } 0 <= j && j < i ==>
131+
acc(b.valuesMap[j], 1/4)
132+
invariant forall j uint16 :: { b.DoesNotContain(j) } 0 <= j && j < i ==>
120133
b.DoesNotContain(j)
121-
invariant forall j uint16 :: 0 <= j && j < i ==>
122-
!b.fcontainshelper(j)
134+
invariant b.fnotcontainshelperUpTo(i)
123135
decreases 256 - i
124136
for i = 0; i < 256; i +=1 {
125-
fold b.DoesNotContain(i)
137+
fold b.DoesNotContain(i)
138+
if b.fnotcontainshelperUpTo(i + 1) {} else {
139+
assert reveal b.fnotcontainshelperUpTo(i)
140+
assert reveal b.fnotcontainshelperUpTo(i + 1)
141+
assert false
142+
}
126143
}
127144
fold b.Inv()
128145
return b

0 commit comments

Comments
 (0)