Appalachian State University
Browse

A Generalization of Short-Cut Fusion and Its Correctness Proof

Download (239.97 kB)
journal contribution
posted on 2025-08-08, 17:06 authored by Patricia Johann
Short-cut fusion is a program transformation technique that uses a single local transformation - called the foldr build rule - to remove certain intermediate lists from modularly constructed functional programs. Arguments that short-cut fusion is correct typical appeal either to intuition or to "free theorems" - even though the latter have not been known to hold for the languages supporting higher-order polymorphic functions and fixed point recursion in which short-cut fusion is usually applied. In this paper we use Pitts' recent demonstration that contextual equivalence in such languages is relationally parametric to prove that programs in them which have undergone short-cut fusion are contextually equivalent to their unfused counterparts. For each algebraic data type we then define a generalization of build which constructs substitution instances of its associated data structures, and use Pitts' techniques to prove the correctness of a contextual equivalence-preserving fusion rule which generalizes short-cut fusion. These rules optimize compositions of functions that uniformly consume algebraic data structures with functions that uniformly produces substitution instances of those data structures.

History

Related Materials

AI-Assisted

  • No

Year Created

2002

College or School

  • College of Arts and Sciences

Department

Computer Science

Language

English

Access Rights

  • Open

Content Genre or Classification

Journal article

Usage metrics

    Research, Scholarly, & Creative Outputs

    Categories

    No categories selected

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC