Let a computational method be a quadruple .
- represents the states of the computation
- represents the set of all inputs, and so is a subset of
- represents the set of all outputs, and so is a subset of
- represents the computational rule, and so leaves pointwise fixed ()
For every input in , there is some computational sequence of the form
This sequence terminates in steps if is the smallest integer for which is in .
Euclid's Algorithm
Let be the set of all singletons , ordered pairs , and ordered quadruples , , where , and are positive integers and is a nonnegative integer.
Let be the subset of all pairs , and be the subset of all singletons .
Let be defined as follows.
This formulation of an algorithm does not enforce effectiveness. A version that does is detailed here.