Engineering
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 |

β†’ ...

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, volleyballfun24
If the thermal strain developed in polyimide film during deposition is given as 0.0044. assume room temperature is kept at 17.3 c, and thermal coefficient of expansion for the film and the substrate are 54 x 10^-6c^-1 and 3.3 x 10^-6c^-1respectively. calculate the deposition temperature.
Answers: 3
image
Engineering, 04.07.2019 18:10, oshawn108
Ahot wire operates at a temperature of 200Β°c while the air temperature is 20Β°c. the hot wire element is a tungsten wire of 5 um diameter and 2 mm in length. plot using excel current, heat transfer and heat generated by the wire for air velocity varying from 1-10 m/s in steps of lm/s? matlab the sensor voltage output, resistance, or assume nu 0.989 re033pr13 take air properties at tr (200Β°c20Β°c)/2 = 110Β°c properties of tungsten: c 0.13 kj/kg. k 3 p 19250 kg/m k (thermal conductivity) = 174 w/m. k
Answers: 2
image
Engineering, 04.07.2019 18:20, myahlit84
Inadequate stores control is not an obstacle to effective work order system. (clo4) a)-true b)-false
Answers: 3
image
Engineering, 04.07.2019 19:20, littlepotato10
To save energy, the air supply to a 2000 ft office has been shut off overnight and the room temperature has dropped to 40Β°f. in the morning, the thermostat is reset to 70Β°f and warm air at 120 f begins to flov in at 200ft'/min. the air is well mixed within the room, and an equal mass flow of air at room temperature (changing with time) is withdrawn through a return duct. the air pressure is nearly 1 atm everywhere. ignoring heat transfer with the surroundings and kinetic and potential energy effects, estimate how long it takes for the room temperature to reach 70Β°f. plot the room temperature as a function of time.
Answers: 1
Do you know the correct answer?
Using the grammar for real-number constants discussed in class, write a set of rewrite rules for sig...

Questions in other subjects: