Related articles |
---|
Algorithm arao@ececs.uc.edu (Amit M. Rao) (1998-07-05) |
Re: Algorithm anton@mips.complang.tuwien.ac.at (1998-07-05) |
Re: Algorithm arao@ececs.uc.edu (Amit M. Rao) (1998-07-05) |
From: | "Amit M. Rao" <arao@ececs.uc.edu> |
Newsgroups: | comp.compilers |
Date: | 5 Jul 1998 01:15:25 -0400 |
Organization: | Dept. of ECECS, Univ. of Cincinnati |
Keywords: | theory, question |
Hi
I am looking for an algorithm that enumerates all possible expression
trees obtained by applying the commutative law to an expresssion tree.
e.g.: a = b * c + d; ( expression is in the form of a tree )
a = d + b * c;
a = c * b + d;
a = d + c * b;
Thanks.
--Amit
Compiler Research lab.
Univ. of Cincinnati.
arao@ececs.uc.edu
[My first cut at it would be to walk the tree recursively, flipping
at each node that is a commutative operator. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.