TL;DR
This paper introduces MatchPy, an open source Python module that provides advanced pattern matching capabilities similar to Mathematica, including support for commutative, associative, and constrained patterns, with improved algorithms for efficiency.
Contribution
The paper presents MatchPy, a novel Python library offering expressive and efficient pattern matching for symbolic computations, surpassing existing tools in flexibility and performance.
Findings
MatchPy supports complex pattern matching features like commutative and associative functions.
It employs new algorithms to efficiently handle large pattern sets.
Performance tests show MatchPy's effectiveness on real-world problems.
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
