316 research outputs found

    A Concurrent Operational Semantics for Constraint Functional Logic Programming

    Get PDF
    In this paper we describe a sound and complete concurrent operational semantics for constraint functional logic programming languages which allows to model declarative applications in which the interaction between demand-driven narrowing and constraint solving helps to prune the search space, leading to shorter goal derivations. We encode concurrency into the generic CFLP(D) scheme, a uniform foundation for the operational semantics of constraint functional logic programming systems parameterized by a constraint solver over the given domain D. In this concurrent version of the CFLP(D) scheme, goal solving processes can be executed concurrently and cooperate together to perform their specific tasks via demand-driven narrowing and declarative residuation guided by constrained definitional trees, constraint solving, and communication by synchronization on logical variables

    Normalisierung und partielle Auswertung von funktional-logischen Programmen

    Get PDF
    This thesis deals with the development of a normalization scheme and a partial evaluator for the functional logic programming language Curry. The functional logic programming paradigm combines the two most important fields of declarative programming, namely functional and logic programming. While functional languages provide concepts such as algebraic data types, higher-order functions or demanddriven evaluation, logic languages usually support a non-deterministic evaluation and a built-in search for results. Functional logic languages finally combine these two paradigms in an integrated way, hence providing multiple syntactic constructs and concepts to facilitate the concise notation of high-level programs. However, both the variety of syntactic constructs and the high degree of abstraction complicate the translation into efficient target programs. To reduce the syntactic complexity of functional logic languages, a typical compilation scheme incorporates a normalization phase to subsequently replace complex constructs by simpler ones until a minimal language subset is reached. While the individual transformations are usually simple, they also have to be correctly combined to make the syntactic constructs interact in the intended way. The efficiency of normalized programs can then be improved by means of different optimization techniques. A very powerful optimization technique is the partial evaluation of programs. Partial evaluation basically anticipates the execution of certain program fragments at compile time and computes a semantically equivalent program, which is usually more efficient at run time. Since partial evaluation is a fully automatic optimization technique, it can also be incorporated into the normal compilation scheme of programs. Nevertheless, this also requires termination of the optimization process, which establishes one of the main challenges for partial evaluation besides semantic equivalence. In this work we consider the language Curry as a representative of the functional logic programming paradigm. We develop a formal representation of the normalization process of Curry programs into a kernel language, while respecting the interference of different language constructs. We then define the dynamic semantics of this kernel language, before we subsequently develop a partial evaluation scheme and show its correctness and termination. Due to the previously described normalization process, this scheme is then directly applicable to arbitrary Curry programs. Furthermore, the implementation of a practical partial evaluator is sketched based on the partial evaluation scheme, and its applicability and usefulness is documented by a variety of typical partial evaluation examples

    Constraint Functional Logic Programming over Finite Domains.

    Get PDF
    Abstract In this paper, we present our proposal to Constraint Functional Logic Programming over Finite Domains (CFLP (FD) ) with a lazy functional logic programming language which seamlessly embodies finite domain (FD) constraints. This proposal increases the expressiveness and power of constraint logic programming over finite domains (CLP (FD) ) by combining functional and relational notation, curried expressions, higher-order functions, patterns, partial applications, non-determinism, lazy evaluation, logical variables, types, domain variables, constraint composition, and finite domain constraints. We describe the syntax of the language, its type discipline, and its declarative and operational semantics. We also describe TOY(FD), an implementation for CFLP (FD) , and a comparison of our approach with respect to CLP (FD) from a programming point of view, showing the new features we introduce. And, finally, we show a performance analysis which demonstrates that our implementation is competitive with respect to existing CLP (FD) systems and that clearly outperforms the closer approach to CFLP (FD)

    Implementing a Functional Logic Programming Language via the Fair Scheme

    Get PDF
    This document presents a new compiler for the Functional Logic programming language Curry based on a novel pull-tabbing evaluation strategy called the Fair Scheme. A simple version of the Fair Scheme is proven sound, complete, and optimal. An elaborated version is also developed, which supports narrowing computations and other features of Curry, such as constraint programming, equational constraints, and set functions. The Fair Scheme is used to develop a new Curry system called Sprite, a high-quality, performant implementation whose aims are to promote practical uses of Curry and to serve as a laboratory for further research. An important aspect of Sprite is its integration with the popular imperative language Python. This combination allows one to write hybrid programs in which the programmer may move between declarative and non-declarative styles with relative ease. Benchmarking data show Sprite to be more complete than other Curry systems and competitive in terms of execution time, particularly for non-deterministic programs
    • …
    corecore