首页> 外文期刊>Theory and Practice of Logic Programming >Singular and plural functions for functional logic programming
【24h】

Singular and plural functions for functional logic programming

机译:用于函数逻辑编程的单数和复数函数

获取原文

摘要

Modern functional logic programming (FLP) languages use non-terminating and non-confluent constructor systems (CSs) as programs in order to define non-strict and non-deterministic 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 basic 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 in this paper we propose two novel compositional plural semantics for CSs that are different from run-time choice. We investigate the basic properties of our plural semantics-compositionality, polarity, and monotonicity for substitutions, and a restricted form of the bubbling property for CSs -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 values computed by them. Besides, we have identified a class of programs characterized by a simple syntactic criterion for which the proposed plural semantics behave the same, and a program transformation that can be used to simulate one of the proposed plural semantics by term rewriting. At the practical level, we study how to use the new expressive capabilities of these semantics for improving the declarative flavor of programs. As call-time choice is the standard semantics for FLP, it still remains the best option for many common programming patterns. Therefore, we propose a language that combines call-time choice and our plural semantics, which we have implemented in the Maude system. The resulting interpreter is then employed to develop and test several significant examples showing the capabilities of the combined semantics.
机译:现代功能逻辑编程(FLP)语言使用非终止且不融合的构造函数系统(CS)作为程序,以定义非严格且不确定的函数。对于使用此类函数进行参数传递,通常考虑了两种语义替代方法:调用时选择和运行时选择。尽管前者是现代FLP语言的标准选择,但后者缺乏一些基本特性-主要是组合性-妨碍了其在实际FLP系统中的使用。传统上认为,呼叫时选择会引起单数的指称语义,而运行时选择会引起复数的语义。我们发现,当涉及模式匹配时,后一种识别是错误的,因此,在本文中,我们提出了两种不同于运行时选择的新颖的CS组成复数语义。我们研究了复数语义的基本属性-替换的组成性,极性和单调性,以及CS冒泡属性的受限形式-以及它们与以前的建议之间的关系,认为这些语义在某种意义上形成了层次集合包含由它们计算出的一组值。此外,我们已经确定了一类程序,该程序的特征在于简单的句法标准,对于该程序而言,所提出的多种语义表现相同,并且可以通过术语重写来模拟所提出的多种语义之一的程序转换。在实践层面,我们研究如何使用这些语义的新表达能力来改善程序的声明性风格。由于呼叫时间选择是FLP的标准语义,因此它仍然是许多常见编程模式的最佳选择。因此,我们提出了一种将呼叫时间选择和我们的复数语义相结合的语言,我们已经在Maude系统中实现了该语言。然后使用结果解释器来开发和测试几个重要的示例,这些示例说明了组合语义的功能。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号