Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1 Convert the following CFG into an equivalent PDA (note that in this problem, the start symbol is X): X X Y |Y Y Y/Z|Z

Q1

Convert the following CFG into an equivalent PDA (note that in this problem, the start symbol is X): X X Y |Y Y Y/Z|Z Z (X)|q Extra points: You may solve this problem either (i) using the shorthand notation we discussed in class and in the book OR (ii) without using the shorthand notation and instead writing out the fully expanded PDA. If you do option (ii) and do it correctly, you will be given two extra points.

Q2

The following is a grammar for JMH-Lisp 2.1, a modified version of the language you encountered in homework 4, with slightly different syntax, and expanded set of functions. It uses underscores rather than spaces, square brackets rather than parentheses, and words as function names instead of symbolic operators. S [O E E] E [O E E]|N N 0|1|2|3|4|5|6|7|8|9|NN O add|sub|mul|div|mod|shl|shr Create a PDA that recognizes JMH-Lisp 2.1. Extra points: You may solve this problem either (i) using the shorthand notation we discussed in class and in the book OR (ii) without using the shorthand notation and instead writing out the fully expanded PDA. If you do option (ii) and do it correctly, you will be given two extra points.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Chemical Engineering Design And Analysis An Introduction

Authors: T. Michael Duncan, Jeffrey A. Reimer

2nd Edition

1108421474, 9781108421478

More Books

Students also viewed these Chemical Engineering questions