The CSE Machine: Programming Language Principles
The CSE Machine: Programming Language Principles
Prepared by
Example
Evaluate -2 ** (a-b), in an environment in which (somehow) a=6 and b=1. Flattened control structure: neg ** 2 - a b. Place this control structure on the Control of the CSE Machine.
Notes
Minus: function that subtracts its second argument from its first one. Minus6: a function that subtracts its argument from 6. Exp, likewise: the exponentiation function. Exp2: function that raises 2 to the power of its argument.
Notes (contd)
Notice difference between "neg" (a name), and "Neg" (the actual operator). Control contains gammas (and lambdas) and names. Stack contains "real" values.
Examples
Three examples of generating control structures.
Prepared by