This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
 MATHEMATICA HOW TO Tutorials »| See Also »| More About »
How to | Use a Rule with an Expression More Than Once
You may find it useful to use one or more rules with an expression several times. Mathematica provides functions that let you iterate when using rules with expressions. In cases where a rule can be used in several ways with an expression, Mathematica also allows you to view all possible results.
While (the short form for ReplaceAll) applies rules to an expression only once, you may find it useful to repeatedly apply rules to an expression until it no longer changes. You can do this by using (the short form for ReplaceRepeated).
Use to apply a rule or list of rules to each part of an expression only once:
 Out[137]=
Use to apply the rules repeatedly until the expression no longer changes:
 Out[138]=
Similarly:
 Out[139]=
 Out[140]=
You should use caution when using with a circular set of rules. Use the MaxIterations option to set the maximum number of iterations for :
 Out[64]=
You can use ReplaceList to transform an entire expression by applying a rule or list of rules in all possible ways. Use Column to display the results for easier viewing:
 Out[143]=