Program vs. Pattern Matching
Optimization of symbolic expressions can be done by an ad hoc
program or by using pattern matching and rewrite rules.
Each has advantages and disadvantages:
Program:
- Adv.: Avoids doing conses for common cases.
- Dis.: Code becomes large. Hard to find errors, omissions.
Pattern Matching:
- Adv.: Declarative representation. Mistakes less likely.
- Dis.: May be slower.
A good compromise is to use a program for the simplest cases, followed
by a pattern matcher for more complex patterns.
Contents   
Page-10   
Prev   
Next   
Page+10   
Index