6,023 research outputs found
Non-linear Pattern Matching with Backtracking for Non-free Data Types
Non-free data types are data types whose data have no canonical forms. For
example, multisets are non-free data types because the multiset has
two other equivalent but literally different forms and .
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
Analyzing Catastrophic Backtracking Behavior in Practical Regular Expression Matching
We develop a formal perspective on how regular expression matching works in
Java, a popular representative of the category of regex-directed matching
engines. In particular, we define an automata model which captures all the
aspects needed to study such matching engines in a formal way. Based on this,
we propose two types of static analysis, which take a regular expression and
tell whether there exists a family of strings which makes Java-style matching
run in exponential time.Comment: In Proceedings AFL 2014, arXiv:1405.527
- …