58 research outputs found
Guarded recursion in Agda via sized types
In type theory, programming and reasoning with possibly non-terminating programs and potentially infinite objects is achieved using coinductive types. Recursively defined programs of these types need to be productive to guarantee the consistency of the type system. Proof assistants such as Agda and Coq traditionally employ strict syntactic productivity checks, which often make programming with coinductive types convoluted. One way to overcome this issue is by encoding productivity at the level of types so that the type system forbids the implementation of non-productive corecursive programs. In this paper we compare two different approaches to type-based productivity: guarded recursion and sized types. More specifically, we show how to simulate guarded recursion in Agda using sized types. We formalize the syntax of a simple type theory for guarded recursion, which is a variant of Atkey and McBride\u27s calculus for productive coprogramming. Then we give a denotational semantics using presheaves over the preorder of sizes. Sized types are fundamentally used to interpret the characteristic features of guarded recursion, notably the fixpoint combinator
Foundational Extensible Corecursion
This paper presents a formalized framework for defining corecursive functions
safely in a total setting, based on corecursion up-to and relational
parametricity. The end product is a general corecursor that allows corecursive
(and even recursive) calls under well-behaved operations, including
constructors. Corecursive functions that are well behaved can be registered as
such, thereby increasing the corecursor's expressiveness. The metatheory is
formalized in the Isabelle proof assistant and forms the core of a prototype
tool. The corecursor is derived from first principles, without requiring new
axioms or extensions of the logic
Guarded Cubical Type Theory: Path Equality for Guarded Recursion
This paper improves the treatment of equality in guarded dependent type
theory (GDTT), by combining it with cubical type theory (CTT). GDTT is an
extensional type theory with guarded recursive types, which are useful for
building models of program logics, and for programming and reasoning with
coinductive types. We wish to implement GDTT with decidable type-checking,
while still supporting non-trivial equality proofs that reason about the
extensions of guarded recursive constructions. CTT is a variation of
Martin-L\"of type theory in which the identity type is replaced by abstract
paths between terms. CTT provides a computational interpretation of functional
extensionality, is conjectured to have decidable type checking, and has an
implemented type-checker. Our new type theory, called guarded cubical type
theory, provides a computational interpretation of extensionality for guarded
recursive types. This further expands the foundations of CTT as a basis for
formalisation in mathematics and computer science. We present examples to
demonstrate the expressivity of our type theory, all of which have been checked
using a prototype type-checker implementation, and present semantics in a
presheaf category.Comment: 17 pages, to be published in proceedings of CSL 201
Guarded Dependent Type Theory with Coinductive Types
We present guarded dependent type theory, gDTT, an extensional dependent type
theory with a `later' modality and clock quantifiers for programming and
proving with guarded recursive and coinductive types. The later modality is
used to ensure the productivity of recursive definitions in a modular, type
based, way. Clock quantifiers are used for controlled elimination of the later
modality and for encoding coinductive types using guarded recursive types. Key
to the development of gDTT are novel type and term formers involving what we
call `delayed substitutions'. These generalise the applicative functor rules
for the later modality considered in earlier work, and are crucial for
programming and proving with dependent types. We show soundness of the type
theory with respect to a denotational model.Comment: This is the technical report version of a paper to appear in the
proceedings of FoSSaCS 201
Guard Your Daggers and Traces: On The Equational Properties of Guarded (Co-)recursion
Motivated by the recent interest in models of guarded (co-)recursion we study
its equational properties. We formulate axioms for guarded fixpoint operators
generalizing the axioms of iteration theories of Bloom and Esik. Models of
these axioms include both standard (e.g., cpo-based) models of iteration
theories and models of guarded recursion such as complete metric spaces or the
topos of trees studied by Birkedal et al. We show that the standard result on
the satisfaction of all Conway axioms by a unique dagger operation generalizes
to the guarded setting. We also introduce the notion of guarded trace operator
on a category, and we prove that guarded trace and guarded fixpoint operators
are in one-to-one correspondence. Our results are intended as first steps
leading to the description of classifying theories for guarded recursion and
hence completeness results involving our axioms of guarded fixpoint operators
in future work.Comment: In Proceedings FICS 2013, arXiv:1308.589
A model of guarded recursion with clock synchronisation
AbstractGuarded recursion is an approach to solving recursive type equations where the type variable appears guarded by a modality to be thought of as a delay for one time step. Atkey and McBride proposed a calculus in which guarded recursion can be used when programming with coinductive data, allowing productivity to be captured in types. The calculus uses clocks representing time streams and clock quantifiers which allow limited and controlled elimination of modalities. The calculus has since been extended to dependent types by Møgelberg. Both works give denotational semantics but no rewrite semantics.In previous versions of this calculus, different clocks represented separate time streams and clock synchronisation was prohibited. In this paper we show that allowing clock synchronisation is safe by constructing a new model of guarded recursion and clocks. This result will greatly simplify the type theory by removing freshness restrictions from typing rules, and is a necessary step towards defining rewrite semantics, and ultimately implementing the calculus
- …