Let the terminal symbols T Give a CFG for the followi

Let the terminal symbols T = { (, ), [, ], }. Give a CFG for the following language PARNE2 defined inductively as:
i. Î PARNE2
ii. If x is a string in PARNE2 then so are (x) and [x]
iii. If x and y are both strings in PARNE2 then so is xy
example strings in PAREN2 are (), [], [[]](), [()()], [[()(())][()]()]
Let the terminal symbols T = { (, ), [, ], }. Give a CFG for the following language PARNE2 defined inductively as:
i. Î PARNE2
ii. If x is a string in PARNE2 then so are (x) and [x]
iii. If x and y are both strings in PARNE2 then so is xy
example strings in PAREN2 are (), [], [[]](), [()()], [[()(())][()]()]
Let the terminal symbols T = { (, ), [, ], }. Give a CFG for the following language PARNE2 defined inductively as:
i. Î PARNE2
ii. If x is a string in PARNE2 then so are (x) and [x]
iii. If x and y are both strings in PARNE2 then so is xy
example strings in PAREN2 are (), [], [[]](), [()()], [[()(())][()]()]

Solution

PARNE2 is given by:

S -> S S {covers point ii}
| O S C {covers point i}
O -> ( / [ / epsilon {covers point iii}
C -> ) / ] / epsilon{covers point iii}

 Let the terminal symbols T = { (, ), [, ], }. Give a CFG for the following language PARNE2 defined inductively as: i. Î PARNE2 ii. If x is a string in PARNE2 t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site