We are interested in the language consisting of the set of all
strings which are true English statements about elephants. The
tokens of the language are fly, die, are, elephants, big, small,
tiny, miniscule, eat and !. Sentences in the language include
{elephants die, elephants eat, elephants are big, elephants are big
big big!}. Sentences not in the language include {elephants are
tiny, elephants fly, tiny big elephants fly, tiny tiny, are die big
tiny}
a. Write a context free grammar for this language using BNF or
EBNF. Document any assumptions you make.
b. Was your grammar ambiguous?
We are interested in the language consisting of the set of all strings which are true English statements about elephants
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
We are interested in the language consisting of the set of all strings which are true English statements about elephants
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!