The following ambiguous grammar describes boolean expressions: B → true B → false B → B ∨ B B → B ∧ B B → ¬ B B → (B) a) Given that negation (¬) binds tighter than conjunction (∧) which binds tighter...



The following ambiguous grammar describes boolean expressions:


B → true


B → false


B → B ∨ B


B → B ∧ B


B → ¬ B


B → (B)


a) Given that negation (¬) binds tighter than conjunction (∧) which binds tighter


than disjunction (∨) and that conjunction and disjunction are both rightassociative, rewrite the grammar to be unambiguous.


b) Write a grammar that accepts the subset of boolean expressions that are equivalent to true (i.e., tautologies). Hint: Modify the answer from question a) and add


an additional nonterminal F for false boolean expressions.



May 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here