Abstract. We propose an approach to declarative programming which integrates the functional and relational paradigms by taking possibly non-deterministic lazy functions as the fundamental notion. Programs in our paradigm are theories in a constructor-based conditional rewriting logic. We present proof calculi and a model theory for this logic, and we prove the existence of free term models which provide an adequate intended semantics for programs. Moreover, we develop a sound and strongly complete lazy narrowing calculus, which is able to support sharing without the technical overhead of graph rewriting and to identify safe cases for eager variable elimination.KEYWORDS: Declarative programming, non-deterministic functions, constructor-based rewriting logic, lazy narrowing.
IntroductionThe interest in combining different declarative programming paradigms, especially functional and logic programming, has grown over the last decade; see [10] for a recent survey. The operational semantics of many functional logic languages is based on term rewriting and narrowing. In some cases, constructorbased term rewriting systems (CTRSs) have been adopted, in order to allow for a model-theoretic semantics that can reflect the behaviour of partial functions in non-strict functional languages. Typical examples of this approach include the languages K-LEAF [5] and BABEL [20]. To model the semantics of non-strict partial functions, these languages use so-called strict equality, which regards two terms as equal iff they have the same constructor normal form. On the other hand, the usefulness of non-deterministic operations for algebraic specification and programming has been advocated by Hussmann [13], who provides several examples (including the specification of semantics for communicating sequential processes) and leaves as an interesting open question "the integration of nonstrict operations (at least non-strict constructors)" (see [13], Section 8.2).Following Hussmann's spirit, we propose a quite general approach to declarative programming which views possibly non-deterministic lazy functions as the * Research supported in part by the spanish CICYT (project TIC 95-0433-C03-01 " CPD ") and by the ESPRIT BR Working Group N. 6028 ~ CCL ~
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.