automata theory - How to construct a grammar that generates language L? -


i'm in formal languages class , have grammar quiz coming up. i'm assuming appear.

consider alphabet ∑ = {a, b, c}. construct grammar generates language l = {bab^nabc^na^p : n ≥ 0, p ≥ 1}. assume start variable s.

it long time since worked formal languages last time, so, please, forgive rustyness, language: divide s prefix variable (a) , suffix variable (b). then, handle prefix , suffix separately, both of them have possible rule of further recursion, , end sign of empty, no occurrence required , constant @ least occurrence required.

{bab^nabc^na^p : n ≥ 0, p ≥ 1}  s -> asb -> babaabc -> {empty} b -> ba b -> 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -