Reversible pebbling of the directed path #
Bennett's recursive strategy reversibly pebbles the directed path 0 → 1 → ⋯ with logarithmically
many pebbles, and this is optimal. With k pebbles,
- a configuration containing
vis reachable iffv + 2 ≤ 2 ^ k; - the configuration
{v}is reachable iff2 * (v + 1) ≤ 2 ^ k.
So the reversible pebbling price of v is ⌈log₂ (v + 2)⌉ and its persistent price is
⌈log₂ (v + 1)⌉ + 1, while the black pebbling price of every vertex other than the source is 2
(blackPebblingPrice_pathDigraph_succ).
Bennett's strategy. bennettMoves a k pebbles the block a, …, a + 2 ^ k - 1 of the path,
given a pebble on a - 1 (or a = 0), and leaves only a + 2 ^ k - 1 pebbled. For k = 0 it
places a pebble on a. For the block of length 2 ^ (k + 1), bennettMoves a (k + 1) first runs
bennettMoves a k to pebble the midpoint a + 2 ^ k - 1, then bennettMoves (a + 2 ^ k) k to
pebble the end, then plays the first run backwards to remove the midpoint. So bennettMoves a k
uses k + 1 extra pebbles and 3 ^ k moves (bennettMoves_mTr, length_bennettMoves). In
particular k + 1 pebbles reversibly pebble a path of 2 ^ k vertices in 3 ^ k moves, ending
with only the last vertex pebbled (exists_mTr_bennett_pathDigraph). These are the procedures
pebble(s, n) and unpebble(s, n) of [LTV98], Section 7, in the form that ends
with a single pebble.
The lower bound. Write R_k for the configurations reachable with k pebbles. We prove by
induction on k that every x in a configuration of R_k has x + 2 ≤ 2 ^ k
(add_two_le_of_reversiblePebbleGame_pathDigraph_mTr), together with the bound
2 * (c + 1) ≤ 2 ^ k on its least element c
(two_mul_min_add_one_le_of_reversiblePebbleGame_pathDigraph_mTr).
- For the least element
c + 1, play the run backwards from the configuration to∅and restrict it to the vertices belowc + 1. The restricted run uses at mostk - 1pebbles whilec + 1is pebbled, and must removec + 1at some point, which needs a pebble onc. - For the other elements, restrict the run from
∅to the vertices at least2 ^ (k - 1), shifted down by2 ^ (k - 1). By the bound on the least element, a nonempty configuration ofR_khas an element below2 ^ (k - 1), so the shifted run uses at mostk - 1pebbles.
This proves the bound of [LTV98], Corollary 2 and Theorem 2(i), by a different route: they first characterize all reachable configurations (Theorem 1 and Corollary 1).
Index conventions. Vertex v of pathDigraph is node v + 1 of [LTV98], whose
node 0 carries a permanent pebble that is not counted; the source 0 here plays the role of
their freely toggled node 1. Their Corollary 2, that the maximum reachable node with n pebbles
is 2 ^ n - 1, is reversiblePebblable_pathDigraph_iff.
Main definitions #
Cslib.Pebbling.bennettMoves a k: Bennett's strategy on the block of length2 ^ kata.
Main results #
Cslib.Pebbling.bennettMoves_mTr,Cslib.Pebbling.length_bennettMoves: Bennett's strategy usesk + 1extra pebbles and3 ^ kmoves.Cslib.Pebbling.exists_mTr_bennett_pathDigraph:k + 1pebbles reversibly pebble a path of2 ^ kvertices in3 ^ kmoves.Cslib.Pebbling.add_two_le_of_reversiblePebbleGame_pathDigraph_mTr: every pebble reachable withkpebbles is at a vertexvwithv + 2 ≤ 2 ^ k.Cslib.Pebbling.reversiblePebblable_pathDigraph_iff,Cslib.Pebbling.persistentReversiblePebblable_pathDigraph_iff: the exact characterizations.Cslib.Pebbling.reversiblePebblingPrice_pathDigraph,Cslib.Pebbling.persistentReversiblePebblingPrice_pathDigraph: the prices asNat.clog 2.Cslib.Pebbling.persistentReversiblePebblingPrice_pathDigraph_two_pow_sub_one,Cslib.Pebbling.reversiblePebblingPrice_pathDigraph_two_pow_sub_one: Bennett'sk + 1pebbles are optimal for the last vertex of a path of2 ^ kvertices, in both forms.
References #
- C. H. Bennett, Time/space trade-offs for reversible computation.
- M. Li, J. Tromp, P. Vitányi, Reversible simulation of irreversible computation by pebble games, Sections 6 and 7, Corollary 2 and Theorem 2(i).
Bennett's strategy #
Bennett's strategy. If the configuration C has no pebble on the block
a, …, a + 2 ^ k - 1 and a pebble on a - 1 (or a = 0), then bennettMoves a k pebbles
a + 2 ^ k - 1 and changes nothing else, using k + 1 pebbles beyond those of C.
Bennett's theorem on paths. k + 1 pebbles reversibly pebble the path of 2 ^ k
vertices 0, …, 2 ^ k - 1 in 3 ^ k moves, ending with only the last vertex pebbled.
Upper bounds #
Pebbling any vertex v of the block a, …, a + 2 ^ k - 1 from C, ending with insert v C,
with k + 1 extra pebbles.
Lower bounds #
The lower bound. Every pebble of a configuration reachable with k pebbles on the
directed path lies at a vertex v with v + 2 ≤ 2 ^ k ([LTV98], Corollary 2).
The least pebble of a nonempty configuration reachable with k pebbles on the directed path
lies at a vertex c with 2 * (c + 1) ≤ 2 ^ k.
Exact prices #
Reversible pebbling of the path. With k pebbles, a configuration containing v is
reachable iff v + 2 ≤ 2 ^ k.
Persistent reversible pebbling of the path. With k pebbles, the configuration {v} is
reachable iff 2 * (v + 1) ≤ 2 ^ k.
The reversible pebbling price of vertex v of the directed path is ⌈log₂ (v + 2)⌉.
The persistent reversible pebbling price of vertex v of the directed path is
⌈log₂ (v + 1)⌉ + 1.
Optimality of Bennett's strategy, visiting form. The last vertex 2 ^ k - 1 of a path of
2 ^ k vertices has reversible price k + 1: with k pebbles it cannot even be visited.
Optimality of Bennett's strategy. Ending with only the last vertex 2 ^ k - 1 of a path of
2 ^ k vertices pebbled costs exactly k + 1 pebbles, the budget of
exists_mTr_bennett_pathDigraph.