|
Slide 7.3: The semantic domains of the calculator language Slide 7.5: The semantic functions of the calculator language Home |
|
v: Integer = { ..., -2, -1, 0, 1, 2, ...} s: State = Integer × Operation × Integer × IntegerOperations +: Integer × Integer → Integer –: Integer × Integer → Integer *: Integer × Integer → Integer nop: Integer × Integer → Integer where nop( a, d ) = d |
Operations domain can be compared to an enumerated type in Pascal.
These four values act as flags inside the calculator by saving the last operator keystroke.
Integer represents the abstract collection of mathematical integers.
State takes values that are quadruples embodying the internal accumulator, the pending operation, the display, and the memory.
The following table shows which entries change the various values in the State tuple:
|