Skip to main content
QUICK REVIEW

[Paper Review] Intensionality, Intensional Recursion, and the Gödel-Löb axiom

G. A. Kavvos|arXiv (Cornell University)|Mar 3, 2017
Logic, programming, and type systemsComputer Science33 references3 citations
TL;DR

This paper introduces Intensional PCF, a typed lambda calculus with modal types that enables safe, consistent intensional programming by distinguishing between code (intensional) and values (extensional). It shows that the Gödel-Löb axiom provides a constructive foundation for intensional recursion—allowing programs to access their own code—thus enabling reflective, self-modifying computation akin to Kleene’s Second Recursion Theorem.

ABSTRACT

The use of a necessity modality in a typed $λ$-calculus can be used to separate it into two regions. These can be thought of as intensional vs. extensional data: data in the first region, the modal one, are available as code, and their description can be examined. In contrast, data in the second region are only available as values up to ordinary equality. This allows us to add non-functional operations at modal types whilst maintaining consistency. In this setting, the Gödel-Löb axiom acquires a novel constructive reading: it affords the programmer the possibility of a very strong kind of recursion which enables them to write programs that have access to their own code. This is a type of computational reflection that is strongly reminiscent of Kleene's Second Recursion Theorem.

Motivation & Objective

  • To formalize a type-safe mechanism for treating programs as data using modal types, enabling metaprogramming and reflection.
  • To resolve the consistency concerns of intensional operations in typed languages by grounding them in modal type theory.
  • To provide a constructive interpretation of the Gödel-Löb axiom as a form of recursion that grants access to a function’s own code.
  • To demonstrate that intensional recursion—stronger than standard recursion—can be consistently implemented in a typed setting.
  • To explore the programming power and practical applications of such a system, including modeling computer viruses and reflective computation.

Proposed method

  • Extends a simply-typed lambda calculus with a necessity modality (□) to distinguish intensional (code) from extensional (value) data.
  • Introduces a typed fixpoint combinator (Y) and a box/unwrap mechanism (□M, unbox M) to manage modal types and enable code inspection.
  • Uses the Gödel-Löb axiom (□(□A → A) → □A) as a constructive principle to derive intensional recursion, where a function can access its own code via Gödel numbering.
  • Defines intensional operations such as `done?`, `eval`, `tick`, and `por` that inspect modalized terms to implement control flow based on code structure.
  • Constructs a reflective virus using Kleene’s Second Recursion Theorem, where a term `virus` can infect other files by embedding its own code via `infect`.
  • Establishes a logical foundation for intensional programming by proving consistency through a realizability model and logical relations.

Experimental results

Research questions

  • RQ1Can intensional operations—such as code inspection and manipulation—be consistently integrated into a typed functional language?
  • RQ2How can the Gödel-Löb axiom be interpreted constructively in a programming context to enable self-referential computation?
  • RQ3What is the computational power of intensional recursion compared to standard extensional recursion?
  • RQ4Can reflective programming patterns, such as self-modifying code or virus-like behavior, be safely modeled in a type-safe setting?
  • RQ5Are there minimal, complete sets of intensional primitives from which all such reflective behaviors can be derived?

Key findings

  • The Gödel-Löb axiom provides a constructive foundation for intensional recursion, allowing a function to access its own code during execution.
  • A consistent type system for intensional programming is achieved by separating intensional (modal) and extensional (non-modal) data using □-types.
  • The paper presents a consistency proof for intensional operations in a typed setting, resolving a long-standing open problem in the field.
  • A reflective virus can be constructed using the fixpoint combinator and code embedding, demonstrating the practical feasibility of self-referential programs.
  • The system supports non-functional operations (e.g., `done?`, `eval`) at modal types without breaking type safety, enabling metaprogramming.
  • The model realizes Kleene’s Second Recursion Theorem in a typed, constructive setting, showing that self-reference is not only possible but type-safe under modal typing.

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.