5. Construct the CYK-table for the string aabb using the following grammar: S X Y Z...
Construct a truth table then simplify the following functional expressions: a) F(x,y,z) = xyz + x(yz)' + x'(y+z) + (xyz)' b) F(x,y,z) = y(x'z + xz') + x(yz + yz')
7.2 7) Construct an npda corresponding to the grammar
S aABB |
aAA,
A aBB |
b,
B bBB | A
We were unable to transcribe this imageWe were unable to transcribe this imageWe were unable to transcribe this image
Consider the following context-free grammar with terminals {a, b, c, d} and start symbol S. S → W | X | Y | Z W → AW D | X | Y | Z X → BXD | Z Y → AY C | Z Z → BZC | ε A → a B → b C → c D → d (a) Give a derivation tree with input string: aaaabccddd (b) What language does this CFG recognize? Give a...
Construct a parse table for following grammar S ----> bSc S----> d
Exhibit a derivation of the string bbbb using the following phrase structured grammar: S + YZY Z + BZC | e BC > CBB Bb + bB bC - Cb BY + Y YC - Y Yse
LL(1) Parser For the grammar: 1. S --> TT 2. T --> aT 3. T --> b Problems Calculate LL(1) parse table Parse string "abab" and construct its parse tree Bonus: Parse string "aabb" and construct its parse tree
2. The following context-free grammar (CFG) has A-productions. S + XY | XYZ X + YXYZ | a | A Y + XZ | ZY | 6 | A Z YZ | XY | X | C Using the algorithm in Chapter 13, find another CFG that generates the same language except for the empty word, and that does not have any A-productions.
3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the string. 3 points) (4 poiots) (5 points) (3 points) sECTION IWOLAttcmpt.any 3.(or 2) questions from this.scction Suppose we have two tokens: (1) the keyword if, and (2) id-entifiers, which are strings of letters other than if. Show the DFA for these tokens. Give a nightmost derivation for the string. Give a parse tree for the string i) Is...
4) (20pts) Given a grammar G: and a string x-aabbab, run the CKY algorithm (construct the table) to determine whether x E L(G). If the answer is Yes, show your derivation based on your table.
Problem 1. Consider the grammar S → Y X Y X → a Y | Y Y → b b Y | X | ε where a and b are tokens. Remember that ε represents the empty string. Y → ε means that Y does not have to match any tokens. 1. Give a leftmost derivation for the string (sequence of tokens): bbabbabb 2. Give a rightmost derivation for the string (sequence of tokens): bbabbabb