Skip to main content
QUICK REVIEW

[Paper Review] Ramified Structural Recursion and Corecursion

Norman Danner, James S. Royer|arXiv (Cornell University)|Jan 22, 2012
Logic, programming, and type systems4 references3 citations
TL;DR

This paper introduces RS₁, a Bellantoni-Cook-style typed programming formalism that supports feasible polynomial-time computation over both inductive data (e.g., lists, trees) and coinductive codata (e.g., streams, infinite trees) using ramified structural recursion and corecursion. By embracing structure-sharing and memoization, RS₁ ensures polynomial-time bounded runtimes and characterizes complexity classes such as ω-regular languages and log-space streams through type restrictions.

ABSTRACT

We investigate feasible computation over a fairly general notion of data and codata. Specifically, we present a direct Bellantoni-Cook-style normal/safe typed programming formalism, RS1, that expresses feasible structural recursions and corecursions over data and codata specified by polynomial functors. (Lists, streams, finite trees, infinite trees, etc. are all directly definable.) A novel aspect of RS1 is that it embraces structure-sharing as in standard functional-programming implementations. As our data representations use sharing, our implementation of structural recursions are memoized to avoid the possibly exponentially-many repeated subcomputations a naive implementation might perform. We introduce notions of size for representations of data (accounting for sharing) and codata (using ideas from type-2 computational complexity) and establish that type-level 1 RS1-functions have polynomial-bounded runtimes and satisfy a polynomial-time completeness condition. Also, restricting RS1 terms to particular types produces characterizations of some standard complexity classes (e.g., omega-regular languages, linear-space functions) and some less-standard classes (e.g., log-space streams).

Motivation & Objective

  • To develop a feasible computation framework for general data and codata, including infinite structures like streams and infinite trees.
  • To extend Bellantoni-Cook style normal/safe ramification to both recursion and corecursion for type-level 1 computation.
  • To incorporate structure-sharing in data representations to avoid exponential recomputation via memoization.
  • To establish poly-time soundness and completeness for RS₁ over polynomial functors (e.g., lists, streams, finite/infinite trees).
  • To characterize standard and non-standard complexity classes (e.g., ω-regular, log-space streams) through type restrictions on RS₁ terms.

Proposed method

  • RS₁ is built by extending a base system S⁻ for structural recursion over inductive data, then applying ramified normal/safe typing to obtain RS⁻₁.
  • The system is extended to codata via a corecursion extension S, with ramification applied to corecursive constructions to ensure complexity bounds.
  • Structure-sharing is natively supported in RS₁’s data representations, enabling memoized evaluation that avoids repeated subcomputations.
  • Size measures are defined for data (accounting for sharing) and codata (using type-2 complexity ideas), with poly-heap bounds derived from second-order polynomials.
  • Type-level 1 functions in RS₁ are shown to have polynomially bounded runtimes using a poly-heap size-boundness theorem.
  • Complexity classes are characterized by restricting RS₁ terms to specific types, such as ω-regular languages via unit → stream functions.

Experimental results

Research questions

  • RQ1Can a unified formalism support feasible computation over both finite data and infinite codata using structural recursion and corecursion?
  • RQ2How does structure-sharing in data representations affect runtime complexity and implementation efficiency?
  • RQ3Can ramified recursion and corecursion be combined in a type system to ensure polynomial-time bounds?
  • RQ4What complexity classes can be characterized by restricting types in RS₁, and how do they compare to known classes?
  • RQ5How does RS₁’s treatment of sharing compare to systems like Pola, which forbid sharing?

Key findings

  • RS₁ ensures polynomial-time bounded runtimes for all type-level 1 functions through a poly-heap size-boundness theorem using second-order polynomials.
  • The system supports direct definition of lists, streams, finite and infinite trees via polynomial functors, with structure-sharing enabling efficient, memoized evaluation.
  • RS₁ characterizes ω-regular languages as the functions of type unit → stream when restricted to base types.
  • Log-space streams are captured by restricting RS₁ to types involving a natural number counter type (nat), aligning with two-sorted complexity characterizations.
  • Linear-space stream functions are characterized by RS₁ functions of type stream → stream when nat is included as a base type.
  • The formalism provides a complexity-theoretically conservative extension for safe functions over data and codata, with bounds on size and observed size.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.