17 research outputs found
Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types
In this paper, we present an Agda formalization of a normalizer for
simply-typed lambda terms. The normalizer consists of two coinductively defined
functions in the delay monad: One is a standard evaluator of lambda terms to
closures, the other a type-directed reifier from values to eta-long beta-normal
forms. Their composition, normalization-by-evaluation, is shown to be a total
function a posteriori, using a standard logical-relations argument.
The successful formalization serves as a proof-of-concept for coinductive
programming and reasoning using sized types and copatterns, a new and presently
experimental feature of Agda.Comment: In Proceedings MSFP 2014, arXiv:1406.153
Decidability of Conversion for Type Theory in Type Theory
Type theory should be able to handle its own meta-theory, both to justify its foundational claims and to obtain a verified implementation. At the core of a type checker for intensional type theory lies an algorithm to check equality of types, or in other words, to check whether two types are convertible. We have formalized in Agda a practical conversion checking algorithm for a dependent type theory with one universe \ue0 la Russell, natural numbers, and η-equality for Πtypes. We prove the algorithm correct via a Kripke logical relation parameterized by a suitable notion of equivalence of terms. We then instantiate the parameterized fundamental lemma twice: once to obtain canonicity and injectivity of type formers, and once again to prove the completeness of the algorithm. Our proof relies on inductive-recursive definitions, but not on the uniqueness of identity proofs. Thus, it is valid in variants of intensional Martin-L\uf6f Type Theory as long as they support induction-recursion, for instance, Extensional, Observational, or Homotopy Type Theory
Introduction to Milestones in Interactive Theorem Proving
On March 8, 2018, Tobias Nipkow celebrated his sixtieth birthday. In anticipation of the occasion, in January 2016, two of his former students, Gerwin Klein and Jasmin Blanchette, and one of his former postdocs, Andrei Popescu, approached the editorial board of the Journal of Automated Reasoning with a proposal to publish a surprise Festschrift issue in his honor. The e-mail was sent to twenty-six members of the board, leaving out one, for reasons that will become clear in a moment. It is a sign of the love and respect that Tobias commands from his colleagues that within two days every recipient of the e-mail had responded favorably and enthusiastically to the proposal
Subtype Universes
We introduce a new concept called a subtype universe, which is a collection of subtypes of a particular type. Amongst other things, subtype universes can model bounded quantification without undecidability. Subtype universes have applications in programming, formalisation and natural language semantics. Our construction builds on coercive subtyping, a system of subtyping that preserves canonicity. We prove Strong Normalisation, Subject Reduction and Logical Consistency for our system via transfer from its parent system UTT[?]. We discuss the interaction between subtype universes and other sorts of universe and compare our construction to previous work on Power types
Expressing Ecumenical Systems in the ??-Calculus Modulo Theory
Systems in which classical and intuitionistic logics coexist are called ecumenical. Such a system allows for interoperability and hybridization between classical and constructive propositions and proofs. We study Ecumenical STT, a theory expressed in the logical framework of the ??-calculus modulo theory. We prove soudness and conservativity of four subtheories of Ecumenical STT with respect to constructive and classical predicate logic and simple type theory. We also prove the weak normalization of well-typed terms and thus the consistency of Ecumenical STT
On Induction, Coinduction and Equality in Martin-L\uf6f and Homotopy Type Theory
Martin L\uf6f Type Theory, having put computation at the center of logicalreasoning, has been shown to be an effective foundation for proof assistants,with applications both in computer science and constructive mathematics. Oneambition though is for MLTT to also double as a practical general purposeprogramming language. Datatypes in type theory come with an induction orcoinduction principle which gives a precise and concise specification of theirinterface. However, such principles can interfere with how we would like toexpress our programs. In this thesis, we investigate more flexible alternativesto direct uses of the (co)induction principles.As a first contribution, we consider the n-truncation of a type in Homo-topy Type Theory. We derive in HoTT an eliminator into (n+1)-truncatedtypes instead of n-truncated ones, assuming extra conditions on the underlyingfunction.As a second contribution, we improve on type-based criteria for terminationand productivity. By augmenting the types with well-foundedness information,such criteria allow function definitions in a style closer to general recursion.We consider two criteria: guarded types, and sized types.Guarded types introduce a modality ”later” to guard the availability ofrecursive calls provided by a general fixed-point combinator. In Guarded Cu-bical Type Theory we equip the fixed-point combinator with a propositionalequality to its one-step unfolding, instead of a definitional equality that wouldbreak normalization. The notion of path from Cubical Type Theory allows usto do so without losing canonicity or decidability of conversion.Sized types, on the other hand, explicitly index datatypes with size boundson the height or depth of their elements. The sizes however can get in theway of the reasoning principles we expect. Our approach is to introduce newquantifiers for ”irrelevant” size quantification. We present a type theory withparametric quantifiers where irrelevance arises as a “free theorem”. We alsodevelop a conversion checking algorithm for a more specific theory where thenew quantifiers are restricted to sizes.Finally, our third contribution is about the operational semantics of typetheory. For the extensions above we would like to devise a practical conversionchecking algorithm suitable for integration into a proof assistant. We formal-ized the correctness of such an algorithm for a small but challenging corecalculus, proving that conversion is decidable. We expect this development toform a good basis to verify more complex theories.The ideas discussed in this thesis are already influencing the developmentof Agda, a proof assistant based on type theory
Programming Language Techniques for Natural Language Applications
It is easy to imagine machines that can communicate in natural language. Constructing such machines is more difficult. The aim of this thesis is to demonstrate
how declarative grammar formalisms that distinguish between abstract and concrete syntax make it easier to develop natural language applications.
We describe how the type-theorectical grammar formalism Grammatical
Framework (GF) can be used as a high-level language for natural language
applications. By taking advantage of techniques from the field of programming
language implementation, we can use GF grammars to perform portable
and efficient parsing and linearization, generate speech recognition language
models, implement multimodal fusion and fission, generate support code for
abstract syntax transformations, generate dialogue managers, and implement
speech translators and web-based syntax-aware editors.
By generating application components from a declarative grammar, we can
reduce duplicated work, ensure consistency, make it easier to build multilingual
systems, improve linguistic quality, enable re-use across system domains, and
make systems more portable
Mechanizing the metatheory of rewire
The [lambda]-calculus provides a simple, well-established framework for research in functional programming languages that readily lends itself to the use offormal methods--that is, the use of mathematically sound techniques and supporting tools--to describe and verify properties of programming languages, as well. This is no coincidence. After all, the [lambda]-calculus formalizes the concept of effective computability, for all computable functions are definable in the untyped [lambda]-calculus, making it expressively equivalent torecursive functions. In software, the expressiveness of functional languages is considereda strength. Functional approaches to language design, however, needn't be limited to soft-ware. In hardware, the expressiveness of functional languages becomes a major obstacle to successful hardware synthesis, for the reason that such languages are usually capable of expressing general recursion. The presence of general recursion makes it possible to generate expressions that run forever, never producing a well-defined value. In this dissertation, we study two novel variants of the simply typed [lambda]-calculus, representing fragments of functional hardware description languages. The first variant extends the type system, using natural numbers representing time. This addition, though simple, is non-trivial. We prove that this calculus possesses bounded variants of type-safety and strong normalization. That is to say, we show that all well-typed expressions evaluate to values within a bound determined by the natural number index of their corresponding types. The second variant is a computational [lambda]-calculus that formalizes the core fragment of the hardware description language known as ReWire. We prove that the language has type-safety and is strongly normalizing -- the proof of strong normalizationis the first mechanized proof of its kind. We define an equational theory with respect to this language. This allows us to prove that the language has desirable security properties by construction. This work supports a full-edged, formal methodology for producing high assurance hardware.Includes bibliographical reference