On the contribution of backward jumps to instruction sequence expressiveness
We investigate the expressiveness of backward jumps in a framework of formalized sequential programming called program algebra. We show that - if expressiveness is measured in terms of the computability of partial Boolean functions - then backward jumps are superfluous. If we, however, want to prevent explosion of the length of programs, then backward jumps are essential.
💡 Research Summary
The paper investigates the role of backward jumps (often implemented as “goto” statements that jump to an earlier point in the code) within the formal framework of Program Algebra (PA). PA models programs as linear instruction sequences composed of basic actions, tests, and jump instructions. Two kinds of jumps are distinguished: forward jumps, which move execution to a later instruction, and backward jumps, which return execution to an earlier instruction, thereby enabling loops and repeated execution.
The authors address two complementary notions of expressiveness. The first is computational expressiveness, measured by the ability to compute any partial Boolean function (a function from finite binary strings to {0, 1, ⊥}). They prove that, even if backward jumps are disallowed, the remaining constructs—forward jumps together with conditional execution and duplication—are sufficient to realize every such function. The construction relies on a systematic “conditional duplication” technique: for each input bit the program creates two copies of the remaining code, one to be executed when the bit is 0 and the other when it is 1. By nesting these duplications, the program can simulate any decision tree, effectively encoding the truth table of the target function without any need for looping. Consequently, from a purely computability standpoint, backward jumps do not increase the class of functions that can be expressed.
The second notion is size‑efficiency, i.e., how long the instruction sequence must be to compute a given function. Here the picture changes dramatically. The same conditional‑duplication approach that eliminates backward jumps incurs an exponential blow‑up in code length: a function of n input bits may require up to 2ⁿ duplicated blocks. The authors illustrate this with a family of functions fₙ that test specific patterns of the n‑bit input and produce different Boolean outputs. With backward jumps, fₙ can be implemented by a simple loop that scans the input once, yielding an O(n) instruction sequence. Without backward jumps, each possible pattern must be enumerated explicitly, leading to O(2ⁿ) instructions. The paper formalizes this intuition by defining a “restricted duplication model” that reflects realistic memory limits; in this model some partial Boolean functions become inexpressible without backward jumps.
The main conclusions are twofold. First, backward jumps are superfluous if one measures expressiveness solely by the set of computable partial Boolean functions—forward jumps and basic actions already achieve full computational power. Second, backward jumps are essential for keeping programs succinct. They enable the construction of loops, which compress repeated patterns and prevent exponential growth of code size. This duality has practical implications for language design: while a language that omits backward jumps remains theoretically complete, it would force programmers to write enormously larger programs for many common tasks, harming readability, maintainability, and performance. Hence modern programming languages include constructs that either directly support backward jumps or provide higher‑level looping abstractions that are semantically equivalent. The paper thus clarifies the precise trade‑off between theoretical expressiveness and practical code efficiency, offering a rigorous foundation for why “goto‑style” control flow persists in contemporary language ecosystems.
Comments & Academic Discussion
Loading comments...
Leave a Comment