This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Everything that Mathematica does can be thought of as derived from its ability to apply general transformation rules to arbitrary symbolic expressions. The Mathematica language provides flexible functions that give direct access to Mathematica's powerful rule transformation engine.
Representing Rules
Rule (->) immediate replacement rule for any pattern
RuleDelayed (:>) delayed rule, with right-hand side evaluated only when used
Applying Rules
ReplaceAll (/.) apply replacement rules throughout an expression
ReplaceRepeated (//.) apply replacement rules repeatedly until no change occurs
Replace apply replacement rules to a complete expression
ReplaceList a list of all possible ways to apply rules
SparseArray give rules for values at particular positions in an array