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:
>
|
|
| (2.1) |
>
|
|
| (2.2) |
>
|
|
| (2.3) |
One can use parameters in applyrule:
>
|
|
| (2.4) |
applyrule can be used over data structures:
>
|
|
| (2.5) |
>
|
|
| (2.6) |
|
Return to Example Worksheet Index
|
Download Help Document
Was this information helpful?