Question

A fully parenthesized arithmetic expression is defined recursively as: (a) A natural number expressed in decimal...

A fully parenthesized arithmetic expression is defined recursively as:

(a) A natural number expressed in decimal notation (e.g., 0, 4, 357, but not 007).

(b) (α+β) or (α∗β), whereαandβare fully parenthesized arithmetic expressions.

Define a CFG that generates the following language over {0,1,...,9,(,),∗,+,o,d,e,v,n}:

L={α odd:αis a fully parenthesized arithmetic expression with an odd value}

∪ {α even:αis a fully parenthesized arithmetic expression with an even value}

For example, “75 odd”, “((241∗2) + 40034) even” are strings in the language (ignore the blank spaces in the strings, they are just there for clarity).

Homework Answers

Know the answer?
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
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT