For a given y ∈ Y ′ , for any v with y v = 1, we can recover the previous two leaves (the trigram ending in v) from either the path variables y p , or the hypergraph variables y e .
define v −1 (v, y) to be the leaf preceding v in the trigram path p with y p = 1 and v 3 (p) = v, and v −2 (v, y) to be the leaf two positions before v in the trigram path p with y p = 1 and v 3 (p) = v. Similarly, define v ′ −1 (v, y) and v ′ −2 (v, y) to be the preceding two leaves under the y e variables.