非自由数据类型的非线性回溯模式匹配
Non-linear Pattern Matching with Backtracking for Non-free Data Types
摘要:
非自由数据类型是其数据没有规范形式的数据类型。例如,多重集是非自由数据类型,因为多重集$\{a,b,b\}$有另外两个等价但字面上不同的形式$\{b,a,b\}$和$\{b,b,a\}$。已知模式匹配提供了处理这种数据类型的方便工具集。尽管到目前为止,已经提出了许多关于模式匹配的研究和实用程序设计语言的实现,我们观察到这些研究都没有满足所有的标准,实际模式匹配,这是如下:i)非线性模式的回溯算法的效率,ii)匹配过程的可扩展性,和iii)多态模式。本文旨在设计一种新的面向模式匹配的程序设计语言,满足所有上述三个标准。该语言具有清晰的类模式语法和高效的可扩展模式匹配语义。这种程序设计语言对于处理复杂的非自由数据类型特别有用,这些数据类型不仅包括多集和集合,还包括图形和符号数学表达式。我们讨论了我们的实际模式匹配的标准的重要性,以及我们的语言设计如何自然地产生的标准。所提出的语言已经实现并开源为Egison程序设计语言。
英文摘要:
Non-free data types are data types whose data have no canonical forms. For example, multisets are non-free data types because the multiset $\{a,b,b\}$ has two other equivalent but literally different forms $\{b,a,b\}$ and $\{b,b,a\}$. 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。