Pattern Matching

Pattern matching is the process of matching an input against a given pattern. If the input and pattern match, then some action can be taken, such as conversion of the input to a new form using an output pattern.

Pattern matching can be done in several steps:

  1. Test whether the input matches the pattern. Keep bindings between variables in the pattern and parts of the input.

  2. Make the output: create a version of the output pattern with substitutions from the input as appropriate.

  3. Keep trying: one transformation may enable another, so continue until the result does not change. (This is called a fixed point .)

Contents    Page-10    Prev    Next    Page+10    Index