Context-free grammar of substrings
Ṁ200 / 200
bounty left

Given a context-free grammar that generates a language L1, how do I create a context-free grammar that generates a language L2 whose words are substrings of words from L1? I'd appreciate an exposition I can actually understand

Get
Ṁ1,000
to start trading!
Sort by:

Do you know how to convert between context free grammars and push down automata? If so you can use this algorithm:

1) create PDA for L1 from the grammar

2) make every state an accept state to create PDA2

3) convert PDA2 to grammar for L2

This is just off the top of my head - it may be simple to go from grammar to grammar directly.

© Manifold Markets, Inc.TermsPrivacy