Skip to main content
QUICK REVIEW

[Paper Review] A General Framework For Lazy Functional Logic Programming With Algebraic Polymorphic Types

Puri Arenas-Sánchez, Mario Rodríguez-Artalejo|ArXiv.org|Apr 24, 2004
Logic, programming, and type systemsComputer Science52 references14 citations
TL;DR

This paper presents a general framework for lazy functional logic programming that supports polymorphic types, algebraic data constructors with equational axioms, and non-determinism. It introduces a novel logic combining C-based rewriting calculi and models, achieving soundness, completeness, and type preservation, with a sound and complete goal-solving procedure using lazy narrowing modulo C.

ABSTRACT

We propose a general framework for first-order functional logic programming, supporting lazy functions, non-determinism and polymorphic datatypes whose data constructors obey a set C of equational axioms. On top of a given C, we specify a program as a set R of C-based conditional rewriting rules for defined functions. We argue that equational logic does not supply the proper semantics for such programs. Therefore, we present an alternative logic which includes C-based rewriting calculi and a notion of model. We get soundness and completeness for C-based rewriting w.r.t. models, existence of free models for all programs, and type preservation results. As operational semantics, we develop a sound and complete procedure for goal solving, which is based on the combination of lazy narrowing with unification modulo C. Our framework is quite expressive for many purposes, such as solving action and change problems, or realizing the GAMMA computation model.

Motivation & Objective

  • To address the limitations of equational logic in capturing the semantics of lazy functional languages, where infinite values cannot be equated.
  • To provide a logical foundation for functional logic programming that supports lazy evaluation, non-determinism, and polymorphic types.
  • To overcome incompleteness in conditional narrowing due to undecidable equality of infinite terms in equational logic.
  • To develop a formal semantics based on C-based rewriting and models, ensuring soundness and completeness.
  • To ensure type safety and preservation under computation through a well-typed operational procedure.

Proposed method

  • The framework defines programs as sets of C-based conditional rewriting rules, where C is an equational theory governing data constructors.
  • It introduces a new logic combining C-based rewriting calculi with a model-theoretic semantics, replacing equational logic as the foundation.
  • A sound and complete goal-solving procedure is developed using lazy narrowing combined with unification modulo C.
  • The framework supports polymorphic types and ensures type preservation through well-typed environments and type variants.
  • It distinguishes between algebraic equality (≈) and strict equality (==), aligning with denotational semantics of lazy languages.
  • The model theory includes free models for all programs and ensures that semantic entailment corresponds to derivability in the logic.

Experimental results

Research questions

  • RQ1Can a logical semantics be defined for lazy functional logic programs that captures infinite values and supports non-determinism?
  • RQ2How can equational logic be extended or replaced to support the semantics of lazy functional languages with infinite data structures?
  • RQ3Is it possible to design a sound and complete operational procedure for goal solving in such a framework?
  • RQ4How can polymorphic types be integrated with equational data constructors while preserving type safety?
  • RQ5What is the relationship between the model-theoretic semantics and the operational semantics based on narrowing?

Key findings

  • The proposed logic ensures soundness and completeness of C-based rewriting with respect to models, providing a solid semantic foundation.
  • Free models exist for all programs, guaranteeing a well-defined denotational semantics.
  • The framework achieves type preservation, ensuring that well-typed programs remain well-typed under computation.
  • The operational procedure based on lazy narrowing modulo C is both sound and complete for goal solving.
  • The framework supports the GAMMA computation model and can be used to solve problems involving action and change.
  • The distinction between algebraic and strict equality resolves undecidability issues in equational logic for infinite terms.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.