Given contextfree Grammar G = ({S,A,B,C}, Σ, P, S)
with Alphabet set of Σ = {a, b}
and has following Production rules:
S | → AA ∣ BA ∣ BB , |
A | → a ∣ AC ∣ BC , |
B | → b ∣ CS , |
C | → b |
Question is, how many prefix does word w = bbbaaa
in the Language G have?
Using CYK Algorithm, I figured out that w
is in the Lanuguage G. Total number of prefix that I figured out for this word are 4. They are b, bb, bbba, bbbaa
. Can there be more prefix for this word?