|
|||||||||||||||||||
|
|||||||||||||||||||
ABSTRACT
Structured programming advocates the elimination of the GOTO from the set of primitives for a computer language. Yet at the machine language level, almost all machines offer only the conditional or unconditional branch as the basic control primitive. Vaughan Pratt has suggested using instead pseudo-non-deterministic programming (as well as the COMFY name). We present a new set of machine language control primitives based on Pratt's suggestion which are simpler to implement than if-then-else and do-while and are more flexible at the same time. The machine language implementation of these primitives requires nothing more complicated than a stack; the size of the stack needed (exclusive of programmer-defined subroutine control points) is O(d), where d is the operator depth of the program. This is much less space and machine complexity than would be required for a true backtracking control structure. The user can emulate if-then-else, do-while, repeat-until, etc., with macros using these primitives if he so desires. INDEX TERMS
Primary Classification:
Additional Classification:
|
|||||||||||||||||||