5,957 research outputs found

    A Calculational Theory of Pers as Types

    Get PDF
    In the calculational approach to programming, programs are derived from specifications by algebraic reasoning. This report presents a calculational programming framework based upon the notion of binary relations as programs, and partial equivalence relations (pers) as types. Working with relations as programs generalises the functional paradigm, admiting non-determinism and the use of relation converse. Working with pers as types permits a natural treatment of types that are subject to laws and restrictions

    Undecidability of Equality in the Free Locally Cartesian Closed Category (Extended version)

    Get PDF
    We show that a version of Martin-L\"of type theory with an extensional identity type former I, a unit type N1 , Sigma-types, Pi-types, and a base type is a free category with families (supporting these type formers) both in a 1- and a 2-categorical sense. It follows that the underlying category of contexts is a free locally cartesian closed category in a 2-categorical sense because of a previously proved biequivalence. We show that equality in this category is undecidable by reducing it to the undecidability of convertibility in combinatory logic. Essentially the same construction also shows a slightly strengthened form of the result that equality in extensional Martin-L\"of type theory with one universe is undecidable

    Foundations for structured programming with GADTs

    Get PDF
    GADTs are at the cutting edge of functional programming and become more widely used every day. Nevertheless, the semantic foundations underlying GADTs are not well understood. In this paper we solve this problem by showing that the standard theory of data types as carriers of initial algebras of functors can be extended from algebraic and nested data types to GADTs. We then use this observation to derive an initial algebra semantics for GADTs, thus ensuring that all of the accumulated knowledge about initial algebras can be brought to bear on them. Next, we use our initial algebra semantics for GADTs to derive expressive and principled tools — analogous to the well-known and widely-used ones for algebraic and nested data types — for reasoning about, programming with, and improving the performance of programs involving, GADTs; we christen such a collection of tools for a GADT an initial algebra package. Along the way, we give a constructive demonstration that every GADT can be reduced to one which uses only the equality GADT and existential quantification. Although other such reductions exist in the literature, ours is entirely local, is independent of any particular syntactic presentation of GADTs, and can be implemented in the host language, rather than existing solely as a metatheoretical artifact. The main technical ideas underlying our approach are (i) to modify the notion of a higher-order functor so that GADTs can be seen as carriers of initial algebras of higher-order functors, and (ii) to use left Kan extensions to trade arbitrary GADTs for simpler-but-equivalent ones for which initial algebra semantics can be derive

    On Irrelevance and Algorithmic Equality in Predicative Type Theory

    Full text link
    Dependently typed programs contain an excessive amount of static terms which are necessary to please the type checker but irrelevant for computation. To separate static and dynamic code, several static analyses and type systems have been put forward. We consider Pfenning's type theory with irrelevant quantification which is compatible with a type-based notion of equality that respects eta-laws. We extend Pfenning's theory to universes and large eliminations and develop its meta-theory. Subject reduction, normalization and consistency are obtained by a Kripke model over the typed equality judgement. Finally, a type-directed equality algorithm is described whose completeness is proven by a second Kripke model.Comment: 36 pages, superseds the FoSSaCS 2011 paper of the first author, titled "Irrelevance in Type Theory with a Heterogeneous Equality Judgement

    An Improved Interface for Interactive Proofs in Separation Logic

    Get PDF
    Seit Software entwickelt wird, stellt sich die Frage, ob diese korrekt ist, d.h. ob sie das tut, was sie tun soll. Gegeben eine formale Spezifikation der Anforderungen, ist eine Aufgabe der Softwareverifikation also zu beweisen, ob eine Implementierung diese Spezifikation erfĂŒllt. Diese Aufgabe kann schwierig zu lösen sein, wenn die verwendete Programmiersprache Befehle mit globalem Effekt erlaubt, sodass diese andere Befehle in unabhĂ€ngigen Teilen des Programms beeinflussen können, zum Beispiel durch einen gemeinsam genutzten Heap-Speicher. Separation-Logic löst dieses Problem, indem es Aussagen um einen separierenden Operator erweitert, wodurch es möglich ist, Teile eines Programms als unabhĂ€ngig vom Rest des Programms anzusehen. Ein Werkzeug, das Beweise zur Softwareverifikation unterstĂŒtzt, sind interaktive Theorembeweiser. Allerdings benötigen Separation-Logic-Beweise in interaktiven Theorembeweisern, besonders mit nicht-linearem Typsystem, viel manuellen Aufwand zur Verwaltung der benötigten Datenstrukturen. Dies kann vermieden werden, indem dem Nutzer eine Schnittstelle zur VerfĂŒgung gestellt wird, die Beweise auf der typischen, höheren Abstraktionsebene ermöglicht. Diese Arbeit beschreibt eine neue Schnittstelle fĂŒr Separation-Logic-Beweise in dem interaktiven Theorembeweiser Lean 4, basierend auf dem Iris-Projekt, und die Verbesserungen an dieser Schnittstelle

    On generalized algebraic theories and categories with families

    Get PDF
    We give a syntax independent formulation of finitely presented generalized algebraic theories as initial objects in categories of categories with families (cwfs) with extra structure. To this end, we simultaneously define the notion of a presentation ÎŁ of a generalized algebraic theory and the associated category CwFÎŁ of small cwfs with a ÎŁ-structure and cwf-morphisms that preserve ÎŁ-structure on the nose. Our definition refers to the purely semantic notion of uniform family of contexts, types, and terms in CwFÎŁ. Furthermore, we show how to syntactically construct an initial cwf with a ÎŁ-structure. This result can be viewed as a generalization of Birkhoff’s completeness theorem for equational logic. It is obtained by extending Castellan, Clairambault, and Dybjer’s construction of an initial cwf. We provide examples of generalized algebraic theories for monoids, categories, categories with families, and categories with families with extra structure for some type formers of Martin-Löf type theory. The models of these are internal monoids, internal categories, and internal categories with families (with extra structure) in a small category with families. Finally, we show how to extend our definition to some generalized algebraic theories that are not finitely presented, such as the theory of contextual cwfs.publishedVersio

    Martin-L\"of \`a la Coq

    Full text link
    We present an extensive mechanization of the meta-theory of Martin-L\"of Type Theory (MLTT) in the Coq proof assistant. Our development builds on pre-existing work in Agda to show not only the decidability of conversion, but also the decidability of type checking, using an approach guided by bidirectional type checking. From our proof of decidability, we obtain a certified and executable type checker for a full-fledged version of MLTT with support for Π\Pi, Σ\Sigma, N\mathbb{N}, and identity types, and one universe. Furthermore, our development does not rely on impredicativity, induction-recursion or any axiom beyond MLTT with a schema for indexed inductive types and a handful of predicative universes, narrowing the gap between the object theory and the meta-theory to a mere difference in universes. Finally, we explain our formalization choices, geared towards a modular development relying on Coq's features, e.g. meta-programming facilities provided by tactics and universe polymorphism
    • 

    corecore