Create a new grammar for the same language

Assignment Help Computer Engineering
Reference no: EM131772554

Assignment

Part 1:

A logical grammar defines logical expressions. You are given the following CGF for Boolean Logic. The terminal symbols are ∑ = { (, ),¬, ∧, ∨, 0, 1}

A→ A ∨ A                        (1)
A→ A ∧ A                        (2)
A→ ¬A                            (3)
A→ (A)                            (4)
A→ 0|1                            (5)

a) Generate by hand the parse tree for the follovving expressions

1 ∨ 1 ¬ 1
(1 ∧ ¬ 0) ∨ ¬ 0
((¬1 ∨ 0) ∧ 0) ∨(0 ∧ (¬1))

b) Show that the grammar is ambiguous by building two parse trees for the same string.

c) Create a new grammar for the same language so that it is unambiguous. The operators are listed in ascending order of precedence in the above rules. The binary operators should be left-associative

Part 2: Building a parser for Boolean Logic Expressions:

a. Your unambiguous grammar is probably left recursive and cannot be implemented using recursive descent parsing. Rewrite the grammar so that it is not left recursive and can be used directly for top-down parsing with Al) terminal look-ahead

b. Implement your unambiguous, non-left recursive gramrnar using either the recursive descent or the table-driven method.

Reference no: EM131772554

Questions Cloud

Perhaps no riskier than most investments : Do you think they are a solid investment for your retirement, perhaps no riskier than most investments? Or do they deserve the derogatory term "junk"?
Venture sustainable growth rate : Use the following information to estimate a venture's sustainable growth rate: Net income = $200,000; Total assets = $1,000,000; equity multiple based
Proportion of americans who fit the description : Parade Magazine reported that "nearly 3200 readers dialed a 900 number to respond to a survey in our Jan. 8 cover story on America's young people and violence".
Would your bond sell for a premium or a discount : The market interest rates for like securities rose to 5%. Would your bond sell for a premium or a discount? Why?
Create a new grammar for the same language : Create a new grammar for the same language so that it is unambiguous. The operators are listed in ascending order of precedence in the above rules.
How many years are there until the bond? matures : The bond pays annual coupons with a coupon rate of 3?% and the next coupon is due in one year. The bond has a yield to maturity of 8.75?%.
Computing the confidence interval for the results : Find the results of a poll reported in a weekly newsmagazine such as Newsweek or Time, in a newspaper such as the New York Times.
Operating activities using the indirect method : Calculate the cash provided (used) in operating activities using the indirect method.
Prepare a business plan - explorer travel & tours : Prepare a Business Plan on Explorer Travel - Tours and Present full cash flow chart based on your market targets for the first 12 months and for the second year

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define how each type compromises a system

define how each type compromises a system. How can these different types of malware be stopped.

  Estimate the probability of a burglary

BEITC703 - Solve the given puzzle using crypt arithmatic method and Construct a Truth table trat shows the truth value of each sentence in KB and indicate the model in which the KB is true.

  Develop a schematic for a printer controller

Repeat Problem, assuming that the printer has a buffer that can hold 80 characters. Printing is activated only when the buffer is full.

  Why is camera transmission not making it to security program

Why is the camera's transmission not making it to the security program? Below are several possible resolutions. Select the best one and explain your reasoning:

  How many total ip hosts did zenmap find on the network

Based on your interpretation of the Intense Scan, describe the purpose/results of each tests script performed during the report. How many total IP hosts did Zenmap find on the network?

  Why are most programs yet in cobol

Leibs, (2008) reported on a novel form of outsourcing software development. express the approach and share your thoughts about this new approach to software development.

  Make a local area network plan for taylor & sons

make a plan to set up a local area network based on the scenario presented in Appendix A.

  Find current court case involving computer crime

Summarize the case and judge for yourself if there really was a crime committed or not. Explain your reasoning based on the laws you researched for your state

  Create a question class to store each question

Design and implement an application to support a moderated question-and-answer session in which audience members submit questions to a queue.

  Which entities are dependent and which are independent

Create a data model. Include entities, attributes, identifiers, and relationships. Which entities are dependent? Which are independent? Use the steps of normalization to put your data model in 3NF. Describe how you know that it is in 3NF.

  Write a matlab script that plots the given functions

Produce a single plot that displays the graphs of the functions sin(kx) across [0,211'], k = 1:5.

  Find percentage of the total votes received by candidate

write down a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate. The program should then output each candidates name, the votes received by that candidate, and the p..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd