14 Nov
2007
14 Nov
'07
2:38 p.m.
Is it possible to disable the automatic flattening of expressions like f = (x+y) + (x+y) into g = 2*y+2*x ? In other words, I want to be able to retain the additions in expression f as binary operators. The reason for this is that I want to examine some expression to detect subtrees that occur multiple times, and this automatic flattening destroys some opportunities for this. Example: a = x*y b = (x*y) * (x*y) Examining a I will see a mul with ops x,y, while examining b I will see a mul with ops power(y,2), power(x,2), requiring some kind of factorization to recognize the similarities. -- Martin