We are interested in the language consisting of the set of all strings which are true English statements about elephants
Posted: Sun May 15, 2022 7:56 am
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?
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?