To deal with updates, we first define, in
Figure A.6, an abstracted *visitChildren*
algorithm, convenient particularly for *variable* expressions
(i.e. expressions that can appear on the left-hand-side of an assignment).
The subexpressions of a variable expression are mostly self-explanatory.
They are:

- If the variable is a named expression, the subexpressions are:
- the prefix of named expression, if it is non-null and is an expression (not a type).

- If the variable is a field reference with a general expression prefix, the
subexpressions are:
- the prefix expression of the field reference.

- If the variable is a field reference with a
`super`prefix, there are no subexpressions. - If the variable is an array element reference, the subexpressions are:
- the target array of the element reference,
- the integer subscripts, if any, of the element reference, and
- the ``shift'' expressions in any shifted-distributed-index subscripts of the element reference.

The *visitChildren* function is applied to the left-hand-side of
a simple assignment in Figure A.7.
An important point is that one does not recursively apply the *simplify* algorithm to the expression representing the variable itself;
the recursion is on the *subexpressions* of the variable expression.
The case of an autoincrement or autodecrement expression is also
straightforward, and it is given in A.8.
There is a complication in the case of compound assignments; they
will be dicussed in the next section.

Compound assignment needs special treatment in the *simplify*
algorithm. Assuming is one of the supported operators, a problem
arises in

if includes a subexpression that must be precomputed,

In this case we are essentially forced to translate the assignment to

thus allowing the use of on the RHS to be precomputed. Moreover if itself is a non-trivial expression, you may then have to mark its subexpressions as being multiply-referenced to avoid their repeated computation.

It is fairly difficult to imagine realistic code in which this situation
would arise, but here is a contrived example:

We will suppose

According to our simplification rules, the composite
multiarray expression `blackBox(a)` must be precomputed, and assigned to
a temporary. So a naive transformation might be:

where

To solve this problem, we should precompute the initial value of the
left-hand-side of the assignment, something like

Of course this still isn't correct due to the repetition of the subscript expression in the variable

An algorithm is given in Figure A.9.
Note that may be marked as a *multiply referenced variable*.
Such expressions were mentioned in section
A.3.2. The effect of marking a
variable expression in this way is to alter the behavior of the *visitChildren* function defined in Figure A.6, causing
it to treat all the subexpressions, , as if they are
multiply referenced *values*.