## A Concurrent Implementation of Curry in Java (1997)

Venue: | In Proc. ILPS'97 Workshop on Parallelism and Implementation Technology for (Constraint) Logic Programming Languages |

Citations: | 2 - 0 self |

### BibTeX

@INPROCEEDINGS{Hanus97aconcurrent,

author = {Michael Hanus and Ramin Sadre},

title = {A Concurrent Implementation of Curry in Java},

booktitle = {In Proc. ILPS'97 Workshop on Parallelism and Implementation Technology for (Constraint) Logic Programming Languages},

year = {1997}

}

### OpenURL

### Abstract

Curry is a multi-paradigm declarative language aiming to amalgamate functional, logic, and concurrent programming paradigms. Curry combines in a seamless way features from functional programming and (concurrent) logic programming. Curry's operational semantics is based on the combination of lazy reduction of expressions together with a possibly non-deterministic binding of free variables occurring in expressions. Moreover, (equational) constraints can be executed concurrently which provides for passive constraints and concurrent computation threads that are synchronized on logical variables. This paper sketches a first prototype implementation of Curry in Java. The main emphasis of this implementation is the exploitation of Java threads to implement the concurrent and non-deterministic features of Curry.

### Citations

1353 | Introduction to Functional Programming
- Bird, Wadler
- 1988
(Show Context)
Citation Context ...ic language, one can choose the best of the two worlds in application programs. For instance, input/output (implemented in logic languages by side effects) can be handled with the monadic I/O concept =-=[20]-=- in a declarative way. Similarly, many other impure features of Prolog (e.g., arithmetic, cut) can be avoided by the use of functions. Beyond this computation model, Curry provides higher-order functi... |

456 | Concurrent Constraint Programming
- Saraswat, Rinard
- 1990
(Show Context)
Citation Context ...ministic computations which is also known as stability from AKL [15]. This scheme implements coroutining features of current Prolog systems [18] as well as features of concurrent constraint languages =-=[22]-=-. In the next section, we review the basic computation model of Curry. Its concurrent implementation in Java is described in Section 3. Section 4 discusses some extensions of the basic computation mod... |

346 | The integration of functions into logic programming: From theory to practice
- Hanus
- 1994
(Show Context)
Citation Context ...en evaluation of functions). Moreover, it also amalgamates the most important operational principles developed in the area of integrated functional logic languages: "residuation" and "n=-=arrowing" (see [9]-=- for a survey on functional logic programming). Curry's operational semantics is based on a single computation model, described in [11], which combines lazy reduction of expressions with a possibly no... |

313 | The Oz Programming Model
- Smolka
- 1995
(Show Context)
Citation Context ...the sequential parts, where similar techniques for the concurrent parts are not available. This is in contrast to other, more fine-grained concurrent computation models like AKL [15], CCP [22], or Oz =-=[23]-=-. 3 Implementation of Curry Programs In this section we sketch a Java-based implementation of an abstract machine for executing Curry programs. We describe the implementation of data terms, defined fu... |

299 | Why functional programming matters
- Hughes
- 1989
(Show Context)
Citation Context ... reduction is not normalizing, Curry is based on a lazy (outermost) strategy. This also allows the computation with infinite data structures and provides more modularity by separating control aspects =-=[13]. A subtle-=- point in the definition of a lazy evaluation strategy in combination with pattern matching is the selection of the "right" outermost redex. For instance, consider the rules of Example 1 tog... |

296 | Uniform narrowing strategies
- Echahed
- 1992
(Show Context)
Citation Context ...dings (non-deterministic step). For inductively sequential programs [1] (these are, roughly speaking, function definitions without overlapping left-hand sides), this strategy, called needed narrowing =-=[2]-=-, computes the shortest possible successful derivations (if common subterms are shared) and a minimal set of solutions, and it is fully deterministic if free variables do not occur. 5 4 Since the exac... |

