/* Routines to do substitutions, replacing one pattern with another */ /* eg, replace an expression of the from x-x by 0 or x+x by 2*x */ typedef struct { pattern *pat; /* the pattern */ value rep; /* What to replace it with */ } subst; subst *make_sub(char *, char *); void free_sub(subst *); value substitute(subst *, value); /* creates a new expression with the substitution done (if possible) */