将数据添加到Curry
Adding Data to Curry
摘要:
函数逻辑语言可以在用户定义的数据和函数上求解方程。因此,相等的适当意义的定义在这些语言中有很长的历史,从早期等式逻辑语言中的自反相等到当代函数逻辑语言中的严格相等。随着类型类的引入,其中相等操作“==”被重载并由用户定义,其含义变得更加复杂。此外,出现在公式中的逻辑变量需要与模式变量不同的类型,因为后者可能用函数值或非终止操作来实例化。在本文中,我们提出了一个解决这些问题的方法,通过引入一个新的类型类“数据”,这是与特定的代数数据类型,逻辑变量,严格相等。我们将讨论这个类的思想及其对Curry的各种概念的影响,如统一,功能模式和程序优化。
英文摘要:
Functional logic languages can solve equations over user-defined data and functions. Thus, the definition of an appropriate meaning of equality has a long history in these languages, ranging from reflexive equality in early equational logic languages to strict equality in contemporary functional logic languages like Curry. With the introduction of type classes, where the equality operation "==" is overloaded and user-defined, the meaning became more complex. Moreover, logic variables appearing in equations require a different typing than pattern variables, since the latter might be instantiated with functional values or non-terminating operations. In this paper, we present a solution to these problems by introducing a new type class "Data" which is associated with specific algebraic data types, logic variables, and strict equality. We discuss the ideas of this class and its implications on various concepts of Curry, like unification, functional patterns, and program optimization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。