prefix(L) is the language containing the prefixes of all strings in L. In other words, prefix(L) = {w | 2 € * and wx € L
Posted: Sat May 14, 2022 7:38 pm
prefix(L) is the language containing the prefixes of all strings in L. In other words, prefix(L) = {w | 2 € * and wx € L}. (a) Prove that prefix is closed over the class of context-free languages by providing a con- struction that, given a CFG generating L, explains how to create a CFG that generates prefix(L). (b) Test your prefix construction on the following grammar: S + ab cSc