CSSE 4 SE424 Semantics

Worksheet 2

 

  1. Using the binary numeral semantics in Figure 4.1 to determine the meaning of the following derivation trees:
  1. Using Figure 4.3 simplify these calculator programs to their meanings in Nat*
  1. Augment the calculator so that it can compare 2 values for equality: add an = button to it and augment the BNF rule for expression to read:

E ::= | E1 = E2

  1. Alter the calculator semantics so that the memory cell argument to S and E becomes a memory stack; i.e. use Nat* in place of Nat as an argumant domain to S and E.