3.2 *SQ

REDUCE uses internally a different representation for algebraic expressions, the standard quotient(SQ, see below). As conversion between algebraic forms and standard quotients is expensive, REDUCE tries to keep the data as long in SQ form as possible. For this purpose there is a special variant of the algebraic form (*SQ u ind): here the internal operator *SQ indicates that the parameter u is not an algebraic form but a standard quotient. If such expression is evaluated, REDUCE detects immediately that it will find the standard quotient already as the second element of the list and no more conversion is necessary.

However, if since creation of this form some values in the system have been changed, the form u might be no longer the “correct” standard quotient; e.g. one of its unknowns might have a value now. For this purpose the third element ind in the list has been introduced: As long as the form u is the correct one, it will be T. As soon as a significant value in the system changes which might affect the validity of u, REDUCE switches all ind elements in the *SQ forms swimming around to nil. So the evaluator decides from the second parameter whether to use u unchanged or to re-evaluate.

By the way, the global replacement of the second parameter in the *SQ forms is a good example of an in-place list operation with a wanted side effect: REDUCE maintains a unique list *sqvar* = (t) and all *SQ forms are built with this list as last pair. If the environment changes it is sufficient to replace this single t in *sqvar* by nil and all *SQ forms built with the actual *sqvar*-tail inherit this automatically switching from t to nil; REDUCE then creates a fresh list *sqvar* = (t) to be used for the next generation of *SQ forms.