8 research outputs found
Flexible Coinduction in Agda
We provide an Agda library for inference systems, also supporting their recent generalization allowing flexible coinduction, that is, interpretations which are neither inductive, nor purely coinductive. A specific inference system can be obtained as an instance by writing a set of meta-rules, in an Agda format which closely resembles the usual one. In this way, the user gets for free the related properties, notably the inductive and coinductive intepretation and the corresponding proof principles. Moreover, a significant modularity is achieved. Indeed, rather than being defined from scratch and with a built-in interpretation, an inference system can also be obtained by composition operators, such as union and restriction to a smaller universe, and its semantics can be modularly chosen as well. In particular, flexible coinduction is obtained by composing in a certain way the interpretations of two inference systems. We illustrate the use of the library by several examples. The most significant one is a big-step semantics for the ?-calculus, where flexible coinduction allows to obtain a special result (?) for all and only the diverging computations, and the proof of equivalence with small-step semantics is carried out by relying on the proof principles offered by the library
Up-To Techniques for Behavioural Metrics via Fibrations
Up-to techniques are a well-known method for enhancing coinductive proofs of behavioural equivalences. We introduce up-to techniques for behavioural metrics between systems modelled as coalgebras and we provide abstract results to prove their soundness in a compositional way.
In order to obtain a general framework, we need a systematic way to lift functors: we show that the Wasserstein lifting of a functor, introduced in a previous work, corresponds to a change of base in a fibrational sense. This observation enables us to reuse existing results about soundness of up-to techniques in a fibrational setting. We focus on the fibrations of predicates and relations valued in a quantale, for which pseudo-metric spaces are an example. To illustrate our approach we provide an example on distances between regular languages
Type-Theoretic Constructions of the Final Coalgebra of the Finite Powerset Functor
The finite powerset functor is a construct frequently employed for the specification of nondeterministic transition systems as coalgebras. The final coalgebra of the finite powerset functor, whose elements characterize the dynamical behavior of transition systems, is a well-understood object which enjoys many equivalent presentations in set-theoretic foundations based on classical logic.
In this paper, we discuss various constructions of the final coalgebra of the finite powerset functor in constructive type theory, and we formalize our results in the Cubical Agda proof assistant. Using setoids, the final coalgebra of the finite powerset functor can be defined from the final coalgebra of the list functor. Using types instead of setoids, as it is common in homotopy type theory, one can specify the finite powerset datatype as a higher inductive type and define its final coalgebra as a coinductive type. Another construction is obtained by quotienting the final coalgebra of the list functor, but the proof of finality requires the assumption of the axiom of choice. We conclude the paper with an analysis of a classical construction by James Worrell, and show that its adaptation to our constructive setting requires the presence of classical axioms such as countable choice and the lesser limited principle of omniscience
An Equational Theory for Weak Bisimulation via Generalized Parameterized Coinduction
Coinductive reasoning about infinitary structures such as streams is widely
applicable. However, practical frameworks for developing coinductive proofs and
finding reasoning principles that help structure such proofs remain a
challenge, especially in the context of machine-checked formalization.
This paper gives a novel presentation of an equational theory for reasoning
about structures up to weak bisimulation. The theory is both compositional,
making it suitable for defining general-purpose lemmas, and also incremental,
meaning that the bisimulation can be created interactively. To prove the
theory's soundness, this paper also introduces generalized parameterized
coinduction, which addresses expressivity problems of earlier works and
provides a practical framework for coinductive reasoning. The paper presents
the resulting equational theory for streams, but the technique applies to other
structures too.
All of the results in this paper have been proved in Coq, and the generalized
parameterized coinduction framework is available as a Coq library.Comment: To be published in CPP 202
Bisimulation as path type for guarded recursive types
In type theory, coinductive types are used to represent processes, and are
thus crucial for the formal verification of non-terminating reactive programs
in proof assistants based on type theory, such as Coq and Agda. Currently,
programming and reasoning about coinductive types is difficult for two reasons:
The need for recursive definitions to be productive, and the lack of
coincidence of the built-in identity types and the important notion of
bisimilarity.
Guarded recursion in the sense of Nakano has recently been suggested as a
possible approach to dealing with the problem of productivity, allowing this to
be encoded in types. Indeed, coinductive types can be encoded using a
combination of guarded recursion and universal quantification over clocks. This
paper studies the notion of bisimilarity for guarded recursive types in Ticked
Cubical Type Theory, an extension of Cubical Type Theory with guarded
recursion. We prove that, for any functor, an abstract, category theoretic
notion of bisimilarity for the final guarded coalgebra is equivalent (in the
sense of homotopy type theory) to path equality (the primitive notion of
equality in cubical type theory). As a worked example we study a guarded notion
of labelled transition systems, and show that, as a special case of the general
theorem, path equality coincides with an adaptation of the usual notion of
bisimulation for processes. In particular, this implies that guarded recursion
can be used to give simple equational reasoning proofs of bisimilarity. This
work should be seen as a step towards obtaining bisimilarity as path equality
for coinductive types using the encodings mentioned above
Diacritical Companions
International audienceCoinductive reasoning in terms of bisimulations is in practice routinely supported by carefully crafted up-to techniques that can greatly simplify proofs. However, designing and proving such bisimulation enhancements sound can be challenging, especially when striving for modularity. In this article, we present a theory of up-to techniques that builds on the notion of companion introduced by Pous and that extends our previous work which allows for powerful up-to techniques defined in terms of diacritical progress of relations. The theory of diacritical companion that we put forward works in any complete lattice and makes it possible to modularly prove soundness of up-to techniques which rely on the distinction between passive and active progresses, such as up to context in λ-calculi with control operators and extensionality
Engineering formal systems in constructive type theory
This thesis presents a practical methodology for formalizing the meta-theory of formal systems with binders and coinductive relations in constructive type theory. While constructive type theory offers support for reasoning about formal systems built out of inductive definitions, support for syntax with binders and coinductive relations is lacking. We provide this support. We implement syntax with binders using well-scoped de Bruijn terms and parallel substitutions. We solve substitution lemmas automatically using the rewriting theory of the -calculus. We present the Autosubst library to automate our approach in the proof assistant Coq. Our approach to coinductive relations is based on an inductive tower construction, which is a type-theoretic form of transfinite induction. The tower construction allows us to reduce coinduction to induction. This leads to a symmetric treatment of induction and coinduction and allows us to give a novel construction of the companion of a monotone function on a complete lattice. We demonstrate our methods with a series of case studies. In particular, we present a proof of type preservation for CC!, a proof of weak and strong normalization for System F, a proof that systems of weakly guarded equations have unique solutions in CCS, and a compiler verification for a compiler from a non-deterministic language into a deterministic language. All technical results in the thesis are formalized in Coq.In dieser Dissertation beschreiben wir praktische Techniken um Formale Systeme mit Bindern und koinduktiven Relationen in Konstruktiver Typtheorie zu implementieren. Während Konstruktive Typtheorie bereits gute Unterstützung für Induktive Definition bietet, gibt es momentan kaum Unterstützung für syntaktische Systeme mit Bindern, oder koinduktiven Definitionen. Wir kodieren Syntax mit Bindern in Typtheorie mit einer de Bruijn Darstellung und zeigen alle Substitutionslemmas durch Termersetzung mit dem -Kalkül. Wir präsentieren die Autosubst Bibliothek, die unseren Ansatz im Beweisassistenten Coq implementiert. Für koinduktive Relationen verwenden wir eine induktive Turmkonstruktion, welche das typtheoretische Analog zur Transfiniten Induktion darstellt. Auf diese Art erhalten wir neue Beweisprinzipien für Koinduktion und eine neue Konstruktion von Pous’ “companion” einer monotonen Funktion auf einem vollständigen Verband. Wir validieren unsere Methoden an einer Reihe von Fallstudien. Alle technischen Ergebnisse in dieser Dissertation sind mit Coq formalisiert