subject
Engineering, 03.04.2020 18:30 Miznatnasah

Using the grammar for real-number constants discussed in class, write a set of rewrite rules for signed real-number constants that allow an optional sign at the front of the constants. Use signed-real-const as the new start symbol. You can reuse as much or as little of the real-number constant grammar rules as you deem appropriate. Examples of valid signed real-number constants are:

-3.56, +17.E09, 4.95

Using the following rewrite rules for Boolean expressions, give a derivation for the Boolean expression (NOT((F AND T)) OR F). Also draw a derivation tree corresponding to the derivation.

bool-exp → T |
→ F |
→ NOT ( bool-exp ) |
→ ( bool-exp AND bool-exp ) |
→ ( bool-exp OR bool-exp )
Using the following rewrite rules for Boolean expressions, find two different derivation trees for the Boolean expression NOT(T OR T AND F).

bool-exp → T |
→ F |
→ NOT ( bool-exp ) |
→ bool-exp AND bool-exp |
→ bool-exp OR bool-exp
Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4.

expr → expr add-op term | term
term → term mult-op factor | factor
factor → ( expr ) | digit-seq
add-op → + | -
mult-op → * | DIV | MOD
digit-seq → digit digit-seq | digit
digit → 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Using the following rewrite rules for arithmetic expressions, draw a derivation tree for the expression 5*3+1+4.

expr → term { add-op term }
term → factor { mult-op factor }
factor → ( expr ) | digit-seq
add-op → + | -
mult-op → * | DIV | MOD
digit-seq → digit digit-seq | digit
digit → 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Note: A pair of new special symbols ('{' and '}') is used in the rewrite rules above. The meaning of {...} is that the string of nonterminal and terminal symbols appearing between { and } can be repeated 0 or more times. For instance, the first rewrite rule:

expr → term { add-op term }
is equivalent to the following (infinite) set of rewrite rules:

expr

→ term |

→ term add-op term |

→ term add-op term add-op term |

→ term add-op term add-op term add-op term |

→ ...

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
question
Engineering, 04.07.2019 18:10
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
question
Engineering, 04.07.2019 18:10
Which from the following instrument is commonly used to detect the high pitch butzing sound in bearings? [clo4] a)-digital ultrasonic meter b)-infrared camera c)-spectroscopic d)-vibrometer
Answers: 2
question
Engineering, 04.07.2019 18:20
Select any two (2) areas of applications of chain-drive. (clo4) a)-permanent lubrication necessary b)-hydraulic forklift truck operation c)-rigging and heavy moving materials d)-relatively high maintenance costs e)-costlier than belt drives
Answers: 2
You know the right answer?
Using the grammar for real-number constants discussed in class, write a set of rewrite rules for sig...
Questions
question
Advanced Placement (AP), 28.01.2020 07:31
question
Mathematics, 28.01.2020 07:31
Questions on the website: 13722360