Skip to main content
QUICK REVIEW

[Paper Review] Fibred Computational Effects

Danel Ahman|arXiv (Cornell University)|Oct 6, 2017
Logic, programming, and type systemsComputer Science94 references9 citations
TL;DR

This paper introduces eMLTT, a core effectful dependently typed language that unifies Martin-Löf type theory with computational effects through a novel computational Σ-type and a category-theoretic framework of fibred adjunction models. It provides a sound and complete semantics for effectful dependent types and extends algebraic effects with handlers via a type-based treatment, resolving soundness issues in term-level handler definitions.

ABSTRACT

Dependent types provide a lightweight and modular means to integrate programming and formal program verification. In particular, the types of programs written in dependently typed programming languages (Agda, Idris, F*, etc.) can be used to express specifications of program correctness. These specifications can vary from being as simple as requiring the divisor in the division function to be non-zero, to as complex as specifying the correctness of compilers of industrial-strength languages. Successful compilation of a program then guarantees that it satisfies its type-based specification. While dependent types allow many runtime errors to be eliminated by rejecting erroneous programs at compile-time, dependently typed languages are yet to gain popularity in the wider programming community. One reason for this is their limited support for computational effects, an integral part of all widely used programming languages, ranging from imperative languages, such as C, to functional languages, such as ML and Haskell. For example, in addition to simply turning their inputs to outputs, programs written in these programming languages can raise exceptions, access computer's memory, communicate over a network, render images on a screen, etc. Therefore, if dependently typed programming languages are to truly live up to their promise of seamlessly integrating programming and formal program verification, we must first understand how to properly account for computational effects in such languages. While there already exists work on this topic, ingredients needed for a comprehensive theory are generally missing. For example, foundations are often not settled; available effects may be limited; or effects may not be treated systematically. In this thesis we address these shortcomings by providing a comprehensive treatment of the combination of dependent types and general computational effects.

Motivation & Objective

  • To develop a comprehensive theory combining dependent types and computational effects, which are both foundational in modern programming languages.
  • To address the lack of a rigorous, unified foundation for effectful dependent types, despite their individual mathematical maturity.
  • To enable systematic specification of effects such as state, I/O, and exceptions using dependent types.
  • To resolve soundness issues in handler-based effect management by introducing a type-based treatment of handlers.
  • To provide a category-theoretic semantics for the full language, including general recursion and algebraic effects.

Proposed method

  • Proposes eMLTT, a core language extending intensional type theory with a clear separation between values and effectful computations.
  • Introduces the computational Σ-type to uniformly handle type dependency in sequential composition.
  • Defines fibred adjunction models as a category-theoretic framework combining split closed comprehension categories (for dependent types) and adjunctions (for computational effects).
  • Develops a type-based treatment of handlers using a new computation type: the user-defined algebra type, which pairs a carrier type with a family of operations.
  • Extends eMLTT with fibred algebraic effects using a dependently typed generalisation of Plotkin and Pretnar’s effect theories.
  • Demonstrates that term-level handlers can be derived from the type-based treatment, enabling sound reasoning about effectful programs.

Experimental results

Research questions

  • RQ1How can dependent types and computational effects be systematically combined in a single formal language?
  • RQ2What category-theoretic models support a sound and complete interpretation of effectful dependent types?
  • RQ3How can handlers for algebraic effects be safely integrated into a dependently typed setting without breaking program equivalence?
  • RQ4Can the computational Σ-type provide a uniform treatment of type dependency in effectful computation?
  • RQ5How can fibred algebraic effects capture location-dependent store types and update monads in a dependently typed setting?

Key findings

  • The computational Σ-type enables a uniform treatment of type dependency in sequential effectful computation, resolving a key challenge in combining effects with dependent types.
  • Fibred adjunction models provide a sound and complete categorical semantics for eMLTT, unifying models of dependent types and computational effects.
  • The type-based handler treatment via user-defined algebra types prevents unsound program equivalences that arise in term-level handler definitions.
  • The approach allows for a systematic, algebraic specification of effects, including state with location-dependent types and update monads.
  • The type-based handler framework is general enough to recover conventional term-level handlers as derived constructs.
  • The language and semantics are shown to be soundly interpretable in models based on the families of sets fibration and Lawvere theories.

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.