Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Is basically for free. We just run the algorithm for M (#patterns) <= N (#terms) and declare the result a match iff all patterns have a term assigned and there's at least one wildcard in the pattern list. E.g.

Code Block
{ 1 | 2 | 3 } matches { 2 | _ | 1 | _ }

is matching N = 3 terms to a pattern list of M = 2 patterns and K = 2 wildcards, and the match will be successful.

...