visited
(that we intend to use to indicate if we have visited a node already):
and build our term
expr {uniq} : { boolean visited = False; };
(1+1) * (1+1)
we get the following graphs
(left (or up) non-uniq; right (or below) uniq; the edge numbers indicate a depth-first left-to-right treewalk):