7 research outputs found

    Explicit Substitutions for Contextual Type Theory

    Get PDF
    In this paper, we present an explicit substitution calculus which distinguishes between ordinary bound variables and meta-variables. Its typing discipline is derived from contextual modal type theory. We first present a dependently typed lambda calculus with explicit substitutions for ordinary variables and explicit meta-substitutions for meta-variables. We then present a weak head normalization procedure which performs both substitutions lazily and in a single pass thereby combining substitution walks for the two different classes of variables. Finally, we describe a bidirectional type checking algorithm which uses weak head normalization and prove soundness.Comment: In Proceedings LFMTP 2010, arXiv:1009.218

    Lambda-Free Logical Frameworks

    Get PDF
    We present the definition of the logical framework TF, the Type Framework. TF is a lambda-free logical framework; it does not include lambda-abstraction or product kinds. We give formal proofs of several results in the metatheory of TF, and show how it can be conservatively embedded in the logical framework LF: its judgements can be seen as the judgements of LF that are in beta-normal, eta-long normal form. We show how several properties, such as the injectivity of constants and the strong normalisation of an object theory, can be proven more easily in TF, and then ‘lifted’ to LF

    Practical Heterogeneous Unification for Dependent Type Checking

    Get PDF
    Dependent types can specify in detail which inputs to a program are allowed, and how the properties of its output depend on the inputs. A program called the type checker assesses whether a program has a given type, thus detecting situations where the implementation of a program potentially differs from its intended behaviour. When using dependent types, the inputs to a program often occur in the types of other inputs or in the type of the output. The user may omit some of these redundant inputs when calling the program, expecting the type-checker to infer those subterms automatically. Some type-checkers restrict the inference of missing subterms to those cases where there is a provably unique solution. This makes the process more predictable, but also limits the situations in which the omitted terms can be inferred; specially when considering that whether a unique solution exists is in general an undecidable problem. This restriction can be made less limiting by giving flexibility to the type-checker regarding the order in which the missing subterms are inferred. The type-checker can then use the information gained by filling in any one subterm in order to infer others, until the whole program has been type-checked. However, this flexibility may in some cases lead to ill-typed subterms being inferred, breaking internal invariants of the type-checker and causing it to crash or loop. The type checker could mitigate this by consistently rechecking the type of each inferred subterm, but this might incur a performance penalty.\ua0An approach by Gundry and McBride (2012) called twin types has the potential to afford the desired flexibility while preserving well-typedness invariants. However, this method had not yet been tested in a practical setting. In this thesis we streamline the method of twin types in order to ease its practical implementation, justify the correctness of our modifications, and then implement the result in an established dependently-typed language called Agda. We show that our implementation resolves certain existing bugs in Agda while still allowing a wide range of examples to be type-checked, and achieves this without heavily impacting performance

    Practical Unification for Dependent Type Checking

    Get PDF
    When using popular dependently-typed languages such as Agda, Idris or Coq to write a proof or a program, some function arguments can be omitted, both to decrease code size and to improve readability.\ua0 Type checking such a program involves inferring a combination of these implicit arguments that makes the program type-correct.Finding such a combination of implicit arguments entails solving a higher-order unification problem.Because higher-order unification is undecidable, our aim is to infer the omitted arguments for as many programs as possible with a reasonable use of computational resources. The extent to whichthese goals are achieved affect how usable a dependently-typed proof assistant or programming language is in practice.Current approaches to higher-order unification are in some cases too inflexible, postponing unification of terms until their types have been unified (Coq, Idris). In other cases they are too optimistic, which sometimes leads to ill-typed terms that break internal invariants (Agda).In order to increase the flexibility of our unifier without sacrificing soundness, we use the twin types technique by Gundry and McBride. We simplify their approach so that it can be used within an existing typetheory without changes to the syntax of terms. We also extend it so that it can handle more classes of constraints. We show that the resulting solutions are correct and unique.Finally, we implement the resulting unification algorithm on an existing type checker prototype for a smaller variant of the Agda language, developed by Mazzoli and Abel. We make a suitable choice of internal term representation, and use few, if any, example-specific optimizations. We obtain a type-checker which avoids ill-typed solutions, and is also able to handle some challenging examples in time and memory comparable to the existing Agda implementation

    A Modular Hierarchy of Logical Frameworks

    Get PDF
    Logical frameworks - formal systems for the specification and representation of other formal systems - are now a well-established field of research, and the number and variety of logical frameworks is large and growing continuously. In this thesis, I tie several examples of logical frameworks into a single hierarchy. I begin by introducing an infinite family of new, weak, lambda-free logical frameworks. These systems do not use lambda-abstraction, local definition, or any similar feature; parameterisation, and the instantiation of parameterisation, is taken as basic. These frameworks form conservative extensions of one another; this structure of extension is what I call the modular hierarchy of logical frameworks. I show how several examples of existing logical frameworks - specifically, the systems PAL and AUT-68 from the AUTOMATH family, the Edinburgh Logical Framework, Martin-Lof's Logical Framework, and Luo's system PAL+ - can be fitted into this hierarchy, in the sense that one of the weak frameworks can be embedded in each as a conservative subsystem. I give several examples of adequacy theorems for object theories in the weak frameworks; these theorems are easier to prove than is usually the case for a logical framework. Adequacy theorems for the systems higher in the hierarchy follow as immediate corollaries. In the second part of this thesis, I investigate an approach to the design of logical frameworks suggested by the existence of such a hierarchy: that a framework could be built by specifying a set of features, the result of adding any of which to a framework is a conservative extension of the same. I show how all of the weak frameworks from the first part, as well as two of the systems we gave there as examples, can indeed be built in this manner
    corecore