A pattern compiler

A pattern compiler for the SCRATCHPAD system provides an efficient implementation of sets of user-defined pattern-replacement rules for symbolic mathematical computation such as tables of integrals or summation identities. Rules are compiled together, with common search paths merged and factored out and with the resulting code optimized for efficient recognition over all patterns. Matching principally involves structural comparison of expression trees and evaluation of predicates. Pattern recognizers are “fully compiled” if values of match variables can be determined by solving equations at compile time. Recognition times for several pattern matchers are compared.