@@ -93,8 +93,8 @@ func testRun(
9393 key *[]byte,
9494 metrics *Metrics,
9595 ctx context.Context,
96- place io.Place,
97- state io.IO_dp3s_state_local) (d *DataPlane) {
96+ ghost place io.Place,
97+ ghost state io.IO_dp3s_state_local) (d *DataPlane) {
9898 // body similar to foldDataPlaneMem
9999 d = &DataPlane{}
100100
@@ -137,43 +137,46 @@ func testRun(
137137 fold accForwardingMetrics(d.forwardingMetrics)
138138
139139 ensures dp.Valid()
140- ensures dp === io.DataPlaneSpec_ {
140+ // the following trivial assertion makes sure that `==` matches
141+ // `===` for ghost structs
142+ ensures dp != io.DataPlaneSpec{}
143+ ensures dp == io.DataPlaneSpec {
141144 linkTypes: dict[io.IO_ifs]io.IO_Link{
142- 1 : io.IO_ProvCust{},
143- 2 : io.IO_ProvCust{},
144- 3 : io.IO_ProvCust{},
145+ io.IO_ifs{1} : io.IO_ProvCust{},
146+ io.IO_ifs{2} : io.IO_ProvCust{},
147+ io.IO_ifs{3} : io.IO_ProvCust{},
145148 },
146149 neighborIAs: dict[io.IO_ifs]io.IO_as{
147- 1: 1001,
148- 2: 1002,
149- 3: 1000,
150+ io.IO_ifs{1}: io.IO_as{ 1001} ,
151+ io.IO_ifs{2}: io.IO_as{ 1002} ,
152+ io.IO_ifs{3}: io.IO_as{ 1000} ,
150153 },
151- localIA: 1000,
154+ localIA: io.IO_as{ 1000} ,
152155 links: dict[io.AsIfsPair]io.AsIfsPair {
153- io.AsIfsPair{1000, 1} : io.AsIfsPair{1001, 7 },
154- io.AsIfsPair{1000, 2} : io.AsIfsPair{1002, 8 },
155- io.AsIfsPair{1000, 3} : io.AsIfsPair{1000, 3 },
156- io.AsIfsPair{1001, 7} : io.AsIfsPair{1000, 1 },
157- io.AsIfsPair{1002, 8} : io.AsIfsPair{1000, 2 }}}
156+ io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{1}} : io.AsIfsPair{io.IO_as{ 1001}, io.IO_ifs{7} },
157+ io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{2}} : io.AsIfsPair{io.IO_as{ 1002}, io.IO_ifs{8} },
158+ io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{3}} : io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{3} },
159+ io.AsIfsPair{io.IO_as{ 1001}, io.IO_ifs{7}} : io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{1} },
160+ io.AsIfsPair{io.IO_as{ 1002}, io.IO_ifs{8}} : io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{2} }}}
158161 outline(
159- pair1 := io.AsIfsPair{1000, 1 }
160- pair2 := io.AsIfsPair{1000, 2 }
161- pair3 := io.AsIfsPair{1000, 3 }
162- pair4 := io.AsIfsPair{1001, 7 }
163- pair5 := io.AsIfsPair{1002, 8 }
162+ pair1 := io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{1} }
163+ pair2 := io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{2} }
164+ pair3 := io.AsIfsPair{io.IO_as{ 1000}, io.IO_ifs{3} }
165+ pair4 := io.AsIfsPair{io.IO_as{ 1001}, io.IO_ifs{7} }
166+ pair5 := io.AsIfsPair{io.IO_as{ 1002}, io.IO_ifs{8} }
164167
165- dp := io.DataPlaneSpec_ {
168+ dp := io.DataPlaneSpec {
166169 linkTypes: dict[io.IO_ifs]io.IO_Link{
167- 1 : io.IO_ProvCust{},
168- 2 : io.IO_ProvCust{},
169- 3 : io.IO_ProvCust{},
170+ io.IO_ifs{1} : io.IO_ProvCust{},
171+ io.IO_ifs{2} : io.IO_ProvCust{},
172+ io.IO_ifs{3} : io.IO_ProvCust{},
170173 },
171174 neighborIAs: dict[io.IO_ifs]io.IO_as{
172- 1: 1001,
173- 2: 1002,
174- 3: 1000,
175+ io.IO_ifs{1}: io.IO_as{ 1001} ,
176+ io.IO_ifs{2}: io.IO_as{ 1002} ,
177+ io.IO_ifs{3}: io.IO_as{ 1000} ,
175178 },
176- localIA: 1000,
179+ localIA: io.IO_as{ 1000} ,
177180 links: dict[io.AsIfsPair]io.AsIfsPair {
178181 pair1: pair4,
179182 pair2: pair5,
@@ -201,7 +204,7 @@ func testRun(
201204 assert reveal dp.Valid()
202205 )
203206
204- assert dp.Asid() == 1000
207+ assert dp.Asid().V == 1000
205208 assert d.localIA == 1000
206209 assert d.dpSpecWellConfiguredLocalIA(dp)
207210 assert d.dpSpecWellConfiguredNeighborIAs(dp)
@@ -238,3 +241,16 @@ func allocateBatchConn() (b BatchConn)
238241
239242ensures u != nil && u.Mem()
240243func allocateUDPAddr() (u *net.UDPAddr)
244+
245+ // the following trivial assertion makes sure that `==` matches
246+ // `===` for ghost structs
247+ func testEquals() {
248+ assert forall d1 io.DataPlaneSpec, d2 io.DataPlaneSpec :: { dummyTrigger(d1), dummyTrigger(d2) } (d1 == d2) == (d1 === d2)
249+ }
250+
251+ ghost
252+ pure
253+ decreases
254+ func dummyTrigger(d io.DataPlaneSpec) bool {
255+ return true
256+ }
0 commit comments