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

09/10/2018
by   Satoshi Egi, et al.
0

The Kleene star operator is an important pattern construct for representing a pattern that repeats multiple times. Due to its simplicity and usefulness, it is imported into various pattern-matching systems other than regular expressions. For example, Mathematica has a similar pattern construct called the repeated pattern. However, they have the following limitations: (i) We cannot change the pattern repeated depending on the current repeat count, and (ii) we cannot apply them to arbitrary data structures such as trees and graphs other than lists. This paper proposes the loop patterns that overcome these limitations. This paper presents numerous working examples and formal semantics of the loop patterns. The examples in this paper are coded in the Egison programming language, which features the customizable non-linear pattern-matching facility for non-free data types.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/31/2018

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

Non-free data types are data types whose data have no canonical forms. F...
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
10/17/2020

Discovering Pattern Structure Using Differentiable Compositing

Patterns, which are collections of elements arranged in regular or near-...
research
09/12/2022

Type checking data structures more complex than trees

Graphs are a generalized concept that encompasses more complex data stru...
research
02/14/2020

Functional Programming in Pattern-Match-Oriented Programming Style

Throughout the history of functional programming, recursion has emerged ...
research
08/29/2019

Improving the Performance of the Paisley Pattern-Matching EDSL by Staged Combinatorial Compilation

Paisley is a declarative lightweight embedded domain-specific language f...
research
11/07/2018

Unification in Matching Logic

Matching Logic is a framework for specifying programming language semant...

Please sign up or login with your details

Forgot password? Click here to reset