176 research outputs found
Generic Fibrational Induction
This paper provides an induction rule that can be used to prove properties of
data structures whose types are inductive, i.e., are carriers of initial
algebras of functors. Our results are semantic in nature and are inspired by
Hermida and Jacobs' elegant algebraic formulation of induction for polynomial
data types. Our contribution is to derive, under slightly different
assumptions, a sound induction rule that is generic over all inductive types,
polynomial or not. Our induction rule is generic over the kinds of properties
to be proved as well: like Hermida and Jacobs, we work in a general fibrational
setting and so can accommodate very general notions of properties on inductive
types rather than just those of a particular syntactic form. We establish the
soundness of our generic induction rule by reducing induction to iteration. We
then show how our generic induction rule can be instantiated to give induction
rules for the data types of rose trees, finite hereditary sets, and
hyperfunctions. The first of these lies outside the scope of Hermida and
Jacobs' work because it is not polynomial, and as far as we are aware, no
induction rules have been known to exist for the second and third in a general
fibrational framework. Our instantiation for hyperfunctions underscores the
value of working in the general fibrational setting since this data type cannot
be interpreted as a set.Comment: For Special Issue from CSL 201
Needle & knot : binder boilerplate tied up
To lighten the burden of programming language mechanization, many approaches have been developed that tackle the substantial boilerplate which arises from variable binders. Unfortunately, the existing approaches are limited in scope. They typically do not support complex binding forms (such as multi-binders) that arise in more advanced languages, or they do not tackle the boilerplate due to mentioning variables and binders in relations. As a consequence, the human mechanizer is still unnecessarily burdened with binder boilerplate and discouraged from taking on richer languages.
This paper presents Knot, a new approach that substantially extends the support for binder boilerplate. Knot is a highly expressive language for natural and concise specification of syntax with binders. Its meta-theory constructively guarantees the coverage of a considerable amount of binder boilerplate for well-formed specifications, including that for well-scoping of terms and context lookups. Knot also comes with a code generator, Needle, that specializes the generic boilerplate for convenient embedding in COQ and provides a tactic library for automatically discharging proof obligations that frequently come up in proofs of weakening and substitution lemmas of type-systems.
Our evaluation shows, that Needle & Knot significantly reduce the size of language mechanizations (by 40% in our case study). Moreover, as far as we know, Knot enables the most concise mechanization of the POPLmark Challenge (1a + 2a) and is two-thirds the size of the next smallest. Finally, Knot allows us to mechanize for instance dependentlytyped languages, which is notoriously challenging because of dependent contexts and mutually-recursive sorts with variables
Code Generation for Higher Inductive Types
Higher inductive types are inductive types that include nontrivial
higher-dimensional structure, represented as identifications that are not
reflexivity. While work proceeds on type theories with a computational
interpretation of univalence and higher inductive types, it is convenient to
encode these structures in more traditional type theories with mature
implementations. However, these encodings involve a great deal of error-prone
additional syntax. We present a library that uses Agda's metaprogramming
facilities to automate this process, allowing higher inductive types to be
specified with minimal additional syntax.Comment: 16 pages, Accepted for presentation in WFLP 201
Initiality for Typed Syntax and Semantics
We give an algebraic characterization of the syntax and semantics of a class
of simply-typed languages, such as the language PCF: we characterize
simply-typed binding syntax equipped with reduction rules via a universal
property, namely as the initial object of some category. For this purpose, we
employ techniques developed in two previous works: in [2], we model syntactic
translations between languages over different sets of types as initial
morphisms in a category of models. In [1], we characterize untyped syntax with
reduction rules as initial object in a category of models. In the present work,
we show that those techniques are modular enough to be combined: we thus
characterize simply-typed syntax with reduction rules as initial object in a
category. The universal property yields an operator which allows to specify
translations - that are semantically faithful by construction - between
languages over possibly different sets of types.
We specify a language by a 2-signature, that is, a signature on two levels:
the syntactic level specifies the types and terms of the language, and
associates a type to each term. The semantic level specifies, through
inequations, reduction rules on the terms of the language. To any given
2-signature we associate a category of models. We prove that this category has
an initial object, which integrates the types and terms freely generated by the
2-signature, and the reduction relation on those terms generated by the given
inequations. We call this object the (programming) language generated by the
2-signature.
[1] Ahrens, B.: Modules over relative monads for syntax and semantics (2011),
arXiv:1107.5252, to be published in Math. Struct. in Comp. Science
[2] Ahrens, B.: Extended Initiality for Typed Abstract Syntax. Logical
Methods in Computer Science 8(2), 1-35 (2012)Comment: presented at WoLLIC 2012, 15 page
Quotient inductive-inductive types
Higher inductive types (HITs) in Homotopy Type Theory (HoTT) allow the definition of datatypes which have constructors for equalities over the defined type. HITs generalise quotient types and allow to define types which are not sets in the sense of HoTT (i.e. do not satisfy uniqueness of equality proofs) such as spheres, suspensions and the torus. However, there are also interesting uses of HITs to define sets, such as the Cauchy reals, the partiality monad, and the internal, total syntax of type theory. In each of these examples we define several types that depend on each other mutually, i.e. they are inductive-inductive definitions. We call those HITs quotient inductive-inductive types (QIITs).
Although there has been recent progress on the general theory of HITs, there isn't yet a theoretical foundation of the combination of equality constructors and induction-induction, despite having many interesting applications. In the present paper we present a first step towards a semantic definition of QIITs. In particular, we give an initial-algebra semantics and show that this is equivalent to the section induction principle, which justifies the intuitively expected elimination rules
Extending scientific computing system with structural quantum programming capabilities
We present a basic high-level structures used for developing quantum
programming languages. The presented structures are commonly used in many
existing quantum programming languages and we use quantum pseudo-code based on
QCL quantum programming language to describe them. We also present the
implementation of introduced structures in GNU Octave language for scientific
computing. Procedures used in the implementation are available as a package
quantum-octave, providing a library of functions, which facilitates the
simulation of quantum computing. This package allows also to incorporate
high-level programming concepts into the simulation in GNU Octave and Matlab.
As such it connects features unique for high-level quantum programming
languages, with the full palette of efficient computational routines commonly
available in modern scientific computing systems. To present the major features
of the described package we provide the implementation of selected quantum
algorithms. We also show how quantum errors can be taken into account during
the simulation of quantum algorithms using quantum-octave package. This is
possible thanks to the ability to operate on density matrices
Turing-completeness totally free
In this paper, I show that general recursive definitions can be represented in the free monad which supports the ‘effect’ of making a recursive call, without saying how these calls should be executed. Diverse semantics can be given within a total framework by suitable monad morphisms. The Bove-Capretta construction of the domain of a general recursive function can be presented datatype-generically as an instance of this technique. The paper is literate Agda, but its key ideas are more broadly transferable
- …