7 research outputs found

    An Extensible Theory of Indexed Types

    No full text
    Indexed families of types are a way of associating run-time data with compile-time abstractions that can be used to reason about them. We propose an extensible theory of indexed types, in which programmers can define the index data appropriate to their programs and use them to track properties of run-time code. The essential ingredients in our proposal are (1) a logical framework, which is used to define index data, constraints, and proofs, and (2) computation with indices, both at the static and dynamic levels of the programming language. Computation with indices supports a variety of mechanisms necessary for programming with extensible indexed types, including the definition and implementation of indexed types, meta-theoretic reasoning about indices, proofproducing run-time checks, computed index expressions, and runtime actions of index constraints. Programmer-defined index propositions and their proofs can be represented naturally in a logical framework such as LF, where variable binding is used to model the consequence relation of the logic. Consequently, the central technical challenge in our design is that computing with indices requires computing with the higherorder terms of a logical framework. The technical contributions of this paper are a novel method for computing with the higher-order data of a simple logical framework and the integration of such computation into the static and dynamic levels of a programming language. Further, we present examples showing how this computation supports indexed programming

    2-Dimensional Directed Dependent Type Theory

    No full text
    The groupoid interpretation of dependent type theory given by Hofmann and Streicher associates to each closed type a category whose objects represent the elements of that type and whose maps represent proofs of equality of elements. The categorial structure ensures that equality is reflexive (identity maps) and transitive (closure under composition); the groupoid structure, which demands that every map be invertible, ensures symmetry. Families of types are interpreted as functors; the action on maps (equality proofs) ensures that families respect equality of elements of the index type. The functorial action of a type family is computationally non-trivial in the case that the groupoid associated to the index type is non-trivial. For example, one may identity elements of a universe of sets up to isomorphism, in which case the action of a family of types indexed by sets must respect set isomorphism. The groupoid interpretation is 2-dimensional in that the coherence requirements on proofs of equality are required to hold “on the nose”, rather than up to higher dimensional equivalences. Recent work by Awodey and Lumsdaine, Voevodsky, and others extends the groupoid interpretation to higher dimensions, exposing close correspondences between type theory, higher-dimensional category theory, and homotopy theory. In this paper we consider another generalization of the groupoid interpretation that relaxes the symmetry requirement on proofs of “equivalence” to obtain a directed notion of transformation between elements of a type. Closed types may then be interpreted as categories, and families as functors that extend transformations on indices to transformations between families. Relaxing symmetry requires a reformulation of type theory to make the variances of type families explicit. The types themselves must be reinterpreted to take account of variance; for example, a type is contravariant in its domain, but covariant in its range. Whereas in symmetric type theory proofs of equivalence can be internalized using the Martin-Löf identity type, in directed type theory the two-dimensional structure must be made explicit at the judgemental level. The resulting 2-dimensional directed dependent type theory, or 2DTT, is validated by an interpretation into the strict 2-category Cat of categories, functors, and natural transformations, generalizing the groupoid interpretation. We conjecture that 2DTT can be given semantics in a broad class of 2-categories, and can be extended to make the higher dimensional structure explicit. We illustrate the use of 2DTT for writing dependently typed programs over representations of syntax and logical systems

    Dependently Typed Programming with Domain-Specific Logics

    No full text
    We define a dependent programming language in which programmers can define and compute with domain-specific logics, such as an access-control logic that statically prevents unauthorized access to controlled resources. Our language permits programmers to define logics using the LF logical framework, whose notion of binding and scope facilitates the representation of the consequence relation of a logic, and to compute with logics by writing functional programs over LF terms. These functional programs can be used to compute values at run-time, and also to compute types at compiletime. In previous work, we studied a simply-typed framework for representing and computing with variable binding [LICS 2008]. In this paper, we generalize our previous type theory to account for dependently typed inference rules, which are necessary to adequately represent domain-specific logics, and we present examples of using our type theory for certified software and mechanized metatheory

    A Formulation of Dependent ML with Explicit Equality Proofs

    No full text
    We study a calculus that supports dependent programming in the style of Xi and Pfenning’s Dependent ML. Xi and Pfenning’s language determines equality of static data using a built-in decision procedure; ours permits explicit, programmer-written proofs of equality. In this report, we define our calculus’ semantics and prove type safety and decidability of type checking; we have mechanized much of these proofs using the Twelf proof assistant. Additionally, we illustrate programming in our calculus through a series of examples. Finally, we present a detailed comparison with other dependently typed languages, including DependentML, Epigram, Cayenne, ATS, ­Ωmega, and RSP1

    Focusing on Binding and Computation

    No full text
    Variable binding is a prevalent feature of the syntax and proof theory of many logical systems. In this paper, we define a programming language that provides intrinsic support for both representing and computing with binding. This language is extracted as the Curry-Howard interpretation of a focused sequent calculus with two kinds of implication, of opposite polarity. The representational arrow extends systems of definitional reflection with the notion of a scoped inference rule, which permits the adequate representation of binding via higher-order abstract syntax. On the other hand, the usual computational arrow classifies recursive functions over such higher-order data. Unlike many previous approaches, both binding and computation can mix freely. Following Zeilberger [POPL 2008], the computational function space admits a form of openendedness, in that it is represented by an abstract map from patterns to expressions. As we demonstrate with Coq and Agda implementations, this has the important practical benefit that we can reuse the pattern coverage checking of these tools

    Homotopical Patch Theory

    No full text
    Homotopy type theory is an extension of Martin-Löf type theory, based on a correspondence with homotopy theory and higher category theory. In homotopy type theory, the propositional equality type becomes proof-relevant, and corresponds to paths in a space. This allows for a new class of datatypes, called higher inductive types, which are specified by constructors not only for points but also for paths. In this paper, we consider a programming application of higher inductive types. Version control systems such as Darcs are based on the notion of patches - syntactic representations of edits to a repository. We show how patch theory can be developed in homotopy type theory. Our formulation separates formal theories of patches from their interpretation as edits to repositories. A patch theory is presented as a higher inductive type. Models of a patch theory are given by maps out of that type, which, being functors, automatically preserve the structure of patches. Several standard tools of homotopy theory come into play, demonstrating the use of these methods in a practical programming context.</p

    The Cult of the Bound Variable: The 9th Annual ICFP Programming Contest

    No full text
    The annual ICFP Programming Contest has become one of the premiere programming competitions in the world. The 9th incarnation of the contest, “The Cult of the Bound Variable,” was held in July 2006 and organized by the Principles of Programming group at Carnegie Mellon University. This report details the contest tasks, the technology used to produce the contest, and the contest results. Several tasks draw ideas from programming languages research. For example, participants implemented a simple virtual machine, played an adventure game based on a substructural logic, and programmed in a two-dimensional circuit language with a discordantly high-level operational semantics. The contest technology includes an optimizing compiler for a high-level functional language that targets our virtual machine. By the end of the three day contest, 365 teams, composed of 700 programmers from all over the world, solved at least one of the contest tasks
    corecore