基于词法作用域的非自由数据类型非线性模式匹配
Non-Linear Pattern-Matching against Unfree Data Types with Lexical Scoping
摘要:
本文提出了一个模式匹配系统,使非线性模式匹配对不自由的数据类型。该系统允许同一变量在同一模式中多次出现,允许模式匹配的多个结果,并允许对每种数据类型同时进行模式匹配的方式模块化。它使我们能够表示模式匹配不仅对代数数据类型,但也不自由的数据类型,如集,图和任何其他数据类型的数据没有规范的形式和多种方式的分解。我已经意识到,有一条规则是从模式的左侧执行模式匹配,而另一条规则是可以在模式的右侧引用模式中变量的绑定。此外,我已经实现了这些模式的模块化与词法范围。在我的系统中,模式不是第一类对象,但一个只获取模式并返回模式的模式函数是第一类对象。这种限制简化了具有词法作用域的非线性模式匹配系统。我已经用Egison程序设计语言实现了模式匹配系统。
英文摘要:
This paper proposes a pattern-matching system that enables non-linear pattern-matching against unfree data types. The system allows multiple occurrences of the same variables in a pattern, multiple results of pattern-matching and modularization of the way of pattern-matching for each data type at the same time. It enables us to represent pattern-matching against not only algebraic data types but also unfree data types such as sets, graphs and any other data types whose data have no canonical form and multiple ways of decomposition. I have realized that with a rule that pattern-matching is executed from the left side of a pattern and a rule that a binding to a variable in a pattern can be referred to in its right side of the pattern. Furthermore, I have realized modularization of these patterns with lexical scoping. In my system, a pattern is not a first class object, but a pattern-function that obtains only patterns and returns a pattern is a first class object. This restriction simplifies the non-linear pattern-matching system with lexical scoping. I have already implemented the pattern-matching system in the Egison programming language.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。