13 research outputs found
A formalized general theory of syntax with bindings
We present the formalization of a theory of syntax with bindings that has been developed and refined over the last decade to support several large formalization efforts. Terms are defined for an arbitrary number of constructors of varying numbers of inputs, quotiented to alpha-equivalence and sorted according to a binding signature. The theory includes a rich collection of properties of the standard operators on terms, such as substitution and freshness. It also includes induction and recursion principles and support for semantic interpretation, all tailored for smooth interaction with the bindings and the standard operators
A formalized general theory of syntax with bindings
We present the formalization of a theory of syntax with bindings that has been developed and refined over the last decade to support several large formalization efforts. Terms are defined for an arbitrary number of constructors of varying numbers of inputs, quotiented to alpha-equivalence and sorted according to a binding signature. The theory includes a rich collection of properties of the standard operators on terms, such as substitution and freshness. It also includes induction and recursion principles and support for semantic interpretation, all tailored for smooth interaction with the bindings and the standard operators
Foundational nonuniform (co)datatypes for higher-order logic
Nonuniform (or “nested” or “heterogeneous”) datatypes are recursively defined types in which the type arguments vary recursively. They arise in the implementation of finger trees and other efficient functional data structures. We show how to reduce a large class of nonuniform datatypes and codatatypes to uniform types in higher-order logic. We programmed this reduction in the Isabelle/HOL proof assistant, thereby enriching its specification language. Moreover, we derive (co)recusion and (co)induction principles based on a weak variant of parametricity
Foundational nonuniform (co)datatypes for higher-order logic
Nonuniform (or “nested” or “heterogeneous”) datatypes are recursively defined types in which the type arguments vary recursively. They arise in the implementation of finger trees and other efficient functional data structures. We show how to reduce a large class of nonuniform datatypes and codatatypes to uniform types in higher-order logic. We programmed this reduction in the Isabelle/HOL proof assistant, thereby enriching its specification language. Moreover, we derive (co)recusion and (co)induction principles based on a weak variant of parametricity
Initial Semantics for higher-order typed syntax in Coq
Initial Semantics aims at characterizing the syntax associated to a signature
as the initial object of some category. We present an initial semantics result
for typed higher-order syntax together with its formalization in the Coq proof
assistant. The main theorem was first proved on paper in the second author's
PhD thesis in 2010, and verified formally shortly afterwards. To a simply-typed
binding signature S over a fixed set T of object types we associate a category
called the category of representations of S. We show that this category has an
initial object Sigma(S). From its construction it will be clear that the object
Sigma(S) merits the name abstract syntax associated to S. Our theorem is
implemented and proved correct in the proof assistant Coq through heavy use of
dependent types. The approach through monads gives rise to an implementation of
syntax where both terms and variables are intrinsically typed, i.e. where the
object types are reflected in the meta-level types. This article is to be seen
as a research article rather than about the formalization of a classical
mathematical result. The nature of our theorem - involving lengthy, technical
proofs and complicated algebraic structures - makes it particularly interesting
for formal verification. Our goal is to promote the use of computer theorem
provers as research tools, and, accordingly, a new way of publishing
mathematical results: a parallel description of a theorem and its formalization
should allow the verification of correct transcription of definitions and
statements into the proof assistant, and straightforward but technical proofs
should be well-hidden in a digital library. We argue that Coq's rich type
theory, combined with its various features such as implicit arguments, allows a
particularly readable formalization and is hence well-suited for communicating
mathematics.Comment: Article as published in JFR (cf. Journal ref). Features some more
example
A type- and scope-safe universe of syntaxes with binding: their semantics and proofs
Almost every programming language's syntax includes a notion of binder and corresponding bound occurrences, along with the accompanying notions of alpha-equivalence, capture-avoiding substitution, typing contexts, runtime environments, and so on. In the past, implementing and reasoning about programming languages required careful handling to maintain the correct behaviour of bound variables. Modern programming languages include features that enable constraints like scope safety to be expressed in types. Nevertheless, the programmer is still forced to write the same boilerplate over again for each new implementation of a scope safe operation (e.g., renaming, substitution, desugaring, printing, etc.), and then again for correctness proofs. We present an expressive universe of syntaxes with binding and demonstrate how to (1) implement scope safe traversals once and for all by generic programming; and (2) how to derive properties of these traversals by generic proving. Our universe description, generic traversals and proofs, and our examples have all been formalised in Agda and are available in the accompanying material available online at https://github.com/gallais/generic-syntax
A formalized general theory of syntax with bindings: extended version
We present the formalization of a theory of syntax with bindings that has been developed and refined over the last decade to support several large formalization efforts. Terms are defined for an arbitrary number of constructors of varying numbers of inputs, quotiented to alpha-equivalence and sorted according to a binding signature. The theory contains a rich collection of properties of the standard operators on terms, including substitution, swapping and freshness—namely, there are lemmas showing how each of the operators interacts with all the others and with the syntactic constructors. The theory also features induction and recursion principles and support for semantic interpretation, all tailored for smooth interaction with the bindings and the standard operators
Variable binding and substitution for (nameless) dummies
By abstracting over well-known properties of De Bruijn's representation with
nameless dummies, we design a new theory of syntax with variable binding and
capture-avoiding substitution. We propose it as a simpler alternative to Fiore,
Plotkin, and Turi's approach, with which we establish a strong formal link. We
also show that our theory easily incorporates simple types and equations
between terms
A general theory of syntax with bindings
In this thesis we give a general theory of syntax with bindings. We address the problem from a mathematical point of view and at the same time we give a formalization, in the Isabelle/HOL proof assistant.
Our theory uses explicit names for variables, and then deals with alpha-equivalence classes, remaining intuitive and close to informal mathematics, although being fully formalized and sound in classical high-order logic. In this sense it can be regarded as a generalization of nominal logic. Our end product can be used to construct complex binding patterns and binding-aware datatypes, including non-well-founded and infinitely branching types, in a modular fashion. We provide definitions of the fundamental operators on terms (free variables, alpha-equivalence, and capture-avoiding substitution) and reasoning and definition
principles, obeying Barendregt’s convention.
We present our work as a thinking process that starts from some desiderata, and then evolves in different formalization stages for the general theory. We start by taking a “universal algebra” approach, modelling syntaxes via algebraic-style binding signatures, which we employ in a substantial case study on formal reasoning: Church-Rosser and standardization theorems for lamda-calculus. This solution proves itself too restrictive, so we refine it into a more flexible one, which constitutes the main original contribution of this thesis: We construct a universe of functors on sets that handle bindings on a general, flexible and modular level.
Our functors do not commit to any a priori syntactic format, cater for codatatypes in addition to datatypes, and are supported by powerful definition and reasoning principles. They generalize the bounded natural functors (BNFs), which have been previously implemented in Isabelle/HOL to support (co)datatypes