Monads for the formalization of a pattern matching procedure

A. V. Zhozhikashvili · Programming and Computer Software · 2014

Pattern matching, if understood in a broad enough sense, includes a variety of operations, from simple pattern matching operations implemented in a number of programming languages to matching a frame pattern to a frame example, which underlies some knowledge representation systems in artificial intelligence. In this paper, a mathematical language is presented that is based on the concepts of category theory and allows one to formally describe various types of pattern matching from a unified point of view. A typical example of a pattern is given by an expression containing variables that can be substituted by other expressions. The category-theoretical description of such patterns presented in the paper is close to the Kleisli construction, which is often used for the formalization of a substitution of expressions for variables. However, the category presented in the paper is not the dual of the Kleisli category, and each pattern in it is assigned a morphism; this allows one to more clearly describe the idea of matching. In particular, the language proposed allows one to describe rules based on pattern matching. Such rules are often used in computer systems.

Read the paper · More papers on PaperTik