EWD249 - 66
that has to accommodate the page image; the variable "image" is the only component of the state space of this machine. Its instruction code comprises two instructions, named "build" and "print" respectively.
Before proceeding, it should be noted that we have used some abbreviations of which I don't know yet whether they are very wise or very foolish. They have both to do with the fact that the variable "image" is a unique variable of this type.
If the state space should have contained two images, I would have written
"type image;
image var image1, image2"
expressing that the state space comprises two variables (called "image1" and "image2" respectively), with the same set of possible values, this set being characterized by their type, called "image". In a later step the type image would enjoy further detailing and this would apply to both variables. As the set of variables of this type contains only one element, I have ventured not to distinguish between the set (called "image") and its only element (also called "image"). When descriptions in COMPFIRST (such as "build(image)") refer to "image", they refer to the variable; when later structuring detail is given, it refers to the type image.
The last line contains the code of instructions which are like the procedure heading. In general they contain the type of the parameters, where the call contains the variables as actual parameters. Again this seems foolish if the parameter is uniquely given by its type and for this reason we have mentioned the actual parameter in the declaration, and have omitted the mentioning of "image" in the code describing the algorithm "draw". Thus we can reserve the explicitly mentioned actual parameters for the case where this combinatorial freedom is actually used.
Before proceeding, I would like to stress that our little algorithm named "draw" can and should be regarded as a program written for a machine. We should write the manual for this machine; in it we have to state
- that the operation "build" assigns a value to the variable "image" specifying the image to be printed on paper as given by the functions fx and fy.