Rewriting: Program vs. Pattern Matching
Rewriting of symbolic expressions can be accomplished by an ad hoc
program, or by using pattern matching and rewrite rules.
Each has advantages and disadvantages:
Program:
- Adv.: Often is more efficient.
Avoids restrictions that may be present with patterns.
- Dis.: The rewriting program becomes large.
Hard to find errors, omissions.
Pattern Matching:
- Adv.: Declarative representation. Easier to understand.
Mistakes less likely.
- Dis.: May be slower.
A good compromise may be to use a pattern matcher in combination
with programs for those cases that are simple or are not easily
handled by patterns.
Contents   
Page-10   
Prev   
Next   
Page+10   
Index