pushdown automaton - Approach to finding the context free grammar of more complicated languages -


i'm having problems approaching following problem.

give context free grammar following language:

{x#y | x,y in {0,1}* , |x| != |y|}  

what best way approach question? @ moment i'm using intuition solve questions these there useful techniques? i.e. think of pda language , derive grammer that? there method finding grammer g = , b using grammars , b?

i'm struggling see how solve appreciated.

thanks.

using intuition valuable technique. solve more such problems, intuitions sharpen, gets easier.

there's no formal technique convert description of language cfg (unless description maps onto cfgs, of course, set of production rules). not, in general, decidable whether language context-free (although cfgs must conform lot of constraints, possible prove language not cfg, semi-mechanically using counting arguments.) , not case intersection of 2 context-free languages context-free, there no procedure can take 2 context-free languages , generate cfg conjunction.

however, union of 2 context-free languages context-free, , cfg can produced mechanically cfgs of 2 languages. there possibility break problems down pieces.

in case of particular problem, suggest simple heuristic, work sort of questions in formal languages classes: try base problem on simpler problems answer know.

as above, union of 2 cfls context free. concatenation, defined as:

l1·l2 = {xy | xl1yl2}

here's 2 approaches, both based on being able construct similar language |x| = |y|. string |x| ≠ |y| must have more characters either on right-hand side or on left-hand side. depending on inclination, add these characters in middle (on 1 or other side of separator) or on 1 of ends. both of these approaches involving using union; 1 of them concatenation , other embedding.

good luck.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -