Applyrule
Introduction
With applyrule, a rule or a list of rules can be applied to a given expression. applyrule computes the fix point; it applies the rule until it cannot be applied anymore. It is more powerful than the command subs, but does not do mathematical transformations as algsubs does.
Examples
Syntax: applyrule(rule, expression) where rule is a rule or a set of rules. The syntax for rule is the same as that used in the pattern matcher. (For more details, see the help page of patmatch.)
A simple manipulation:
One can use parameters in applyrule:
applyrule can be used over data structures:
Return to Example Worksheet Index
Download Help Document