19,382 research outputs found
Step-Indexed Relational Reasoning for Countable Nondeterminism
Programming languages with countable nondeterministic choice are
computationally interesting since countable nondeterminism arises when modeling
fairness for concurrent systems. Because countable choice introduces
non-continuous behaviour, it is well-known that developing semantic models for
programming languages with countable nondeterminism is challenging. We present
a step-indexed logical relations model of a higher-order functional programming
language with countable nondeterminism and demonstrate how it can be used to
reason about contextually defined may- and must-equivalence. In earlier
step-indexed models, the indices have been drawn from {\omega}. Here the
step-indexed relations for must-equivalence are indexed over an ordinal greater
than {\omega}
Logical Step-Indexed Logical Relations
Appel and McAllester's "step-indexed" logical relations have proven to be a
simple and effective technique for reasoning about programs in languages with
semantically interesting types, such as general recursive types and general
reference types. However, proofs using step-indexed models typically involve
tedious, error-prone, and proof-obscuring step-index arithmetic, so it is
important to develop clean, high-level, equational proof principles that avoid
mention of step indices. In this paper, we show how to reason about binary
step-indexed logical relations in an abstract and elegant way. Specifically, we
define a logic LSLR, which is inspired by Plotkin and Abadi's logic for
parametricity, but also supports recursively defined relations by means of the
modal "later" operator from Appel, Melli\`es, Richards, and Vouillon's "very
modal model" paper. We encode in LSLR a logical relation for reasoning
relationally about programs in call-by-value System F extended with general
recursive types. Using this logical relation, we derive a set of useful rules
with which we can prove contextual equivalence and approximation results
without counting steps
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
Functional Big-step Semantics
When doing an interactive proof about a piece of software, it is important that the underlying programming language’s semantics does not make the proof unnecessarily difficult or unwieldy. Both smallstep and big-step semantics are commonly used, and the latter is typically given by an inductively defined relation. In this paper, we consider an alternative: using a recursive function akin to an interpreter for the language. The advantages include a better induction theorem, less duplication, accessibility to ordinary functional programmers, and the ease of doing symbolic simulation in proofs via rewriting. We believe that this style of semantics is well suited for compiler verification, including proofs of divergence preservation. We do not claim the invention of this style of semantics: our contribution here is to clarify its value, and to explain how it supports several language features that might appear to require a relational or small-step approach. We illustrate the technique on a simple imperative language with C-like for-loops and a break statement, and compare it to a variety of other approaches. We also provide ML and lambda-calculus based examples to illustrate its generality
A Relational Logic for Higher-Order Programs
Relational program verification is a variant of program verification where
one can reason about two programs and as a special case about two executions of
a single program on different inputs. Relational program verification can be
used for reasoning about a broad range of properties, including equivalence and
refinement, and specialized notions such as continuity, information flow
security or relative cost. In a higher-order setting, relational program
verification can be achieved using relational refinement type systems, a form
of refinement types where assertions have a relational interpretation.
Relational refinement type systems excel at relating structurally equivalent
terms but provide limited support for relating terms with very different
structures.
We present a logic, called Relational Higher Order Logic (RHOL), for proving
relational properties of a simply typed -calculus with inductive types
and recursive definitions. RHOL retains the type-directed flavour of relational
refinement type systems but achieves greater expressivity through rules which
simultaneously reason about the two terms as well as rules which only
contemplate one of the two terms. We show that RHOL has strong foundations, by
proving an equivalence with higher-order logic (HOL), and leverage this
equivalence to derive key meta-theoretical properties: subject reduction,
admissibility of a transitivity rule and set-theoretical soundness. Moreover,
we define sound embeddings for several existing relational type systems such as
relational refinement types and type systems for dependency analysis and
relative cost, and we verify examples that were out of reach of prior work.Comment: Submitted to ICFP 201
Extending Nunchaku to Dependent Type Theory
Nunchaku is a new higher-order counterexample generator based on a sequence
of transformations from polymorphic higher-order logic to first-order logic.
Unlike its predecessor Nitpick for Isabelle, it is designed as a stand-alone
tool, with frontends for various proof assistants. In this short paper, we
present some ideas to extend Nunchaku with partial support for dependent types
and type classes, to make frontends for Coq and other systems based on
dependent type theory more useful.Comment: In Proceedings HaTT 2016, arXiv:1606.0542
On Spatial Conjunction as Second-Order Logic
Spatial conjunction is a powerful construct for reasoning about dynamically
allocated data structures, as well as concurrent, distributed and mobile
computation. While researchers have identified many uses of spatial
conjunction, its precise expressive power compared to traditional logical
constructs was not previously known. In this paper we establish the expressive
power of spatial conjunction. We construct an embedding from first-order logic
with spatial conjunction into second-order logic, and more surprisingly, an
embedding from full second order logic into first-order logic with spatial
conjunction. These embeddings show that the satisfiability of formulas in
first-order logic with spatial conjunction is equivalent to the satisfiability
of formulas in second-order logic. These results explain the great expressive
power of spatial conjunction and can be used to show that adding unrestricted
spatial conjunction to a decidable logic leads to an undecidable logic. As one
example, we show that adding unrestricted spatial conjunction to two-variable
logic leads to undecidability. On the side of decidability, the embedding into
second-order logic immediately implies the decidability of first-order logic
with a form of spatial conjunction over trees. The embedding into spatial
conjunction also has useful consequences: because a restricted form of spatial
conjunction in two-variable logic preserves decidability, we obtain that a
correspondingly restricted form of second-order quantification in two-variable
logic is decidable. The resulting language generalizes the first-order theory
of boolean algebra over sets and is useful in reasoning about the contents of
data structures in object-oriented languages.Comment: 16 page
- …