pith. sign in

arxiv: 1710.00077 · v1 · pith:CU6JV5XRnew · submitted 2017-09-29 · 💻 cs.PL · cs.PF

Efficient Pattern Matching in Python

classification 💻 cs.PL cs.PF
keywords matchingpatternmatchpyalgorithmspythonsymbolicwellabstract
0
0 comments X
read the original abstract

Pattern matching is a powerful tool for symbolic computations. Applications include term rewriting systems, as well as the manipulation of symbolic expressions, abstract syntax trees, and XML and JSON data. It also allows for an intuitive description of algorithms in the form of rewrite rules. We present the open source Python module MatchPy, which offers functionality and expressiveness similar to the pattern matching in Mathematica. In particular, it includes syntactic pattern matching, as well as matching for commutative and/or associative functions, sequence variables, and matching with constraints. MatchPy uses new and improved algorithms to efficiently find matches for large pattern sets by exploiting similarities between patterns. The performance of MatchPy is investigated on several real-world problems.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.