pattern matching

(redirected from Pattern matches)
Also found in: Dictionary.

pattern matching

(1)
A function is defined to take arguments of a particular type, form or value. When applying the function to its actual arguments it is necessary to match the type, form or value of the actual arguments against the formal arguments in some definition. For example, the function

length [] = 0 length (x:xs) = 1 + length xs

uses pattern matching in its argument to distinguish a null list from a non-null one.

There are well known algorithm for translating pattern matching into conditional expressions such as "if" or "case". E.g. the above function could be transformed to

length l = case l of [] -> 0 x:xs -> 1 : length xs

Pattern matching is usually performed in textual order though there are languages which match more specific patterns before less specific ones.

pattern matching

(2)
Descriptive of a type of language or utility such as awk or Perl which is suited to searching for strings or patterns in input data, usually using some kind of regular expression.
References in periodicals archive ?
More recently, Nymeyer and Katoen [1997] describe an implementation of an algorithm based on BURS theory, that computes all pattern matches, and which does a search that results in optimal code.
Pattern matches occur wherever reductions are called for.
Cosmic strings have recently run into trouble in that arena because their expected pattern matches neither the distribution of galactic clusters nor the patchiness of background radiation left over from the Big Bang (SN: 1/27/96, p.
Always over-estimate and allow for pattern matches. If you're a beginner it's as well to choose a style you don't have to match and avoid stairwells and ceiling units.
If the pattern matches your body measurement length, then you don't need to adjust; that area of the pattern will fit.
This pattern matches the general picture emerging from computer climate models, say the researchers.
What's more, Wignall doesn't agree that the extinction pattern matches the hypercapnia idea.
The cloud's absorption pattern matches that associated with other radio sources known to lie near the Milky Way's center.