139 research outputs found

    Principal Typings in a Restricted Intersection Type System for Beta Normal Forms with De Bruijn Indices

    Full text link
    The lambda-calculus with de Bruijn indices assembles each alpha-class of lambda-terms in a unique term, using indices instead of variable names. Intersection types provide finitary type polymorphism and can characterise normalisable lambda-terms through the property that a term is normalisable if and only if it is typeable. To be closer to computations and to simplify the formalisation of the atomic operations involved in beta-contractions, several calculi of explicit substitution were developed mostly with de Bruijn indices. Versions of explicit substitutions calculi without types and with simple type systems are well investigated in contrast to versions with more elaborate type systems such as intersection types. In previous work, we introduced a de Bruijn version of the lambda-calculus with an intersection type system and proved that it preserves subject reduction, a basic property of type systems. In this paper a version with de Bruijn indices of an intersection type system originally introduced to characterise principal typings for beta-normal forms is presented. We present the characterisation in this new system and the corresponding versions for the type inference and the reconstruction of normal forms from principal typings algorithms. We briefly discuss the failure of the subject reduction property and some possible solutions for it

    A Theory of Explicit Substitutions with Safe and Full Composition

    Full text link
    Many different systems with explicit substitutions have been proposed to implement a large class of higher-order languages. Motivations and challenges that guided the development of such calculi in functional frameworks are surveyed in the first part of this paper. Then, very simple technology in named variable-style notation is used to establish a theory of explicit substitutions for the lambda-calculus which enjoys a whole set of useful properties such as full composition, simulation of one-step beta-reduction, preservation of beta-strong normalisation, strong normalisation of typed terms and confluence on metaterms. Normalisation of related calculi is also discussed.Comment: 29 pages Special Issue: Selected Papers of the Conference "International Colloquium on Automata, Languages and Programming 2008" edited by Giuseppe Castagna and Igor Walukiewic

    Explicit substitution : on the edge of strong normalisation

    Get PDF

    Tealeaves: Structured Monads for Generic First-Order Abstract Syntax Infrastructure

    Get PDF
    Verifying the metatheory of a formal system in Coq involves a lot of tedious "infrastructural" reasoning about variable binders. We present Tealeaves, a generic framework for first-order representations of variable binding that can be used to develop this sort of infrastructure once and for all. Given a particular strategy for representing binders concretely, such as locally nameless or de Bruijn indices, Tealeaves allows developers to implement modules of generic infrastructure called backends that end users can simply instantiate to their own syntax. Our framework rests on a novel abstraction of first-order abstract syntax called a decorated traversable monad (DTM) whose equational theory provides reasoning principles that replace tedious induction on terms. To evaluate Tealeaves, we have implemented a multisorted locally nameless backend providing generic versions of the lemmas generated by LNgen. We discuss case studies where we instantiate this generic infrastructure to simply-typed and polymorphic lambda calculi, comparing our approach to other utilities

    Extensions of nominal terms

    Get PDF
    This thesis studies two major extensions of nominal terms. In particular, we study an extension with -abstraction over nominal unknowns and atoms, and an extension with an arguably better theory of freshness and -equivalence. Nominal terms possess two levels of variable: atoms a represent variable symbols, and unknowns X are `real' variables. As a syntax, they are designed to facilitate metaprogramming; unknowns are used to program on syntax with variable symbols. Originally, the role of nominal terms was interpreted narrowly. That is, they were seen solely as a syntax for representing partially-speci ed abstract syntax with binding. The main motivation of this thesis is to extend nominal terms so that they can be used for metaprogramming on proofs, programs, etc. and not just for metaprogramming on abstract syntax with binding. We therefore extend nominal terms in two signi cant ways: adding -abstraction over nominal unknowns and atoms| facilitating functional programing|and improving the theory of -equivalence that nominal terms possesses. Neither of the two extensions considered are trivial. The capturing substitution action of nominal unknowns implies that our notions of scope, intuited from working with syntax possessing a non-capturing substitution, such as the -calculus, is no longer applicable. As a result, notions of -abstraction and -equivalence must be carefully reconsidered. In particular, the rst research contribution of this thesis is the two-level - calculus, intuitively an intertwined pair of -calculi. As the name suggests, the two-level -calculus has two level of variable, modelled by nominal atoms and unknowns, respectively. Both levels of variable can be -abstracted, and requisite notions of -reduction are provided. The result is an expressive context-calculus. The traditional problems of handling -equivalence and the failure of commutation between instantiation and -reduction in context-calculi are handled through the use of two distinct levels of variable, swappings, and freshness side-conditions on unknowns, i.e. `nominal technology'. The second research contribution of this thesis is permissive nominal terms, an alternative form of nominal term. They retain the `nominal' rst-order avour of nominal terms (in fact, their grammars are almost identical) but forego the use of explicit freshness contexts. Instead, permissive nominal terms label unknowns with a permission sort, where permission sorts are in nite and coin nite sets of atoms. This in nite-coin nite nature means that permissive nominal terms recover two properties|we call them the `always-fresh' and `always-rename' properties that nominal terms lack. We argue that these two properties bring the theory of -equivalence on permissive nominal terms closer to `informal practice'. The reader may consider -abstraction and -equivalence so familiar as to be `solved problems'. The work embodied in this thesis stands testament to the fact that this isn't the case. Considering -abstraction and -equivalence in the context of two levels of variable poses some new and interesting problems and throws light on some deep questions related to scope and binding

    A Type Checker for a Logical Framework with Union and Intersection Types

    Get PDF
    We present the syntax, semantics, and typing rules of Bull, a prototype theorem prover based on the Delta-Framework, i.e. a fully-typed lambda-calculus decorated with union and intersection types, as described in previous papers by the authors. Bull also implements a subtyping algorithm for the Type Theory Xi of Barbanera-Dezani-de'Liguoro. Bull has a command-line interface where the user can declare axioms, terms, and perform computations and some basic terminal-style features like error pretty-printing, subexpressions highlighting, and file loading. Moreover, it can typecheck a proof or normalize it. These terms can be incomplete, therefore the typechecking algorithm uses unification to try to construct the missing subterms. Bull uses the syntax of Berardi's Pure Type Systems to improve the compactness and the modularity of the kernel. Abstract and concrete syntax are mostly aligned and similar to the concrete syntax of Coq. Bull uses a higher-order unification algorithm for terms, while typechecking and partial type inference are done by a bidirectional refinement algorithm, similar to the one found in Matita and Beluga. The refinement can be split into two parts: the essence refinement and the typing refinement. Binders are implemented using commonly-used de Bruijn indices. We have defined a concrete language syntax that will allow the user to write Delta-terms. We have defined the reduction rules and an evaluator. We have implemented from scratch a refiner which does partial typechecking and type reconstruction. We have experimented Bull with classical examples of the intersection and union literature, such as the ones formalized by Pfenning with his Refinement Types in LF. We hope that this research vein could be useful to experiment, in a proof theoretical setting, forms of polymorphism alternatives to Girard's parametric one
    corecore