Skip to main content
QUICK REVIEW

[Paper Review] Functional Logic Program Transformations

Hanus Michael, Steven Libby|arXiv (Cornell University)|Jan 19, 2026
Logic, programming, and type systemsComputer Science0 citations
TL;DR

The paper presents a method to implement program transformations using functional logic programming in Curry, leveraging non-determinism and functional patterns to create compact, modular transformations, and compares non-deterministic vs deterministic approaches on FlatCurry representations.

ABSTRACT

Many tools used to process programs, like compilers, analyzers, or verifiers, perform transformations on their intermediate program representation, like abstract syntax trees. Implementing such program transformations is a non-trivial task, since it is necessary to iterate over the complete syntax tree and apply various transformations at nodes in a tree. In this paper we show how the features of functional logic programming are useful to implement program transformations in a compact and comprehensible manner. For this purpose, we propose to write program transformations as partially defined and non-deterministic operations. Since the implementation of non-determinism usually causes some overhead compared to deterministically defined operations, we compare our approach to a deterministic transformation method. We evaluate these alternatives for the functional logic language Curry and its intermediate representation FlatCurry which is used in various analysis and verification tools and compilers.

Motivation & Objective

  • Motivate and study program transformations as a tool for compilers, analyzers, and verifiers.
  • Show how functional logic programming facilitates compact and comprehensible transformation definitions.
  • Present a representation (FlatCurry) and demonstrate transformation definitions as partially defined, non-deterministic operations.
  • Evaluate non-deterministic versus deterministic transformation approaches in Curry and its FlatCurry intermediate form.

Proposed method

  • Define program transformations as partially defined and non-deterministic operations in Curry.
  • Use functional patterns to express deep pattern matching in transformations.
  • Utilize FlatCurry as the intermediate representation to target and manipulate transformed programs.
  • Explain encapsulated search to manage non-determinism and failure in transformations.
  • Compare non-deterministic transformation definitions against deterministic ones in terms of implementation and overhead.
  • Provide illustrative examples (e.g., insert at position in a list) to show transformation definitions.

Experimental results

Research questions

  • RQ1How can functional logic features in Curry be used to express program transformations in a modular and comprehensible way?
  • RQ2What are the benefits and drawbacks (e.g., overhead) of non-deterministic versus deterministic transformation definitions?
  • RQ3How well do these transformation approaches apply to Curry programs and the FlatCurry intermediate representation?
  • RQ4What role do functional patterns and encapsulated search play in expressing and controlling transformations?

Key findings

  • Functional logic features enable compact and modular representations of program transformations.
  • Non-deterministic operations (with encapsulated search) can express transformations succinctly and handle multiple results when appropriate.
  • Functional patterns allow deep, potentially arbitrary-depth pattern matching within transformations, improving expressiveness.
  • The study includes a comparative evaluation of non-deterministic versus deterministic transformation approaches in the Curry/FlatCurry setting.
  • FlatCurry serves as a practical intermediate form for applying and evaluating transformations in Curry-based tooling.

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.