intermission: the uniq storage option

Kimwitu has a feature that makes it quite easy to find common subexpressions: the uniq storage option:

[picture of a tree without node-sharing][picture of a tree with node-sharing]

(dot to generated graphs: left non-uniq, right uniq, the edge numbers indicate a depth-first left-to-right treewalk)

To enable it is sufficient to add the following declaration:

expr {uniq} :;
and build our term (1+1) * (1+1)

expr e = Times( Plus( Const( 1 ), Const( 1 )), Plus( Const( 1 ), Const( 1 )) );

next overview up


Last updated at 03 February '98 by kimwitu@cs.utwente.nl