8:2 D. Pous, J. Rot, and J. Wagemaker Vol. 20:2
These structures were later extended in order to deal with common programming
constructs. For instance, Kleene algebras with tests (KAT) [
Koz97
], which combine Kleene
algebra and Boolean algebra, make it possible to represent the control flow of while programs.
Kleene star is used for while loops, and Boolean tests are used for the conditions of such
loops, as well as the conditions in if-then-else statements. Again, the axioms of KAT are
complete w.r.t. appropriate classes of models, and its equational theory remains in PSpace.
Proving so is non-trivial: Kozen’s proof reduces completeness of KAT to completeness of
KA, via a direct syntactic transformation on terms.
Another extension is Concurrent Kleene algebra (CKA) [
HMSW11
], where a binary
operator for parallelism is added. The resulting theory is characterised by languages of
pomsets rather than languages of words, and is ExpSpace-complete [
BPS17
]. Trying to
have both tests and concurrency turned out to be non-trivial, and called for yet another
notion: Kleene algebras with observations (KAO) [
KBR+19
], which are again complete w.r.t.
appropriate models, and decidable.
When used in the context of program verification, e.g., in a proof assistant, such
structures make it possible to write algebraic proofs of correctness, and to mechanise some
of the steps: when two expressions
e
and
f
representing two programs happen to be
provably equivalent in KA, KAT, or KAO, one does not need to provide a proof, one can
simply call a certified decision procedure [
BP10
,
KN12
,
Pou13
]. However, this is often not
enough [
KP00
,
AK01
,
HK02
]: most of the time, the expressions
e
and
f
are provably equal
only under certain assumptions on their constituents. For instance, to prove that (
a
+
b
)
∗
and
a∗b∗
are equal, one may have to use the additional assumption
ba
=
ab
. In other words,
one would like to prove equations under some assumptions, to have algorithms for the Horn
theory of Kleene algebra and its extensions rather than just their equational theories.
Unfortunately, those Horn theories are typically undecidable [
Koz96
,
Koz02
], even with
rather restricted forms of hypotheses (e.g., commutation of specific pairs of letters, as in the
above example). Nevertheless, important and useful classes of hypotheses can be ‘eliminated’,
by reducing to the plain and decidable case of the equational theory. This is, for instance,
the case for Hoare hypotheses [
Koz00
], of the shape
e
= 0, which allow to encode Hoare
triples for partial correctness in KAT.
In some cases, one wants to exploit hypotheses about specific constituents (e.g,
a
and
b
in the above example). In other situations, one wants to exploit assumptions on the whole
structure. For instance, in commutative Kleene algebra [
Red64
,
Con71
,
Bru19
], one assumes
that the product is commutative everywhere.
Many of these extensions of Kleene algebra (KAT, KAO, commutative KA, specific
hypotheses) fit into the generic framework of Kleene algebra with hypotheses [
DKPP19
],
providing in each case a canonical model in terms of closed languages.
We show that we recover standard models in this way, and we provide tools to establish
completeness and decidability of such extensions, in a modular way. The key notion is
that of reduction from one set of hypotheses to another. We summarise existing reductions,
provide new ones, and design a toolbox for combining those reductions together. We use
this toolbox in order to obtain new and modular proofs of completeness for KAT, KAO and
NetKAT [
AFG+14
]; to prove completeness of KAT with a full element and KAT with a
converse operation, two extensions that were formerly proposed for KA alone, respectively
in [
PW22
] and [
B´
ES95
,
´
EB95
]; and to prove completeness for the variant of KAT where
tests are only assumed to form a distributive lattice.