Pattern calculus

Like lambda calculus, it supports a uniform treatment of function evaluation.

In addition, pattern calculus supports uniform access to the internal structure of arguments, be they pairs or lists or trees.

In the notation of the programming language bondi, it is given by the recursive function The second, or default case x -> 1 matches the pattern x against the argument and returns 1.

Suppose given constructors Leaf for creating the leaves of a tree, and Count for converting numbers into counters.

These examples can be produced by applying the generic eliminator elim to the constructors in question.