Question

Consider the set of all strings consisting of one or more “a”s. Explain the flaw in...

Consider the set of all strings consisting of one or more “a”s. Explain the flaw in this grammar and if possible, give an example string this grammar produces that is not in the set:

<S>* ::= <T> | a
<T>  ::= a <T> | <empty>

language is SML/NJ

0 0
Add a comment Improve this question Transcribed image text
Answer #1
<S>* ::= <T> | a
<T>  ::= a <T> | <empty>

This grammar does not always produce strings with one or more a's
this below generates an empty string.

<S> -> <T> -> <empty>

This is the flaw in this grammar.
Add a comment
Know the answer?
Add Answer to:
Consider the set of all strings consisting of one or more “a”s. Explain the flaw in...
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
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