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 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](/WebImages/25/let-the-terminal-symbols-t-give-a-cfg-for-the-followi-1065580-1761557329-0.webp)