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 12:10
On a average work day more than work place firs are reorted
Answers: 1
question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
Answers: 2
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
question
Engineering, 04.07.2019 18:20
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10Γ€1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
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
Mathematics, 27.10.2021 07:10
question
Mathematics, 27.10.2021 07:10
question
Advanced Placement (AP), 27.10.2021 07:10
question
Mathematics, 27.10.2021 07:10
question
Mathematics, 27.10.2021 07:10
question
History, 27.10.2021 07:10
question
Mathematics, 27.10.2021 07:10
question
Computers and Technology, 27.10.2021 07:10
Questions on the website: 13722361