Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

context free grammar

Posted on 2008-10-09
3
Medium Priority
?
428 Views
Last Modified: 2008-10-24
can someone give me a link in the internet of resources that proves :

L = {a^nba^mba^(m+n) | n,m>=1}
0
Comment
Question by:kuntilanak
3 Comments
 
LVL 5

Accepted Solution

by:
PaulKeating earned 2000 total points
ID: 22693276
I think you are looking for a proof that

"L = {a^nba^mba^(m+n) | n,m>=1} is (or: is not) context-free".

When you need a proof, it's helpful to know the answer up front so that you know what you want to prove. That answer is: You can't write a regular expression for this language. The plain-language rule is "finite automata cannot count". It is also not context-free. The plain-language rule is "context-free grammars can count 2 things but not 3."

But you don't just want the answer, you want a proof. Most online resources on this topic are not free. Here is one that is: How to Use The Pumping Theorem, available at

http://www.cs.utexas.edu/~ben/teaching/cs341_fa04/pumping.pdf

It doesn't cover the specific language you specify: for that you're going to have to do a bit of work. I suspect the language was chosen specifically to be slightly different from the standard textbook examples. In other words, you are unlikely to find a proof that you can simply crib.
0
 

Author Comment

by:kuntilanak
ID: 22736536
I've read that, but seems like I don't find any resources there that will help me to solve this
0
 
LVL 85

Expert Comment

by:ozo
ID: 22737043
M ::= b | a M a
L ::= b M | a L a'
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question