33 research outputs found
Mechanisation of Model-theoretic Conservative Extension for HOL with Ad-hoc Overloading
Definitions of new symbols merely abbreviate expressions in logical
frameworks, and no new facts (regarding previously defined symbols) should hold
because of a new definition. In Isabelle/HOL, definable symbols are types and
constants. The latter may be ad-hoc overloaded, i.e. have different definitions
for non-overlapping types. We prove that symbols that are independent of a new
definition may keep their interpretation in a model extension. This work
revises our earlier notion of model-theoretic conservative extension and
generalises an earlier model construction. We obtain consistency of theories of
definitions in higher-order logic (HOL) with ad-hoc overloading as a corollary.
Our results are mechanised in the HOL4 theorem prover.Comment: In Proceedings LFMTP 2020, arXiv:2101.0283
On the formalization of some results of context-free language theory
This work describes a formalization effort, using the Coq proof assistant, of fundamental results related to the classical theory of context-free grammars and languages. These include closure properties (union, concatenation and Kleene star), grammar simplification (elimination of useless symbols, inaccessible symbols, empty rules and unit rules), the existence of a Chomsky Normal Form for context-free grammars and the Pumping Lemma for context-free languages. The result is an important set of libraries covering the main results of context-free language theory, with more than 500 lemmas and theorems fully proved and checked. This is probably the most comprehensive formalization of the classical context-free language theory in the Coq proof assistant done to the present date, and includes the important result that is the formalization of the Pumping Lemma for context-free languages.info:eu-repo/semantics/publishedVersio
Self-Formalisation of Higher-Order Logic: Semantics, Soundness, and a Verified Implementation
This is the final version of the article. It first appeared from Springer via http://dx.doi.org/10.1007/s10817-015-9357-xWe present a mechanised semantics for higher-order logic (HOL), and a proof of soundness for the inference system, including the rules for making definitions, implemented by the kernel of the HOL Light theorem prover. Our work extends Harrison’s verification of the inference system without definitions. Soundness of the logic extends to soundness of a theorem prover, because we also show that a synthesised implementation of the kernel in CakeML refines the inference system. Apart from adding support for definitions and synthesising an implementation, we improve on Harrison’s work by making our model of HOL parametric on the universe of sets, and we prove soundness for an improved principle of constant specification in the hope of encouraging its adoption. Our semantics supports defined constants directly via a context, and we find this approach cleaner than our previous work formalising Wiedijk’s Stateless HOL.The first author was supported by the Gates Cambridge Trust. The second author was funded in part by the EPSRC (grant number EP/K503769/1). The third author was partially supported by the Royal Society UK and the Swedish Research Council
A formalisation of the theory of context-free languages in higher order logic
We present a formalisation of the theory of context-free languages using the HOL4
theorem prover. The formalisation of this theory is not only interesting in its own right,
but also gives insight into the kind of manipulations required to port a pen-and-paper
proof to a theorem prover. The mechanisation proves to be an ideal case study of how
intuitive textbook proofs can blow up in size and complexity, and how details from the
textbook can change during formalisation.
The mechanised theory provides the groundwork for our subsequent results about
SLR parser generation. The theorems, even though well-established in the field, are
interesting for the way they have to be “reproven” in a theorem prover. Proofs must
be recast to be concrete enough for the prover: patching deductive gaps which are
relatively easily grasped in a text proof, but beyond the automatic capabilities of
contemporary tools. The library of proofs, techniques and notations developed here
provides a basis from which further work on verified language theory can proceed at a
quickened pace.
We have mechanised classical results involving context-free grammars and pushdown
automata. These include but are not limited to the equivalence between those two
formalisms, the normalisation of CFGs, and the pumping lemma for proving a language
is not context-free. As an application of this theory, we describe the verification of SLR
parsing. Among the various properties proven about the parser we show, in particular,
soundness: if the parser results in a parse tree on a given input, then the parse tree is
valid with respect to the grammar, and the leaves of the parse tree match the input;
and completeness: if the input belongs in the language of the grammar then the parser
constructs the correct parse tree for the input with respect to the grammar. In addition,
we develop a version of the algorithm that is executable by automatic translation
from HOL to SML. This alternative version of the algorithm requires some interesting
termination proofs.
We conclude with a discussion of the issues we faced while mechanising pen-and-paper
proofs. Carefully written formal proofs are regarded as rigorous for the audience they
target. But when such proofs are implemented in a theorem prover, the level of detail
required increases dramatically. We provide a discussion and a broad categorisation of
the causes that give rise to this
Formally Verified Compositional Algorithms for Factored Transition Systems
Artificial Intelligence (AI) planning and model checking are two
disciplines that found wide practical applications.
It is often the case that a problem in those two fields concerns
a transition system whose behaviour can be encoded in a digraph
that models the system's state space.
However, due to the very large size of state spaces of realistic
systems, they are compactly represented as propositionally
factored transition systems.
These representations have the advantage of being exponentially
smaller than the state space of the represented system.
Many problems in AI~planning and model checking involve questions
about state spaces, which correspond to graph theoretic questions
on digraphs modelling the state spaces.
However, existing techniques to answer those graph theoretic
questions effectively require, in the worst case, constructing
the digraph that models the state space, by expanding the
propositionally factored representation of the syste\
m.
This is not practical, if not impossible, in many cases because
of the state space size compared to the factored representation.
One common approach that is used to avoid constructing the state
space is the compositional approach, where only smaller
abstractions of the system at hand are processed and the given
problem (e.g. reachability) is solved for them.
Then, a solution for the problem on the concrete system is
derived from the solutions of the problem on the abstract
systems.
The motivation of this approach is that, in the worst case, one
need only construct the state spaces of the abstractions which
can be exponentially smaller than the state space of the concrete
system.
We study the application of the compositional approach to two
fundamental problems on transition systems: upper-bounding the
topological properties (e.g. the largest distance between any two
states, i.e. the diameter) of the state spa\
ce, and computing reachability between states.
We provide new compositional algorithms to solve both problems by
exploiting different structures of the given system.
In addition to the use of an existing abstraction (usually
referred to as projection) based on removing state space
variables, we develop two new abstractions for use within our
compositional algorithms.
One of the new abstractions is also based on state variables,
while the other is based on assignments to state variables.
We theoretically and experimentally show that our new
compositional algorithms improve the state-of-the-art in solving
both problems, upper-bounding state space topological parameters
and reachability.
We designed the algorithms as well as formally verified them with
the aid of an interactive theorem prover.
This is the first application that we are aware of, for such a
theorem prover based methodology to the design of new algorithms
in either AI~planning or model checking
HOL Metatheory of Relevant Implication Syntax and Semantics
We mechanise two Hilbert systems, a Natural Deduction system, the Routley-Meyer semantics, and the Cover semantics for the Relevant Logic R in HOL4. We also show equivalence results between one of the Hilbert Systems and the other Hilbert system and the Natural Deduction system. We also show soundness and completeness results between the one of the Hilbert Systems and the two Semantic systems, thereby producing machine checked proofs of all of these results
A formalisation of the normal forms of context-free grammars in HOL4
Abstract. We describe the formalisation of the normal forms of context-free grammars (CFGs) using the HOL4 theorem prover. These straightforward pen and paper proofs easily understood from the text turn out to be much harder to mechanise. The informal observations in the text become deductive gaps for a theorem prover that need to be patched
The problem of programming language concurrency semantics
Despite decades of research, we do not have a satisfactory concurrency semantics for any general-purpose programming language that aims to support concurrent systems code. The Java Memory Model has been shown to be unsound with respect to standard compiler optimisations, while the C/C++11 model is too weak, admitting undesirable thin-air executions.
Our goal in this paper is to articulate this major open problem as clearly as is currently possible, showing how it arises from the combination of multiprocessor relaxed-memory behaviour and the desire to accommodate current compiler optimisations. We make several novel contributions that each shed some light on the problem, constraining the possible solutions and identifying new difficulties.
First we give a positive result, proving in HOL4 that the existing axiomatic model for C/C++11 guarantees sequentially consistent semantics for simple race-free programs that do not use low-level atomics (DRF-SC, one of the core design goals). We then describe the thin-air problem and show that it cannot be solved, without restricting current compiler optimisations, using any per-candidate-execution condition in the style of the C/C++11 model. Thin-air executions were thought to be confined to programs using relaxed atomics, but we further show that they recur when one attempts to integrate the concurrency model with more of C, mixing atomic and nonatomic accesses, and that also breaks the DRF-SC result. We then describe a semantics based on an explicit operational construction of out-of-order execution, giving the desired behaviour for thin-air examples but exposing further difficulties with accommodating existing compiler optimisations. Finally, we show that there are major difficulties integrating concurrency semantics with the C/C++ notion of undefined behaviour.
We hope thereby to stimulate and enable research on this key issue
From types to sets by local type definitions in higher-order logic
Types in Higher-Order Logic (HOL) are naturally interpreted as nonempty sets—this intuition is reflected in the type definition rule for the HOL-based systems (including Isabelle/HOL), where a new type can be defined whenever a nonempty set is exhibited. However, in HOL this definition mechanism cannot be applied inside proof contexts. We propose a more expressive type definition rule that addresses the limitation and we prove its soundness. This higher expressive power opens the opportunity for a HOL tool that relativizes type-based statements to more flexible set-based variants in a principled way. We also address particularities of Isabelle/HOL and show how to perform the relativization in the presence of type classes