Singular and plural functions for functional logic programming
-
Published:2012-05-17
Issue:1
Volume:14
Page:65-116
-
ISSN:1471-0684
-
Container-title:Theory and Practice of Logic Programming
-
language:en
-
Short-container-title:Theory and Practice of Logic Programming
Author:
RIESCO ADRIÁN,RODRÍGUEZ-HORTALÁ JUAN
Abstract
AbstractModern 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.
Publisher
Cambridge University Press (CUP)
Subject
Artificial Intelligence,Computational Theory and Mathematics,Hardware and Architecture,Theoretical Computer Science,Software
Reference58 articles.
1. López-Fraguas F. , Martin-Martin E. , Rodríguez-Hortalá J. and Sánchez-Hernández J. Available on request. Rewriting and narrowing for constructor systems with call-time choice semantics. Submitted to Theory and Practice of Logic Programming.
2. Term Rewriting and All That
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Synthesizing Set Functions;Functional and Constraint Logic Programming;2019