CUM 1: Schrödinger’s conditionals

A form of boolean expression wherein a variable can be considered to simultaneously have multiple values, a “superposition”.

Status of this document

Final draft, not yet accepted by CUP.


Though this may seem confusing, it really is quite natural. Consider this looping idiom:

comefrom if n is n + 1
# ... do things ...
n = n + 1

The condition would be considered true when incrementing variable n, because it can be satisfied by using the value of n before assignment on one side of the conditional and the value of n after assignment on the other. It is not necessary that the value before assignment be used, that is, this conditional is also true, provided n is defined:

comefrom if n is n

In this case, the conditional is satisfied by using the value of n after assignment on both sides.

Superpositions come into play only when the same variable appears on both sides of a boolean operator. If no boolean operator is involved, or if the variable only appears on one side of an operator, it is viewed as having collapsed to its value after assignment.