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, 03.07.2019 15:10
Heat is added to a piston-cylinder device filled with 2 kg of air to raise its temperature 400 c from an initial temperature of t1 27 cand pressure of pi 1 mpa. the process is isobaric process. find a)-the final pressure p2 b)-the heat transfer to the air.
Answers: 1
question
Engineering, 04.07.2019 18:10
Give heat transfer applications for the following, (i) gas turbines (propulsion) ) gas turbines (power generation). (iii) steam turbines. (iv) combined heat and power (chp). (v) automotive engines
Answers: 1
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:20
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
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
English, 25.09.2019 21:00
question
Mathematics, 25.09.2019 21:00
question
Spanish, 25.09.2019 21:00
Questions on the website: 13722361