Skip to main content
QUICK REVIEW

[Paper Review] Design and Implementation of the Andromeda Proof Assistant

Andrej Bauer, Gaëtan Gilbert|arXiv (Cornell University)|Feb 17, 2018
Logic, programming, and type systemsComputer Science3 references4 citations
TL;DR

Andromeda is an LCF-style proof assistant that uses a minimal trusted nucleus to enforce type-theoretic inference rules, while delegating complex tasks like equality checking to user-defined code in a meta-language (AML) with algebraic effects and handlers. The system demonstrates that expressive type theories with equality reflection—despite losing decidability and strong normalization—can be practically supported through user-level extensibility, enabling flexible, customizable proof development.

ABSTRACT

Andromeda is an LCF-style proof assistant where the user builds derivable judgments by writing code in a meta-level programming language AML. The only trusted component of Andromeda is a minimalist nucleus (an implementation of the inference rules of an object-level type theory), which controls construction and decomposition of type-theoretic judgments. Since the nucleus does not perform complex tasks like equality checking beyond syntactic equality, this responsibility is delegated to the user, who implements one or more equality checking procedures in the meta-language. The AML interpreter requests witnesses of equality from user code using the mechanism of algebraic operations and handlers. Dynamic checks in the nucleus guarantee that no invalid object-level derivations can be constructed. %even if the AML code (or interpreter) is untrusted. To demonstrate the flexibility of this system structure, we implemented a nucleus consisting of dependent type theory with equality reflection. Equality reflection provides a very high level of expressiveness, as it allows the user to add new judgmental equalities, but it also destroys desirable meta-theoretic properties of type theory (such as decidability and strong normalization). The power of effects and handlers in AML is demonstrated by a standard library that provides default algorithms for equality checking, computation of normal forms, and implicit argument filling. Users can extend these new algorithms by providing local "hints" or by completely replacing these algorithms for particular developments. We demonstrate the resulting system by showing how to axiomatize and compute with natural numbers, by axiomatizing the untyped $λ$-calculus, and by implementing a simple automated system for managing a universe of types.

Motivation & Objective

  • To design a proof assistant that supports highly expressive type theories, such as dependent type theory with equality reflection, despite their loss of meta-theoretic properties like decidability and strong normalization.
  • To minimize the trusted code base by isolating all complex reasoning—such as equality checking and normalization—outside the core inference engine.
  • To enable users to implement, override, or extend proof automation (e.g., normalization, implicit argument filling) through a high-level meta-language with effects and handlers.
  • To demonstrate that user-level code can safely and flexibly manage complex type-theoretic operations while maintaining soundness through dynamic checks in the nucleus.

Proposed method

  • The system uses a minimal, trusted nucleus that enforces only basic type-theoretic inference rules and inversion principles, ensuring soundness through dynamic checks.
  • User-level derivations are constructed via AML, a meta-language based on ML with algebraic operations and handlers, which enables extensible control over judgment construction.
  • Equality checking and normalization are delegated to user code, which is invoked via algebraic operations when mismatches arise during judgment construction.
  • Handlers in AML allow users to intercept and respond to requests for equality evidence, normal forms, or implicit arguments, enabling local or global algorithm overrides.
  • The nucleus does not perform complex reasoning; instead, it validates all requests using dynamic checks, ensuring no invalid derivations can be constructed.
  • The system supports extensibility by allowing users to define custom universe structures, including Tarski-style universes or even Type : Type, via modifications to the AML type system.

Experimental results

Research questions

  • RQ1Can a proof assistant be built with a minimal trusted core that supports expressive type theories lacking standard meta-theoretic properties, such as decidability and strong normalization?
  • RQ2How can equality checking and normalization be safely delegated to user-level code without compromising soundness?
  • RQ3To what extent can effects and handlers in a meta-language enable modular, composable, and extensible proof automation in a proof assistant?
  • RQ4Can user-defined algorithms for type checking and normalization be effectively overridden or extended using nested handlers for specialized reasoning?
  • RQ5How can the system support flexible universe constructions, including inconsistent or non-standard ones like Type : Type, without breaking the trusted core?

Key findings

  • The Andromeda system successfully implements a proof assistant based on dependent type theory with equality reflection, a theory that lacks decidability and strong normalization, demonstrating that such systems can still be practically usable.
  • By delegating complex reasoning to user code via algebraic effects and handlers, the system maintains a minimal trusted core while enabling powerful, customizable proof automation.
  • The use of dynamic checks in the nucleus ensures that no invalid derivations can be constructed, even when user-provided equality checkers or normalization procedures are incorrect or incomplete.
  • The system allows users to replace or extend default algorithms for equality checking, normalization, and implicit argument filling, with local hints or full reimplementation, enabling fine-grained control over type-theoretic computation.
  • The design supports future extensibility, including the removal of Type : Type and the ability to define custom universe structures or even make equality reflection user-definable.
  • The paper demonstrates that the system can axiomatize natural numbers, the untyped λ-calculus, and manage a universe of types, showing practical applicability despite the underlying theory's non-standard properties.

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.