Non-linear Associative-Commutative Many-to-One Pattern Matching with Sequence Variables

Manuel Krebber
5/2/2017
10 citations
cs.SC

Official code: HPAC/matchpy (174 stars, Python, MIT, last commit 2024-04-18).

Abstract

Pattern matching is a powerful tool which is part of many functional programming languages as well as computer algebra systems such as Mathematica. Among the existing systems, Mathematica offers the most expressive pattern matching.

Show full abstract

Unfortunately, no open source alternative has comparable pattern matching capabilities. Notably, these features include support for associative and/or commutative function symbols and sequence variables. While those features have individually been subject of previous research, their comprehensive combination has not yet been investigated. Furthermore, in many applications, a fixed set of patterns is matched repeatedly against different subjects. This many-to-one matching can be sped up by exploiting similarities between patterns. Discrimination nets are the state-of-the-art solution for many-to-one matching. In this thesis, a generalized discrimination net which supports the full feature set is presented. All algorithms have been implemented as an open-source library for Python. In experiments on real world examples, significant speedups of many-to-one over one-to-one matching have been observed.

View on arXivView PDF

Code Implementations(1)

HPAC/matchpyOfficial100%
MIT

A library for pattern matching on symbolic expressions in Python.

17426Python, TeXAug 25, 20162 years agoMIT
pattern-matchingpythonsymbolic-expressionsterm-rewriting

Similar Papers

Cite this paper

@article{krebber2017nonlinear,
  title  = {Non-linear Associative-Commutative Many-to-One Pattern Matching with Sequence Variables},
  author = {Manuel Krebber},
  year   = {2017},
  eprint = {1705.00907},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1705.00907}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1705.00907.svg)](https://codeofpaper.com/paper/1705.00907)

Discussion