Each set in the hierarchy induces a structure preserving cons
operator, denoted cons_
n for the nth level
set, and satisfying this equation.
cons_
n(
x_
n,
y_
n)
=
(cons(
x,
y))_
n
It will be convenient to generalize all of these cons
operators to be
defined on members of other sets than their own.
cons_
n(
x_
m,
y_
p)
=
x_
m
In this equation, p is unrestricted. The intuition is that
if the left operand of a cons
is the result of a computation that
went wrong due to an exceptional condition (more exceptional than
n, the level already in effect), then the exceptional
result becomes the whole result.
It is tempting to hazard a slightly stronger statement, which is that
this equation holds even if y_
p is equal to some
expression f x that is undefined according to the
operator semantics. This stipulation would correspond to an
implementation in which the right operand isn't evaluated after an error
is detected in the left, but there are two problems with it.
Nevertheless, the implementation in avram
is sequential and does
indeed behave as proposed, with no practical difficulty. As for any
deficiency in the theory, it could be banished by recasting the
semantics in terms of a calculus of expressions with formal rules of
manipulation. An operand to the cons
operator would be identified
not with a member of a semantic domain, but with the expression used to
write it down, and then even “undefinedness” could be
defined. However, the present author's preference in computing as in
life is to let some things remain a mystery rather than to abandon the
quest for meaning entirely.
A comparable condition applies in cases where the right side of a pair represents an exceptional result.
cons_
n(
x_
n,
y_
m)
=
y_
m
Whereas an infinitude of cons
operators has been needed, it will
be possible to get by with only one invisible operator, as before, by
generalizing it in the following way to operands on any level of the
hierarchy.
_
n x_
n = (
f x)_
n
_
n x_
m = x_
m
That is, the result of evaluating two operands on the same level is the image relative to that level of the result of their respective images on the bottom level, but the result of evaluating two operands on different levels is the same as the right operand.