Question

(5) (a) Define a deterministic PDA (give table of moves) that accepts the language of balanced strings of parentheses. For convenience, a special end-marker is added to the end of each string. Use the grammar TT TTIE (b) Show the moves that parses the string O$, alongside with the corresponding steps in the left derivation of the string.

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

PDA for given language is given here.

CI) PDA , C, CC ヲHere at state A :- push '[' on to stack for each input string '[' . and pop one '[' for each input string ']'.

when end of string is reached, i.e $ found, and stack is empty accept the string at state B.

--> here symbol Z0 indicates empty stack.

----> Here is the parse tree and derivation for the given string []$ :

Denvaten os string c1$ &T ㄈㄏㄧ ㄒ ㄒ

note : Here given language is left recursive, so there can be ambiguity in derivation.

If you have any doubts, you can ask in comment section.

Add a comment
Know the answer?
Add Answer to:
Define a deterministic PDA (give table of moves) that accepts the language of balanced strings of...
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
  • 4. Show that the pda constructed in Example 7.6 accepts the strings aabb and aaabbbb, and that bo...

    4. Show that the pda constructed in Example 7.6 accepts the strings aabb and aaabbbb, and that both strings are in the language generated by the given grammar. EXAMPLE 7.6 Construct a pda that accepts the language generated by a grammar with productions We first transform the grammar into Greibach normal form, changing the productions to A bB, The corresponding automaton will have three states (go, 91,92), with initial state go and final state q2. First, the start symbol S...

  • 1. Consider the alphabet {a,b,c}. Construct a finite automaton that accepts the language described by the...

    1. Consider the alphabet {a,b,c}. Construct a finite automaton that accepts the language described by the following regular expression. 6* (ab U bc)(aa)* ccb* Which of the following strings are in the language: bccc, babbcaacc, cbcaaaaccbb, and bbbbaaaaccccbbb (Give reasons for why the string are or are not in the language). 2. Let G be a context free grammar in Chomsky normal form. Let w be a string produced by that grammar with W = n 1. Prove that the...

  • Please help me with the coding for LL(1)!! The given grammar was: P → PL |...

    Please help me with the coding for LL(1)!! The given grammar was: P → PL | L L → N; | M; | C N → print E M → print "W" W → TW | ε C → if E {P} | if E {P} else {P} E → (EOE) | V (note: this has a variable O) O → + | - | * V → 0 | 1 | 2 | 3 (note: this has a terminal...

  • Task The task for this assignment is to have the following user-defined data type: struct rgb...

    Task The task for this assignment is to have the following user-defined data type: struct rgb { unsigned char red; unsigned char green; unsigned char blue; }; be able to be: read in from a stream (e.g., std::cin), i.e., write: std::istream& operator >>(std::istream& is, rgb& colour); (see below) written out to a stream (e.g., std::cout), i.e., write: std::ostream& operator <<(std::ostream& os, rgb const& colour); (see below) stored in a container, e.g., std::vector<rgb>, std::array<rgb,16>; (see below) processed via algorithms (and other...

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