Updating the double-counting round #
A successful transcript answers membership in the current round. Scan successors of that round to obtain its next frontier. Each new vertex contributes once to the count, and its distance is the next round index. Figure 2 of [RA00] increments once per qualifying predecessor and flags ties. Its accumulator agrees with the set-based update here when the next-round predecessor test succeeds. On a tied round the set-based tally still counts each newly reached vertex once. Under uniqueness in the current round, a new vertex has a unique shortest walk exactly when it has a unique predecessor in that round.
The checked diamond in CslibFrontierTests.LayeredDigraph uses isSome_iff
to query a vertex outside the first round, then uses the predecessor criterion
to show that uniqueness fails in the second. Scan provides a streaming
replay of the bounded scan, and the native LogSpace.DoubleCounting module
certifies the terminal comparison of binary tallies.
Main results #
Cslib.DoubleCounting.nextTally_eq_expected: the scan computes the exact next tally.Cslib.DoubleCounting.existsUnique_shortest_iff_predecessor: correctness of the tie check at a new vertex.
The vertices outside the current round that have a predecessor selected in its scan.
Add one count and the new distance for each vertex in the next frontier.
From the exact previous tally and a successful scan, the update computes the exact tally.
Assuming uniqueness in the current round, a newly reached vertex has one shortest walk exactly when it has one predecessor in the current round.
A unique current transcript extends to a unique next-round transcript exactly when all newly reached vertices pass the predecessor check.