Skip to content

Commit df77786

Browse files
authored
Adapt to new version of z3 (4.16) and Viper (2026.09) (#438)
1 parent f61e818 commit df77786

4 files changed

Lines changed: 22 additions & 2 deletions

File tree

gobra-mod.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"default_job_cfg": {
33
"module": "github.com/scionproto/scion",
4+
"assert_timeout": 45000,
45
"includes": ["", "verification/dependencies"],
56
"only_files_with_header": true,
67
"assume_injectivity_inhale": true,

pkg/slayers/path/scion/raw_spec.gobra

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,11 @@ func ValidPktMetaHdrSublice(raw []byte, idx int) {
451451
unfold acc(sl.Bytes(raw[:idx], 0, idx), R56)
452452
assert forall i int :: { &raw[:MetaLen][i] } 0 <= i && i < MetaLen ==>
453453
&raw[:MetaLen][i] == &raw[:idx][:MetaLen][i]
454+
// Sharing the locations is not enough: the two calls of RawBytesToMetaHdr
455+
// read the meta header through different sl.Bytes predicates, so their
456+
// snapshots must be related on those bytes as well.
457+
assert forall i int :: { &raw[:MetaLen][i] } 0 <= i && i < MetaLen ==>
458+
raw[:MetaLen][i] == raw[:idx][:MetaLen][i]
454459
fold acc(sl.Bytes(raw, 0, len(raw)), R56)
455460
fold acc(sl.Bytes(raw[:idx], 0, idx), R56)
456461
}

pkg/slayers/scion_spec.gobra

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ ensures acc(sl.Bytes(ub, 0, length), R55)
394394
ensures s.ValidHeaderOffset(ub, len(ub))
395395
decreases
396396
func (s *SCION) ValidHeaderOffsetFromSubSliceLemma(ub []byte, length int) {
397-
reveal s.ValidHeaderOffset(ub, len(ub))
397+
reveal s.ValidHeaderOffset(ub, length)
398398
unfold acc(sl.Bytes(ub, 0, len(ub)), R56)
399399
unfold acc(sl.Bytes(ub, 0, length), R56)
400-
assert reveal s.ValidHeaderOffset(ub, length)
400+
assert reveal s.ValidHeaderOffset(ub, len(ub))
401401
fold acc(sl.Bytes(ub, 0, len(ub)), R56)
402402
fold acc(sl.Bytes(ub, 0, length), R56)
403403
}
@@ -532,6 +532,12 @@ decreases
532532
func IsSupportedPktSubslice(raw []byte, idx int) {
533533
unfold acc(sl.Bytes(raw, 0, len(raw)), R56)
534534
unfold acc(sl.Bytes(raw[:idx], 0, idx), R56)
535+
// The two calls of IsSupportedPkt read the next header and the path type
536+
// through different sl.Bytes predicates. Reading both locations through
537+
// both slices while the predicates are unfolded is what makes their
538+
// snapshots agree on them.
539+
assert raw[:idx][4] == raw[4]
540+
assert raw[:idx][8] == raw[8]
535541
reveal IsSupportedPkt(raw)
536542
reveal IsSupportedPkt(raw[:idx])
537543
fold acc(sl.Bytes(raw, 0, len(raw)), R56)
@@ -547,6 +553,9 @@ decreases
547553
func GetPathTypeSubslice(raw []byte, idx int) {
548554
unfold acc(sl.Bytes(raw, 0, len(raw)), R56)
549555
unfold acc(sl.Bytes(raw[:idx], 0, idx), R56)
556+
// Relates the two sl.Bytes snapshots on the byte holding the path type,
557+
// which is the only one the two calls of GetPathType read.
558+
assert raw[:idx][8] == raw[8]
550559
fold acc(sl.Bytes(raw, 0, len(raw)), R56)
551560
fold acc(sl.Bytes(raw[:idx], 0, idx), R56)
552561
}

router/dataplane.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,11 @@ func (d *DataPlane) Run(ctx context.Context /*@, ghost place io.Place, ghost sta
13761376
// @ ensures d.DpAgreesWithSpec(dp)
13771377
// @ ensures d.getValForwardingMetrics() != nil
13781378
// @ decreases
1379+
// The postcondition of this method cannot be exhaled under the package-wide
1380+
// more complete exhale: Silicon summarises the whole heap once per lookup and
1381+
// per consumed conjunct, and the prover grows until it is killed. On demand is
1382+
// enough here, so it is requested for this member alone.
1383+
// @ #backend[exhaleMode(2)]
13791384
func (d *DataPlane) initMetrics( /*@ ghost dp io.DataPlaneSpec @*/ ) {
13801385
// @ assert reveal d.PreWellConfigured()
13811386
// @ reveal d.getDomExternal()

0 commit comments

Comments
 (0)