Question

Show that the CFG below is ambiguous by finding a word with two distinct syntax trees....

Show that the CFG below is ambiguous by finding a word with two distinct syntax trees. Show both syntax trees.

S → SbSbS

S → a

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:-----------

Add a comment
Know the answer?
Add Answer to:
Show that the CFG below is ambiguous by finding a word with two distinct syntax trees....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a CFG for the following expressions: 6. a) ab(a+b)*ba (10) b) a*ba* (10) c) Convert the previous CFGs into Chomsky's normal form, CNF (20) d) Draw the syntax tree for one word from eac...

    Create a CFG for the following expressions: 6. a) ab(a+b)*ba (10) b) a*ba* (10) c) Convert the previous CFGs into Chomsky's normal form, CNF (20) d) Draw the syntax tree for one word from each of the previous CFGs. (10) Create a CFG for the following expressions: 6. a) ab(a+b)*ba (10) b) a*ba* (10) c) Convert the previous CFGs into Chomsky's normal form, CNF (20) d) Draw the syntax tree for one word from each of the previous CFGs. (10)

  • In R × R, for any two distinct points A and B, there exists a unique line containing them Show th...

    in R × R, for any two distinct points A and B, there exists a unique line containing them Show this statement is not true in Z, x Z, by finding the equations of two distinct lines that both pass through the points (1,2) and (3,4) in R × R, for any two distinct points A and B, there exists a unique line containing them Show this statement is not true in Z, x Z, by finding the equations of...

  • can you plzz do question 1 and 2 Question 1. Design a CFG for the language...

    can you plzz do question 1 and 2 Question 1. Design a CFG for the language over = {1, #} whose elements consist of every pair of distinct, #-separated unary values: L = {rı#x2 | 21, 22 € 1", 21 * x2}. Question 2. Design a CFG for the language of binary strings that contain at least one 1 in their second half: L = {uv | UE (OU 1)", v € OU 1)*1(0U 1)", [u '}. Question 3. This...

  • Show that the following grammar is ambiguous. Hint: Show two different leftmost or rightmost derivations for...

    Show that the following grammar is ambiguous. Hint: Show two different leftmost or rightmost derivations for the same string. Equivalently, you can show two different parse trees for the same string. <expr> ::= <expr> + <expr> | <expr> - <expr> | <expr> * <expr> | <expr> / <expr> | int int ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Using this grammar show that ambiguity is not acceptable...

  • Please help and show full steps will upvote thanks! Define a context-free grammar (CFG) that generates...

    Please help and show full steps will upvote thanks! Define a context-free grammar (CFG) that generates exactly the following language. B = {1'0'ik | i+j = k or i+k=j with i, j, k > 0} Both ambiguous and unambiguous grammars are acceptable (it does not matter in this question). For grading purposes, please use as the starting variable. Alphabet E = {0,1}

  • In Java, building a recursive descent recognizer that prints concrete syntax trees without building them. A...

    In Java, building a recursive descent recognizer that prints concrete syntax trees without building them. A sample input file appears below. It consists of six regular expressions, one on each line. Call this inputFile2.txt. two t|w|o [two] [ˆtwo] t(oo?|wo) (\<(/?[^\>]+)\>) For each statement in the file, you are to print a concrete syntax tree as the parse proceeds. The required output is shown below. The amount of horizontal indentation depicts the nesting level of the node within the tree. The...

  • The following shows a context-free Tammar on {0, 1}. Show that the grammar is ambiguous by...

    The following shows a context-free Tammar on {0, 1}. Show that the grammar is ambiguous by generating 2 derivation sequences for word 00111. S > AS5 A → Al|0A101 The following is a context-free grammar on alphabet {a}. Use the string a +a- a to verify whether or not the grammar is ambiguous. AA+AA-AA The following is a gamar equivalent to the one shown above in problem (5). Is it ambiguous? Use a +a- a to verify it. A →...

  • Q1: Given the below language and context free gramma:, a. Show that the grammar is ambiguous...

    Q1: Given the below language and context free gramma:, a. Show that the grammar is ambiguous using the string ( abc) by using substitutions. b. Then design a push down automata that recognizes the language. C. Then show the tracing of (abc, abbccc) using the push down automata. d. Then Show which two simple languages create the greaterlanguage. Give set builder notation for each language. e. Then produce Chomsky normal form for the grammar. The following context-free language is inherently...

  • 9. Mark the best description (smallest language class) for each of the following lang • R...

    9. Mark the best description (smallest language class) for each of the following lang • R if it is regular • C if it is context free, but not regular . N if it is "bigger than" context free You do not have to prove your answer. L = {www: we {a,b}"} L2 = {a" : n > 2, m < 5} L3 = {a"m : n + m is even } LA = {w:na(w) + no(w) = n(w)} Ls...

  • 3. Using the grammar below, show a parse tree and a leftmost derivation for the statement....

    3. Using the grammar below, show a parse tree and a leftmost derivation for the statement. A = ( A + (B)) * C assign <idxpr expr>? <expr> <term> term <term factor factor (<expr>) l <term I <factor l <id> 4. Prove that the following grammar is ambiguous (Give sentence that has two parse trees, and show the parse trees):

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT