Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

= { a, b, c }, design a context-free grammar G such that L(G) equals the complement of { a n b n c n

= { a, b, c }, design a context-free grammar G such that L(G) equals the complement of { an bn cn : n 0 }

To do this we can: First design a DFA M such that L(M) = a b c . Then complement the DFA to get M' such that L(M') = a b c . Next, allocate a variable Aq for each state q. Then convert arcs (p, c, q) into rules Ap cAq, plus Ap c if q is a final state of M' . Call the new grammar G' and use G' as an option from the start symbol S of G to handle strings not of the form a b c . Now you need to handle strings that do have this form but dont have their numbers of as, bs, and cs all equal. Write those inequalities as further disjunctions of > and < and a or c cases.

Explain why this shows that the class of context-free languages is not closed under complementation.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions