arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1710.00077cs.PLcs.PF
收藏

Python中的高效模式匹配

Efficient Pattern Matching in Python

Manuel Krebber, Henrik Barthels, Paolo Bientinesi

摘要:

模式匹配是符号计算的有力工具。应用程序包括术语重写系统,以及符号表达式,抽象语法树,XML和JSON数据的操作。它还允许以重写规则的形式直观地描述算法。我们提出了开源Python模块MatchPy,它提供了类似于Mathematica中的模式匹配的功能和表现力。特别地,它包括语法模式匹配,以及交换和/或关联函数、序列变量的匹配,以及与约束的匹配。MatchPy使用新的和改进的算法,通过利用模式之间的相似性来有效地找到大型模式集的匹配。MatchPy的性能进行了研究在几个现实世界的问题。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