This grammar represents a set of trees which we encode compactly using a weighted hypergraph (or packed forest), a data structure that defines a probability (or weight) for each tree.
we first transform the CYK parser and our grammar into a hypergraph and then compute the weights using inside-outside.