Dynamic Predicates in Functional Logic Programs (2004)
| Venue: | Journal of Functional and Logic Programming |
| Citations: | 14 - 6 self |
BibTeX
@ARTICLE{Hanus04dynamicpredicates,
author = {Michael Hanus},
title = {Dynamic Predicates in Functional Logic Programs},
journal = {Journal of Functional and Logic Programming},
year = {2004},
volume = {2004},
pages = {2004}
}
OpenURL
Abstract
In this paper we propose a new concept to deal with dynamic predicates in functional logic programs. The definition of a dynamic predicate can change over time, i.e., one can add or remove facts that define this predicate. Our approach is easy to use and has a clear semantics that does not depend on the particular (demand-driven) evaluation strategy of the underlying implementation. In particular, the concept is not based on (unsafe) side effects so that the order of evaluation does not influence the computed results—an essential requirement in non-strict languages. Dynamic predicates can also be persistent so that their definitions are saved across invocations of programs. Thus, dynamic predicates are a lightweight alternative to the explicit use of external database systems. Moreover, they extend one of the classical application areas of logic programming to functional logic programs. We present the concept, its use and an implementation in a Prolog-based compiler. 1 Motivation and Related Work Functional logic languages [11] aim to integrate the best features of functional and logic languages in order to provide a variety of programming concepts to the programmer. For instance, the concepts of demand-driven evaluation, higherorder functions, and polymorphic typing from functional programming can be combined with logic programming features like computing with partial information (logical variables), constraint solving, and non-deterministic search for solutions. This combination leads to optimal evaluation strategies [2] and new design patterns [4] that can be applied to provide better programming abstractions, e.g., for implementing graphical user interfaces [13] or programming dynamic web pages [14]. However, one of the traditional application areas of logic programming is not yet sufficiently covered in existing functional logic languages: the combination







