68 research outputs found
Reasoning about modular datatypes with Mendler induction
In functional programming, datatypes a la carte provide a convenient modular
representation of recursive datatypes, based on their initial algebra
semantics. Unfortunately it is highly challenging to implement this technique
in proof assistants that are based on type theory, like Coq. The reason is that
it involves type definitions, such as those of type-level fixpoint operators,
that are not strictly positive. The known work-around of impredicative
encodings is problematic, insofar as it impedes conventional inductive
reasoning. Weak induction principles can be used instead, but they considerably
complicate proofs.
This paper proposes a novel and simpler technique to reason inductively about
impredicative encodings, based on Mendler-style induction. This technique
involves dispensing with dependent induction, ensuring that datatypes can be
lifted to predicates and relying on relational formulations. A case study on
proving subject reduction for structural operational semantics illustrates that
the approach enables modular proofs, and that these proofs are essentially
similar to conventional ones.Comment: In Proceedings FICS 2015, arXiv:1509.0282
Martin Hofmann’s case for non-strictly positive data types
We describe the breadth-first traversal algorithm by Martin Hofmann that usesa non-strictly positive data type and carry out a simple verification in anextensional setting. Termination is shown by implementing the algorithm inthe strongly normalising extension of system F by Mendler-style recursion.We then analyze the same algorithm by alternative verifications in anintensional setting, in a setting with non-strictly positive inductivedefinitions (not just non-strictly positive data types), and one by algebraicreduction. The verification approaches are compared in terms of notions ofsimulation and should elucidate the somewhat mysterious algorithm and thusmake a case for other uses of non-strictly positive data types. Except forthe termination proof, which cannot be formalised in Coq, all proofs wereformalised in Coq and some of the algorithms were implemented in Agda andHaskell
Applied Type System: An Approach to Practical Programming with Theorem-Proving
The framework Pure Type System (PTS) offers a simple and general approach to
designing and formalizing type systems. However, in the presence of dependent
types, there often exist certain acute problems that make it difficult for PTS
to directly accommodate many common realistic programming features such as
general recursion, recursive types, effects (e.g., exceptions, references,
input/output), etc. In this paper, Applied Type System (ATS) is presented as a
framework for designing and formalizing type systems in support of practical
programming with advanced types (including dependent types). In particular, it
is demonstrated that ATS can readily accommodate a paradigm referred to as
programming with theorem-proving (PwTP) in which programs and proofs are
constructed in a syntactically intertwined manner, yielding a practical
approach to internalizing constraint-solving needed during type-checking. The
key salient feature of ATS lies in a complete separation between statics, where
types are formed and reasoned about, and dynamics, where programs are
constructed and evaluated. With this separation, it is no longer possible for a
program to occur in a type as is otherwise allowed in PTS. The paper contains
not only a formal development of ATS but also some examples taken from
ats-lang.org, a programming language with a type system rooted in ATS, in
support of employing ATS as a framework to formulate advanced type systems for
practical programming
Theorem proving support in programming language semantics
We describe several views of the semantics of a simple programming language
as formal documents in the calculus of inductive constructions that can be
verified by the Coq proof system. Covered aspects are natural semantics,
denotational semantics, axiomatic semantics, and abstract interpretation.
Descriptions as recursive functions are also provided whenever suitable, thus
yielding a a verification condition generator and a static analyser that can be
run inside the theorem prover for use in reflective proofs. Extraction of an
interpreter from the denotational semantics is also described. All different
aspects are formally proved sound with respect to the natural semantics
specification.Comment: Propos\'e pour publication dans l'ouvrage \`a la m\'emoire de Gilles
Kah
The computability path ordering
This paper aims at carrying out termination proofs for simply typed
higher-order calculi automatically by using ordering comparisons. To this end,
we introduce the computability path ordering (CPO), a recursive relation on
terms obtained by lifting a precedence on function symbols. A first version,
core CPO, is essentially obtained from the higher-order recursive path ordering
(HORPO) by eliminating type checks from some recursive calls and by
incorporating the treatment of bound variables as in the com-putability
closure. The well-foundedness proof shows that core CPO captures the essence of
computability arguments \'a la Tait and Girard, therefore explaining its name.
We further show that no further type check can be eliminated from its recursive
calls without loosing well-foundedness, but for one for which we found no
counterexample yet. Two extensions of core CPO are then introduced which allow
one to consider: the first, higher-order inductive types; the second, a
precedence in which some function symbols are smaller than application and
abstraction
- …