The Łukasiewicz coding of plane trees #
Section 2.1 of the paper (source lines 683–696) and Section 2.3 (source lines 735–736).
PlaneTree.dfsSeq Tis the DFS sequence𝐱(T) = (k_{u_1}(T) - 1, …, k_{u_n}(T) - 1).- Its partial sums are nonnegative before time
n = |T|and equal-1at timen, soζ(𝐱(T) ++ 𝐲) = |T|for every continuation𝐲(zeta_dfsSeq_append). - The coding is injective and even prefix-free (
dfsSeq_append_inj), and its range is exactly the set of sequences with increments≥ -1whose first passage time to-1is their length (mem_range_dfsSeq_iff). PlaneTree.ofSeq 𝐱is the paper'sT(𝐱): the tree whose DFS sequence is(x_1, …, x_{ζ(𝐱)}).eq:fringe: thei-th cyclic shift of𝐱(T), stopped at its first passage time to-1, is the DFS sequence of the fringe subtree at thei-th vertex (ofSeq_rotate_dfsSeq).
Forests (lists of trees) are coded by concatenation (PlaneTree.forestSeq); a forest of k
trees corresponds to a sequence with first passage to -k at its end.
The DFS sequence of a forest: the concatenation of the DFS sequences of its trees.
Equations
Instances For
All proper partial sums of a DFS sequence are nonnegative (before ζ).
Łukasiewicz coding (B02). For every tree T and every continuation 𝐲,
ζ(𝐱(T) 𝐲) = |T|.
The DFS sequence determines the tree.
The outdegree sequence in DFS order determines the tree.
Łukasiewicz coding, surjectivity (B02). If 𝐱 has increments ≥ -1 and
ζ(𝐱) = m < ∞, then (x_1, …, x_m) is the DFS sequence of a tree (with m vertices).
The paper's T(𝐱): the tree whose DFS sequence is (x_1, …, x_{ζ(𝐱)}), if ζ(𝐱) < ∞
and this prefix is a DFS sequence (which holds whenever all increments are ≥ -1), and none
otherwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If 𝐱 has increments ≥ -1 and ζ(𝐱) = m < ∞, then T(𝐱) is defined, has m vertices,
and its DFS sequence is (x_1, …, x_m).
Fringe subtrees and cyclic shifts (eq:fringe) #
The DFS sequence of the fringe subtree at the i-th vertex (in DFS order, 0-indexed) is a
contiguous block of 𝐱(T) starting at position i.
Index bound transfer: |T| is the length of the list of fringe trees.
eq:fringe. The i-th cyclic shift of 𝐱(T) first hits -1 at the size of the
fringe subtree T_{u_i} at the i-th vertex.
eq:fringe. The i-th cyclic shift of 𝐱(T), up to its first passage time to -1, is
the DFS sequence of the fringe subtree T_{u_i}.
eq:fringe. T(𝐱^{(i)}(T)) = T_{u_i}.