Converts an expression expressed in terms of the outputs of this
program into an expression expressed in terms of the inputs,
registers it in the list of common sub-expressions, and returns a
reference to that expression.

registerOutput

Converts an expression expressed in terms of the outputs of this
program into an expression expressed in terms of the inputs,
registers it in the list of common sub-expressions, and returns a
reference to that expression.

If normalize, converts the program to canonical form. In
canonical form, in addition to the usual constraints:

The first N internal expressions are RexInputRefs to the N
input fields;

Subsequent internal expressions reference only preceding expressions;

Arguments to RexCalls must be RexLocalRefs (that is,
expressions must have maximum depth 1)

there are additional constraints:

Expressions appear in the left-deep order they are needed by
the projections and (if present) the condition. Thus, expression N+1
is the leftmost argument (literal or or call) in the expansion of
projection #0.