arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1203.2431cs.PL
收藏

函数式逻辑程序设计中的奇异函数与复数函数

Singular and Plural Functions for Functional Logic Programming

Adrián Riesco, Juan Rodríguez-Hortalá

摘要:

函数逻辑编程(FLP)语言使用非终止和非汇合构造器系统(CS)作为程序,以便定义非严格非确定性函数。对于这类函数的参数传递,通常考虑两种语义选择:调用时选择和运行时选择。虽然前者是现代FLP语言的标准选择,但后者缺乏一些属性--主要是组合性--这阻碍了它在实际FLP系统中的使用。传统上,它已被认为是调用时的选择诱导一个单一的指称语义,而运行时的选择诱导一个复数的语义。我们已经发现,后者的识别是错误的,当涉及到模式匹配,因此,我们提出了两个新的组合复数语义CS的是不同的运行时的选择。我们研究了我们的复数语义的基本属性-组合性,极性,单调性的替代,和构造函数系统的冒泡属性的限制形式-以及它们之间的关系和以前的建议,得出的结论是,这些语义形成了一个层次结构的意义上的集合包含的一组计算值。我们还确定了一类程序,其特征在于所提出的复数语义的行为相同的语法标准,和一个程序转换,可以用来模拟其中之一的长期重写。在实践层面上,我们研究如何使用这些语义的表达能力,以提高程序的声明味。我们还提出了一种语言,结合调用时间的选择和我们的复数语义,我们已经实现了在莫德。由此产生的解释器被用来测试几个显着的例子显示的组合语义的能力。逻辑程序设计理论与实践(Theory and Practice of Logic Programming,TPLP)

英文摘要:

Functional logic programming (FLP) languages use non-terminating and non-confluent constructor systems (CS's) as programs in order to define non-strict non-determi-nistic functions. Two semantic alternatives have been usually considered for parameter passing with this kind of functions: call-time choice and run-time choice. While the former is the standard choice of modern FLP languages, the latter lacks some properties---mainly compositionality---that have prevented its use in practical FLP systems. Traditionally it has been considered that call-time choice induces a singular denotational semantics, while run-time choice induces a plural semantics. We have discovered that this latter identification is wrong when pattern matching is involved, and thus we propose two novel compositional plural semantics for CS's that are different from run-time choice. We study the basic properties of our plural semantics---compositionality, polarity, monotonicity for substitutions, and a restricted form of the bubbling property for constructor systems---and the relation between them and to previous proposals, concluding that these semantics form a hierarchy in the sense of set inclusion of the set of computed values. We have also identified a class of programs characterized by a syntactic criterion for which the proposed plural semantics behave the same, and a program transformation that can be used to simulate one of them by term rewriting. At the practical level, we study how to use the expressive capabilities of these semantics for improving the declarative flavour of programs. We also propose a language which combines call-time choice and our plural semantics, that we have implemented in Maude. The resulting interpreter is employed to test several significant examples showing the capabilities of the combined semantics. To appear in Theory and Practice of Logic Programming (TPLP)

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

↑