Pattern Matching

Given a pattern and an input, matching must:

  1. Test whether the input matches the pattern.

  2. Determine variable bindings: the input code that corresponds to each pattern variable.


Pattern:      (- ?x (- ?y))

Input:        (- (sin theta) (- w))
The input matches the pattern; the bindings should be:

 ( (?x . (sin theta))
   (?y . w) )

Contents    Page-10    Prev    Next    Page+10    Index