Skip to content

Commit 619be2c

Browse files
committed
path
1 parent 663bdbb commit 619be2c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pkg/slayers/path/epic/epic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type Path struct {
8383
// @ preserves let ub := p.UBytes() in
8484
// @ sl.Bytes(ub, 0, len(ub))
8585
// @ preserves sl.Bytes(b, 0, len(b))
86+
// @ ensures old(p.UBytes()) === p.UBytes()
8687
// @ ensures r != nil ==> r.ErrorMem()
8788
// @ ensures !old(p.HasScionPath()) ==> r != nil
8889
// @ ensures len(b) < old(p.LenSpec()) ==> r != nil

pkg/slayers/path/path.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ type Path interface {
8383
//@ preserves acc(Mem(), R1)
8484
//@ preserves sl.Bytes(UBytes(), 0, len(UBytes()))
8585
//@ preserves sl.Bytes(b, 0, len(b))
86+
//@ ensures UBytes() === old(UBytes())
8687
//@ ensures e != nil ==> e.ErrorMem()
8788
//@ decreases
8889
SerializeTo(b []byte) (e error)
@@ -92,7 +93,10 @@ type Path interface {
9293
//@ requires NonInitMem()
9394
//@ requires acc(sl.Bytes(b, 0, len(b)), R42)
9495
//@ ensures err == nil ==> Mem()
96+
// The following post contains the conjunct 0 < len(b) on the LHS
97+
// specifically to support the implementation proof for the empty path.
9598
//@ ensures err == nil && 0 < len(b) ==> UBytes() === b
99+
//@ ensures err == nil && 0 == len(b) ==> UBytes() === b || UBytes() == nil
96100
//@ ensures err == nil ==>
97101
//@ acc(sl.Bytes(UBytes(), 0, len(UBytes())), R42)
98102
//@ ensures err == nil ==> IsValidResultOfDecoding()

0 commit comments

Comments
 (0)