By using a dynamic programming table that stores the values of φ(u) for all u ∈ Sub(w) we can compute this in time O(|K| 2 |F ||w| 3 ); this is just an elementary variant of the CKY algorithm.
we define the language defined by the DLG G to be to say, a string is in the language if we predict that a string has the context (λ, λ).