Non-linear Pattern Matching with Backtracking for Non-free Data Types

08/31/2018
by   Satoshi Egi, et al.
0

Non-free data types are data types whose data have no canonical forms. For example, multisets are non-free data types because the multiset {a,b,b} has two other equivalent but literally different forms {b,a,b} and {b,b,a}. Pattern matching is known to provide a handy tool set to treat such data types. Although many studies on pattern matching and implementations for practical programming languages have been proposed so far, we observe that none of these studies satisfy all the criteria of practical pattern matching, which are as follows: i) efficiency of the backtracking algorithm for non-linear patterns, ii) extensibility of matching process, and iii) polymorphism in patterns. This paper aims to design a new pattern-matching-oriented programming language that satisfies all the above three criteria. The proposed language features clean Scheme-like syntax and efficient and extensible pattern matching semantics. This programming language is especially useful for the processing of complex non-free data types that not only include multisets and sets but also graphs and symbolic mathematical expressions. We discuss the importance of our criteria of practical pattern matching and how our language design naturally arises from the criteria. The proposed language has been already implemented and open-sourced as the Egison programming language.

READ FULL TEXT
research
11/12/2019

Scheme Macros for Non-linear Pattern Matching with Backtracking for Non-free Data Types

Pattern matching is an important feature of programming languages for da...
research
09/10/2018

Loop Patterns: Extension of Kleene Star Operator for More Expressive Pattern Matching against Arbitrary Data Structures

The Kleene star operator is an important pattern construct for represent...
research
11/07/2018

Unification in Matching Logic

Matching Logic is a framework for specifying programming language semant...
research
02/14/2020

Functional Programming in Pattern-Match-Oriented Programming Style

Throughout the history of functional programming, recursion has emerged ...
research
11/07/2018

Unification in Matching Logic - Extended Version

Matching Logic is a framework for specifying programming language semant...
research
12/30/2021

Deriving Distributive Laws for Graded Linear Types

The recent notion of graded modal types provides a framework for extendi...
research
04/11/2020

What Kind of Programming Language Best Suits Integrative AGI?

What kind of programming language would be most appropriate to serve the...

Please sign up or login with your details

Forgot password? Click here to reset