<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Repository for Tarski-Kleene Algebras</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Walter Guttmann</string-name>
          <email>walter.guttmann@uni-ulm.de</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Georg Struth</string-name>
          <email>g.struth@dcs.shef.ac.uk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tjark Weber</string-name>
          <email>tw333@cl.cam.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Cambridge</institution>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of She eld</institution>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Universitat Ulm</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>30</fpage>
      <lpage>39</lpage>
      <abstract>
        <p>We have implemented a repository of algebraic structures and theorems in the theorem proving environment Isabelle/HOL. It covers variants of Kleene algebras and relation algebras with many of their models. Most theorems have been obtained by automated theorem proving within Isabelle. Main purposes of the repository are the engineering of algebraic theories for computing systems and their application in formal program development. This paper describes the present state of the repository, illustrates its potential by a theory engineering and a program veri cation example, and discusses the most important directions for future work.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        relation algebras [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ]. Tony Hoare has proposed the name Tarski-Kleene algebras for this family
of structures. Isabelle/HOL [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] is a theorem proving environment based on higher-order logic.
It has recently been complemented by tactics for invoking external automated theorem
proving systems (ATP systems) and satis ability modulo theories solvers (SMT solvers) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and by
counterexample generators [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Hierarchies of algebras can be developed in a modular way in Isabelle by using its axiomatic
classes and locales; theorems can be inherited across hierarchies. Abstract algebraic structures
can be linked formally with concrete models, for instance relation algebras with binary relations.
This yields a seamless transition between point-free algebraic and point-wise logical reasoning.
Calculational algebraic proofs can to a large extent be automated by ATP and SMT. The user
can control the level of granularity of proofs and use Isabelle's proof scripting language Isar to
present statements and proofs in a readable, publishable style. Proof search in Isabelle is greatly
enhanced by a relevance lter, which selects hypotheses from a large set of internal libraries.</p>
      <p>
        For a tutorial overview of the repository, including some simple theory formalisation and
proof examples, see [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Some advanced modelling examples in (modal) Kleene algebras and an
abstract formalisation of Hoare logic can be found in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Complementing these two articles, this
paper provides a more detailed description of the current structure and content of the repository.
It also shows two new examples of automated theory engineering and program veri cation with
Isabelle. Further, it discusses the role of the repository as the backbone of prospective proof
environments which can be linked with existing formal methods, and various directions for future
work. The repository is open to contributions of the formal methods community.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Automated Algebraic Theory Engineering in Isabelle/HOL</title>
      <p>
        Isabelle/HOL [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] is one of the most widely used interactive theorem proving systems. Since
its origins as a metalogical framework, there has been a strong focus on proof automation
and applications in program analysis and veri cation. A recent breakthrough has been the
integration of external ATP systems and SMT solvers via the Sledgehammer tactic [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
Stateof-the-art provers such as Vampire, E, SPASS and Z3 are called with a number of hypotheses
selected by an internal relevance lter. In contrast to alternative tools such as PVS, these provers
are not used as oracles. The internally veri ed ATP system Metis [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] or alternative methods
are used to formally reconstruct proofs within Isabelle. This is desirable, since ATP systems and
SMT solvers are complex software systems that depend on sophisticated heuristics. Compared
to these, Isabelle's proof engine is very simple, easy to verify, and has stood the test of time. In
addition, several counterexample generators have been added to Isabelle.
      </p>
      <p>With this new integration at hand, users can bene t from the best of two worlds: the
expressivity and versatility of interactive theorem provers, and the computational power of ATP
systems, SMT solvers and counterexample generators.</p>
      <p>
        It was already known that Tarski-Kleene algebras lend themselves very well to automated
theorem proving, see [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] and references therein. But an implementation of our repository within
Isabelle yields additional bene ts:
      </p>
      <p>Theory hierarchies: Isabelle's axiomatic classes and locales allow us to design and
implement theory hierarchies for Tarski-Kleene algebras in modular ways, building on existing
libraries for orders, semilattices and Boolean algebras. For instance, we have formally captured
in Isabelle that relation algebras are expansions of Boolean algebras. Models of axiomatic
structures can be obtained by instantiation. For example, we have proved that binary relations and
formal languages are models of Kleene algebras.</p>
      <p>Cross-theory reasoning: Theorems are automatically inherited across the hierarchy. All
theorems about orders, for instance, are available automatically for semilattices and Boolean
algebras; all theorems about relation algebras hold in the model of binary relations; all theorems of
Kleene algebras hold in relation algebras expanded by an operation of re exive-transitive closure.
One particular algebraic axiomatisation can have a variety of computationally interesting
models. Theorems proved at the abstract algebraic level are automatically available in all models:
for instance, our theorems about Kleene algebras hold for binary relations and formal languages.
In each particular model they can be augmented by domain-speci c facts that will usually be
proved by means of logic and set theory. In the relational semantics of imperative programs, for
instance, abstract point-free algebraic facts can be combined with concrete point-wise reasoning
about the store of a program and its updates.</p>
      <p>Proof management: Isabelle ensures that only veri ed facts can be used as hypotheses
in proofs. Moreover, with the Isar scripting language, the user owns the means of production:
proofs can be either fully automated or re ned into steps of arbitrary granularity. The proof
of an equation s = t in Boolean algebra, for instance, can be broken down into proofs of
s t and t s. State-of-the-art ATP systems and SMT solvers are powerful enough to prove
calculational algebraic statements at textbook-level granularity. In calculational applications,
Isabelle becomes almost entirely a proof manager for the external ATP systems.</p>
      <p>Hypothesis learning: Isabelle provides a relevance lter that searches its internal libraries
and selects hypotheses for individual proof goals. For small theory scopes this is surprisingly
e ective. In our case studies, proofs of moderate complexity could usually be fully automated
by calling Sledgehammer. Structures such as modal Kleene algebras, where large numbers of
lemmas are in the scope, seem to bring the relevance lter to its limits.</p>
      <p>Theorems for free: Isabelle's higher-order features support more sophisticated forms of
proof management which are based on symmetries, dualities and similar properties. In
semigroups with forward and backward modalities, for instance, there is a symmetry between these
two kinds of operations that is expressed by swapping the order of multiplication. In Boolean
algebra, there is a duality between the underlying join and meet semilattices. In relation
algebra, theorems such as the modular laws can be obtained by instantiating more general theorems
about Boolean algebras with operators. Operations that are shown to be adjoints of a Galois
connection satisfy certain additivity, isotonicity or cancellation properties. All of these properties
can be expressed and exploited in Isabelle, and are heavily used in engineering our repository.</p>
      <p>
        Due to these features, the combination of algebra with automated proof search lends
itself to the development of lightweight algebraic formal methods with heavyweight automation.
Whereas previously a variety of di erent Isabelle tactics had to be mastered by users in order
to make proofs succeed, the ATP/SMT integration largely simpli es this task to proof planning
plus push-button proof search. The complementation of automated proof search with
counterexample generators such as Nitpick and Quickcheck [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] allows a style of proof and refutation that
is particularly bene cial for engineering new theories and debugging speci cations.
3
      </p>
      <p>
        Implementing Tarski-Kleene Algebras in Isabelle
`Tarski-Kleene algebras' loosely characterise a family of algebras based around Kleene and
relation algebras. Kleene algebras were originally proposed by Kleene as algebras of regular
expressions; more recently variants of Kleene algebras have been used for modelling program
re nement [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] and probabilistic protocols [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. Extensions cover in nite systems [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], modal
reasoning similar to propositional dynamic logic [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], Hoare logic [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] and true concurrency [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ].
      </p>
      <p>
        Relation algebras have initially been conceived by Tarski as algebras of binary relations [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ].
There is a longstanding history of using such structures for program semantics [
        <xref ref-type="bibr" rid="ref19 ref4">4, 19</xref>
        ] or as a
basis for data re nement [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ]. In the area of formal methods, relation algebras have been used
for developing algorithms for graphs, orders or lattices from logical speci cations [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ].
      </p>
      <p>Kleene algebras and relation algebras share many properties, but there are also signi cant
di erences. Kleene algebras provide precisely the regular operations of addition (or union or
join), multiplication and Kleene star, which in the context of programming can be interpreted as
non-deterministic choice, sequential composition and nite iteration. Relation algebras lack the
star operation, but provide operations for meet, complementation and converse besides addition
and multiplication. Relation algebras have been designed with one particular model in mind,
whereas Kleene algebras owe their fundamental status to the fact that they capture several
important models of computation.</p>
      <p>
        Our hierarchy connects Kleene algebras and relation algebras by expanding the latter with
an operation of re exive-transitive closure, as proposed by Ng and Tarski [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]. Then every
expanded relation algebra is a Kleene algebra and the theorems for Kleene algebras are available
in this setting. Similarly, we expand relation algebras by operations of domain and range, which
project on the rst and second coordinate of a binary relation, and link these operations with
the modalities of modal Kleene algebras. In this context, every relation algebra thus expanded
is a modal Kleene algebra and all theorems are again inherited.
      </p>
      <p>In the context of program development, most of the theory hierarchy should be hidden behind
an interface, providing developers with a simple relational speci cation language a la Alloy and
access to Sledgehammer and Nitpick. From that side of the interface, the distinction between
reasoning in relation algebra or Kleene algebra would vanish.</p>
      <p>We now describe the theory hierarchy in more detail.</p>
      <p>Dioids: Our hierarchy is based on classes for semilattices and variants of semirings. Near
semirings (a generalisation of near rings) consist of an additive and a multiplicative semigroup
that interact via a single distribution law; we also require that addition is commutative. Near
dioids are obtained by making addition idempotent; this gives a semilattice structure with a
canonical order (the re nement order in many models). By distributivity, multiplication is
isotone in one argument. Adding isotonicity in the other argument gives predioids; requiring
both distribution laws yields dioids (and semirings by omitting idempotency). Further variants
are obtained by including a multiplicative or an additive unit. The latter is typically a left
annihilator of multiplication, but in several models it is not a right annihilator; we account for
this similarly to the omission of one of the distribution laws.</p>
      <p>
        Kleene Algebras: All of the dioid variants are expanded by axioms for the Kleene star;
they too come in left- and right-sided forms. These weaker Kleene algebras are important
in applications involving demonic re nement algebra [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] or probabilistic Kleene algebra [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ].
Interestingly, all the known equations of Kleene algebra could already be proved in the variant
which omits the right induction axiom.
      </p>
      <p>Omega Algebras: Supplementing the Kleene star operation for nite iteration, omega
algebra introduces the omega operation for in nite iterations. This is useful, for instance, to
model reactive, not necessarily terminating systems. Among the applications of this theory we
provide, for example, highly automated proofs of loop re nement laws and termination theorems.</p>
      <p>
        Domain Semirings: Semirings and dioids are expanded by a domain operation, which
abstractly represents the set of states in which a computation is enabled. In particular, the
image of the domain operation corresponds to the state space of a program; depending on the
axioms it is a distributive lattice or a Boolean algebra [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Domain elements can serve as tests,
for example, in preconditions and conditional statements.
      </p>
      <p>Range Semirings: The range operation is obtained from domain by swapping the order of
multiplication. The entire theory is obtained fully automatically by dualising domain semirings,
using Isabelle's locale mechanism.</p>
      <p>
        Modal Kleene Algebras: Domain and range give rise to forward and backward diamond
and box operators. They abstractly represent states from which a computation may or must
reach certain target states; in particular the forward box corresponds to the weakest liberal
precondition. With the Kleene star operation we obtain Kleene algebra with tests [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] and, for
applications in formal methods, a semantics for simple while-programs, and algebraic variants
of propositional Hoare logic and propositional dynamic logic. Axiomatic algebraic approaches
to temporal logics such as LTL and CTL can easily be developed from that basis.
      </p>
      <p>
        Demonic Re nement Algebra: The axioms in our hierarchy cover related theories, such
as von Wright's demonic re nement algebra [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] and the imperative fragment of the Unifying
Theories of Programming [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. So far we only have basic theorems for these; particular models
and advanced results need to be added.
      </p>
      <p>Concurrent Kleene Algebra: The development is discussed in more detail in Section 4.</p>
      <p>Propositional Hoare Logic: A more basic setting (than modal Kleene algebra) su ces
to encode this logic. Based on a Boolean algebra representing the state space, we directly
axiomatise preconditions and while-programs; soundness and completeness of the Hoare rules
are then derived automatically. This makes the calculus available for a wider range of models.</p>
      <p>Boolean Algebra: Based on Huntington's minimalist axioms we have implemented Boolean
algebra. This is useful because only few axioms have to be checked for instantiation, but it also
yields an interesting test bed for ATP performance due to the di culty of deriving the usual
laws. We use the higher-order features of Isabelle to provide Boolean algebras with operators.</p>
      <p>Relation Algebra: Expanding Boolean algebras with operations for composition and
converse yields relation algebras. In particular, they are dioids, whence we automatically inherit
the dioid theorems. We have added most of the ingredients for relational program development:
subidentities and vectors for modelling sets, points, a calculus of functions, and domain and
range operations. We have formally shown that relation algebras are domain and range
semirings. Finally, we have expanded relation algebra by an operation of re exive-transitive closure
and shown that the resulting structure is a Kleene algebra.</p>
      <p>We have formalised the most important models of these structures, for instance, binary
relations, languages and program traces for Kleene algebras, omega algebras and Kleene algebras
with domain. The formal relationship between the abstract algebras and the concrete models is
established by using Isabelle's locale mechanism. An example is discussed in more detail in the
next section.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Engineering Concurrent Semirings</title>
      <p>
        This section illustrates theory engineering in the context of concurrent semirings and their
models. Concurrent semirings have been proposed|under a di erent name|two decades ago
as algebraic axiomatisations of series-parallel posets [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. They have recently been studied as
models for true concurrency based on a simple aggregation and independence model that is
inspired by concurrent separation logic [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. Here, we sketch the implementation of the abstract
theory hierarchy from semigroups to concurrent semirings, and of their set-theoretic models
based on notions of aggregation and independence. Due to lack of space we cannot show the
Isabelle development; the complete code can be found in our repository.
      </p>
      <p>We have rst implemented the following algebraic hierarchy using Isabelle's axiomatic classes.
An ordered semigroup is a structure (S; ; ) such that (S; ) is a semigroup, (S; ) is a poset
and is isotone with respect to the order: x y implies z x z y and x z y z. An
ordered monoid (S; ; 1; ) is an ordered semigroup expansion such that (S; ; 1) is a monoid. In
our setting, can be interpreted as a form of sequential or serial composition of actions in S.</p>
      <p>To model true concurrency we introduce a second operation of concurrent or parallel
composition. In contrast to process algebras such as CCS it is not necessarily related to interleaving.
An ordered bisemigroup is a structure (S; ; ; ) such that (S; ; ) is an ordered semigroup and
(S; ; ) is an ordered commutative semigroup. In particular, is also isotone. An ordered
bimonoid (S; ; ; 1; e; ) is the obvious expansion, where 1 is the unit of and e that of .</p>
      <p>Next we relate sequential and parallel composition. A concurrent semigroup is an ordered
bisemigroup that satis es the multiplication inclusion law x y x y, the small exchange laws
(x y) z x (y z) and x (y z) (x y) z, and the exchange law (w x) (y z) (w y) (x z).
A concurrent monoid is an ordered bimonoid that satis es 1 = e and the exchange law. It can
be shown that regular languages with shu e and series-parallel posets satisfy the above laws
(for example, (fag fag) (fbg fbg) contains less words than (fag fbg) (fag fbg)), but our
main justi cation comes from the model below. We have proved by ATP that the multiplication
inclusion law and the small exchange laws are derivable in concurrent monoids, and, using
Isabelle's counterexample generators, that none of the speci c concurrent semigroup axioms
hold already in ordered bisemigroups.</p>
      <p>At the nal stage of the abstract hierarchy we have implemented concurrent semirings.
Formally, a concurrent semiring is a structure (S; +; ; ; 0; 1) such that both (S; +; ; 0; 1) and
(S; +; ; 0; 1) are idempotent semirings (x + x = x), and (S; ; ; 1; ) is a concurrent monoid,
where x y if and only if x + y = y.</p>
      <p>At the concrete set-theoretic level, we have implemented independence algebras over
aggregation algebras. An aggregation semigroup is a semigroup (A; ) and an aggregation monoid a
monoid (A; ; u). An independence relation is a bilinear binary relation R on an aggregation
algebra: R (x y) z , R x z ^ R y z and R x (y z) , R x y ^ R x z. In the monoidal case,
R is also bistrict : R u x and R x u. The idea is that x y represents a system that consists of
two parts x and y; u is the empty system. The linearity laws say that a compound system is
independent from another system if and only if its parts are. The strictness laws say that the
empty system is independent from any system. We use two independence relations R and S for
sequential and concurrent composition and require that S x y , S y x and R S.</p>
      <p>We have veri ed a number of properties by ATP that are useful for proving instances of the
concurrent semirings and monoid axioms. The following law, for example, is used in the proof
of the exchange law: R (w x) (y z) ^ S w x ^ S y z ) R w y ^ R x z ^ S (w y) (x z).</p>
      <p>The last step for building models is to de ne operations on the powerset of the carrier of
an aggregation algebra A. This is similar to lifting word to language products. We de ne
the complex product R : 2A 2A ! 2A as X R Y = fx y j x 2 X ^ x 2 Y ^ R x yg.
Since ATP systems are rather erratic on set expressions, we prove the property z 2 X R Y ,
9x; y : z = x y ^ x 2 X ^ y 2 Y ^ R x y (and similarly for S). It can be used in combination
with Isabelle's built-in laws for set extensionality and set inclusion to simplify to rst-order
expressions that ATP systems can handle.</p>
      <p>Theorem proving at this level usually requires the application of Isabelle's simpli er with the
mentioned rules, before calling Sledgehammer. We could then easily verify that the independence
algebras under consideration form concurrent semigroups or concurrent monoids. Finally, with
+ interpreted as set union, we veri ed that independence algebras form concurrent semirings.</p>
    </sec>
    <sec id="sec-4">
      <title>Veri cation of a Naive Reachability Algorithm</title>
      <p>
        As a second example, we show the veri cation of a naive reachability algorithm [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] using the
algebraic structures and lemmas available in our repository. This example is peculiar in that
relations are not only used at the control ow level, but also, and primarily, as data structures
that capture the digraphs or transition systems on which reachability is considered.
      </p>
      <p>The algorithm is implemented in a simple imperative language with assignment, sequential
composition and while-loops:
x := V ; while :(x Y</p>
      <p>x) do x := x + x Y od
The algorithm operates on a single variable x. First, x is initialised to V , a vector that represents
initial states. Y is an adjacency matrix. The elements x, V and Y can be modelled by binary
relations; we represent them more abstractly as elements of a Kleene algebra. Upon termination,
x contains the relation V Y , that is, those states reachable from V via the re exive-transitive
closure of Y . Partial correctness is thus expressed by the following Hoare triple.
Theorem 1: vars x</p>
      <p>
        f True g x := V ; while :(x Y
Here, we have additionally annotated the while-loop with its invariant, which captures the idea
of the program: to compute intermediate relations x iteratively such that after each iteration, x
is a superset of V and a subset of V Y . To prove this theorem, we rely on built-in automation
in Isabelle/HOL that uses the invariant together with Hoare rules for assignment, sequential
composition and while-loops to eliminate the algorithm's control structure [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]:
x) inv f V
x ^ x
      </p>
      <p>V Y g do x := x + x Y od f x = V Y g
proof (vcg simp)
show V</p>
      <p>V Y
After this simpli cation we are left with three automatically generated veri cation conditions.
The rst states that the precondition implies the loop invariant:
We invoke Sledgehammer with this subgoal. It calls 5 external ATP systems, all of which nd a
proof within a few seconds. They return the set of lemmas from our Kleene algebra repository
used in the proof. For example, the prover E automatically generates the following command:
by (metis mult isol mult oner star ref)
This invokes Isabelle's built-in automation for rst-order logic, Metis, to reconstruct the proof
using three basic lemmas. Metis immediately succeeds and the rst subgoal is thus proved. The
second condition states that the invariant is preserved under execution of the loop's body:
next x x show V
x ^ x</p>
      <p>V Y ^ :(x Y
x) ) V
x + x Y ^ x + x Y</p>
      <p>V Y
We invoke Sledgehammer again. This time, only Vampire nds a proof within a few minutes.
It uses 9 lemmas and neither Metis nor SMT are able to reconstruct a proof within Isabelle.
Instead we proceed by proving one part of the condition from a reduced set of assumptions:
next x x show x V Y ) x + x Y V Y</p>
      <p>by (metis add lub leq def mult assoc mult isol star 1r subdistr)
In a few seconds, Vampire returns with 6 lemmas, and Metis is able to reconstruct a proof. The
second condition is completed by invoking Sledgehammer again. All provers and Metis succeed:
thus V x ^ x V Y ^ :(x Y
by (metis add ub order trans)
x) ) V
x + x Y ^ x + x Y</p>
      <p>V Y
The nal condition states that the loop invariant after termination implies the postcondition.
Called from Sledgehammer, a proof is automatically produced by SPASS within a few seconds:
next x x show V x ^ x V Y ^ x Y x ) x = V Y</p>
      <p>by (metis add lub le neq trans less le not le star inductr) qed
This completes the proof of Theorem 1. It is fully automatic except for the second veri cation
condition, where Isabelle's proof reconstruction does not keep up with Vampire. This issue
would vanish if the external prover returned a detailed proof that could be checked in Isabelle.</p>
      <p>We formulated the reachability algorithm in terms of Kleene algebra operations. The proof
of Theorem 1 only used axioms and lemmas of Kleene algebra. In our repository, we have shown
that binary relations are a model of Kleene algebras. Isabelle/HOL, therefore, automatically
generates an instance of Theorem 1 where all Kleene algebra operations have been replaced
by the corresponding operations in the relational model: by relational composition, + by set
union, by the re exive-transitive closure operation, and by set inclusion.
6</p>
    </sec>
    <sec id="sec-5">
      <title>Future Directions</title>
      <p>Our repository already contains a signi cant part of the calculus of variants of Kleene algebras
and relation algebras. Extensions for domain-speci c applications can be obtained with minor
e ort. In the context of program development, a large number of laws for dealing with the control
structure of programs, as needed by Kleene algebra with tests, relational program semantics,
Hoare logic, propositional dynamic logic or the w(l)p calculus, are present. Links with the
data ow layer, for instance via the assignment rule of Hoare logic (as described in Section 5),
are currently under construction. These will help transforming our repository into a program
development and veri cation environment that could be adapted to support various existing
formal methods and perhaps introduce a higher level of simplicity and automation.</p>
      <p>We currently envisage the following main directions for future research and development.</p>
      <p>Hypothesis learning: While Isabelle's relevance lter works impressively well on smaller
theory scopes, learning hypotheses in large theories remains di cult. Our repository is very
interesting in that respect since it yields a large benchmark suite of similar algebras, in which
a similar kind of reasoning is required. It seems particularly useful to complement syntactic
techniques, for instance, whether some term in a lemma matches some term in a proof goal, by
domain-speci c semantic techniques. For instance, a standard trick in ordered structures such
as dioids or Boolean algebras is splitting the unit: x = x 1 = x (x + x0) = x x + x x0 = x x
proves idempotency of meet in Boolean algebra. How can such tricks be learned?</p>
      <p>Solvers and decision procedures: Some fragments of Tarski-Kleene algebras are known
to be decidable, for instance the equational theories of Kleene algebras, Kleene algebras with
tests, (continuous) probabilistic Kleene algebras and concurrent semirings, but only the decision
procedure for Kleene algebra is available in Isabelle. For many other fragments, decidability is
not known. Sometimes, Horn formulas with antecedents of a particular shape can be reduced
to equations. None of these hypothesis elimination algorithms are available in Isabelle, and
for most variants of Tarski-Kleene algebras they have not been investigated. Integrating such
algorithms could dramatically increase proof automation. In this context, decision procedures
are typically based on automata, trees or graphs. Thus their output cannot be directly veri ed
by Isabelle. Such procedures would have to be used as oracles or would have to be veri ed
within Isabelle. Most of the proofs in the repository would only require small data structures in
the decision procedures, hence even naive implementations would make a di erence.</p>
      <p>Integration of point-free and point-wise reasoning: The examples in Sections 4 and 5
suggest that these two styles can e ectively be combined in our framework. In simple
applications, entire veri cation tasks could probably be blasted away by SMT solvers. More generally,
however, updates on program states must be modelled in a concrete semantics (for example,
binary relations or predicate transformers) or the abstract algebraic layer must be augmented
by rules for assignments and substitutions, as for instance in the B method. The development
of speci c lemmas and tactics that link the two layers is crucial for applications.</p>
      <p>Design of simple modelling languages: The taxonomy of algebraic variants, their
axioms and lemmas should, to a large extent, be hidden from the users. Instead simple modelling
languages should be developed, for example, relational ones similar to that of Alloy. The
underlying provers and counterexample generators could be used by developers to guide their
semiformal understanding of a system's properties to be analysed.</p>
      <p>Interfaces to formal methods: Due to their versatility, the structures and properties
implemented in the repository are relevant to many applications. A prime example is relational
program development for which a variety of tools with their own languages and idiosyncrasies
exist. Many of these methods could be supported by creating interfaces to our repository.
7</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>We presented ongoing work on a repository for Tarski-Kleene algebras in Isabelle/HOL which is
intended to provide automated proof support for program development methods. The
development of the repository and its applicative potential depend strongly on the recent integration of
ATP systems, SMT solvers and counterexample generators into Isabelle. Using this technology,
new algebraic theories could be engineered quickly and easily, and a high degree of automation
should be achievable in practical applications.</p>
      <p>While the previous section contains a detailed discussion of ongoing and future work on this
project, we conclude the paper with some remarks on automated theorem proving technology.</p>
      <p>
        First of all, order-based reasoning is as important for program development as equational
reasoning, for instance, in the context of re nement or when modelling simulation relations.
Also reasoning in Tarski-Kleene algebras is, to a large extent, order based. Shifting between
the two styles is possible, in principle, since x = y if and only if x y and y x, and x y
if and only if x + y = y, but whereas splitting an equation into inequalities often simpli es
proofs, the replacement of inequalities by equations blows up the size of terms and makes proof
search more di cult. Ordered chaining calculi [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] have been developed to complement the
superposition calculi used in many ATP systems in order to enhance order-based reasoning.
But this technology has not been implemented in state-of-the-art tools.
      </p>
      <p>
        Second, Isabelle's current integration uses only a handful of ATP systems and SMT solvers.
Prover9, which on algebraic proof examples often shows the best overall performance [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], is
not among them. Standardisation projects for ATP inputs (TPTP) and, in particular, proof
output (TSTP) are important here. Via these interfaces, a large class of ATP systems could be
accessed via Sutcli e's System on TPTP. For SMT solvers, similar standards (SMT-LIB) exist.
      </p>
      <p>For programming applications, sorts or types are very important. They are currently
supported by only a few ATP systems. Although they can be encoded explicitly as constraints or
guards to the algebraic speci cation, this can drastically slow down the proof search.
Acknowledgements. Walter Guttmann was supported by the Postdoc-Programme of the
German Academic Exchange Service (DAAD). Georg Struth acknowledges funding from EPSRC
grant EP/G031711/1. Tjark Weber acknowledges funding from EPSRC grant EP/F067909/1.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bachmair</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Ganzinger</surname>
          </string-name>
          .
          <article-title>Ordered chaining calculi for rst-order theories of transitive relations</article-title>
          .
          <source>Journal of the ACM</source>
          ,
          <volume>45</volume>
          (
          <issue>6</issue>
          ):
          <volume>1007</volume>
          {
          <fpage>1049</fpage>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>R.</given-names>
            <surname>Berghammer</surname>
          </string-name>
          .
          <article-title>Combining relational calculus and the Dijkstra{Gries method for deriving relational programs</article-title>
          .
          <source>Information Sciences</source>
          ,
          <volume>119</volume>
          (
          <issue>3</issue>
          {4):
          <volume>155</volume>
          {
          <fpage>171</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>R.</given-names>
            <surname>Berghammer</surname>
          </string-name>
          .
          <article-title>Applying relation algebra and Rel View to solve problems on orders and lattices</article-title>
          .
          <source>Acta Informatica</source>
          ,
          <volume>45</volume>
          (
          <issue>3</issue>
          ):
          <volume>211</volume>
          {
          <fpage>236</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Berghammer</surname>
          </string-name>
          and
          <string-name>
            <given-names>H.</given-names>
            <surname>Zierer</surname>
          </string-name>
          .
          <article-title>Relational algebraic semantics of deterministic and nondeterministic programs</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>43</volume>
          :
          <fpage>123</fpage>
          {
          <fpage>147</fpage>
          ,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Berghofer</surname>
          </string-name>
          and
          <string-name>
            <given-names>T.</given-names>
            <surname>Nipkow</surname>
          </string-name>
          .
          <article-title>Random testing in Isabelle/HOL</article-title>
          . In
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Cuellar</surname>
          </string-name>
          and
          <string-name>
            <surname>Z</surname>
          </string-name>
          . Liu, editors,
          <source>SEFM 2004</source>
          , pages
          <fpage>230</fpage>
          {
          <fpage>239</fpage>
          . IEEE Computer Society,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J. C.</given-names>
            <surname>Blanchette</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>Bohme</article-title>
          , and
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Paulson</surname>
          </string-name>
          .
          <article-title>Extending Sledgehammer with SMT solvers</article-title>
          .
          <source>In Automated Deduction: CADE-23</source>
          ,
          <year>2011</year>
          . To appear.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>E.</given-names>
            <surname>Cohen</surname>
          </string-name>
          .
          <article-title>Separation and reduction</article-title>
          . In R. Backhouse and
          <string-name>
            <surname>J. N</surname>
          </string-name>
          . Oliveira, editors,
          <source>MPC</source>
          <year>2000</year>
          , volume
          <volume>1837</volume>
          <source>of LNCS</source>
          , pages
          <volume>45</volume>
          {
          <fpage>59</fpage>
          . Springer,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J. H.</given-names>
            <surname>Conway</surname>
          </string-name>
          .
          <source>Regular Algebra and Finite Machines. Chapman and Hall</source>
          ,
          <year>1971</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>J.</given-names>
            <surname>Desharnais</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Struth</surname>
          </string-name>
          .
          <article-title>Internal axioms for domain semirings</article-title>
          .
          <source>Science of Computer Prog</source>
          .,
          <volume>76</volume>
          (
          <issue>3</issue>
          ):
          <volume>181</volume>
          {
          <fpage>203</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S.</given-names>
            <surname>Foster</surname>
          </string-name>
          , G. Struth, and
          <string-name>
            <given-names>T.</given-names>
            <surname>Weber</surname>
          </string-name>
          .
          <article-title>Automated engineering of relational and algebraic methods in Isabelle/HOL</article-title>
          . In H. de Swart, editor,
          <source>RAMiCS</source>
          , volume
          <volume>6663</volume>
          <source>of LNCS</source>
          , pages
          <volume>52</volume>
          {
          <fpage>67</fpage>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Gischer</surname>
          </string-name>
          .
          <article-title>The equational theory of pomsets</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>61</volume>
          (
          <issue>2</issue>
          {3):
          <volume>199</volume>
          {
          <fpage>224</fpage>
          ,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>W.</given-names>
            <surname>Guttmann</surname>
          </string-name>
          , G. Struth, and
          <string-name>
            <given-names>T.</given-names>
            <surname>Weber</surname>
          </string-name>
          .
          <article-title>Automating algebraic methods in Isabelle</article-title>
          .
          <source>In Formal Methods and Software Engineering: ICFEM</source>
          ,
          <year>2011</year>
          . To appear.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>C. A. R.</given-names>
            <surname>Hoare</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>He</surname>
          </string-name>
          .
          <article-title>Unifying theories of programming</article-title>
          .
          <source>Prentice Hall Europe</source>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>C. A. R.</given-names>
            <surname>Hoare</surname>
          </string-name>
          ,
          <string-name>
            <surname>B.</surname>
          </string-name>
          <article-title>Moller</article-title>
          , G. Struth,
          <string-name>
            <surname>and I. Wehrman.</surname>
          </string-name>
          <article-title>Concurrent Kleene Algebra and its foundations</article-title>
          .
          <source>Journal of Logic and Algebraic Programming</source>
          ,
          <volume>80</volume>
          (
          <issue>6</issue>
          ):
          <volume>266</volume>
          {
          <fpage>296</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15] P. Hofner, G. Struth, and G. Sutcli e.
          <source>Automated veri cation of re nement laws. Annals of Mathematics and Arti cial Intelligence</source>
          ,
          <volume>55</volume>
          (
          <issue>1</issue>
          {2):
          <volume>35</volume>
          {
          <fpage>62</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>J.</given-names>
            <surname>Hurd</surname>
          </string-name>
          .
          <article-title>System description: The Metis proof tactic</article-title>
          . In C. Benzmuller, J. Harrison, and C. Schurmann, editors,
          <source>ESHOL 2005</source>
          , pages
          <fpage>103</fpage>
          {
          <fpage>104</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>D.</given-names>
            <surname>Kozen</surname>
          </string-name>
          .
          <article-title>A completeness theorem for Kleene algebras and the algebra of regular events</article-title>
          .
          <source>Information and Computation</source>
          ,
          <volume>110</volume>
          (
          <issue>2</issue>
          ):
          <volume>366</volume>
          {
          <fpage>390</fpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>D.</given-names>
            <surname>Kozen</surname>
          </string-name>
          .
          <article-title>Kleene algebra with tests</article-title>
          .
          <source>ACM Transactions on Programming Languages and Systems</source>
          ,
          <volume>19</volume>
          (
          <issue>3</issue>
          ):
          <volume>427</volume>
          {
          <fpage>443</fpage>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>R. D.</given-names>
            <surname>Maddux</surname>
          </string-name>
          .
          <article-title>Relation-algebraic semantics</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>160</volume>
          (
          <issue>1</issue>
          {2):1{
          <fpage>85</fpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <surname>A. K. McIver</surname>
            and
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Weber</surname>
          </string-name>
          .
          <article-title>Towards automated proof support for probabilistic distributed systems</article-title>
          . In G. Sutcli e and A. Voronkov, editors,
          <source>LPAR</source>
          , volume
          <volume>3835</volume>
          <source>of LNCS</source>
          , pages
          <volume>534</volume>
          {
          <fpage>548</fpage>
          . Springer,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <surname>B.</surname>
          </string-name>
          <article-title>Moller</article-title>
          and G. Struth.
          <article-title>Algebras of modal operators and partial correctness</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>351</volume>
          (
          <issue>2</issue>
          ):
          <volume>221</volume>
          {
          <fpage>239</fpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <surname>K. C.</surname>
          </string-name>
          <article-title>Ng. Relation Algebras with Transitive Closure</article-title>
          .
          <source>PhD thesis</source>
          , Univ. of California, Berkeley,
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>T.</given-names>
            <surname>Nipkow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Paulson</surname>
          </string-name>
          , and M. Wenzel. Isabelle/HOL:
          <article-title>A Proof Assistant for Higher-Order Logic</article-title>
          , volume
          <volume>2283</volume>
          <source>of LNCS</source>
          . Springer,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <surname>W.-P. de Roever</surname>
            and
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Engelhardt</surname>
          </string-name>
          .
          <source>Data Re nement: Model-Oriented Proof Methods and their Comparison</source>
          . Cambridge University Press,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>N.</given-names>
            <surname>Schirmer</surname>
          </string-name>
          .
          <article-title>Veri cation of Sequential Imperative Programs in Isabelle/HOL</article-title>
          .
          <source>PhD thesis</source>
          , TU Munchen,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>A.</given-names>
            <surname>Tarski</surname>
          </string-name>
          .
          <article-title>On the calculus of relations</article-title>
          .
          <source>Journal of Symbolic Logic</source>
          ,
          <volume>6</volume>
          (
          <issue>3</issue>
          ):
          <volume>73</volume>
          {
          <fpage>89</fpage>
          ,
          <year>1941</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>J. von</given-names>
            <surname>Wright</surname>
          </string-name>
          .
          <article-title>Towards a re nement algebra</article-title>
          .
          <source>Science of Computer Prog</source>
          .,
          <volume>51</volume>
          (
          <issue>1</issue>
          {2):
          <volume>23</volume>
          {
          <fpage>45</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>