Question: PROBLEMS: Let Sigma = { a , b , c } for all problems. 1 . ( 5 pts ) Let language L 1

PROBLEMS:
Let \Sigma ={a, b, c} for all problems.
1.(5 pts) Let language L1 be the language where all strings contain the substring bab. The strings
should NOT contain the symbol c. Create a BNF grammar for L1. Example: bab, abab, babb.
2.(5 pts) Using your grammar, provide a derivation for the string u = ababbab.
3.(5 pts) Is your grammar regular? Explain why or why not.
4.(5 pts) Is L1 regular? Explain why or why not.
5.(5 pts) Let language L2 be the language where the strings must contain an a after or before a c.
Strings may have no c's at all. Examples of strings not in L2: abc, bcbaaba, cbbababb, empty string.
Examples of strings in L2: a,b,aa,bb,ab,ba,ca,ac,aca,caa,bac,bca. Create a BNF grammar for L2.
6.(5 pts) Using your grammar, provide a derivation for the string u = baccabb.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!