Open AccessJournal Article
Encapsulating Non-Determinism in Functional Logic Computations.
TL;DR: This paper examines the current approaches to encapsulate non-deterministic computations for the declarative multi-paradigm language Curry, and presents a new approach which combines the advantages but avoids the problems and defines the operational semantics of this new primitive.
read more
Abstract: One of the key features of the integration of functional and logic languages is the access to non-deterministic computations from the functional part of the program. In order to ensure the determinism of top-level computations in a functional logic program, which is usually a monadic sequence of I/O operations, one has to encapsulate the non-determinism (i.e., search for solutions) occurring in logic computations. However, an appropriate approach to encapsulation can be quite subtle if subexpressions are shared, as in lazy evaluation strategies. In this paper we examine the current approaches to encapsulate non-deterministic computations for the declarative multi-paradigm language Curry, show their relative advantages and the problems they induce. Furthermore, we present a new approach which combines the advantages but avoids the problems. Our proposal is based on providing a primitive I/O action for encapsulation from which various specialized search operators can be derived. In order to provide a formal foundation for this new approach to encapsulation, we define the operational semantics of this new primitive. 1 Why Encapsulate and How (Not) To Functional logic languages are intended to integrate the best features provided in functional and logic languages (see [7] for a survey). They also form a base to improve the evaluation strategies of existing languages due to the existence of optimal evaluation strategies for functional logic languages [3]. However, there is one subtle problem when combining the worlds of functional and logic programming. Usually, the top-level of a realistic functional (logic) program is a monadic sequence of I/O operations that should be applied to the outside world (e.g., see [23]). Since the outside world cannot be copied, all non-determinism in logic computations must be encapsulated, as proposed in [11] for the declarative ∗This work has been partially supported by the DFG under grants Ha 2457/1-2 and Ha 2457/5-1. †Institut fur Informatik, Christian-Albrechts-Universitat zu Kiel, D-24098 Kiel, Germany. {bbr,mh,fhu}@informatik.uni-kiel.de
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Systematic generation of glass-box test cases for functional logic programs
Sebastian Fischer,Herbert Kuchen +1 more
- 14 Jul 2007
TL;DR: This work employs the narrowing-based execution mechanism of the functional logic programming language Curry to automatically generate a system of test cases for glass-box testing of Curry programs, and presents a novel coverage criterion for this programming paradigm.
Type-oriented construction of web user interfaces
Michael Hanus
- 10 Jul 2006
TL;DR: A new technique for the high-level construction of type-safe web-oriented user interfaces where users can only input type-correct data is proposed and an implementation of this concept in the declarative multi-paradigm language Curry is shown.
•Journal Article
Type-Oriented Construction of Web User Interfaces.
TL;DR: In this article, the authors propose a technique for the high-level construction of type-safe web-oriented user interfaces, i.e., interfaces where users can only input type-correct data (types can be standard types of a programming language as well as any computable predicate on the data).
42
The Kiel Curry System KiCS.
Bernd Brassel,Frank Huch +1 more
- 01 Jan 2007
TL;DR: The Kiel Curry System is presented, a new implementation of the lazy functional logic language Curry with main features beyond other Curry implementations: flexible search control by means of search trees, referentially transparent encapsulation and sharing across non-determinism.
28
The Kiel Curry System KiCS
Bernd Braßel,Frank Huch +1 more
- 21 Apr 2009
TL;DR: The Kiel Curry System (KCS) as mentioned in this paper is a new implementation of the Curry language with flexible search control by means of search trees, referentially transparent encapsulation and sharing across non-determinism.
References
Imperative functional programming
TL;DR: Imperative functional programming is the application of the ideas of functional programming to imperative computations, and merely applies it to a new context, that of imperative compu-
Controlling Search in Declarative Programs
Michael Hanus,Frank Steiner +1 more
TL;DR: This work proposes the addition of a single primitive to logic-oriented languages to control non-deterministic computation steps that can be applied if the standard search facilities are not successful or to encapsulate search.
57
Implementing Encapsulated Search for a Lazy Functional Logic Language
Wolfgang Lux
- 11 Nov 1999
TL;DR: A distinguishing feature of logic and functional logic languages is their ability to perform computations with partial data and to search for solutions of a goal.
32
Related Papers (5)
Peyton Jones,L Simon +1 more
- 01 Jan 2003
Bernd Braßel,Olaf Chitil,Michael Hanus,Frank Huch +3 more
- 18 Jun 2004
Francisco Javier López-Fraguas,Jaime Sánchez Hernández +1 more
- 02 Jul 1999