158 | Definitional trees
- Antoy
- 1992
(Show Context)
Citation Context ...reduction may yield a single new expression (deterministic step) or a disjunction of new expressions together with corresponding bindings (non-deterministic step). For inductively sequential programs =-=[1]-=- (these are, roughly speaking, function definitions without overlapping left-hand sides), this strategy, called needed narrowing [2], computes the shortest possible successful derivations (if common s... |

154 |
Logic programming with functions and predicates: The language BABEL
- Moreno-Navarro, Rodr'iguez-Artalejo
- 1992
(Show Context)
Citation Context ...ate or constraint which instantiates its argument with potential solutions (i.e., gen is flexible) and test checks whether the argument is a 6 This notion of equality is also known as strict equality =-=[7, 17]-=- and is the only reasonable notion of equality in the presence of non-terminating functions.sWorkshop on Parallelism and Implementation Technology correct solution (i.e., test is rigid), then a constr... |

138 | A unified computation model for functional and logic programming
- Hanus
- 1997
(Show Context)
Citation Context ...oitation of Java threads to implement the concurrent and non-deterministic features of Curry. Keywords: Functional logic programming, lazy evaluation, concurrency, implementation 1 Introduction Curry =-=[11, 12]-=- is a multi-paradigm declarative language aiming to integrate functional, logic, and concurrent programming paradigms. Curry combines in a seamless way features from functional programming (nested exp... |

116 | Programming paradigms of the Andorra Kernel Language
- Janson, Haridi
- 1991
(Show Context)
Citation Context ...ons) while its corresponding twin thread is already active. The latter case avoids the duplication of processes for don't know non-deterministic computations which is also known as stability from AKL =-=[15]-=-. This scheme implements coroutining features of current Prolog systems [18] as well as features of concurrent constraint languages [22]. In the next section, we review the basic computation model of ... |

102 |
Kernel LEAF: a logic plus functional language
- Giovannetti, Levi, et al.
- 1991
(Show Context)
Citation Context ...ate or constraint which instantiates its argument with potential solutions (i.e., gen is flexible) and test checks whether the argument is a 6 This notion of equality is also known as strict equality =-=[7, 17]-=- and is the only reasonable notion of equality in the presence of non-terminating functions.sWorkshop on Parallelism and Implementation Technology correct solution (i.e., test is rigid), then a constr... |

97 | A demand driven computation strategy for lazy narrowing
- Loogen, Fraguas, et al.
- 1993
(Show Context)
Citation Context ...uational constraint e 1 =e 2 is solved by evaluating e 1 and e 2 to unifiable data terms where the lazy evaluation of the expressions is interleaved with the binding of variables to constructor terms =-=[16]-=-. Thus, an equational constraint e 1 =e 2 without occurrences of defined functions has the same meaning (unification) as in Prolog. The basic kernel of Curry only provides equations e 1 =e 2 between e... |

88 |
Higher-order extensions to prolog: are they needed
- Warren
- 1982
(Show Context)
Citation Context ...omputation model described so far includes only first-order functions, higher-order features can be implemented by providing a (first-order) definition of the application function (as shown by Warren =-=[25]-=- for logic programming). Curry supports the higher-order features of current functional languages (partial function applications, lambda abstractions) by this technique, where the rules for the applic... |

75 | Kernel Andorra Prolog and its Computation Model
- Haridi, Janson
- 1990
(Show Context)
Citation Context ...if another active leaf has bound the variable. This can avoid unnecessary duplications of active threads and prefers deterministic parts of the computation, similarly to the Andorra computation model =-=[14]-=-. If all leafs in a computation structure are suspended but there are several leafs waiting to bind a variable non-deterministically, then only one of them (e.g., the leaf corresponding to the leftmos... |

28 |
Towards a Clean Amalgamation of Logic Programs with External Procedures
- Bonnier, Maluszynski
- 1988
(Show Context)
Citation Context ...rts a concurrent programming style like in concurrent constraint/logic programming languages. Moreover, the suspension of function calls is also essential to connect external functions in a clean way =-=[3]-=-. For instance, the integer numbers can be considered as an infinite set of constants where the addition on integers is conceptually defined by an infinite set of rules: 0+0 = 0 0+1 = 1 ... 2+3 = 5 ..... |

17 |
Multiprocessor Execution of Logic Programs
- GUPTA
- 1994
(Show Context)
Citation Context ...fY=s(X)g. 2 The run-time system of our implementation uses threads to implement different abstract machines. Each machine needs a data structure that stores the bindings initiated by the machine (see =-=[8]-=- for an overview of different implementation methods). Our current implementation is based on binding arrays: every variable has a unique number that is interpreted as an index in an array of expressi... |

12 | Goffin - Higher-order functions meet concurrent constraints
- Chakravarty, Guo, et al.
- 1998
(Show Context)
Citation Context ...oon as its argument is sufficiently instantiated. It is also interesting to note that this model is able to cover recent developments in parallel functional computation models like Eden [4] or Goffin =-=[5]. For inst-=-ance, a constraint of the form "X=f(t1)Y=g(t2)Z=h(X,Y)" specifies a potentially concurrent computation of the functions f, g and h where the function h can proceed its computation only if th... |

9 |
Implementation Mechanisms for Dependent And-Parallelism
- PONTELLI, GUPTA
- 1997
(Show Context)
Citation Context ...mportant for the computed results, since Curry has no side effects. Because there is no need to ensure a sequential backtracking semantics as in Prolog (e.g., unlike in the ACE parallel Prolog system =-=[21]-=-), we will implement disjunctive computations by independent threads. However, this implementation issue is less important than in Prolog since most parts of larger computations are purely determinist... |

7 |
On the compilation of a domain-based Prolog
- Nilsson
- 1983
(Show Context)
Citation Context ...nt to implement concurrently (by Java threads) rather than sequentially as in Prolog. Thus, standard techniques to translate (sequential) logic programs into procedures of imperative languages (e.g., =-=[19]-=-) cannot be applied here. 2 In the following we use a Prolog-like syntax which is slightly different from the actual Curry syntax. Workshop on Parallelism and Implementation Technology 3 construct nat... |

6 |
Teaching Functional and Logic Programming with a Single Computation Model
- Hanus
- 1292
(Show Context)
Citation Context ...programming in general. Actually, Curry has been successfully applied to teach functional and logic programming techniques in a single course without switching between different programming languages =-=[10]-=-. In order to provide a portable implementation of Curry, we have developed an interpreter for Curry in Java. Each function defined in a Curry program is translated into a Java class containing instru... |

3 | Concurrency in functional and logic programming
- Breitinger, Loogen, et al.
- 1995
(Show Context)
Citation Context ...activated as soon as its argument is sufficiently instantiated. It is also interesting to note that this model is able to cover recent developments in parallel functional computation models like Eden =-=[4] or Goffin-=- [5]. For instance, a constraint of the form "X=f(t1)Y=g(t2)Z=h(X,Y)" specifies a potentially concurrent computation of the functions f, g and h where the function h can proceed its computat... |

2 |
Available at http://www.cs.kuleuven.ac.be/~bmd/PrologInJava
- JProlog
- 1996
(Show Context)
Citation Context ...oad classes during run time allows the user to hold only those functions in memory that are actually needed (this feature has also been used by other projects like the Prolog-to-Java-compiler JProlog =-=[6]-=-). And last but not least: since the Java-compiler produces bytecode for the JVM, the entire Curry run-time system is portable to other platforms: any computer with an installed JVM (e.g., a WWW-brows... |