Post on 16-Oct-2021
Renate SchmidtGeorg Struth (eds.)
Relations and Kleene Algebrain Computer Science
PhD Programme at RelMiCS/AKA 2006
Manchester, UKAugust 28 - September 2, 2006
Proceedings
Research Report CS-06-09, Department of Computer Science, University of Sheffield
Preface
This volume contains the tutorials and the contributed extended abstracts ofthe PhD Programme at the 9th International Conference on Relational Methodsin Computer Science (RelMiCS-9) and the 4th International Workshop on Ap-plications of Kleene Algebra (AKA’06). The Programme has been organised forthe first time in association with RelMiCS/AKA. It was hosted by the Schoolof Computer Science at the University of Manchester, UK, from August 29 toSeptember 2, 2006 and included invited tutorials, a student session and atten-dance at the conference. Ten students have been selected for the programme bythe organisers due to the relevance and quality of their submissions.
The tutorials—Foundations of Relation Algebra and Kleene Algebra by PeterJipsen (Chapman University, USA) and Relational Methods for Program Refine-ment by John Derrick (University of Sheffield, UK)—introduced the theory ofrelational methods and presented an important application.
The student session allowed the participants to present and discuss their ownwork. The extended abstracts of their talks nicely reflect the diverse applicationsof relations and Kleene algebras in computing.
The RelMiCS/AKA conference series is the main forum for the relationalcalculus as a conceptual and methodological tool and for topics related to Kleenealgebras. The programme of RelMiCS/AKA 2006 featured 25 contributed talksand three invited lectures: Weak Kleene Algebra and Computation Trees by ErnieCohen (Microsoft, USA), Finite Symmetric Integral Relation algebras with no 3-Cycles by Roger Maddux (Iowa State University, USA), and Computations andRelational Bundles by Jeff Sanders (Oxford, UK). The proceedings are publishedas volume 4136 of the Springer LNCS series.
The organisers would warmly like to thank all those who contributed to thesuccess of the programme: the tutorial and keynote speakers for accepting our in-vitation, the students for their interest in the programme and the local organisersat the University of Manchester for their dedicated help; the staff in the ACSOoffice, especially Bryony Quick, the conference secretary, Helen Spragg, and IainHart; the staff of the finance office; the technical staff and the building manage-ment team; as well as Zhen Li, David Robinson and Juan Navarro-Perez. We arevery grateful to the UK Engineering and Physical Sciences Research Council forfunding the entire PhD programme (grant EP/D079926/1) and we are pleasedto acknowledge support of RelMICS/AKA 2006 by the London MathematicalSociety, the British Logic Colloquium and the University of Manchester.
Manchester and Sheffield, August 2006 Renate SchmidtGeorg Struth
Table of Contents
Tutorials
Foundations of Relations and Kleene Algebras . . . . . . . . . . . . . . . . . . . . . . . . 1Peter Jipsen
Relational Methods for Program Refinement . . . . . . . . . . . . . . . . . . . . . . . . . 23John Derrick
Contributed Extended Abstracts
Relations for Specifying the Invariant Behavior of Object Collaborations . 45Stephanie Balzer
RelAPS: A Proof System for Relational Categories . . . . . . . . . . . . . . . . . . . . 50Joel Glanfield and Michael Winter
f -Generated Kleene Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Peter Hofner
Nomadic Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Andrew Hughes
Combining Relational Methods and Evolutionary Algorithms . . . . . . . . . . . 65Britta Kehden
A topographical analysis of event structures . . . . . . . . . . . . . . . . . . . . . . . . . . 70Jose Juan Palacios Perez
Relational Kleene Algebras and their compilation to modularapplicative transducers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Benoıt Razet
Resolution Based Natural Deduction For Modal Logic . . . . . . . . . . . . . . . . . 79David Robinson
Some Notes on Duality in Refinement Algebra . . . . . . . . . . . . . . . . . . . . . . . . 84Kim Solin
Foundations of Relations and Kleene Algebras
Peter Jipsen
Department of Mathematics and Computer Science, Chapman University, USA.jipsen@chapman.edu
Fou
ndat
ions
ofRel
atio
ns
and
Kle
ene
Alg
ebra
Pet
erJi
pse
n
Chapm
an
Univ
ersity
Augu
st24
,20
06
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
1/
84
Intr
oduct
ion
Aim
:co
ver
the
bas
ics
abou
tre
lation
san
dK
leen
eal
gebr
asw
ithin
the
fram
ewor
kof
univ
ersa
lal
gebr
a
This
isa
tuto
rial
Slid
esgi
vepr
ecise
defi
nitio
ns,
lots
ofst
atem
ents
Dec
ide
whic
hst
atem
ents
are
true
(can
be
impr
oved
)w
hic
har
efa
lse
(and
per
hap
show
they
can
be
fixe
d).
90m
inute
sis
fairly
shor
t,m
ayhav
eto
continue
onyo
ur
own
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
2/
84
Pre
requisites
Know
ledge
ofse
ts,unio
n,in
ters
ection
,co
mple
men
tation
Som
ebas
icfirs
t-or
der
logi
c
Bas
icdiscr
ete
mat
h(e
.g.
funct
ion
not
atio
n)
Thes
enot
esta
kean
alge
brai
cper
spec
tive
Con
vention
s:
Min
imiz
edistinct
ion
bet
wee
nco
ncr
ete
and
abst
ract
not
atio
n
x,y
,z,x
1,.
..va
riab
les
(im
plic
itly
univ
ersa
llyquan
tified
)
X,Y
,Z,X
1,.
..se
tva
riab
les
(im
plic
itly
univ
ersa
llyquan
tified
)
f,g
,h,f
1,.
..fu
nct
ion
variab
les
a,b,c
,a1,.
..co
nst
ants
i,j,
k,i
1,.
..in
tege
rva
riab
les,
usu
ally
non
neg
ativ
e
m,n
,n1,.
..non
neg
ativ
ein
tege
rco
nst
ants
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
3/
84
Alg
ebra
icpr
oper
ties
ofse
top
erat
ion
Let
Ube
ase
t,an
dP
(U)
=X
:X
⊆U
the
pow
erse
tof
U
P(U
)is
anal
gebr
aw
ith
oper
atio
ns
unio
n∪
,in
ters
ection
∩,
com
ple
men
tation
X−
=U\
X
Sat
isfies
man
yid
entities
:e.
g.X
∪Y
=Y
∪X
for
allX
,Y∈P
(U)
How
can
we
des
crib
eth
ese
tof
allid
entities
that
hol
d?
Can
we
dec
ide
ifa
par
ticu
lar
iden
tity
hol
ds
inal
lpow
erse
tal
gebr
as?
Thes
ear
eques
tion
sab
out
the
equat
ional
theo
ryof
thes
eal
gebr
as
We
will
consider
sim
ilar
ques
tion
sab
out
seve
ralot
her
types
ofal
gebr
as,
inpar
ticu
lar
rela
tion
alge
bras
and
Kle
ene
alge
bras
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
4/
84
2
Bin
ary
rela
tion
s
An
order
edpai
r,w
ritt
en(u
,v),
has
the
defi
nin
gpr
oper
ty
(u,v
)=
(x,y
)iff
u=
xan
dv
=y
The
direc
tpr
oduct
ofse
tsU
,V
is
U×
V=
(u,v
):u∈
U,v
∈V
Abin
ary
rela
tion
Rfrom
Uto
Vis
asu
bse
tof
U×
V
Write
uRv
if(u
,v)∈
R,ot
her
wise
write
u/ Rv
Defi
ne
uR
=v
:uRv
and
Rv
=u
:uRv
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
5/
84
Oper
atio
ns
onbin
ary
rela
tion
s
Com
pos
itio
nof
rela
tion
s:R
;S=
(u,v
):uR∩
Rv6=
∅
=(
u,v
):∃x
uRx
and
xSv
Con
vers
eof
Ris
R`
=(
v,u
):(u
,v)∈
R
Iden
tity
rela
tion
I U=
(u,u
):u∈
U
Abin
ary
rela
tion
ona
set
Uis
asu
bse
tof
U×
U
Defi
ne
R0
=I U
and
Rn+
1=
R;R
nfo
rn≥
0
Tra
nsitive
clos
ure
ofR
isR
+=
⋃ n≥
1
Rn
Refl
exiv
etr
ansitive
clos
ure
ofR
isR∗
=R
+∪
I U=
⋃ n≥
0
Rn
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
6/
84
Pro
per
ties
ofbin
ary
rela
tion
s
Let
Rbe
abin
ary
rela
tion
onU
Ris
reflex
ive
ifxR
xfo
ral
lx∈
U
Ris
irre
flex
ive
ifx/ Rx
for
allx∈
U
Ris
sym
met
ric
ifxR
yim
plie
syR
x(im
plic
itly
quan
tified
)
Ris
antisy
mm
etric
ifxR
yan
dyR
xim
plie
sx
=y
Ris
tran
sitive
ifxR
yan
dyR
zim
plie
sxR
z
Ris
univ
alen
tif
xRy
and
xRz
implie
sy
=z
Ris
tota
lif
xR6=
∅fo
ral
lx∈
U(o
ther
wise
par
tial
)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
7/
84
Pro
per
ties
inre
lation
alfo
rm
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ris
reflex
ive
iffI U
⊆R
Ris
irre
flex
ive
iffI U
*R
Ris
sym
met
ric
iffR
⊆R
`
iffR
=R
`
Ris
antisy
mm
etric
iffR∩
R`
=I U
Ris
tran
sitive
iffR
;R=
Riff
R=
R+
Ris
funct
ional
iffR
;R`
⊆I U
Ris
tota
liff
I U⊆
R;R
`
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
8/
84
3
Bin
ary
oper
atio
ns
and
prop
erties
Abin
ary
oper
atio
n+
onU
isa
funct
ion
from
U×
Uto
U
Write
+(x
,y)
asx
+y
+is
idem
pot
ent
ifx
+x
=x
(all
implic
itly
quan
tified
)
+is
com
muta
tive
ifx
+y
=y
+x
+is
asso
ciat
ive
if(x
+y)+
z=
x+
(y+
z)
+is
conse
rvat
ive
ifx
+y
=x
orx
+y
=y
+is
left
cance
llative
ifz
+x
=z
+y
implie
sx
=y
+is
righ
tca
nce
llative
ifx
+z
=y
+z
implie
sx
=y
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
9/
84
Con
nec
tion
with
rela
tion
s
Defi
ne
R+
onU
byxR
+y
iffx
+z
=y
for
som
ez∈
U
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
If+
isid
empot
ent
then
R+
isre
flex
ive.
If+
isco
mm
uta
tive
then
R+
isan
tisy
mm
etric.
If+
isas
soci
ativ
eth
enR
+is
tran
sitive
.
Ase
mig
roup
isa
set
with
anas
soci
ativ
ebin
ary
oper
atio
n
Aban
dis
ase
mig
roup
(U,+
)su
chth
at+
isid
empot
ent
Aquas
i-or
der
edse
t(q
oset
)is
ase
tw
ith
are
flex
ive
tran
sitive
rela
tion
⇒If
(U,+
)is
aban
dth
en(U
,R+)
isa
qos
et
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
10
/84
Mor
esp
ecifi
cco
nnec
tion
with
rela
tion
s
Defi
ne≤
+on
Uby
x≤
+y
iffx
+y
=y
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
+is
idem
pot
ent
iff≤
+is
reflex
ive.
+is
com
muta
tive
iff≤
+is
antisy
mm
etric.
+is
asso
ciat
ive
iff≤
+is
tran
sitive
.
Ase
mila
ttic
eis
aban
d(U
,+)
such
that
+is
com
muta
tive
Apar
tial
lyor
der
edse
tis
aqos
et(U
,R)
such
that
Ris
antisy
mm
etric
⇒If
(U,+
)is
ase
mila
ttic
eth
en(U
,≤+)
isa
par
tial
lyor
der
edse
t
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
11
/84
Apar
tial
lyor
der
edse
tis
calle
da
pos
etfo
rsh
ort
Ast
rict
par
tial
order
isan
irre
flex
ive
tran
sitive
rela
tion
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
If<
isa
strict
par
tial
order
onU
,th
en(U
,<∪
I U)
isa
pos
et.
If(U
,≤)
isa
pos
et,th
en<
=≤
\I U
isa
strict
par
tial
order
.
For
a,b∈
Uwe
say
that
ais
cove
red
byb
(writt
ena≺
b)
ifa
<b
and
ther
eis
no
xsu
chth
ata
<x
<b
To
visu
aliz
ea
finite
pos
etwe
can
dra
wa
Has
sedia
gram
:
ais
connec
ted
with
anupw
ard
slop
ing
line
tob
ifa≺
b
Nonisom
orp
hic
connec
ted
pose
tsw
ith≤
4el
emen
ts
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
12
/84
4
Equiv
alen
cere
lation
s
An
equiv
alen
cere
lation
isa
reflex
ive
sym
met
ric
tran
sitive
rela
tion
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ris
aneq
uiv
alen
cere
lation
onU
iffI U
⊆R
=R
`
;R
Let
Rbe
aneq
uiv
alen
cere
lation
ona
set
U,an
du∈
U
Then
uR
=x
:uRx
isca
lled
aneq
uiv
alen
cecl
ass
ofR
Usu
ally
writt
en[u
] Ror
sim
ply
[u];
uis
calle
da
repr
esen
tative
of[u
]
The
set
ofal
leq
uiv
alen
cecl
asse
sof
Ris
U/R
=[
u]:u∈
U
Equiv
ale
nce
rela
tions
on
a3-e
lem
ent
set
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
13
/84
Par
tition
s
Apar
tition
ofU
isa
subse
tP
ofP
(U)
such
that
⋃
P=
U,∅
/∈P
,an
dX
=Y
orX
∩Y
=∅
for
allX
,Y∈
P
(wher
e⋃
P=
x:x∈
Xfo
rso
me
X∈
P)
For
apar
tition
Pdefi
ne
are
lation
byx≡
Py
iffx,y
∈X
for
som
eX
∈P
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
map
f(R
)=
U/R
isa
bijec
tion
from
the
set
ofeq
uiv
alen
cere
lation
son
Uto
the
set
ofpar
tition
sof
U,w
ith
f−
1(P
)gi
ven
by≡
P.
Par
titions
ofa
3-e
lem
ent
set
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
14
/84
The
pos
etin
duce
dby
aquas
i-or
der
For
aqos
et(U
,v),
defi
ne
are
lation
onU
byx≡
yiff
xv
yan
dyv
x
Now
defi
ne≤
onU
/≡by
[x]≤
[y]iff
xv
y
≤is
said
tobe
wel
ldefi
ned
if[x
′ ]=
[x]≤
[y]=
[y′ ]
implie
s[x
′ ]≤
[y′ ]
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
rela
tion
≤is
wel
ldefi
ned
and
(U/≡
,≤)
isa
pos
et.
Fac
toring
mat
hem
atic
alst
ruct
ure
sby
appr
opriat
eeq
uiv
alen
cere
lation
sis
apow
erfu
lway
ofunder
stan
din
gan
dcr
eating
new
stru
cture
s.
Nonisom
orp
hic
connec
ted
qose
tson
4el
emen
ts
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
15
/84
Som
ecl
asse
sof
bin
ary
rela
tion
s
all
rels
ar
st
arrs
at
qose
tsst
subid
rels
pose
tseq
uiv
rels
idre
ls
a=
antisy
mm
etric
r=
reflex
ive
s=
sym
met
ric
t=
transitive
aand
s⇒
t
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
16
/84
5
Tuple
san
ddirec
tpr
oduct
s
We
hav
ese
ense
vera
lex
ample
sof
alge
bras
and
rela
tion
alst
ruct
ure
s:
(U,+
)an
alge
bra
with
one
bin
ary
oper
atio
n,e.
g.(N
,+),
(P(U
),∪
)
(U,R
)a
rela
tion
alst
ruct
ure
with
abin
ary
rela
tion
,e.
g.(N
,≤),
(P(U
),⊆
)
Applic
atio
ns
usu
ally
invo
lve
seve
raln-a
ryop
erat
ions
and
rela
tion
s
For
ase
tI,
anI-
tuple
(ui)
i∈I
isa
funct
ion
map
pin
gi∈
Ito
ui.
Atu
ple
over
(Ui)
i∈I
isan
I-tu
ple
(ui)
i∈I
such
that
ui∈
Uifo
ral
li∈
I
The
direc
tpr
oduct
∏
i∈IU
iis
the
set
ofal
ltu
ple
sov
er(U
i)i∈
I
Inpar
ticu
lar,
∏
i∈IU
isth
ese
tU
Iof
allfu
nct
ions
from
Ito
U
IfI
=1
,...
,n
then
we
write
UI=
Un
and
∏
i∈IU
i=
U1×···×
Un
Not
e:U
0=
U∅
=(
)has
one
elem
ent,
nam
ely
the
empty
funct
ion
()=
∅
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
17
/84
Alg
ebra
san
dre
lation
alst
ruct
ure
s
A(u
nisor
ted
firs
t-or
der
)st
ruct
ure
isa
tuple
U=
(U,(
fU) f
∈F
τ,(
RU) R
∈R
τ)
Uis
the
under
lyin
gse
t
Fτ
isa
set
ofop
erat
ion
sym
bol
san
d
Rτ
isa
set
ofre
lation
sym
bol
s(d
isjo
int
from
Fτ)
The
type
τ:F
τ∪R
τ→
0,1
,2,.
..
give
sth
ear
ity
ofea
chsy
mbol
fU
:U
τ(f
)→
Uan
dR
U⊆
Uτ(R
)ar
eth
ein
terp
reta
tion
ofsy
mbol
fan
dR
0-ar
yop
erat
ion
sym
bol
sar
eca
lled
const
ant
sym
bol
s
Uis
a(u
niv
ersa
l)al
gebr
aifR
τ=
∅;use
A,B
,Cfo
ral
gebr
as
Con
vention
:th
est
ring
ofsy
mbol
sf(x
1,.
..,x
n)
implie
sth
atf
has
arity
n
The
super
script
Uis
ofte
nom
itte
d
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
18
/84
Mon
oids
and
invo
lution
Rec
allth
at(A
,·)
ase
mig
roup
if·is
anas
soci
ativ
eop
erat
ion
Am
onoi
dis
ase
mig
roup
with
anid
entity
elem
ent
i.e.
ofth
efo
rm(A
,·,1
)su
chth
atx·1
=x
=1·x
An
invo
lutive
sem
igro
up
isa
sem
igro
up
with
anin
volu
tion
i.e.
ofth
efo
rm(A
,·,`
)su
chth
at`
has
per
iod
two:
x`
`
=x,an
d`
antidistr
ibute
sov
er· :
(x·y
)`=
y`
·x`
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ifan
invo
lutive
sem
igro
up
satisfi
esx·1
=x
for
som
eel
emen
t1
and
allx
then
itsa
tisfi
es1
`
=1
and
1·x
=x
An
invo
lutive
mon
oid
isa
mon
oid
with
anin
volu
tion
Agr
oup
isan
invo
lutive
mon
oid
such
that
x·x
`
=1
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
19
/84
Join
-sem
ilatt
ices
Ase
mila
ttic
eis
aco
mm
uta
tive
idem
pot
ent
sem
igro
up
(A,+
,≤)
isa
join
-sem
ilatt
ice
if(A
,+)
isa
sem
ilatt
ice
and
x≤
y⇔
x+
y=
y
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
(A,+
,≤)
isa
join
-sem
ilatt
ice
iff(A
,≤)
isa
pos
etan
dx
+y
=z⇔
∀w
(x≤
wan
dy≤
w⇔
z≤
w)
iff(A
,≤)
isa
pos
etan
dx
+y≤
z⇔
x≤
zan
dy≤
z
⇒an
ytw
oel
emen
tsx,y
hav
ea
leas
tupper
bou
nd
x+
y
Whic
hof
the
follo
win
gar
ejo
in-s
emila
ttic
es?
Nonisom
orp
hic
connec
ted
pose
tsw
ith≤
4el
emen
ts
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
20
/84
6
Lat
tice
san
ddual
s
Am
eet-
sem
ilatt
ice
(A,·
,≤)
isa
sem
ilatt
ice
with
x≤
y⇔
x·y
=x
(A,+
,·)
isa
latt
ice
if+
,·ar
eas
soci
ativ
e,co
mm
uta
tive
oper
atio
ns
that
satisf
yth
eab
sorb
tion
law
s:x
+(y
·x)
=x
=(x
+y)·x
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
(A,+
,·)
isa
latt
ice
iff(A
,+,≤
)is
ajo
in-s
emila
ttic
ean
d(A
,·,≤
)is
am
eet-
sem
ilatt
ice
wher
ex≤
y⇔
x+
y=
y.
Defi
ne
x≥
y⇔
y≤
x.
The
dual
(A,+
,≤)d
=(A
,+,≥
)(A
,·,≤
)d=
(A,·
,≥)
and
(A,+
,·)d
=(A
,·,+
)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
dual
ofa
join
-sem
ilatt
ice
isa
mee
t-se
mila
ttic
ean
dvi
ceve
rsa.
The
dual
ofa
latt
ice
isag
ain
ala
ttic
e.
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
21
/84
Distr
ibutivi
tyan
dbou
nds
Ala
ttic
eis
distr
ibutive
ifit
satisfi
esx·(
y+
z)
=(x
·y)+
(x·z
)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ala
ttic
eis
distr
ibutive
iffx
+(y
·z)
=(x
+y)·(
x+
z)
iff(x
+y)·(
x+
z)·(
y+
z)
=(x
·y)+
(x·z
)+
(y·z
)
⇒a
latt
ice
isdistr
ibutive
iffits
dual
isdistr
ibutive
Ase
mila
ttic
ew
ith
iden
tity
isa
com
muta
tive
idem
pot
ent
mon
oid
(A,+
,0,·
,>)
isa
bou
nded
latt
ice
if(A
,+,·
)is
ala
ttic
ean
d(A
,+,0
),(A
,·,>
)ar
ese
mila
ttic
esw
ith
iden
tity
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Suppos
e(A
,+,·
)is
ala
ttic
e.T
hen
(A,+
,0,·
,>)
isa
bou
nded
latt
ice
iff0≤
x≤
>iff
x·0
=0
and
x+>
=>
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
22
/84
Com
ple
men
tation
and
Bool
ean
alge
bras
(A,+
,0,·
,>,−
)is
ala
ttic
ew
ith
com
ple
men
tation
if(A
,+,0
,·,>
)is
abou
nded
latt
ice
such
that
x+
x−
=>
and
x·x
−=
0
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Lat
tice
sw
ith
com
ple
men
tation
satisf
yx−−
=x
and
DeM
orga
n’s
law
s(x
+y)−
=x−·y
−an
d(x
·y)−
=x−
+y−
AB
ool
ean
alge
bra
isa
distr
ibutive
latt
ice
with
com
ple
men
tation
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Bool
ean
alge
bras
satisf
yx−−
=x
and
DeM
orga
n’s
law
s(x
+y)−
=x−·y
−an
d(x
·y)−
=x−
+y−
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
(A,+
,0,·
,>,−
)is
aBoole
an
alg
ebra
iff+
isco
mm
uta
tive
with
iden
tity
0,·is
com
muta
tive
with
iden
tity
1,+
distr
ibute
sove
r·,·distr
ibute
sove
r+
,x
+x−
=>
and
x·x−
=0.
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
23
/84
Bool
ean
alge
bras
ofse
ts
P(U
)=
(P(U
),∪
,∅,∩
,U,−
)is
the
Bool
ean
alge
bra
ofal
lsu
bse
tsof
U
Aco
ncr
ete
Bool
ean
alge
bra
isan
yco
llect
ion
ofsu
bse
tsof
ase
tU
that
iscl
osed
under
∪,∩
,an
d−
The
atom
sof
ajo
in-s
emila
ttic
ew
ith
0ar
eth
eco
vers
of0
Ajo
in-s
emila
ttic
ew
ith
0is
atom
less
ifit
has
no
atom
s,an
d
atom
icif
for
ever
yx6=
0th
ere
isan
atom
a≤
x
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
P(U
)is
atom
icfo
rev
ery
set
U
H=
(a 1
,b1]∪···∪
(an,b
n]:0≤
a i<
bi≤
1ar
era
tion
als,
n∈
N
isan
atom
less
concr
ete
Bool
ean
alge
bra
with
Uth
ese
tof
pos
itiv
era
tion
als≤
1
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
24
/84
7
Rel
atio
nal
gebr
as
An
(abst
ract
)re
lation
alge
bra
isof
the
form
(A,+
,0,·
,>,−
,;,1
,`)
wher
e
(A,+
,0,·
,>,−
)is
aB
ool
ean
alge
bra
(A,;
,1)
isa
mon
oid
(x;y
)·z
=0
⇔(x
`
;z)·y
=0
⇔(z
;y`
)·x
=0
The
last
line
stat
esth
eSch
roder
equiv
alen
ces
(or
DeM
orga
n’s
Thm
K)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ina
rela
tion
alge
bra
x`
`
=x
and
`
isse
lf-c
onju
gate
d,i.e.
x`
·y=
0⇔
x·y
`
=0.
Hen
ce(x
+y)`
=x
`
+y
`
,x−
`
=x
`−,
(x·y
)`=
x`
·y`
,`
isan
invo
lution
and
x;(
y+
z)
=x;y
+x;z
.H
int:
Ina
Boole
an
alg
ebra
u=
viff
∀x(u
·x
=0⇔
v·x
=0)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
AB
ool
ean
alge
bra
expan
ded
with
anin
volu
tive
mon
oid
isa
rela
tion
alge
bra
iffx;(
y+
z)
=x;y
+x;z
,(x
+y)`
=x
`
+y
`
and
x`
;(x;y
)−·y
=0
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
25
/84
Con
cret
ere
lation
alge
bras
Rel
(U)
=(P
(U2),∪
,∩,∅
,U2,−
,;,I
U,`
)th
esq
uar
ere
lation
alge
bra
onU
Aco
ncr
ete
rela
tion
alge
bra
isof
the
form
(C,∪
,∩,∅
,>,−
,;,I
U,`
)w
her
eC
isa
set
ofbin
ary
rela
tion
son
ase
tU
that
iscl
osed
under
the
oper
atio
ns
∪,−,;,
`
,an
dco
nta
ins
I U
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Eve
rysq
uar
ere
lation
alge
bra
isco
ncr
ete.
Eve
ryco
ncr
ete
rela
tion
alge
bra
isa
rela
tion
alge
bra,
and
the
larg
est
rela
tion
isan
equiv
alen
cere
lation
Rel
atio
nal
gebr
ashav
eap
plic
atio
ns
inpr
ogra
mse
man
tics
,sp
ecifi
cation
,der
ivat
ion,dat
abas
es,se
tth
eory
,finite
variab
lelo
gic,
com
bin
ator
ics,
...
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
26
/84
Idem
pot
ent
sem
irin
gs
Ase
mirin
gis
anal
gebr
a(A
,+,0
,;,1
)su
chth
at
(A,+
,0)
isa
com
muta
tive
mon
oid
(A,;
,1)
isa
mon
oid
x;(
y+
z)
=(x
;y)+
(x;z
),(x
+y);
z=
(x;z
)+
(y;z
)
x;0
=0
=0;
x
Ase
mirin
gis
idem
pot
ent
ifx
+x
=x
⇒an
idem
pot
ent
sem
irin
gis
ajo
in-s
emila
ttic
ew
ith
x≤
y⇔
x+
y=
y,a
bot
tom
elem
ent
0,;distr
ibute
sov
er+
and
0is
aze
rofo
r;
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Inan
idem
pot
ent
sem
irin
gx≤
yim
plie
sx;z
≤y;z
and
z;x
≤z;y
For
any
mon
oid
M=
(M,·
,1),
the
pow
erse
tid
empot
ent
sem
irin
gis
P(M
)=
(P(M
),∪
,∅,;
,1
)w
her
eX
;Y=
x·y
:x∈
X,
y∈
Y
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
27
/84
Kle
ene
alge
bras
AK
leen
eal
gebr
ais
ofth
efo
rm(A
,+,0
,;,1
,∗)
wher
e
(A,+
,0,;
,1)
isan
idem
pot
ent
sem
irin
g
1+
x+
x∗;x
∗=
x∗
x;y
≤y⇒
x∗;y
≤y
(wher
ex≤
y⇔
x+
y=
y)
y;x
≤y⇒
y;x
∗≤
y
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Let
M=
(M,·
,1)
be
am
onoi
d.
Then
P(M
)ca
nbe
expan
ded
toa
Kle
ene
alge
bra
ifwe
defi
ne
X∗
=⋃
n≥
0X
nw
her
eX
0=
1
and
Xn+
1=
Xn;X
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
For
any
set
U,K
Rel
(U)
=(P
(U2),∪
,,;,
I U,∗
)is
aK
leen
eal
gebr
a
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
28
/84
8
Kle
ene
alge
bras
continued
Tra
ditio
nal
lywe
write
x;y
sim
ply
asxy
AK
leen
eex
pres
sion
has
anop
pos
ite
give
nby
reve
rsin
gth
eex
pres
sion
.
The
oppos
ite
axio
ms
ofK
leen
eal
gebr
asag
ain
defi
ne
Kle
ene
alge
bras
,so
any
proof
ofa
resu
ltca
nbe
conve
rted
toa
proof
ofth
eop
pos
ite
resu
lt
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ina
Kle
ene
alge
bra
xn≤
x∗
for
alln≥
0(w
her
ex
0=
1,x
n+
1=
xnx)
x≤
y⇒
x∗≤
y∗
xx∗
=x∗x
x∗∗
=x∗
and
x∗
=1
+x
+w
her
ex
+=
xx∗
xy+
z≤
y⇒
x∗z≤
y(a
nd
its
oppos
ite)
xy=
yz⇒
x∗y
=yz
∗
(xy)∗
x=
x(y
x)∗
and
(x+
y)∗
=x∗(y
x∗)∗
Kle
ene
alge
bras
hav
eap
plic
atio
ns
inau
tom
ata
theo
ry,par
sing,
pat
tern
mat
chin
g,se
man
tic
and
logi
cof
prog
ram
s,an
alys
isof
algo
rith
ms,..
.
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
29
/84
Kle
ene
alge
bras
with
test
s
Kle
ene
alge
bras
model
conca
tenat
ion,non
det
erm
inistic
choi
cean
diter
atio
n,but
tom
odel
prog
ram
snee
dgu
arded
choi
cean
dgu
arded
iter
atio
n
AK
leen
eal
gebr
aw
ith
test
s(K
AT
)is
ofth
efo
rm(A
,+,0
,;,1
,∗,−
,B)
wher
e(A
,+,0
,;,1
,∗)
isa
Kle
ene
alge
bra,
Bis
aunar
yre
lation
(⊆A
)an
dx,y
∈B
⇒x
+y,
x;y
,x−,
0,1∈
B,
x;x
=x,
x;x
−=
0,x
+x−
=1
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ina
KAT
,(B
,+,0
,;,1
,−)
isa
Bool
ean
alge
bra
[Koz
en19
96]defi
nes
KAT
sas
two-
sort
edal
gebr
as,but
her
eth
eyar
eon
e-so
rted
stru
cture
sw
ith
−a
par
tial
oper
atio
ndefi
ned
only
onB
The
prog
ram
const
ruct
if
bthen
pelse
qis
expr
esse
dby
b;p
+b−;q
while
bdo
pis
expr
esse
dby
(b;p
)∗;b
−
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
30
/84
Idem
pot
ent
sem
irin
gsw
ith
dom
ain
and
range
Eve
ryK
leen
eal
gebr
ais
aK
AT
with
B=
0,1
InK
Rel
(U)
the
test
sar
ea
subal
gebr
aof
P(I
U)
Can
also
defi
ne
idem
pot
ent
sem
irin
gsw
ith
test
s(just
omit
∗)
Mor
eex
pres
sive
:ad
da
dom
ain
oper
ator
[Des
har
nai
sM
olle
rStr
uth
2006
]
An
idem
pot
ent
sem
irin
gw
ith
pred
omai
nis
ofth
efo
rm(A
,+,0
,;,1
,−,δ
)w
her
e(A
,+,0
,;,1
,−,δ
[A])
isan
idem
pot
ent
sem
irin
gw
ith
test
s,x≤
δ(x);
xan
dδ(
δ(x);
y)≤
δ(x)
For
idem
pot
ent
sem
irin
gsw
ith
dom
ain
add
δ(x;δ
(y))
≤δ(
x;y
)
InRel
(U)
the
dom
ain
oper
ator
isdefi
nab
leby
δ(R
)=
(R;R
`
)∩
I U
Idem
pot
ent
sem
irin
gsw
ith
(pre
)ran
geop
erat
orar
eop
pos
ite
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
31
/84
Ter
ms
and
form
ula
s
UA
isa
fram
ewor
kfo
rst
udyi
ng
and
com
par
ing
allth
ese
alge
bras
Giv
ena
set
X,th
ese
tof
τ-t
erm
sw
ith
variab
les
from
Xis
the
smal
lest
set
T=
Tτ(X
)su
chth
at
X⊆
Tan
d
ift 1
,...
,tn∈
Tan
df∈F
τth
enf(t
1,.
..,t
n)∈
T.
The
term
alge
bra
over
Xis
Tτ(X
)=
T=
(Tτ(X
),(f
T) f
∈F
τ)
with
fT(t
1,.
..,t
n)
=f(t
1,.
..,t
n)
for
t 1,.
..,t
n∈
Tτ(X
)
Aτ-e
quat
ion
isa
pai
rof
τ-t
erm
s(s
,t),
usu
ally
writt
ens
=t
Aquas
iequat
ion
isan
implic
atio
n(s
1=
t 1an
d..
.an
ds n
=t n
⇒s 0
=t 0
)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
32
/84
9
Model
san
dth
eories
An
atom
icfo
rmula
isa
τ-e
quat
ion
orR
(x1,.
..,x
n)
for
R∈R
τ
Aτ-for
mula
φ::=
atom
icfrm
.|φan
dφ|φ
orφ|¬
φ|φ
⇒φ|φ
⇔φ|∀
xφ|∃
xφ
Write
U|=
φif
τ-for
mula
φhol
ds
inτ-s
truct
ure
U(s
tandar
ddef
n)
Thro
ugh
outK
isa
clas
sof
τ-s
truct
ure
s,F
ase
tof
τ-for
mula
s
Write
K|=
Fif
U|=
φfo
ral
lU
∈K
and
φ∈
F
Mod(F
)=
U:U
|=F
=cl
ass
ofal
lm
odel
sof
F
Th(K
)=
φ:K
|=φ
=firs
tor
der
theo
ryof
K
The(K
)=
Th(K
)∩τ
-equat
ions
=eq
uat
ional
theo
ryof
K
Thq(K
)=
Th(K
)∩τ
-quas
iequat
ions
=quas
iequat
ional
theo
ryof
K
Thq(K
)is
also
calle
dth
est
rict
univ
ersa
lH
orn
theo
ryof
K
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
33
/84
Subst
ruct
ure
s,hom
omor
phism
san
dpr
oduct
s
Let
U,V
,Vi(i
∈I)
be
stru
cture
sof
type
τan
dle
tf,R
range
over
Fτ,R
τ
Uis
asu
bst
ruct
ure
ofV
ifU
⊆V
,fU(u
1,.
..,u
n)
=fV(u
1,.
..,u
n)
and
RU
=R
V∩
Un
for
allu1,.
..,u
n∈
U
h:U
→V
isa
hom
omor
phism
ifh
isa
funct
ion
from
Uto
V,
h(f
U(u
1,.
..,u
n))
=fV(h
(u1),
...,
h(u
n))
and
(u1,.
..,u
n)∈
RU⇒
(h(u
1),
...,
h(u
n))
∈R
Vfo
ral
lu1,.
..,u
n∈
U
Vis
ahom
omor
phic
imag
eof
Uif
ther
eex
ists
asu
rjec
tive
hom
omor
phism
h:U
³V
.
Uis
isom
orphic
toV
,in
sym
bol
sU
∼ =V
,if
ther
eex
ists
abijec
tive
hom
omor
phism
from
Uto
V.
U=
∏
i∈IV
i,th
edirec
tpr
oduct
ofst
ruct
ure
sV
i,if
U=
∏
i∈IV
i,(f
U(u
1,.
..,u
n) i
) i∈
I=
(fV
i(u
1i,
...,
uni)
) i∈
Ian
d(u
1,.
..,u
n)∈
RU⇔
∀i(
u1i,
...,
uni)∈
RV
ifo
ral
lu1,.
..,u
n∈
U
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
34
/84
Subst
ruct
ure
sar
ecl
osed
under
allop
erat
ions;
give
“loca
lin
form
atio
n”
Hom
omor
phism
sar
est
ruct
ure
pres
ervi
ng
map
s,an
dth
eir
imag
esca
ptu
regl
obal
regu
larity
ofth
edom
ain
stru
cture
Direc
tpr
oduct
sar
euse
dto
build
ordec
ompos
ebig
ger
stru
cture
s
Ast
ruct
ure
with
one
elem
ent
isca
lled
triv
ial
Ast
ruct
ure
isdirec
tly
dec
ompos
able
ifit
isisom
orphic
toa
direc
tpr
oduct
ofnon
triv
ialst
ruct
ure
s
Adirec
tpr
oduct
has
proj
ection
map
sπ
i:∏
i∈IV
i³
Viw
her
eπ
i(u)
=ui
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
For
any
direc
tpr
oduct
the
proj
ection
map
sar
ehom
omor
phism
s
Isom
orphism
spr
eser
veal
llo
gica
llydefi
ned
prop
erties
(not
only
firs
t-or
der
)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
35
/84
Var
ieties
and
HSP
HK
isth
ecl
ass
ofhom
omor
phic
imag
esof
mem
ber
sof
K
SK
isth
ecl
ass
ofsu
bst
ruct
ure
sof
mem
ber
sof
K
PK
isth
ecl
ass
ofdirec
tpr
oduct
sof
mem
ber
sof
K
Ava
riet
yis
ofth
efo
rmM
od(E
)fo
rso
me
set
Eof
equat
ions
Aquas
ivar
iety
isof
the
form
Mod(Q
)fo
rso
me
set
Qof
quas
iequat
ions
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfK
isa
quas
ivar
iety
then
SK
⊆K
,PK
⊆K
and
HK
⊆K
The
nex
tch
arac
teriza
tion
mar
ksth
ebeg
innin
gof
univ
ersa
lal
gebr
a
Theo
rem
(Birkh
off19
35)
Kis
ava
riet
yiff
HK
=K
,SK
=K
and
PK
=K
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
36
/84
10
Var
ieties
gener
ated
bycl
asse
s
Λτ
=M
od(E
):E
isa
set
ofτ-e
quat
ions
=se
tof
allτ-v
arie
ties
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
For
sets
Fiof
τ-for
mula
s⋂
i∈IM
od(F
i)=
Mod(⋃
i∈IF
i)
Hen
ceΛ
τis
clos
edunder
arbitra
ryin
ters
ection
s⋂
Λτ
=M
od(
x=
y)
=th
ecl
ass
Oτ
oftr
ivia
lτ-s
truct
ure
s
The
variet
yge
ner
ated
byK
isVK
=⋂
all
variet
ies
that
conta
inK
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
SHK
=H
SK
,PHK
=H
PK
and
PSK
=SPK
for
any
clas
sK
Theo
rem
(Tar
ski19
46)
VK
=H
SPK
for
any
clas
sK
ofst
ruct
ure
s
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
37
/84
Com
ple
tela
ttic
es
For
asu
bse
tX
ofa
pos
etU
write
X≤
uif
x≤
ufo
ral
lx∈
Xan
ddefi
ne
z=
∑
Xif
X≤
u⇔
z≤
u(s
o∑
Xis
the
leas
tupper
bou
nd
ofX
)
u≤
Xan
dth
egr
eate
stlo
wer
bou
nd
∏
Xar
edefi
ned
dual
ly.
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
If∑
Xex
ists
for
ever
ysu
bse
tof
apos
etth
en∏
X=
∑
u:u≤
X
Ast
ruct
ure
Uw
ith
apar
tial
order
isco
mple
teif
∑
Xex
ists
for
allX
⊆U
⇒ev
ery
com
ple
tejo
in-s
emila
ttic
eis
aco
mple
tela
ttic
e;x·y
=∏
x,y
Aco
mple
tela
ttic
ehas
abot
tom
0=
∑
∅an
da
top>
=∏
∅
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Uw
ith
par
tial
order
≤is
com
ple
teiff
∏
Xex
ists
for
allX
⊂U
Λτ
par
tial
lyor
der
edby
⊆is
aco
mple
tela
ttic
e
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
38
/84
Con
gruen
ces
and
quot
ient
alge
bras
Aco
ngr
uen
ceon
anal
gebr
aA
isan
equiv
alen
cere
lation
θon
Ath
atis
com
pat
ible
with
the
oper
atio
ns
ofA
,i.e.
for
allf∈
Fn
x 1θy
1an
d..
.an
dx n
θyn⇒
fA(x
1,.
..,x
n)θ
fA(y
1,.
..,y
n)
Con
(A)
isth
ese
tof
allco
ngr
uen
ces
onA
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Con
(A)
isa
com
ple
tela
ttic
ew
ith
∏
=⋂
,bot
tom
I Aan
dto
pA
2
For
θ∈
Con
(A),
the
quot
ient
alge
bra
isA
/θ=
(A/θ
,(fA
/θ) f
∈F
τ)
wher
e
fA
/θ([
x 1] θ
,...
,[x n
] θ)
=fA(x
1,.
..,x
n)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
oper
atio
ns
fA
/θ
are
wel
ldefi
ned
and
hθ
:A→
A/θ
give
nby
hθ(x
)=
[x] θ
isa
surjec
tive
hom
omor
phism
from
Aon
toA
/θ
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
39
/84
Imag
es,ke
rnel
san
disom
orphism
theo
rem
s
For
afu
nct
ion
f:A→
Bth
eim
age
off
isf[A
]=
f(x
):x∈
A
The
kern
elof
fis
kerf
=(
x,y
)∈
A2
:f(x
)=
f(y
)(a
neq
uiv
alen
cere
l)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ifh
:A
→B
isa
hom
omor
phism
then
kerh∈
Con
(A)
h[A
]is
the
under
lyin
gse
tof
asu
bal
gebr
ah[A
]of
B
The
firs
tisom
orphism
theo
rem
:f
:A
/ker
h³
h[A
]gi
ven
byf([
x] θ
)=
h(x
)is
awel
ldefi
ned
isom
orphism
The
seco
nd
isom
orphism
theo
rem
:For
θ∈
Con
(A),
the
subse
t↑θ
=ψ
:θ⊆
ψ
ofCon
(A)
isisom
orphic
toCon
(A/θ
)vi
ath
em
apψ7→
ψ/θ
wher
e[x
]ψ/θ
[y]⇔
xψ
y
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
40
/84
11
Ina
join
-sem
ilatt
ice,
uis
join
irre
duci
ble
ifu
=x
+y
⇒u∈x
,y
uis
join
prim
eif
u≤
x+
y⇒
u≤
xor
u≤
y
uis
com
ple
tely
join
irre
duci
ble
ifth
ere
isa
(uniq
ue)
grea
test
elem
ent
<u
uis
com
ple
tely
join
prim
eif
u≤
∑
X⇒
u≤
xfo
rso
me
x∈
X
(com
ple
tely
)m
eet
irre
duci
ble
and
(com
ple
tely
)m
eet
prim
ear
egi
ven
dual
ly
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Inco
mple
tela
ttic
es,u
isco
mple
tely
join
irre
duci
ble
iffu
=∑
X⇒
u∈
X
Distr
ibutivi
ty⇒
(com
ple
tely
)jo
inirre
duci
ble
=(c
omple
tely
)jo
inpr
ime
uis
com
pac
tif
u≤
∑
X⇒
u≤
x 1+···+
x nfo
rso
me
x 1,.
..,x
n∈
X
Aco
mple
tela
ttic
eis
alge
brai
cif
allel
emen
tar
ejo
ins
ofco
mpac
tel
emen
ts
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Con
(A)
isan
alge
brai
cla
ttic
e(h
int:
com
pact
=finitel
ygen
erate
d)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
41
/84
Subdirec
tpr
oduct
san
dsu
bdirec
tly
irre
duci
ble
s
An
embed
din
gis
anin
ject
ive
hom
omor
phism
An
embed
din
gh
:A
→∏
i∈IB
iis
subdirec
tif
πi[h[A
]]=
Bifo
ral
li∈
I
Ais
asu
bdirec
tpr
oduct
of(B
i)i∈
Iif
ther
eis
asu
bdirec
th
:A
→∏
i∈IB
i
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Defi
ne
h:A
→∏
i∈IA
/θiby
h(a
)=
([a]
θ i) i∈
I
Then
his
asu
bdirec
tem
bed
din
giff
⋂
i∈Iθ i
=I A
Ais
subdirec
tly
irre
duci
ble
iffo
ran
ysu
bdirec
th
:A
→∏
i∈IB
ith
ere
isan
i∈
Isu
chth
atπ
i
his
anisom
orphism
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ais
subdirec
tly
irre
duci
ble
iffI A
∈Con
(A)
isco
mple
tely
mee
tirre
duci
ble
iffCon
(A)
has
asm
alle
stnon
bot
tom
elem
ent
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
42
/84
Mee
tirre
duci
ble
san
dsu
bdirec
tre
pres
enta
tion
s
Zor
n’s
Lem
ma
stat
esth
atif
ever
ylin
early
order
edsu
bpos
etof
apos
ethas
anupper
bou
nd,th
enth
epos
etitse
lfhas
max
imal
elem
ents
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Inan
alge
brai
cla
ttic
eal
lm
ember
sar
em
eets
ofco
mple
tly
mee
tirre
duci
ble
s
The
nex
tre
sult
show
sth
atsu
bdirec
tly
irre
duci
ble
sar
ebuild
ing
blo
cks
Theo
rem
(Birkh
off19
44)
Eve
ryal
gebr
ais
asu
bdirec
tpr
oduct
ofits
subdirec
tly
irre
duci
ble
imag
es
KSIis
the
clas
sof
subdirec
tly
irre
duci
ble
sof
K
⇒V
=SP(V
SI)
for
any
variet
yV
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
43
/84
Filt
ers
and
idea
lsFor
apos
et(U
,≤)
the
prin
cipal
idea
lof
x∈
Uis↓x
=y
:y≤
x
For
X⊆
Udefi
ne↓X
=⋃
x∈
X↓x
;X
isa
dow
nse
tif
X=
↓X
Xis
up-d
irec
ted
ifx,y
∈X
⇒∃u∈
X(x
≤u
and
y≤
u)
Xis
anid
ealif
Xis
anup-d
irec
ted
dow
nse
t
prin
cipal
filter
↑x,↑X
,upse
t,dow
n-d
irec
ted
and
filter
are
defi
ned
dual
ly
An
idea
lor
filter
ispr
oper
ifit
isnot
the
whol
epos
et
An
ultra
filter
isa
max
imal
(with
resp
ect
toin
clusion
)pr
oper
filter
Afilter
Xin
ajo
in-s
emila
ttic
eis
prim
eif
x+
y∈
X⇒
x∈
Xor
y∈
X
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
set
Fil(
U)
ofal
lfilter
son
apos
etU
isan
alge
brai
cla
ttic
eIn
ajo
in-s
emila
ttic
eev
ery
max
imal
filter
ispr
ime
Ina
distr
ibutive
latt
ice
ever
ypr
oper
prim
efilter
ism
axim
al
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
44
/84
12
Ultra
product
s
Fis
afilter
over
ase
tI
ifF
isa
filter
in(P
(I),⊆
)
Fdefi
nes
aco
ngr
uen
ceon
U=
∏
i∈IU
ivi
axθ F
y⇔
i∈
I:x i
=y i∈F
U/θ
Fis
calle
da
reduce
dpr
oduct
,den
oted
by∏
FU
i
IfF
isan
ultra
filter
then
U/θ
Fis
calle
dan
ultra
product
PuK
isth
ecl
ass
ofultra
product
sof
mem
ber
sof
K
Kis
finitel
yax
iom
atiz
able
ifK
=M
od(φ
)fo
ra
singl
efo
rmula
φ
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfK
|=φ
then
PuK
|=φ
for
any
firs
tor
der
form
ula
φ
IfK
isfinitel
yax
iom
atiz
able
then
the
com
ple
men
tof
Kis
clos
edunder
ultra
product
s
IfK
isa
finite
clas
sof
finite
τ-s
truct
ure
sth
enP
uK
=K
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
45
/84
Con
gruen
cedistr
ibutivi
tyan
dJo
nss
on’s
Theo
rem
Ais
congr
uen
cedistr
ibutive
(CD
)if
Con
(A)
isa
distr
ibutive
latt
ice
Acl
assK
ofal
gebr
asis
CD
ifev
ery
alge
bra
inK
isCD
Theo
rem
(Jon
sson
1967
)
IfV
=VK
isco
ngr
uen
cedistr
ibutive
then
VSI⊆
HSP
uK
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfK
isa
finite
clas
sof
finite
alge
bras
and
VK
isCD
then
VSI⊆
HSK
IfA
,B∈V
SIar
efinite
non
isom
orphic
andV
isCD
then
VA
6=VB
Vis
finitel
yge
ner
ated
ifV
=VK
for
som
efinite
clas
sof
finite
alge
bras
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Afinitel
yge
ner
ated
CD
variet
yhas
only
finitel
ym
any
subva
riet
ies
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
46
/84
Lat
tice
sof
subva
riet
ies
IfF
σ⊂
Fτ
then
theF
σ-r
educt
ofa
τ-a
lgeb
raA
isA
′=
(A,(
fA) f
∈F
σ)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfA
′is
are
duct
ofA
then
Con
(A)
isa
subla
ttic
eof
Con
(A′ )
The
variet
yof
latt
ices
isCD
,so
any
variet
yof
alge
bras
with
latt
ice
reduct
sis
CD
For
ava
riet
yV
the
latt
ice
ofsu
bva
riet
ies
isden
oted
byΛV
The
mee
tis
⋂
and
the
join
is∑
i∈IV
i=
V(⋃
i∈IV
i)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
For
any
variet
yV
,ΛV
isan
alge
brai
cla
ttic
ew
ith
com
pac
tel
emen
ts=
variet
ies
that
are
finitel
yax
iom
atiz
able
over
V
HSP
u(K
∪L
)=
HSP
uK∪
HSP
uL
for
any
clas
sesK
,L
IfV
isCD
then
ΛV
isdistr
ibutive
and
the
map
V7→
VSIis
ala
ttic
eem
bed
din
gof
ΛV
into
P(V
SI)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
47
/84
Sim
ple
alge
bras
and
the
discr
imin
ator
Ais
sim
ple
ifCon
(A)
=I
A,A
2
i.e.
has
asfe
wco
ngr
uen
ces
aspos
sible
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Any
sim
ple
alge
bra
issu
bdirec
tly
irre
duci
ble
Ais
adiscr
imin
ator
alge
bra
iffo
rso
me
tern
ary
term
tA
|=x6=
y⇒
t(x,y
,z)=
xan
dt(
x,x
,z)=
z
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Any
subdirec
tly
irre
duci
ble
discr
imin
ator
alge
bra
issim
ple
Vis
adiscr
imin
ator
variet
yifV
isge
ner
ated
bya
clas
sof
discr
imin
ator
alge
bras
(for
afixe
dte
rmt)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
48
/84
13
Unar
ydiscr
imin
ator
inal
gebr
asw
ith
Bool
ean
reduct
Aunar
ydiscr
imin
ator
term
isa
term
din
anal
gebr
aA
with
aB
ool
ean
reduct
such
that
d(0
)=
0an
dx6=
0⇒
d(x
)=
>
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
An
alge
bra
with
aB
ool
ean
reduct
isa
discr
imin
ator
alge
bra
iffit
has
aunar
ydiscr
imin
ator
term
[Hin
t:le
td(x
)=
t(0,x
,>)−
and
t(x,y
,z)=
x·d(x
−·y
+x·y−
)+
z·d(x
−·y
+x·y−
)−]
Ina
concr
ete
rela
tion
alge
bra
the
term
d(x
)=
>;x
;>is
aunar
ydiscr
imin
ator
term
For
aquan
tifier
free
form
ula
φwe
defi
ne
ate
rmφ
tin
duct
ivel
yby
(r=
s)t=
(r−
+s)
·(r
+s−
),(φ
and
ψ)t
=φ
t·ψ
t ,(¬
φ)t
=d((
φt )−)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ina
discr
imin
ator
alge
bra
with
Bool
ean
reduct
φ⇔
(φt=
1)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
49
/84
Rel
atio
nal
gebr
asar
ea
discr
imin
ator
variet
y
Let
Aa
=(↓
a,+
,0,·
,a,−
a,;
a,1·a
,a)
be
the
rela
tive
subal
gebr
aof
rela
tion
alge
bra
Aw
ith
a∈
Aw
her
ex−
a=
x−·a
,x; a
y=
(x;y
)·a,
and
xa=
x`
·a
An
elem
ent
ain
are
lation
alge
bra
isan
idea
lel
emen
tif
a=
>;a
;>
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Aa
isa
rela
tion
alge
bra
iffa
=a`
=a;
a
For
any
idea
lel
emen
ta
the
map
h(x
)=
(x·a
,x·a
−)
isan
isom
orphism
from
Ato
Aa×
Aa−
Are
lation
alge
bra
issim
ple
iffit
issu
bdirec
tly
irre
duci
ble
iffit
isnot
direc
tly
dec
ompos
able
iff0,>
are
the
only
idea
lel
emen
tsiff
>;x
;>is
aunar
ydiscr
imin
ator
term
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
50
/84
Rep
rese
nta
ble
rela
tion
alge
bras
The
clas
sRRA
ofre
pres
enta
ble
rela
tion
alge
bras
isSPR
el(X
):X
isa
set
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
An
alge
bra
isin
RRA
iffit
isem
bed
dab
lein
aco
ncr
ete
rela
tion
alge
bra
The
clas
sK
=SR
el(X
):X
isa
set
iscl
osed
under
H,S
and
Pu
[Hin
t:P
uS⊆
SP
uso
ifA
=∏
URel
(Xi)
for
som
eultra
filter
Uove
rI,
let
Y=
∏
UX
i,defi
ne
h:A
→Rel
(Y)
by
[x]h
([R
])[y
]⇔
i∈
I:x i
Riy
i∈
Uand
show
his
awel
ldefi
ned
embed
din
g]
⇒(V
K) S
I⊆
Kby
Jonss
on’s
Theo
rem
⇒VK
=SPK
=RRA
byB
irko
ff’s
subdirec
tre
pres
enta
tion
theo
rem
⇒[T
arsk
i19
55]RRA
isa
variet
y
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
51
/84
Theo
rem
[Lyn
don
1950
]T
her
eex
ist
non
repr
esen
table
rela
tion
alge
bras
(i.e
./∈
RRA
)
[Mon
k19
69]RRA
isnot
finitel
yax
iom
atiz
able
[Jon
sson
1991
]RRA
cannot
be
axio
mat
ized
with
finitel
ym
any
variab
les
Outlin
eof
non
finite
axio
mat
izab
ility
:T
her
eis
ase
quen
ceof
finite
rela
tion
alge
bras
An
with
nat
oms
and
the
prop
erty
that
An
isre
pres
enta
ble
iffth
ere
exists
apr
ojec
tive
pla
ne
ofor
der
n
By
are
sult
of[B
ruck
and
Rys
er19
49]pr
ojec
tive
pla
nes
do
not
exist
for
infinitel
ym
any
order
s
The
ultra
product
ofth
eco
rres
pon
din
gse
quen
ceof
non
repr
esen
table
An
isre
pres
enta
ble
,so
the
com
ple
men
tof
RRA
isnot
clos
edunder
ultra
product
s
⇒RRA
isnot
finitel
yax
iom
atiz
able
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
52
/84
14
Chec
king
ifa
finite
rela
tion
alge
bra
isre
pres
enta
ble
Theo
rem
(Lyn
don
1950
,M
addux
1983
)
Ther
eis
anal
gorith
mth
athal
tsif
agi
ven
finite
rela
tion
alge
bra
isnot
repr
esen
table
Lyn
don
give
sa
recu
rsiv
eax
iom
atiz
atio
nfo
rRRA
Mad
dux
defi
nes
ase
quen
ceof
variet
ies
RA
nsu
chth
atRA
=RA
4⊃
RA
5⊃
...R
RA
=⋂
n≥
4RA
nan
dit
isdec
idab
leif
afinite
alge
bra
isin
RA
n
Imple
men
ted
asa
GA
Ppr
ogra
m[J
ipse
n19
93]
Com
er’s
one-
poi
nt
exte
nsion
met
hod
ofte
ngi
ves
suffi
cien
tco
nditio
ns
for
repr
esen
tabili
ty;al
soim
ple
men
ted
asa
GA
Ppr
ogra
m[J
1993
]
Theo
rem
(Hirsc
hH
odki
nso
n20
01)
Rep
rese
nta
bili
tyis
undec
idab
lefo
rfinite
rela
tion
alge
bras
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
53
/84
Com
ple
xal
gebr
as
Let
U=
(U,T
,`,E
)be
ast
ruct
ure
with
T⊆
U3,
`
:U
→U
,E⊆
U
The
com
ple
xal
gebr
aCm
(U)
is(P
(U),∪
,∅,∩
,U,−
,;,`
,1)
wher
eX
;Y=
z:(x
,y,z
)∈
Tfo
rso
me
x∈
X,y
∈Y,
X`
=x
`
:x∈
X,
and
1=
E
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Cm
(U)
isa
rela
tion
alge
bra
iffx
=y⇔
∃z∈
E(x
,z,y
)∈
T,
(x,y
,z)∈
T⇔
(x`
,z,y
)∈
T⇔
(z,y
`
,x)∈
T,an
d(x
,y,z
)∈
Tan
d(z
,u,v
)∈
T⇒
∃w
((x,w
,v)∈
Tan
d(y
,v,w
)∈
T)
An
alge
bra
A=
(A,
,`,e
)ca
nbe
view
edas
ast
ruct
ure
(A,T
,`,E
)w
her
eT
=(
x,y
,z)
:x
y=
z
and
E=
e
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Cm
(A)
isa
rela
tion
alge
bra
iffA
isa
grou
p
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
54
/84
Ato
mst
ruct
ure
s
J(A
)den
otes
the
set
ofco
mple
tely
join
irre
duci
ble
elem
ents
ofA
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ina
Bool
ean
alge
bra
J(A
)is
the
set
ofat
oms
ofA
Eve
ryat
omic
BA
isem
bed
dab
lein
P(J
(A))
via
x7→
J(A
)∩↓x
Eve
ryco
mple
tean
dat
omic
Bool
ean
alge
bra
isisom
orphic
toP
(J(A
))
The
atom
stru
cture
ofan
atom
icre
lation
alge
bra
Ais
(J(A
),`
,T,E
)w
her
eT
=(
x,y
,z)∈
J(A
):x;y
≥z
and
E=
J(A
)∩↓1
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
U=
(U,`
,T,E
)is
the
atom
stru
cture
ofso
me
atom
icre
lation
alge
bra
iffCm
(U)
isa
rela
tion
alge
bra
IfA
isco
mple
tean
dat
omic
then
Cm
(J(A
))∼ =
A
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
55
/84
Inte
gral
and
finite
rela
tion
alge
bras
Are
lation
alge
bra
isin
tegr
alif
x;y
=0
⇒x
=0
ory
=0
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Are
lation
alge
bra
Ais
inte
gral
iff1
isan
atom
ofA
iffx6=
0⇒
x;>
=>
Rel
(2)
has
4at
oms
and
isth
esm
alle
stsim
ple
non
inte
gral
rela
tion
alge
bra
Non
inte
gral
RA
sca
nof
ten
be
dec
ompos
edin
toa
“sem
idirec
tpr
oduct
”of
inte
gral
alge
bras
,so
mos
twor
khas
bee
ndon
eon
finite
inte
gral
RA
s
For
finite
rela
tion
alge
bras
one
usu
ally
wor
ksw
ith
the
atom
stru
cture
Rel
(∅)
isth
eon
e-el
emen
tRA
;ge
ner
ates
the
variet
yO
=M
od(0
=>
)
Rel
(1)
isth
etw
o-el
emen
tRA
,w
ith
1=
>,x;y
=x·y
,x
`
=x
Itge
ner
ates
the
variet
yA
1=
Mod(1
=>
)of
Bool
ean
rela
tion
alge
bras
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
56
/84
15
Var
ieties
ofsm
allre
lation
alge
bras
Defi
ne
xs
=x
+x
`
and
letA
shav
eunder
lyin
gse
tA
s=
xs
:x∈
A
Are
lation
alge
bra
Ais
sym
met
ric
ifx
=x
`
(iff
As
=A
)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfA
isco
mm
uta
tive
,th
enA
sis
asu
bal
gebr
aof
AT
her
ear
etw
oRA
sw
ith
4el
emen
ts:A
2=
Cm
(Z2)
and
A3
=(C
m(Z
3))
s
The
variet
ies
gener
ated
byA
2an
dA
3ar
eden
oted
A2
andA
3
By
Jonss
on’s
Theo
rem
A1,A
2an
dA
3ar
eat
oms
ofΛ
RA
Theo
rem
(Jon
sson
)
Eve
rynon
triv
ialva
riet
yof
rela
tion
alge
bras
incl
udes
A1,A
2or
A3
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
57
/84
Gro
up
RAs
and
inte
gral
RAs
ofsize
8A
com
ple
xal
gebr
aof
agr
oup
isca
lled
agr
oup
rela
tion
alge
bra
GRA
isth
eva
riet
yge
ner
ated
byal
lgr
oup
rela
tion
alge
bras
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfU
isa
grou
pth
enCm
(U)
isem
bed
ded
inRel
(U)
via
Cay
ley’
sre
pres
enta
tion
,gi
ven
byh(X
)=
(u,u
x)
:u∈
U,x
∈X
⇒G
RA
isa
subva
riet
yof
RRA
For
anal
gebr
aA
and
x∈
A,SgA(x
)is
the
subal
gebr
age
ner
ated
byx
Ther
ear
e10
inte
gral
rela
tion
alge
bras
with
8el
emen
ts,al
l1-
gener
ated
subal
gebr
asof
grou
pre
lation
alge
bras
,hen
cere
pres
enta
ble
B1
=SgCm
Z42
B5
=SgCm
Z51
,4
C1
=SgCm
Z71
,2,4
B2
=SgCm
Z62
,4
B6
=SgCm
Z81
,4,7
C2
=SgCm
Qr
:r
>0
B3
=SgCm
Z63
B7
=SgCm
Z123
,4,6
,8,9
C3
=Cm
(Z3)
B4
=SgCm
Z93
,6
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
58
/84
Inte
gral
rela
tion
alge
bras
with
4at
oms
The
8-el
emen
tin
tegr
alRA
sal
lhav
eA
3as
the
only
prop
ersu
bal
gebr
a
⇒th
eyge
ner
ate
join
-irr
educi
ble
variet
ies
abov
eA
3
B1,.
..,B
7ar
esy
mm
etric,
C1,C
2,C
3
[Com
er]T
her
ear
e10
2in
tegr
al16
-ele
men
tRA
s,not
allre
pres
enta
ble
(65
are
sym
met
ric,
and
37ar
enot
)
[Jip
sen
Her
tzel
Kra
mer
Mad
dux]
31non
repr
esen
table
(20
are
sym
met
ric)
Pro
ble
m
What
isth
esm
alle
stre
pres
enta
ble
RA
that
isnot
inG
RA
?Is
ther
eon
ew
ith
16el
emen
ts?
Ther
ear
e34
candid
ates
atwww.chapman.edu/∼jipsen/gap/ramaddux.html
that
are
repr
esen
table
but
not
know
nto
be
grou
pre
pres
enta
ble
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
59
/84
Sum
mar
yof
bas
iccl
asse
sof
stru
cture
s
Qos
et=
quas
iord
ered
sets
=se
tsw
ith
are
flex
ive
and
tran
sitive
rela
tion
Pos
et=
par
tial
lyor
der
edse
ts=
antisy
mm
etric
quos
ets
Equiv
=eq
uiv
alen
cere
lation
s=
sym
met
ric
quos
ets
Sgr
p=
sem
igro
ups
=as
soci
ativ
egr
oupoi
ds
Bnd
=ban
ds
=id
empot
ent
(x+
x=
x)
sem
igro
ups
Sla
t=
sem
ilatt
ices
=co
mm
uta
tive
ban
ds
JSla
t=
join
-sem
ilatt
ices
=se
mila
ttic
esw
ith
x≤
y⇔
x+
y=
yLat
=la
ttic
es=
two
sem
ilatt
ices
with
abso
rption
law
sM
on=
mon
oids
=se
mig
roups
with
iden
tity
x·1
=x
=1·x
Mon
`
=in
volu
tive
mon
oids
=m
onoi
ds
with
x`
`
=x,(x·y
)`=
y`
·x`
Grp
=gr
oups
=in
volu
tive
mon
oids
with
x`
·x=
1JS
Lat
0=
join
-sem
ilatt
ices
with
iden
tity
x+
0=
xLat
0>
=bou
nded
latt
ices
=la
ttic
esw
ith
x+
0=
xan
dx·>
=>
Lat
−=
com
ple
men
ted
latt
ices
=Lat
0>
with
x+
x−
=>
and
x·x
−=
0D
Lat
=distr
ibutive
latt
ices
=la
ttic
esw
ith
x·(y
+z)
=x·y
+x·z
BA
=B
ool
ean
alge
bras
=co
mple
men
ted
distr
ibutive
latt
ices
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
60
/84
16
Som
epr
omin
ent
subcl
asse
sof
sem
irin
gs
Srn
g=
sem
irin
gs=
mon
oids
distr
ibuting
over
com
muta
tive
mon
oids
and
0IS
=(a
dditiv
ely)
idem
pot
ent
sem
irin
gs=
sem
irin
gsw
ith
x+
x=
x`M
=la
ttic
e-or
der
edm
onoi
ds
=id
empot
ent
sem
irin
gsw
ith
mee
tRL
=re
siduat
edla
ttic
es=
`-m
onoi
ds
with
residual
sK
A=
Kle
ene
alge
bra
=id
empot
ent
sem
irin
gw
ith
∗,unfo
ldan
din
duct
ion
KA∗
=∗-
continuou
sK
leen
eal
gebr
a=
KA
with
...
KAT
=K
leen
eal
gebr
asw
ith
test
s=
KA
with
Bool
ean
subal
gebr
a≤
1K
AD
=K
leen
eal
gebr
asw
ith
dom
ain
KL
=K
leen
ela
ttic
es=
Kle
ene
alge
bras
with
mee
tB
M=
Bool
ean
mon
oids
=distr
ibutive
`-m
onoi
ds
with
com
ple
men
tsK
BM
=K
leen
eB
ool
ean
mon
oids
=B
ool
ean
mon
ids
with
Kle
ene-∗
RA
=re
lation
alge
bras
=B
ool
ean
mon
oids
with
invo
lution
and
residual
sK
RA
=K
leen
ere
lation
alge
bras
=re
lation
alge
bras
with
Kle
ene-∗
RRA
=re
pres
enta
ble
rela
tion
alge
bras
=co
ncr
ete
rela
tion
alge
bras
RK
RA
=re
pres
enta
ble
Kle
ene
rela
tion
alge
bras
=RRA
with
Kle
ene-∗
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
61
/84
Subcl
asse
sfrom
com
bin
atio
ns
of∗,te
sts,
mee
t,−,
`
IS
KA
IST
`MIS
`
KAT
KL
`MT
KA
`IS
T`
`M`
KLT
BM
KAT
`K
L`
`MT
`
KBM
KLT
`RA
KRA
A=
Alg
ebra
B=
Boole
an
I=
Idem
pote
nt
K=
Kle
ene
L=
Latt
ice
`=
latt
ice-
ord
ered
M=
Monoid
R=
Rel
ation
S=
Sem
irin
gT
=w
ith
test
s`
=w
ith
conve
rse
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
62
/84
Man
y,but
not
all,
ofth
ese
clas
ses
are
variet
ies
Rec
allth
atquas
ivar
iete
sar
ecl
asse
sdefi
ned
byim
plic
atio
ns
ofeq
uat
ions
Mos
tnot
ably,K
leen
eal
gebr
asan
dso
me
ofits
subcl
asse
sar
equas
ivar
ieties
Inge
ner
al,im
plic
atio
ns
are
not
pres
erve
dby
hom
omor
phic
imag
es
To
see
that
KA
isnot
ava
riet
y,find
anal
gebr
ain
H(K
A)\
KA
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Let
Abe
the
pow
erse
tK
leen
eal
gebr
aof
(N,+
,0)
and
let
θbe
the
equiv
alen
cere
lation
with
blo
cks∅,
0,
all
finite
sets
6=0,∅
and
all
infinite
subse
ts.
Then
θis
aco
ngr
uen
ce,butA
/θis
not
aK
leen
eal
gebr
a.
Theo
rem
(Mal
’cev
)
Acl
assK
isa
quas
ivar
iety
iffit
iscl
osed
under
S,P
and
Pu
The
smal
lest
quas
ivar
iety
conta
inin
gK
isQK
=SPP
uK
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
63
/84
Fre
eal
gebr
as
Let
Kbe
acl
ass
and
letF
be
anal
gebr
ath
atis
gener
ated
bya
set
X⊆
F(i.e
.F
has
no
prop
ersu
bal
gebr
ath
atco
nta
ins
X)
FisK
-fre
ely
gener
ated
byX
ifan
yf
:X
→A
∈K
exte
nds
toa
hom
omor
phism
f:F→
A
Ifal
soF∈K
then
Fis
theK
-fre
eal
gebr
aon
Xan
dis
den
oted
byFK(X
).
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
IfK
isth
ecl
ass
ofal
lτ-a
lgeb
ras
then
the
term
alge
bra
Tτ(X
)is
the
K-fre
eal
gebr
aon
X
IfK
isan
ycl
ass
ofτ-a
lgeb
ras,
let
θ K=
⋂
ker
h|h
:T
τ(X
)→
Ais
ahom
omor
phism
,A
∈K.
Then
F=
Tτ(X
)isK
-fre
ely
gener
ated
and
ifK
iscl
osed
under
subdirec
tpr
oduct
s,th
enF∈K
⇒free
alge
bras
exist
inal
l(q
uas
i)va
riet
ies
(sin
ceth
eyar
eS,P
clos
ed)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
64
/84
17
Exa
mple
sof
free
alge
bras
Afree
alge
bra
onm
gener
ator
ssa
tisfi
eson
lyth
ose
equat
ions
with≤
mva
riab
les
that
hol
din
allm
ember
sof
K
FSgrp
(X)∼ =
⋃
n≥
1X
nF
Mon(X
)∼ =
⋃
n≥
0X
nx7→
(x)
Thes
ese
tsof
n-t
uple
sar
eusu
ally
den
oted
byX
+an
dX
∗
FSla
t(X
)∼ =
Pfin(X
)\∅
FSla
t 0(X
)∼ =
Pfin(X
)x7→
x
FSrn
g(X
)∼ =
finite
multiset
sof
X∗
FIS
(X)∼ =
Pfin(X
∗)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Ifeq
ual
ity
bet
wee
nel
emen
tsof
allfinitel
yge
ner
ated
free
algeb
ras
isdec
idab
le,th
enth
eeq
uat
ional
theo
ryis
dec
idab
le
⇒th
eeq
uat
ional
theo
ries
ofSgr
p,M
on,Sla
t,Srn
g,IS
are
dec
idab
le
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
65
/84
Fre
edistr
ibutive
latt
ices
and
Bool
ean
alge
bras
The
free
alge
bras
for
DLat
and
BA
are
also
easy
todes
crib
e
FD
Lat(
X)∼ =
Sg
P(P
(X))
DLat
(h[X
])
FBA(X
)∼ =
Sg
P(P
(X))
BA
(h[X
])
wher
ein
bot
hca
ses
h(x
)=
Y∈P
(X)
:x∈
Y
and
x7→
h(x
)
For
finite
X,th
efree
BA
isac
tual
lyisom
orphic
toP
(P(X
))
For
latt
ices
,th
efree
alge
bra
on>
3ge
ner
ator
sis
infinite
but
the
equat
ional
theo
ryis
still
dec
idab
le[S
kole
m19
28](in
pol
ynom
ialtim
e)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
66
/84
Kle
ene
alge
bras
and
regu
lar
sets
Dec
idin
geq
uat
ions
inK
Ais
also
pos
sible
,but
take
sa
bit
mor
ewor
k
Let
Σbe
afinite
set,
calle
dan
alphab
et
The
free
mon
oid
gener
ated
byΣ
isΣ
∗=
(Σ∗,·
,ε)
Her
eε
isth
eem
pty
sequen
ce()
,an
d·is
conca
tenat
ion
The
Kle
ene
alge
bra
ofre
gula
rse
tsisR
Σ=
Sg
P(Σ
∗)
KA
((
x)
:x∈
Σ)
Theo
rem
(Koz
en19
94)
RΣ
isth
efree
Kle
ene
alge
bra
onΣ
Inpar
ticu
lar,
are
gula
rse
tis
the
imag
eof
aK
Ate
rm
So
dec
idin
gif
(s=
t)∈
The(K
A)
iseq
uiv
alen
tto
chec
king
iftw
ore
gula
rse
tsar
eeq
ual
Mem
ber
ship
inre
gula
rse
tsca
nbe
det
erm
ined
byfinite
auto
mat
a
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
67
/84
Auto
mat
a
AΣ
-auto
mat
onis
ast
ruct
ure
U=
(U,(
aU) a
∈Σ,S
,T)
such
that
aUis
abin
ary
rela
tion
and
S,T
are
unar
yre
lation
s.
Ele
men
tsof
U,S
,Tar
eca
lled
stat
es,st
art
stat
esan
dte
rmin
alst
ates
resp
ective
ly
For
w∈
Σ∗
defi
ne
wU
byεU
=I U
and
(a·w
)U=
aU;w
U
The
langu
age
reco
gniz
edby
Uis
L(U
)=
w∈
Σ∗
:w
U∩
S×
T6=
∅
Rec
Σis
the
set
ofal
lla
ngu
ages
reco
gniz
edby
som
eΣ
-auto
mat
on
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
∅,ε,
a∈
Rec
Σfo
ral
la∈
Σ
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
68
/84
18
Reg
ula
rse
tsar
ere
cogn
izab
le
Afinite
auto
mat
onca
nbe
view
edas
adirec
ted
grap
hw
ith
stat
esas
nodes
and
anar
row
label
led
afrom
uito
ujiff
(ui,
uj)∈
aU
Giv
enau
tom
ata
U,V
,defi
ne
U+
Vto
be
the
disjo
int
unio
nof
U,V
U;V
=(U
]V
,(aU
]aV
](a
UT
U×
SV))
a∈
Σ,S
′ ,T
V)
wher
e
S′=
SU
ifS
U∩
TU
=∅
SU∪
SV
other
wise
and
aUT
U=
u:∃v(u
,v)∈
aU,v
∈T
U
U+
=(U
,(aU
](a
UT
U×
SU))
a∈
Σ,S
U,T
U)
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
L(U
+V
)=
L(U
)∪
L(V
),L(U
;V)=
L(U
);L(V
),an
dL(U
+)
=L(U
)+
⇒ev
ery
regu
lar
set
isre
cogn
ized
byso
me
finite
auto
mat
on
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
69
/84
Mat
rice
sin
sem
irin
gsan
dK
leen
eal
gebr
as
For
ase
mirin
gA
,le
tM
n(A
)=
An×
nbe
the
set
ofn×
nm
atrice
sov
erA
Mn(A
)is
agai
na
sem
irin
gw
ith
usu
alm
atrix
additio
nan
dm
ultip
licat
ion
0is
the
zero
mat
rix,
and
I nis
the
iden
tity
mat
rix
IfA
isa
Kle
ene
alge
bra
and
M=
[
NP
QR
]
∈M
n(A
)defi
ne
M∗
=
[
(N+
PR∗Q
)∗N
∗P
(R+
QN
∗P
)∗
R∗Q
(N+
PR∗Q
)∗(R
+Q
N∗P
)∗
]
This
ism
otiv
ated
byth
edia
gram
:
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
defi
nitio
nof
M∗
isin
dep
enden
tof
the
chos
endec
ompos
itio
n
IfA
isa
Kle
ene
alge
bra,
sois
Mn(A
)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
70
/84
Fin
ite
auto
mat
aas
mat
rice
sG
iven
U=
(U,(
aU) a
∈Σ,S
,T)
with
U=
u1,.
..,u
n
let
(s,M
,t)
be
a0,
1-ro
wn-v
ecto
r,an
n×
nm
atrix
and
a0,
1-co
lum
nn-v
ecto
rw
her
e
s i=
1⇔
ui∈
S,M
ij=
∑
a:(u
i,uj)∈
aU,
and
t i=
1⇔
ui∈
T
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
L(U
)=
h(s
;M;t
)w
her
eh
:T
KA(Σ
)→
RΣ
isin
duce
dby
h(x
)=
(x)
⇒ev
ery
reco
gniz
able
langu
age
isa
regu
lar
set
[Kle
ene
1956
]
But
man
ydiff
eren
tau
tom
ata
may
corr
espon
dto
the
sam
ere
gula
rse
t
Uis
adet
erm
inistic
auto
mat
onif
each
aUis
afu
nct
ion
onU
and
Sis
asingl
eton
set
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Any
non
det
erm
inistic
auto
mat
onU
can
be
conve
rted
toa
det
erm
inistic
one
U′w
ith
U′=
P(U
),a′
(X)
=v
:(u
,v)∈
aUfo
rso
me
u∈
X,
S′=
S
and
T′=
X:X
∩T
6=∅
such
that
L(U
′ )=
L(U
)
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
71
/84
Min
imal
auto
mat
aA
stat
ev
isac
cess
ible
if(u
,v)∈
wU
for
som
eu∈
San
dw
∈Σ∗
Ina
det
erm
inistic
auto
mat
on,th
eac
cess
ible
stat
esar
eth
esu
bal
gebr
age
ner
ated
from
the
star
tst
ate
Theo
rem
(Myh
ill,N
erode
1958
)
Giv
ena
det
erm
inistic
auto
mat
onU
with
no
inac
cess
ible
stat
es,th
ere
lation
uθv
iff∀w
∈Σ∗
w(u
)∈
T⇔
w(v
)∈
Tis
aco
ngr
uen
ceon
the
auto
mat
onan
dL(U
/θ)
=L(U
)
An
auto
mat
onis
min
imal
ifal
lst
ates
are
acce
ssib
lean
dth
eθ
congr
uen
ceis
the
iden
tity
rela
tion
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Let
U,V
be
min
imal
auto
mat
a.T
hen
L(U
)=
L(V
)iff
U∼ =
V.
⇒T
he
equat
ional
theo
ryof
Kle
ene
alge
bras
isdec
idab
le
Try
this
inJF
LA
P:A
nIn
tera
ctiv
eFor
mal
Lan
guag
esan
dA
uto
mat
aPac
kage
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
72
/84
19
Th
q((
idem
pot
ent)
sem
irin
gs)
isundec
idab
le
Theo
rem
(Pos
t19
47,M
arko
v19
49)
The
quas
iequat
ional
theo
ryof
sem
igro
ups
isundec
idab
le
For
ase
mig
roup
A,le
tA
1be
the
mon
oid
obta
ined
byad
join
ing
1
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Any
sem
igro
up
Ais
asu
bal
gebr
aof
the
;-re
duct
ofP
(A)
IfK
=;
-red
uct
sof
sem
irin
gs
then
SK
=th
ecl
ass
ofse
mig
roups
Aquas
iequat
ion
that
use
son
ly;hol
ds
inK
iffit
hol
ds
inal
lse
mig
roups
⇒th
equas
iequat
ional
theo
ryof
(idem
pot
ent)
sem
irin
gsis
undec
idab
le
Sin
ceP
(A)
isa
reduct
ofK
A,K
AT
,K
AD
,B
Mth
esa
me
resu
lthol
ds
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
73
/84
The
equat
ional
theo
ryof
RA
isundec
idab
le
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
For
any
sem
igro
up
A,th
em
onoi
dA
1is
embed
ded
inth
e;-re
duct
ofRel
(A1)
via
the
Cay
ley
map
x7→
(x,x
y)
:y∈
A1
IfK
=;
-red
uct
sof
sim
ple
RA
sth
enSK
=th
ecl
ass
ofse
mig
roups
The
quas
iequat
ional
theo
ryof
RA
SI,
RA
and
RRA
isundec
idab
le
RA
isa
discr
imin
ator
variet
y,hen
cean
yquas
iequat
ion
(in
fact
any
quan
tifier
free
form
ula
)φ
can
be
tran
slat
edin
toan
equat
ion
φt=
1w
hic
hhol
ds
inRA
iffφ
hol
ds
inRA
SI
⇒T
he(R
A)
isundec
idab
le
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
74
/84
Undec
idab
ility
isper
vasive
inΛ
RA
Theo
rem
(Andre
kaG
ivan
tN
emet
i19
97)
IfK
⊆RA
such
that
for
each
n≥
1th
ere
isan
alge
bra
inK
SIw
ith
atle
ast
nel
emen
tsbel
owth
eid
entity
then
TheK
isundec
idab
le
IfK
⊆RA
such
that
for
each
n≥
1th
ere
isan
alge
bra
inK
with
asu
bse
tof
atle
ast
npai
rwise
disjo
int
elem
ents
that
form
agr
oup
under
;an
d`
then
TheK
isundec
idab
le
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
The
variet
ies
ofin
tegr
alRA
s,sy
mm
etric
RA
san
dgr
oup
rela
tion
alge
bras
are
undec
idab
le
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
75
/84
Sum
mar
yof
dec
idab
ility
and
other
prop
erties
The
dec
Thq
dec
Th
dec
Var
CD
loc
fin
Sgr
p,M
onX
××
X×
×
Sla
tX
X×
X×
X
Lat
XX
×X
X×
DLat
XX
×X
XX
BA
XX
XX
XX
Grp
X×
×X
××
Srn
gX
××
X×
×
ISX
××
X×
×
KA
,K
AT
X×
××
××
KA
D×
××
××
RsK
A×
×X
X×
RsL
X×
×X
X×
BM
××
×X
X×
RA
××
×X
X×
RRA
××
×X
X×
KRA
××
×X
X×
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
76
/84
20
Cat
egor
ies
Aca
tego
ryis
ast
ruct
ure
C=
(C,O
,,1
,dom
,cod)
such
that
Cis
acl
ass
ofm
orphism
s,O
isa
clas
sof
obje
cts,
dom
,cod
:C
→O
give
the
dom
ain
and
codom
ain,
1:O
→C
give
san
iden
tity
mor
phism
,an
dco
mpos
itio
n
isa
par
tial
bin
ary
oper
atio
non
C
1(X
)is
den
oted
1X,
f:X
→Y
mea
ns
dom
f=
Xan
dco
df
=Y
g
fex
ists
iffdom
g=
codf,in
whic
hca
sedom
(g
f)
=dom
f,
cod(g
f)
=co
dg
and
ifdom
g=
codh
then
(f
g)
h=
f
(g
h)
dom
1X
=X
=co
d1 X
,1 d
om
f
f=
fan
df
1 codf
=f
The
clas
sH
om(X
,Y)
=f
:dom
f=
Xan
dco
df
=Y
isa
set
Set
isa
cate
gory
with
sets
asob
ject
san
dfu
nct
ions
asm
orphism
s
Relis
aca
tego
ryw
ith
sets
asob
ject
san
dbin
ary
rela
tion
sas
mor
phism
s
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
77
/84
Funct
ors
Cat
egor
yth
eory
iswel
lsu
ited
for
rela
ting
area
sof
mat
hem
atic
s
Funct
ors
are
stru
cture
pres
ervi
ng
map
s(h
omom
orphism
s)of
cate
gories
For
cate
gories
C,D
aco
varian
tfu
nct
orF
:C→
Dm
aps
C→
Dan
dO
C→
OD
such
that
F(1
X)
=1 F
Xan
dif
f:X
→Y
then
Ff
:FX
→FY
iff
:X
→Y
,g
:Y
→Z
then
F(g
f)
=FgFf
For
aco
ntr
avar
iant
funct
orF
:C→
Dth
edefi
nitio
nbec
omes
F(1
X)
=1 F
Xan
dif
f:X
→Y
then
Ff
:FY
→FX
iff
:X
→Y
,g
:Y
→Z
then
F(g
f)
=FfFg
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Aca
tego
ryw
ith
one
obje
ctis
(equiv
alen
tto
)a
mon
oid,an
dco
varian
tfu
nct
ors
bet
wee
nsu
chca
tego
ries
are
mon
oid
hom
omor
phism
s
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
78
/84
Het
erog
eneo
us
rela
tion
alge
bras
The
cate
gory
Relof
typed
bin
ary
rela
tion
sis
usu
ally
enrich
edby
addin
gco
nve
rse
and
Bool
ean
oper
atio
non
the
sets
Hom
(X,Y
)
Inth
isse
ttin
git
isal
sonat
ura
lto
write
com
pos
itio
nS
Ras
R;S
Ahet
erog
eneo
us
rela
tion
alge
bra
(HRA
)is
ast
ruct
ure
C=
(C,O
,;,1
,dom
,cod,`
,+,>
,·,0
,−)
such
that
(C,O
,;,1
,dom
,cod)
isa
cate
gory
`
:H
om(x
,y)→
Hom
(y,x
)sa
tisfi
esr`
`
=r,
1` x=
1 x,
(r;s
)`=
s`;r
`
for
allob
ject
sx,y
,(H
om(x
,y),
+,>
,·,0
,−)
isa
Bool
ean
alge
bra
and
for
allr;
s,t∈
Hom
(x,y
),(r
;s)·
t=
0⇔
(r`
;t)·s
=0⇔
(t;s
`
)·r
=0
Pro
ve(a
nd
exte
nd)
ordispr
ove
(and
fix)
Rel
atio
nal
gebr
asar
e(e
quiv
alen
tto
)H
RA
sw
ith
one
obje
ct
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
79
/84
Oth
eren
rich
edca
tego
ries
Suitab
lywea
kenin
gth
eax
iom
sof
HRA
s(s
eee.
g.[K
ahl20
04])
give
sor
der
edca
tego
ries
(with
conve
rse)
(joi
n/m
eet)
-sem
ilatt
ice
cate
gories
(idem
pot
ent)
sem
irin
gca
tego
ries
Kle
ene
cate
gories
(with
test
s)(d
istr
ibutive
/div
isio
n)
alle
gories
Giv
ena
sem
irin
g(A
,+,·
),th
ese
tM
at(A
)=
Am×
n:m
,n≥
1of
all
mat
rice
sov
erA
isan
impor
tant
exam
ple
ofa
sem
irin
gca
tego
ry,w
ith
mat
rix
multip
licat
ion
asco
mpos
itio
n
The
cate
gorica
lap
proa
chis
hel
pfu
lin
applic
atio
ns
since
itm
atch
eswel
lw
ith
typed
spec
ifica
tion
langu
ages
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
80
/84
21
Con
clusion
The
foundat
ions
ofre
lation
alge
bras
and
Kle
ene
alge
bras
span
asu
bst
antial
par
tof
alge
bra,
logi
can
dco
mpute
rsc
ience
Her
ewe
hav
eon
lybee
nab
leto
men
tion
som
eof
the
bas
ics,
with
anem
phas
ison
conce
pts
from
univ
ersa
lal
gebr
a
Par
tici
pan
tsar
een
coura
ged
tore
adfu
rther
inso
me
ofth
epr
imar
yso
urc
esan
dex
celle
nt
expos
itar
ywor
ks,so
me
ofw
hic
har
elis
ted
bel
ow
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
81
/84
Ref
eren
ces
and
furt
her
read
ing
I[A
ndre
kaGiv
ant
Nem
eti1994]T
he
latt
ice
ofva
riet
ies
ofre
pre
senta
ble
rela
tion
alg
ebra
s,J.
Sym
bolic
Logic
[Andre
kaGiv
ant
Nem
eti1997]D
ecisio
npro
ble
ms
for
equationalth
eories
ofre
lation
alg
ebra
s,M
emoirs
AM
S
[Ber
gham
mer
Moller
Str
uth
(Eds)
2004]Rel
ationaland
Kle
ene-
alg
ebra
icM
ethods
inCom
pute
rSci
ence
,LN
CS
3051,Springer
[Birkhoff
1935]O
nth
est
ruct
ure
ofabst
ract
alg
ebra
s,Pro
c.Cam
b.
Phil.
Soc.
[Birkhoff
1944]Subdirec
tunio
ns
inuniv
ersa
lalg
ebra
,Bull.
AM
S
[Brink
KahlSch
mid
t(E
ds)
1997]Rel
ationalM
ethods
inCom
pute
rSci
ence
,Springer
[Burr
isSanka
ppanava
r1981]A
cours
ein
univ
ersa
lalg
ebra
,Springer
,online
[Conway
1971]Reg
ula
ralg
ebra
and
finite
mach
ines
,Chapm
an
and
Hall
[Des
har
nais
Moller
Str
uth
2003]K
leen
ealg
ebra
sw
ith
dom
ain
,online
[Des
har
nais
Moller
Str
uth
2004]M
odalK
leen
ealg
ebra
sand
applica
tions,
JoRM
iCS,online
[Hirsc
hH
odkin
son
2001]Rep
rese
nta
bility
isnot
dec
idable
for
finite
rela
tion
alg
ebra
s,Tra
ns.
AM
S
[Hirsc
hH
odkin
son
2002]Rel
ation
alg
ebra
sby
gam
es,N
ort
h-H
olland
[Hodkin
son
Mik
ula
sVen
ema
2001]Axi
om
atizi
ng
com
ple
xalg
ebra
sby
gam
es,Alg
ebra
Univ
ersa
lis
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
82
/84
Ref
eren
ces
and
furt
her
read
ing
II[J
ipse
n1993]D
iscr
imin
ato
rva
riet
ies
ofBoole
an
alg
ebra
sw
ith
residuate
doper
ato
rs,in
“Alg
ebra
icLogic
”,Banach
Cen
ter
Publ.,online
[Jip
sen
2004]Fro
mse
mirin
gs
tore
siduate
dK
leen
ela
ttic
es,Stu
dia
Logic
a,online
[Jip
sen
Lukacs
1994]M
inim
alre
lation
alg
ebra
s,Alg
ebra
Univ
ersa
lis
[Jip
sen
Maddux
1997]N
onre
pre
senta
ble
sequen
tialalg
ebra
s,J.IG
PL,online
[Jip
sen
Tsinakis
2002]A
surv
eyofre
siduate
dla
ttic
es,in
“O
rder
edalg
ebra
icst
ruct
ure
s”,K
luwer
,online
[Jonss
on
1967]Alg
ebra
sw
hose
congru
ence
latt
ices
are
distr
ibutive
,M
ath
Sca
nd.
[Jonss
on
1982]Var
ieties
ofre
lation
alg
ebra
s,Alg
ebra
Univ
ersa
lis
[Jonss
on
1991]T
he
theo
ryofbin
ary
rela
tions,
in“Alg
ebra
icLogic
”,N
ort
h-H
olland
[Jonss
on
Tar
ski1951/2]Boole
an
alg
ebra
sw
ith
oper
ato
rsI,
II,Am
er.
J.M
ath
.
[Kahl2004]Ref
act
oring
het
erogen
eous
rela
tion
alg
ebra
sar
ound
ord
ered
cate
gories
and
conve
rse,
JoRM
iCS,online
[Koze
n1994]A
com
ple
tenes
sth
eore
mfo
rK
leen
ealg
ebra
sand
the
alg
ebra
ofre
gula
rev
ents
,In
for.
and
Com
put.,online
[Koze
n1994]O
nact
ion
alg
ebra
s,in
“Logic
and
Info
rmation
Flo
w”,M
ITPre
ss,online
[Koze
n1997]Auto
mata
and
com
puta
bility,
Springer
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
83
/84
Ref
eren
ces
and
furt
her
read
ing
III
[Koze
n2003]Auto
mata
on
guar
ded
strings
and
applica
tions,
Mate
mat.
Conte
mp.,
online
[Koze
nand
Sm
ith
1996]K
leen
ealg
ebra
sw
ith
test
:Com
ple
tenes
sand
dec
idability,
inLN
CS
1258,Springer
,online
[Maddux
1982]Som
eva
riet
ies
conta
inin
gre
lation
alg
ebra
s,Tra
ns.
AM
S
[Maddux
1983]A
sequen
tca
lculu
sfo
rre
lation
alg
ebra
s,Ann.
Pure
and
Appl.
Logic
[Maddux
1985]Fin
ite
inte
gra
lre
lation
alg
ebra
s,in
LN
M1149,Springer
[Maddux
2006]Rel
ation
alg
ebra
s,Elsev
ier
[Pra
tt1990]D
ynam
icalg
ebra
sas
awel
l-beh
ave
dfragm
ent
ofre
lation
alg
ebra
s,in
LN
CS
425,
Springer
,online
[Pra
tt1990]Act
ion
logic
and
pure
induct
ion,in
LN
CS
478,Springer
,online
[Tar
ski1946]A
rem
ark
on
funct
ionally
free
alg
ebra
s,Ann.
Math
.
[Tar
ski1955]Contr
ibutions
toth
eth
eory
ofm
odel
sIII,
Konin
.N
eder
l.Aka
d.
Wet
en.
Pro
c.
Pete
rJip
sen
(Chapm
an
Univ
ers
ity)
Rela
tion
alg
ebra
sand
Kle
ene
alg
ebra
August
24,2006
84
/84
22
Relational Methods for Program Refinement
John Derrick
Department of Computer Science, University of Sheffield, UK.jd@dcs.shef.ac.uk
+ +
RelMiCS 2006Relational methods forProgram Renement
John Derri kUniversity of SheÆeld
+ 1
+ +A Tutorial on Renement in State-based Spe i ation LanguagesIn this tutorial we aim to provide: An introdu tion to the idea of renementas a formal development pro ess. An insight into how renement is denedin Z and other spe i ation languages. An understanding of how the relationalbasis for Z leads to the derivation of theZ simulation rules as they are usually pre-sented. An understanding of the relationship tovarious pro ess algebrai renement rela-tions.+ 2
+ +Outline: Overview of Renement A relational framework Data renement Simulations Renement in Z Deriving simulations in Z Examples Con urrent models of renement Unifying relational and on urrent rene-ment+ 3
+ +
What is Renement? Write a program to input a number, dou-ble it and output the result on the s reen. Draw a Ja k playing ard.
Spe i ations dene what is observable andwhat is hidden.They are also often loose, i.e., ontain non-determinism.+ 4
24
+ +Renement is the pro ess of development: the internal representation doesn't mat-ter, all that matters is the observable be-haviour. if options have been left open, we arefree to make a hoi e i.e., redu e non-determinism.
So renement is based upon:The Prin iple of Substitutivity: itis a eptable to rene one program byanother,- provided it is impossible for a userof the programs to observe that thesubstitution has taken pla e.+ 5
+ +
All formal methods have notions of rene-ment: Pro ess algebras (CSP, LOTOS et ) - tra e,failure-divergen e, redu tion et . Automata; State-based languages (Z, VDM, B et ) -data renement.
+ 6
+ +Renement in ZData renement is a methodology that allowsstate spa es to be altered in a development,and non-determinism to be redu ed.For example, a digital wat h might have thestate spa eTimeHMhrs : 0::23mins : 0::59 TimeHMInitTimeHM0With operations to show and reset the timeShowTimeTimeHMhrs ! : 0::23mins ! : 0::59hrs = hrs !mins = mins !
ResetTimeTimeHMhrs? : 0::23mins? : 0::59hrs 0 = hrs?mins 0 = mins?+ 7
+ +A renement to the wat h might add somemore detail to this design:Change the internal representation, e.g.,TimeHMhrs : 0::23mins : 0::59 CTimeHMtime : N Nand/or redu e some non-determinismTimeHMInitTimeHM0 CTimeHMInitCTimeHM0time 0 = (0; 0)What is the orre t spe i ation of ShowTimeusing CTimeHM?+ 8
25
+ +Programs in this spe i ation are sequen esof operations:TimeHMInit o9 ShowTime o9 ShowTimeo9 ResetTime o9 ShowTimeIn a renement we will need to mat h equiv-alent programs, so that an abstra t program an be rened by a on rete program.AInitRCInit
-AOp1-COp1
-AOp2-COp2
--
-AOpn-COpnAFinRCFin
So a spe i ation A is rened by C i for ea hprogram PP(C) P(A)e.g.CInit o9COp1 o9COp2 o9CFin AInit o9AOp1 o9AOp2 o9AFin+ 9
+ +
Thus for our example, we need:CTimeHMInit o9CShowTimeo9CShowTime o9CResetTime TimeHMInit o9 ShowTimeo9ShowTime o9ResetTime(Don't worry about the AFin and CFin bit.)But we need to verify this for every possibleprogram.
+ 10
+ +Several issues What exa tly are the observations of anabstra t data type, and what is their re-lation to ADT programs? How do inputs and outputs t in with this? What is the ee t of using operations spe -ied by relations whi h are not ne essarilytotal? What is the fun tion of initialisation? How an we verify renements without he king all programs?
+ 11
+ +Data Renement and SimulationsNext: the standard denition of data renementfor data types whose operations are totalrelations, the denitions of upward and downwardsimulations, the statement of their soundness and joint ompleteness.
To apply this theory to a spe i ation lan-guage we look at how operations in a spe i- ation are modelled as partial relations.The appli ation of the simulation rules to spe -i ations with partial operations leads to thesimulation rules as they are normally presentedin Z.First, some denitions : : :+ 1226
+ +Denition 1 (Data type)A data type, (State; Init; fOpigi2I;Fin), has operations fOpig, indexed by i 2 I,that are total relations on the set State; Initis a relation from G to State; Fin is a relationfrom State to G. 2A data type is anoni al if Init, Opi and Fin areall fun tions. Two data types are onformalif their global data spa e G and the indexingsets of their operations are equal.Denition 2 (Complete program)A omplete program over a data type D isan expression of the form Init o9P o9 Fin, whereP, a relation over State, is a program overfOpigi2I. 2For example, if p = hp1; : : : ;pni thenpD = Init o9Opp1 o9 : : : o9Oppn o9 Fin.+ 13
+ +ExampleLet G = N , D = (N ; Init; fOp1;Op2g;Fin) whereInit = fx : N (x;0)gOp1 = fx : N x0 = x + 1gOp2 = fx; y : N j x0 2 fx; x + 2ggFin = idNThe program [1;2;1D denotesInit o9Op1 o9Op2 o9Op1 o9 Fin whi h isfx : N ; y : f2;4g (x; y)g.
rrrrr
rrrrr
rrrrr
rrrrr
rrrrr
rrrrr01234
01234
-
...Init
R
Op1
-AAAAAAAAAUOp2
RROp1
--Fin+ 14
+ +Denition 3 (Data renement)For data types A and C, C renes A (denotedA v C) i for ea h nite sequen e p over I,pC pA. 2Data renement is transitive and re exive, i.e.,it is a preorder.ExampleLet G = N , withA = (N ; idN ; fAOpg; idN )C = (N ; idN ; fCOpg; idN )AOp = fx; y : N j x < y (x; y)gCOp = fx : N (x; x + 1)gShow that for any sequen e p:pA = fx; y : N j x + #p y (x; y)g; whereaspC = fx : N (x; x + #p)gThus pC pA, and therefore C renes A.+ 15
+ +How to verify a renementSimulations are used to verify renements: they allow a step-by-step omparison ofoperations, instead of looking at the ee t of thewhole program.
AInitRCInit-AOp1-COp1
-AOp2-COp2
--
-AOpn-COpnAFinRCFinR R R R R
R links the abstra t and on rete state spa es.+ 16
27
+ +SimulationsHow to verify a renement by onsidering stepby step values.We need a relation R between the two sets ofstates AState and CState.Then we an onsider two types of step bystep omparisons: downwards simulation andupwards simulation.Fa ts: these two simulations are sound andjointly omplete.Every downwards or upwards simulation is avalid renement.Every valid renement an be proved by a ombination of downwards and upwards sim-ulations. In fa t every renement needs justone upwards simulation followed by a down-wards simulation.+ 17
+ +Two ways of making the diagram ommute:-AOp-COpR R -?
-AOp-COpR R -6
Denition 4 (Downward simulation)Given A = (AState;AInit; fAOpigi2I;AFin) andC = (CState;CInit; fCOpigi2I;CFin). A down-ward simulation is a relation R from AStateto CState satisfyingCInit AInit o9R (1)R o9CFin AFin (2)8 i : I R o9COpi AOpi o9R (3)If su h a simulation exists, C is alled a down-ward simulation of A. 2Downward simulations are also known as for-ward simulations.+ 18
+ +Denition 5 (Upward simulation)For data types A and C as above, an up-ward simulation is a relation T from CStateto AState su h thatCInit o9T AInit (4)CFin T o9AFin (5)8 i : I COpi o9T T o9AOpi (6)If su h a simulation exists, we also say that Cis an upward simulation of A. 2Another term for this is ba kward simulation.Exer ise:Show that if a relation T between CState andAState is total and fun tional, then T is anupward simulation between A and C if andonly if T1 is a downward simulation betweenA and C.+ 19
+ +Answer: Totality of T is en oded relation-ally as T o9T1 idCState, and fun tionality asT1 o9T idAState.Together these allow the proof of equivalen efor the orresponding upward and downwardsimulation onditions.E.g.,COpi o9T T o9AOpi)T1 o9COpi o9T o9T1 T1 o9T o9AOpi o9T1) f totality on lhs, fun tionality on rhs gT1 o9COpi AOpi o9T1)T o9T1 o9COpi o9T T o9AOpi o9T1 o9T) f totality on lhs, fun tionality on rhs gCOpi o9T T o9AOpi(The middle line is the ondition for T1 tobe a downward simulation, whi h both impliesand is implied by the top/bottom line.)+ 2028
+ +Theorem 1 (Horizontal omposition) For on-formal data types A and C as above, and ap-propriately typed relations R and T,(a) if (1) and (3) hold, then (1) holds forAInit := AInit o9AOpi and CInit := CInit o9COpi(b) if (3) holds, then it also holds for any se-quen e of two operations, i.e.,8 i; j : I R o9COpi o9COpj AOpi o9AOpj o9R( ) if (3) and (2) hold, then (2) holds forAFin := AOpi o9AFin and CFin := COpi o9CFin(d) if (4) and (6) hold, then (4) holds forAInit := AInit o9AOpi and CInit := CInit o9COpi(e) if (6) holds, then it also holds for any se-quen e of two operations, i.e.,8 i; j : I COpi o9COpj o9T T o9AOpi o9AOpj(f) if (6) and (5) hold, then (5) holds forAFin := AOpi o9AFin and CFin := COpi o9CFin+ 21
+ +Answer:(a) CInit o9COpi fby (1)gAInit o9R o9COpi fby (3)gAInit o9AOpi o9R(b) R o9COpi o9COpj fby (3)gAOpi o9R o9COpj fby (3)gAOpi o9COpj o9R+ 22
+ +( ) R o9COpi o9CFin fby (3)gAOpi o9R o9CFin fby (2)gAOpi o9AFinShow the following:Theorem 2 (Soundness of simulations) If anupward or downward simulation exists between onformal data types A and C, then C is adata renement of A.By indu tion on the ( omplete) programs, byproving a base ase, and using Theorem 1(a)/(d) as the indu tion step.+ 23
+ +(in)CompletenessHowever, neither downward simulation nor up-ward simulation is omplete on their own.Example of ADTs whi h are related by datarenement where no downward simulation ex-ists are as follows:Let G = 0::4, whi h a ts as the global stateand one of the lo al states; the other lo alstate is YS = f0;1;3;4g. DeneX = (G; Init; fXOp1;XOp2g; idG),Y = (YS; Init; fYOp1;YOp2; g; idYS), whereInit = fx : G (x;0)g;XOp1 = f(0;1); (0;2); (1;1); (2;2); (3;3); (4;4)g;XOp2 = f(0;0); (1;3); (2;4); (3;3); (4;4)g;YOp1 = f(0;1); (1;1); (3;3); (4;4)g;YOp2 = f(0;0); (1;3); (1;4); (3;3); (4;4)g:+ 24
29
+ +--0 -R
1 -32 -0 -1 -R344XOp1
YOp1XOp2YOp2Init
Init
A program here is a nite sequen e over thenumbers 1 and 2. The nalisation is the iden-tity, so the nal state is the only observableout ome of a program. Any program whi h does not in lude op-eration 1 (in luding the empty program)will end in state 0. Any program ontaining operation 1 butnot 2 after it will end in state 1 or 2 forX, and in state 1 for Y.+ 25
Any other program (i.e., ontaining at leastoperation 1 followed by 2 sometime later) ould end in either state 3 or 4 for bothX and Y.As the out omes for Y are always in luded inthose for X, data renement holds.
+ +Assume we have a downward simulation Rfrom G to YS.From the nalisation ondition (2) we getR idYS.From initialisation and renement for the rstoperation we then get that (1;1) 2 R.The renement ondition for the se ond op-eration then gives us:R o9YOp2 XOp2 o9R) f(1;1) 2 R; transitivity of gf(1;3); (1;4)g XOp2 o9Rf(1;3); (1;4)g f(1;3)g o9R) fo9g(3;4) 2 Rwhi h ontradi ts that R is ontained in theidentity relation.Thus, no su h R an exist.+ 26
+ +Exer ise:Show that it an be proved that f(0;0); (1;1);(1;2); (3;3); (4;4)g does onstitute an upwardsimulation in this ase.Exer ise:Constru t a similar example where the ab-stra t and on rete data type are swappedand f(1;2); (2;1)g added to both nalisationsto show a data renement where no upwardsimulation exists.Theorem 3 Upward and downward simula-tion are jointly omplete, i.e., any data re-nement an be proved by a ombination ofsimulations.+ 27
30
+ +PartialityNot all operations are total, the meaning ofan operation Op spe ied as a partial relationis: Op behaves as spe ied when used withinits pre ondition (domain); outside its pre ondition, anything may hap-pen.
We model this by totalising relations, i.e., addinga distinguished element ?, denoting undened-ness.Two ways to do this: ontra t vs behavioural.+ 28
+ +In the \ ontra t" approa h, the domain (pre- ondition) of an operation des ribes the areawithin whi h the operation should be guaran-teed to deliver a well-dened result, as spe i-ed by the relation.Outside that domain, the operation may beapplied, but may return any value, even an un-dened one (modelling, e.g., non-termination).In the \behavioural" approa h, operations maynot be applied outside their pre ondition; do-ing so anyway leads to an undened result.In either ase, in both approa hes the simu-lation rules for partial operations are derivedfrom those for total operations:partial relations on a set S are modelled as to-tal relations on a set S?, whi h is S extendedwith a distinguished value ? not in S.+ 29
+ +E.g., in the behavioural approa h, values out-side the domain are linked to ? only.
rrrr
rrrr0
12?
012?-
-HHHHHHHHHHHHHjHHHHHHHHHHHHHjj
Denition 6 (Totalisation)For a partial relation Op on State, its totalisa-tion is a total relation dOp on State?, denedin the \ ontra t" approa h to ADTs bydOp == Op [ fx; y : State? j x 62 domOp (x; y)gor in the behavioural approa h to ADTs bydOp == Op [ fx : State? j x 62 domOp (x;?)gTotalisations of initialisation and nalisationare dened analogously. 2+ 30
+ +
Denition 7 (Extension)A relation R between AState and CState isextended to a relation gR between AState? andCState?, dened in the ontra t approa h bygR == R [ (f?AStateg CState?)and in the behavioural approa h bygR == R [ f(?AState;?CState)g 2
+ 3131
+ +Extra ting the partialityThe simulation rules are dened in terms oftotalised relations. We an extra t the under-lying rules for the original operations.Thus our goal is to apply the simulation rulesto the totalised versions of these data types,and then to remove all o urren es of e, band ? in the rules.For initialisation we have:dCInit dAInit o9 gRCInit [ f(?G;?CState)g(AInit [ f(?G;?AState)g) o9 (R [ f(?AState;?CState)g)CInit [ f(?G;?CState)g AInit o9R [ f(?G;?CState)gCInit AInit o9R+ 32
+ +We use the following abbreviation:X6 == (domX )?For the operations we get the following:gR o9 dCOp dAOp o9 gR : : :R o9COp AOp o9R^(R o9 (COp6 f?CStateg)) (AOp6 f?CStateg)The se ond onjun t an be further simpli-ed. As the ranges of both relations are f?CStateg,only their domains are relevant. Removingalso the omplements, we getran(domAOpCR) domCOpFor nalisation, using analogous steps:gR o9 dCFin dAFinR o9CFin AFin^ran(domAFinCR) domCFin+ 33
+ +Denition 8Let A = (AState;AInit; fAOpigi2I;AFin) and C =(CState;CInit; fCOpigi2I;CFin) be data typeswhere the operations may be partial.A downward simulation is a relation R fromAState to CState satisfying, in the ontra tinterpretationCInit AInit o9RR o9CFin AFinran(domAFinCR) domCFin8 i : I ran(domAOpi CR) domCOpi8 i : I (domAOpi CR) o9COpi AOpi o9RThe ve onditions are ommonly referred toas initialisation, nalisation, nalisation ap-pli ability, appli ability and orre tness. Inthe behavioural interpretation, orre tness isstrengthened to:8 i : I R o9COpi AOpi o9R+ 34
+ +Upward SimulationsdCInit o9 gT dAInit simplies to CInit o9T AInit.For operations, we get:dCOp o9 gT gT o9 dAOp : : :COp o9T T o9AOp^domCOp dom(TB domAOp)For nalisation, as with downward simulation,we obtain an appli ability ondition ompara-ble to that for operations8 : CState (j T j) domAFin) 2 domCFinplus the \unde orated" version of the original onditionCFin T o9AFin+ 35
32
+ +Denition 9 (Upward simulation)Let A = (AState;AInit; fAOpigi2I;AFin) and C =(CState;CInit; fCOpigi2I;CFin) be data typeswhere the operations may be partial.An upward simulation is a relation T fromCState to AState satisfying, in the ontra tinterpretationCInit o9T AInitCFin T o9AFin8 : CState (j T j) domAFin) 2 domCFin8 i : I domCOpi dom(TB domAOpi)8 i : I dom(TB domAOpi)CCOpi o9T T o9AOpiIn the behavioural interpretation, orre tnessis strengthened to:8 i : I COpi o9T T o9AOpiTheorem 4 (Upward simulations are total)When the on rete nalisation is total, theupward simulation T from CState to AStateis total on CState.+ 36
+ +Transforming into ZThese rules an be written in the Z s hema al ulus, where they be ome: 8CState 0 CInit ) 9AState 0 AInit ^R 0 8AState; CState preAOp ^R =) preCOp 8AState; CState; CState 0 preAOp^R^COp =) 9AState 0 R 0^AOp
These are the three onditions you need toprove to verify a renement. You have toprove the 2nd and 3rd onditions for all oper-ations.Finalisation has disappeared be ause outputappears at ea h operation step, rather thanwaiting to the end.We now explore these issues.+ 37
+ +Renement in ZTo derive simulation rules in Z, interpretinitialisation, operations et as appropriaterelations:Init pi ks a suitable initial state and opiesover the sequen e of inputs from the globalstate. Opi onsumes an input, produ es anoutput and the state is transformed a ordingto the operation:Init is (is ;os) 7! (is ; hi; State 0)Opi is (h?Opiia is;os; State) 7!(is ;os a h!Opii; State 0)Finalisation just makes all outputs visible:Fin is (is ;os ; State) 7! (hi;os)Given this embedding, we an translate thedownward and upward simulation onditionsinto the Z s hema al ulus.+ 38
+ +Example - without input or output.The standard Z ADT (B; Init; fOn;O g) whereBb : BInitB 0b0
OnB:b ^ b0OBb ^ :b0is interpreted as the relational data type(B; Init; fOn;Og;Fin) whereB == fhj b == true ji; hj b == false jigInit == f 7! hj b == true jigOn == fhj b == false ji 7! hj b == true jigO == fhj b == true ji 7! hj b == false jigFin == fhj b == true ji 7! ; hj b == false ji 7! g+ 39
33
+ +A retrieve relation R between AState and CStatemust be embedded in the relational settingsimilarly to how we embedded operations:R == fR AState 7! CStategThe retrieve relation R between B in and N d=[ x : f0; 1g given byRB; Nb = (x = 1)is represented by the relationR == fhj b == true ji 7! hj x == 1 ji;hj b == false ji 7! hj x == 0 jig+ 40
+ +Deriving Downward Simulation in ZGiven the embedding above, we an translatethe relational renement onditions of simu-lations into renement onditions for Z.Initialisation:CInit AInit o9R f denition of g8g; 0 (g; 0) 2 CInit) (g; 0) 2 AInit o9R f denition of o9 g8g; 0 (g; 0) 2 CInit) 9a0 (g;a0) 2 AInit ^ (a0; 0) 2 R f interpretation of Init and R 0; g = g8 0 0 2 fCInit CState 0g )9a0 a0 2 fAInit AState 0g^ (a0; 0) 2 fR 0 AState 0 7! CState 0g f use s hema quanti ation g8CState 0 CInit ) 9AState 0 AInit ^R 0+ 41
+ +For nalisation:R o9CFin AFin f denition of g8g;a (a;g) 2 R o9CFin) (a;g) 2 AFin f denition of AFin g8g;a (a;g) 2 R o9CFin) (a 2 AState ^ g = ) f ranCFin = fg, domR AState gtrueandran(domAFinCR) domCFin f domCFin = CState gtrue+ 42
+ +Appli ability:ran(domAOpi CR) domCOpi8CState; AState R ^ preAOpi ) preCOpiCorre tness:(domAOpi CR) o9COpi AOpi o9R8AState; CState; CState 0 R ^ preAOpi ^COpi) 9AState 0 AOpi ^R 0Together, these onditions make up the rulesfor downward simulation for Z s hemas in sys-tems without input or output.+ 43
34
+ +The relation R on AState^CState is a down-ward simulation from A to C if8CState 0 CInit ) 9AState 0 AInit ^R 0and for all i 2 I :8AState; CState preAOpi ^R ) preCOpi8AState; CState; CState 0 preAOpi ^R ^COpi) 9AState 0 R 0 ^AOpiIn the behavioural interpretation, the rule for orre tness be omes8AState; CState; CState 0 R ^COpi ) 9AState 0 R 0 ^AOpiWhen this behavioural orre tness onditionholds, the appli ability ondition above is equiv-alent to8AState; CState R ) (preAOpi , preCOpi)+ 44
+ +Deriving Upward SimulationIn a similar fashion:CInit o9T AInit8AState 0; CState 0 CInit ^T 0 ) AInitFinalisation produ es an important ondition:CFin T o9AFin8CState 9AState TAppli ability gives:domCOpi dom(TB domAOpi)8CState (8AState T ) preAOpi)) preCOpi+ 45
+ +For orre tness, we have:dom(TB domAOpi)CCOpi o9T T o9AOpi8AState 0; CState; CState 0 (8AState T ) preAOpi)) (COpi ^T 0 ) 9AState T ^AOpi)Together these be ome:The relation T on AState ^CState is an up-ward simulation from A to C if8CState 9AState T8AState 0; CState 0 CInit ^T 0 ) AInitand for all i 2 I :8CState (8AState T ) preAOpi)) preCOpi8AState 0; CState; CState 0 (8AState T ) preAOpi)) (COpi ^T 0 ) 9AState T ^AOpi)+ 46
+ +Under the assumption of totality of T , theappli ability ondition an be written8CState 9AState T ^ (preAOpi ) preCOpi)In the behavioural interpretation, the rule for orre tness be omes8AState 0; CState; CState 0 (COpi ^T 0)) 9AState T ^AOpiDownward and upward simulations allow thesame sort of hanges in a renement: pre on-ditions an be weakened and non-determinismin post onditions resolved.But ... downward simulations do not allowpostponement of non-deterministi hoi e.+ 47
35
+ +In a downward simulation a on rete programis simulated starting in the initial state, andea h on rete step is then mat hed by an ab-stra t one. They are sometimes alled for-ward simulations.In an upward simulation an arbitrary point in a on rete program is pi ked and the simulationworks ba kwards to see if it ould be simu-lated from some abstra t initialisation. Theyare sometimes alled ba kward simulations.This also explains why upward simulations needto be total.Totality is needed be ause the upward simu-lation begins at an arbitrary point in the on- rete program, and we need to be sure thatfrom any su h point we an simulate ba k-wards.Be ause downward simulations begin at theinitialisation totality is not ne essary for theirretrieve relations.+ 48
+ +Embedding Inputs and OutputsHow to apply to operations with input andoutput?Op-State -State 0??Op 6!Op Op-State -State 0? 6 -!Op-?Op
Add input and output information to the globaland lo al state:G == seq Input seqOutputState == seq Input seqOutput StateInit pi ks a suitable initial state and opiesover the sequen e of inputs from the globalstate.Init is (is ;os) 7! (is ; hi; State 0)+ 49
+ +Finalisation just makes all outputs visible:Fin is (is ;os ; State) 7! (hi;os)Opi onsumes an input, produ es an outputand the state is transformed a ording to theoperation:Opi is (h?Opiia is;os; State) 7!(is ;os a h!Opii; State 0)
Op-State -State 0? 6 -!Op-?Op append -hdtl-seq Input -seqOutput-
+ 50
+ +We an now derive the simulation rules again,the result is essentially the same set of rulesex ept that we have to quantify over inputsand outputs.The given nalisation is total, so the appli a-bility ondition for nalisation holds. We alsohave:R o9CF AF f denition of g8 is ;os ;a; is 0;os 0 ((is ;os ;a); (is 0;os 0)) 2 R o9CF)((is ;os ;a); (is 0;os 0)) 2 AF f g8 is ;os ;a ((is ;os ;a); (hi;os) 2 R o9CF)((is ;os ;a); (hi;os) 2 AF( f predi ate al ulus g8 is ;os ;a ((is ;os ;a); (hi;os) 2 AF f denition of AF gtrue+ 51
36
+ +
Downward simulations - Operation rene-mentWhen the retrieve relation is the identity, e.g.,when we use the same state spa e in abstra tand on rete, the rules are simplied: 8State 0 CInit ) AInit 8State preAOp =) preCOp 8State; State 0 preAOp ^COp =) AOp
+ 52
+ +Examples1. Initialisation onditionTimeHMhrs : 0::23mins : 0::59TimeHMInitTimeHM0 CTimeHMInitTimeHM0hrs 0 = 0 ^mins 0 = 0Then (TimeHM, CTimeHMInit) is a rene-ment of (TimeHM, CTimeHMInit).We need to show that:8TimeHM0 TimeHMInit ) TimeHMInit8hrs 0 : 0::23; mins 0 : 0::59 hrs 0 = 0 ^mins 0 = 0) true+ 53
+ +2. Redu ing non-determinism in after-stateStatex : NAOpStatex 0 2 f0; 1g COpStatex 0 2 f0gWe need to show that:8State preAOp =) preCOp8State; State 0 preAOp ^COp =) AOplatter is (why?):8 x ; x 0 x 0 2 f0g =) x 0 2 f0; 1g+ 54
+ +3. Redu ing non-determinism in outputStatex : N InitState 0x 0 = 1AOpStaten! : Nn! 2 f0; 1g
COpStaten! : Nn! 2 f0gWe need to show that (+ initialisation ondi-tion):8State preAOp =) preCOp8State; State 0 preAOp ^COp =) AOplatter is:8 x ; x 0; n! n! 2 f0g =) n! 2 f0; 1g+ 55
37
+ +4. Widening the pre- onditionStatex : N InitState 0x 0 = 1AOpStaten! : Nx = 1 ^ n! 2 f0; 1g
COpStaten! : N(x = 1 ^ n! 2 f0g)_(x = 2 ^ n! = 2)We need to show that (+ initialisation ondi-tion):8State preAOp =) preCOp8State; State 0 preAOp ^COp =) AOpWhat is preAOp and preCOp?+ 56
+ +Data renement1. Changing variable namesAStatex : N AInitAState 0x 0 = 1AOpAStaten! : Nx = 1 ^ n! 2 f0; 1gRenement is:CStatey : N CInitCState 0y 0 = 1COpCStaten! : Ny = 1 ^ n! 2 f0; 1g+ 57
+ +Retrieve relation:RAStateCState: : :Conditions are: 8CState 0 CInit ) 9AState 0 AInit ^R 0 8AState; CState preAOp ^R =) preCOp 8AState; CState; CState 0 preAOp^R^COp =) 9AState 0 R 0^AOp
+ 58
+ +2. Wat h exampleTimeHMhrs : 0::23mins : 0::59 TimeHMInitTimeHM0
ShowTimeTimeHMhrs ! : 0::23mins ! : 0::59hrs = hrs !mins = mins !ResetTimeTimeHMhrs? : 0::23mins? : 0::59hrs 0 = hrs?mins 0 = mins?
Rene this to:CTimeHMtime : N N CTimeHMInitCTimeHM0time 0 = (0; 0)+ 59
38
+ +CShowTimeCTimeHMhrs ! : 0::23mins ! : 0::59time:1 = hrs !time:2 = mins !CResetTimeCTimeHMhrs? : 0::23mins? : 0::59time 0 = (hrs?;mins?)
Retrieve relation:RTimeHMCTimeHM: : :8CTimeHM0 CTimeHMInit )9TimeHM0 TimeHMInit ^R 08TimeHM; CTimeHM preShowTime ^R =) preCShowTime8TimeHM; CTimeHM; CTimeHM0 preShowTime ^R ^CShowTime =)9TimeHM0 R 0 ^ ShowTimeet + 60
+ +3. Changing sets into sequen es[PersonAStated : P Person#d Max AInitAState 0d 0 = ?AEnterAStatep? : Person#d < Maxp? 62 dd 0 = d [ fp?g
ALeaveAStatep? : Personp? 2 dd 0 = d n fp?gRenement uses sequen es instead of sets tore ord the people in the lass:CStatel : iseqPerson#l Max CInitCState 0l 0 = h i+ 61
+ +
CEnterCStatep? : Person#l < Maxp? 62 ran ll 0 = l a hp?iCLeaveCStatep? : Personp? 2 ran lran l 0 = ran l n fp?g
What is R?What are the onditions we have to prove?
+ 62
+ +ExampleThe abstra t spe i ation evaluates the meanof a set of real numbers in a bag.AStateb : bag R AInitAState 0b0 = [[ EnterAAStater? : Rb0 = b [[r?
MeanAAStatem! : Rb 6= [[ ^m! = (Pb)=#bThe on rete spe i ation only maintains arunning sum and a ount of the items in thebag.CStates : Rn : N CInitCState 0s 0 = 0 ^ n0 = 0+ 63
39
+ +
EnterCCStater? : Rs 0 = s + r?n0 = n + 1MeanCCStatem! : Rn 6= 0 ^m! = s=n
The required retrieve relation isRAStateCStates = Pb ^ n = #b
+ 64
+ +
Unifying Con urrent and Relational Re-nementWhy is a pro ess algebra blessed with amultitude of renement relations, whereasa language like Z only has one notion ofrenement?How an one use Z to spe ify on urrentsystems?What is the dieren e between failures-divergen es renement and aninput/output model?+ 65
+ +Other approa hes to renementIn pro ess algebras there are a range of rene-ment relations, ea h with dierent strengths.These in lude tra e and failure-divergen e re-nement, plus equivalen es su h as weak andstrong bisimulation.Tra e renementTra e renement he ks that safety proper-ties are preserved.These are hara terised by saying 'nothingbad happens'.If nothing bad happens in the abstra t spe -i ation, then nothing bad should happen ina renement.This is a hieved by asking for tra e subset-ting.+ 66
+ +A tra e is a sequen e of events that an hap-pen in the pro ess.E.g., for P = a; b; stop the following are allvalid tra es of P:; hai; ha;biWe normally write ha;bi as ab.The set of tra es of a spe i ation (or pro- ess) P is denoted Tra es(P).Tra e renement is dened by saying P0 isrened by P1 (written P0 vtr P1) whenever:Tra es(P1) Tra es(P0)Examples:a; b; stop vtr a; stopa; b; stop vtr stop+ 67
40
+ +But:a; b; ; stop 6vtr a; ; stopa; b; ; stop 6vtr a; b; ; d ; stopTra e renement fails to distinguish betweenpro esses that we would naturally think of asdierent (te hni ally - be able to onstru ttests that distinguish them).For example, we an't distinguish betweena; (b; stop[ ; stop)and(a; b; stop)[(a; ; stop)Failures re ord more information. A failure isa pair (tr ;X ) where tr is a tra e of the pro ess,and X is a refusal set.A refusal set is a re ord of events that thepro ess would refuse after that tra e.+ 68
+ +Failures(P) is the set of all failures of the pro- ess P.E.g., for P = a; b; stop the following are fail-ures of P:(; fbg); (a; fag); (ab; fa;bg)Failures renement asks for subsetting of fail-ure sets:P1 is a failures renement of P0 if:Failures(P1) Failures(P0)We an now distinguish betweena; (b; stop[ ; stop)and(a; b; stop)[(a; ; stop)Why? Cal ulate their failures.+ 69
+ +Failures-divergen es renementThe tra es of events are re orded as opposedto an input/output relation.For example, in failures-divergen es renementa pro ess is modelled by the triple (A;F ;D)where A is its alphabet, F is its failures andD is its divergen es.The failures of a pro ess are pairs (t;X ) wheret is a nite sequen e of events that thepro ess may undergo and X is a set of eventsthe pro ess may refuse to perform afterundergoing t.A pro ess Q is a renement of a pro ess P iffailures Q failures Pdivergen es Q divergen es P+ 70
+ +Dieren esRelational renement is only on erned withthe relation between input and output, sin ethat is all that is observed in the global state.In a pro ess algebra the event names havean importan e not attributed to them in therelational setting.Relational renement looks at redu tion ofnon-determinism visible in the global state asgiven by programs.Failures-divergen es renement is not just on erned with tra es but also with refusalsand divergen es.The relationship between these two views isnot immediately obvious. f. Work of Bolton and Davies shows thatfailures-divergen es renement is not the sameas relational renement as in Z.+ 7141
+ +Adding refusals to relational renementThe basi observations the relational modelmakes are thus very weak: make more observations, the only way we an do this is to in reasethe expressitivity of the nalisation.
Generalise nalisation from being(is ;os ; State) 7! (hi;os)to be oming(is ;os ; State) 7! (hi;os ;E)What goes in E depends on what we want toobserve.+ 72
+ +Example - no input or outputBb : BInitB 0b0
OnB:b ^ b0OBb ^ :b0Make E refusals, nalisation hanges fromFin == f hj b == true ji 7! ; : : :gtoFin == f hj b == true ji 7! fOng;hj b == true ji 7! ?;hj b == false ji 7! fOffg;hj b == false ji 7! ?g+ 73
+ +Simulation rules - no input or output1. Downward simulationR o9CFin AFinbe omes8R (fi : I j :preCOpig fi : I j :preAOpig)This pla es no extra onditions on adownward simulation.2. Upward simulationCFin T o9AFinbe omes8CState 9AState T^(fi : I j :preCOpig fi : I j :preAOpig)This is,8CState 9AState 8 i : I : : :instead of8 i : I 8CState 9AState : : :+ 74
+ +NotesWe have extended our observations beyonda eptan e of tra es and now re ord refusals.This appears in the simulation rules via thequanti ation over i that o urs within thes ope of the quanti ation over AState andCState.Although we began by embedding refusals in analisation, the onditions an be unwound tobe expressed in terms of the s hema al ulusdire tly.The onditions extra ted from this nalisationrequirement work with both the blo king andthe non-blo king model of pre onditions.+ 75
42
+ +The orresponden e withfailures-divergen es renementThis relational renement orresponds in somesense to failures-divergen es renement.In some sense means it is modulo anen oding of the spe i ation as a set of events,however, this en oding is natural andun ontroversial.Theorem 5 In the blo king model, relationalrenement with extended nalisations orresponds to failures-divergen es renement.In the non-blo king model the en oding isslightly dierent, e.g., there are divergen es,but no refusals beyond those after adivergen e.Theorem 6 In the non-blo king model, rela-tional renement with extended nalisations orresponds to failures-divergen es renement.+ 76
+ +Dealing with input and output (blo kingmodel) Des ribe the orre t orrespondingpro ess and its failures and divergen es, Dene the nalisation, Prove that relational renement is the sameas failures-divergen es renement, and Extra t simulation rules from the relationalrenement, expressing them in the s hema al ulus.
+ 77
+ +Refusals of an event with output: Demoni - the environment annotin uen e the output, and there arerefusals due to a parti ular output being hosen, or Angeli - the environment an in uen ethe output, and there are no su h refusals.
Finalisation in ludes these refusals.+ 78
+ +The simulation rules1. Downward simulation in the demoni modelTheorem 7 The ondition R o9CFin AFin inthe demoni model is subsumed by the normalappli ability and orre tness rules.2. Upward simulation in the demoni modelExample 1A and C are not failures-divergen es equiva-lent.A has failure (hBi; fTVF ;ESFg) whi h is notpresent in CTo re over failures-divergen es renement inthe blo king model one needs to add the strength-ened appli ability ondition:8CState 9AState 8 i : I T ^ (preAOpi ) preCOpi)+ 7943
+ +
Example 2This example shows that we need an addi-tional ondition on refusal sets due to outputsas well.Now the strengthened appli ability onditionholds- ea h state simple, luxury , tv and ensuitehave operations HasES and HasTV enabled -so this does not pi k up the dierent refusalinformation due to the outputs.+ 80
+ +Simulation rulesBased on maximal refusal sets.Sim = (I Input) 7!OutputE : Sim represents:domE disabled;domE enabled, outputs in E hosenen oded as Maxref (E ;State)The nalisation ondition is:8CState; E : Sim Maxref (E ;CState)) 9AState; E 0 E T ^MaxRef (E 0;AState)Simpler for the angeli model of outputs.+ 81
+ +Downward simulations - summaryOutputs: none Demoni Angeli Init InitApp App -Corr CorrBlo kFin - FinAngInit 8CState 0 CInit ) 9AState 0 AInit ^R 0App 8R; i : I ; Input preAOpi ) preCOpiCorrBlo k 8 i : I ; Input ; Output ; R; CState 0 COpi ) 9AState 0 R 0 ^AOpiFinAng 8R; i : I ; Input ; Output Pre AOpi ) Pre COpiwhere in angeli rules we alter the denitionof preOp to in lude existential quanti ationof the after state only, i.e.,Pre Op d= 9State 0 Op.+ 82
+ +Upward simulations - summaryOutputs: none Demoni Angeli Init InitApp -Corr CorrBlo kFin FinRef FinDem FinAngInit 8T 0 CInit ) AInitCorrBlo k 8 i : I ; Input ; Output ; T 0; CState COpi ) 9AState T ^AOpiFinRef 8CState 9AState T^8 i : I ; Input preAOpi ) preCOpiFinDem 8CState; E : Sim Maxref (E ;CState)) : : :FinAng 8CState 9AState T^8 Input ; Output ; i : I Pre AOpi ) Pre COpi+ 83
44
Relations for Specifying the Invariant Behaviorof Object Collaborations
Stephanie Balzer
ETH Zurich (Swiss Federal Institute of Technology)Department of Computer Science
CH-8092 Zurich, Switzerlandstephanie.balzer@inf.ethz.ch
Abstract. The missing first-class support of object collaborations inclass-based object-oriented programming languages is increasingly criti-cized as it results in distributing the information about such collabora-tions across multiple classes. In response, the introduction of first-classrelationships is proposed. Relationships are the programming languageabstractions that encapsulate the collaborations that emerge from theinteracting objects. With first-class support, relationships exist in addi-tion to classes and can — like classes — define their own members, suchas attributes and methods. Our work enriches the concept of first-classrelationships with the notion of structural invariants. Structural invari-ants specify the invariant behavior of object collaborations. They restrictthe participation of objects in relationships and are expressed in termsof mathematical relations.
1 Introduction
Common class-based object-oriented programming languages do not provide thenecessary abstractions to reflect object collaborations. Object collaborations areimplemented using (unidirectional) references. This approximation results in theloss of a global view as the information about a given collaboration may bedistributed across multiple classes [1]. In response, numerous authors proposeto preserve collaborations from the design to the implementation stage [2–4, 1,5]. Whereas Noble and Grundy [4] stay within the limits of the programminglanguage and represent collaborations explicitly using separate classes, Rum-baugh [2], Albano et al. [3], and Bierman and Wren [1] go further and extendthe programming language to include relationships, the abstractions necessaryto encapsulate these object collaborations. Relationships together with classesthen constitute the first-class notions of the programming language. Like classes,relationships can also declare attributes and methods.
Our work relies on the foundations of previous work on first-class relation-ships. However, we significantly differ from existing approaches in that we includeinvariants to allow reasoning about programs with classes and relationships. Theapplication of invariants to class-based object-oriented programming and spec-ification languages [6–10] has already proved viable to express the consistency
conditions of the instances of a class. We want to exploit the benefits of in-variants also to specify the invariant behavior of object collaborations. We thusintroduce the concepts of value-based and structural invariants [11]. Unlike tra-ditional class-based invariants, relationship invariants are specified on the collab-orating classes. Due to a shortage of space, we only discuss structural invariantsin this paper.
An important contribution of our work is the observation that structuralinvariants can be expressed by means of mathematical relations. Using relations,we have the full mathematical expressiveness at our disposal when restrictingrelationship participation. The mathematical basis further allows us to reasonon the interdependences between structural invariants and any operations thatchange relationship participation.
The remainder of this paper is structured as follows: Section 2 provides a shortintroduction to the modeling of object collaborations. Section 3 discusses theconcept of structural invariants and shows their application to the specificationof object collaborations. Section 4 describes future work and Section 5 concludesthis paper.
2 Example
Figure 1 depicts an Entity-Relationship (ER) diagram [12] modeling parts of aperson information system, which serves as the running example of this paper.The example illustrates the different collaborations a person can take part in. Forexample, a person can be a writer and thus become the author of books. Addi-tionally (or alternatively) a person can be a member of a golf club. Figure 1 alsodisplays the cardinality and participation constraints [13] of the relationships. Inthe case of the author relationship, for example, these constraints specify thatevery book needs to have at least one author.
KOOB
BULC_FLOG LATIPSOH
NOSREP TNEITAP
ROHTUA
REBMEM
)n ,0(
)n ,1(
)n ,0()n ,0(
)n ,1()n ,1(
EGAIRRAM
)1 ,0()1 ,0(
Fig. 1. Person Information System (ER)
Modeling the person information system (see Figure 1) using first-class re-lationships results in the classes Person, Book, GolfClub, and Hospital and therelationships Author, Member, Patient, and Marriage.
46
3 Structural Invariants
Structural invariants restrict the participation of objects in relationships basedon the occurrence of objects. A possible restriction is, for example, to requirethat a particular object participates with at most one other object in a specificrelationship. We use mathematical relations1 to express structural invariants.Using relations, we have the full mathematical expressiveness and rigor at ourdisposal for defining participation restriction. The mathematical basis of ourwork is also the distinguishing feature that separates structural invariants fromrelated concepts, such as the cardinality and participation constraints of rela-tional databases [13] and the multiplicities as proposed by Bierman and Wren [1].
Applying structural invariants to the person information system results insurjective relations for Author, Member, and Patient and a symmetric, irreflexivepartial injection for Marriage.
Figure 2 illustrates the concepts introduced so far on the basis of the Author
relationship, using a Java-like notation. The relationship has the participantclasses Person and Book. We use role names to denote the role of a participantin a relationship. For instance, a person plays the role of a writer, and a bookthe one of the author’s work. Roles are particularly helpful when a relationshipinvolves instances of the same class. The relationship further declares the at-tribute submissionDate, which records the date the manuscript was submitted.The structural invariant of the Author relationship is introduced by the keywordinvariant and specifies a surjective relation.
relationship Author
participants(Person writer, Book work);
//structural invariant
invariant
surjectiveRelation(writer, work)
//attribute of relationship Author
Date submissionDate;
Fig. 2. Relationship Author
An illustration of the structural invariant of the Author relationship is givenin Figure 3. The figure depicts several illustration forms: mathematical relations
1 To clarify the terminology, note that we use the term relationship to refer to theabstraction that encapsulates object collaborations and use the mathematical termrelation to denote the set of participant pairs of relationships.
47
in the upper right corner, and a VEN diagram-like representation of relationsin the lower right corner. If expressible in terms of cardinality and participationconstraints, the respective ER diagram representation is provided additionally.Especially the VEN diagram-like representation nicely illustrates the surjectivityof the relation: every book is connected to a person at least through one line,but not every person is connected to a book.
12
Mathematical Relations
PERSON
BOOK
AUTHOR
(1, n)
(0, n)
AUTHOR: PERSON BOOK
PERSON BOOK
1
n
0
n
surjective relation
Fig. 3. Illustrations of Structural Invariants
4 Future Work
Structural invariants clearly must hold over the entire lifespan of relationships.Any programming language together with its supportive system implementingthe concepts introduced in this paper thus has to provide means, preferablystatic ones, to maintain those invariants.
Before starting out implementing a particular invariant monitoring mecha-nism, we specify the semantics of structural invariants. Our current work thusinvolves the modeling of the interdependences between structural invariants andany operations that change relationship participation. We use Event-B [14] forthis purpose, a methodology to model software systems based on discrete math-ematics and refinement. The resulting model will define the semantics of struc-tural invariants by indicating the invariant-maintaining actions for every kind ofrelation and operation applied.
5 Concluding Remarks
We have presented in this paper our ongoing work on the specification of ob-ject collaborations. The approach we describe relies on the concept of first-classrelationships, the programming language abstraction to encapsulate the collab-orations that emerge from the interacting instances of classes. The main contri-bution of our work is to include structural invariants to allow the specification
48
of the invariant behavior of object collaborations. Structural invariants are ex-pressed in terms of mathematical relations, which in turn facilitate the definitionof the semantics of structural invariants.
References
1. Bierman, G.M., Wren, A.: First-class relationships in an object-oriented language.In Black, A.P., ed.: ECOOP. Volume 3586 of Lecture Notes in Computer Science.,Springer-Verlag GmbH (2005) 262–286
2. Rumbaugh, J.: Relations as semantic constructs in an object-oriented language. In:OOPSLA ’87: Conference proceedings on Object-oriented programming systems,languages and applications, New York, NY, USA, ACM Press (1987) 466–481
3. Albano, A., Ghelli, G., Orsini, R.: A relationship mechanism for a strongly typedobject-oriented database programming language. In: VLDB. (1991) 565–575
4. Noble, J., Grundy, J.: Explicit relationships in object-oriented development. InMeyer, B., ed.: TOOLS’95: Conference proceedings on the Technology of Object-Oriented Languages and Systems, Prentice-Hall (1995) 211–226
5. Thomas, D.A.: On the next move in programming. Journal of Object Technology5 (2006) 7–11
6. Meyer, B.: Object-Oriented Software Construction. Second edn. Prentice HallProfessional Technical Reference (1997)
7. Meyer, B.: Eiffel: The Language. Prentice Hall Professional Technical Reference(1991)
8. Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: Anoverview. In Barthe, G., Burdy, L., Huisman, M., Lanet, J.L., Muntean, T., eds.:Construction and Analysis of Safe, Secure, and Interoperable Smart Devices: In-ternational Workshop, CASSIS 2004. Volume 3362 of Lecture Notes in ComputerScience., Springer-Verlag GmbH (2005) 49–69
9. Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: A behavioralinterface specification language for java. Technical Report 98-06-rev29, Iowa StateUniversity (2006)
10. Burdy, L., Cheon, Y., Cok, D.R., Ernst, M.D., Kiniry, J.R., Leavens, G.T., Leino,K.R.M., Poll, E.: An overview of jml tools and applications. STTT’05: Interna-tional Journal on Software Tools for Technology Transfer 7 (2005) 212–232
11. Balzer, S., Eugster, P., Gross, T.R.: Value-based and structural invariants forobject relationships. Technical report, ETH Zurich (2006)
12. Chen, P.P.: The entity-relationship model - toward a unified view of data. ACMTrans. Database Syst. 1 (1976) 9–36
13. Elmasri, R., Navathe, S.B.: Fundamentals of Database Systems, 2nd Edition.Second edn. Benjamin/Cummings (1994)
14. Abrial, J.R.: The B-Book: Assigning Programs to Meanings. Cambridge UniversityPress (1996)
49
RelAPS: A Proof System for RelationalCategories
Joel Glanfield and Michael Winter?
Department of Computer Science,Brock University,
St. Catharines, Ontario, Canada, L2S 3A1jg00de|mwinter@brocku.ca
Abstract. This paper provides a short introduction to the RelAPS sys-tem – an interactive system assisting in proving relation-algebraic theo-rems.
1 Introduction
In the past thirty years relational methods have become of fundamental impor-tance in computer science. Especially, theories of relations based on categorytheory are used as a tool to describe programs and their behavior. Therefore,proving relation-algebraic theorems has become a part of certain areas of com-puter science. These proofs usually follow a specific style, e.g., they might bebased on chains of inclusions. Since theorem-proving by hand can be rathererror-prone and tedious we developed a system that would aid in the imita-tion of typical relation-algebraic proofs while eliminating some of the negativeaspects.
The aim of the RelAPS system is to provide a graphical environment where auser may prove various theorems, within the context of the category of relations,as if the proof were being done by hand [4]. It should be noted that automatictheorem-proving is not a goal of the system, i.e., RelAPS is not a theorem-prover.
Contrary to the RALF system [5, 6] RelAPS is text-based and does not usea tree representation of the corresponding formula/term object. It should bementioned that RelAPS focuses on a subset of the formulae, and is, therefore,not as general as RALF. However, future extensions of RelAPS aim in a differentdirection (see Section 5), which motivates this restriction.
2 Relational Preliminaries
Throughout this paper, we use the following notation. To indicate that a mor-phism R of a category R has source A and target B we write R : A → B. The
? The author gratefully acknowledges support from the Natural Sciences and Engi-neering Research Council of Canada.
collection of all morphisms R : A → B is denoted by R[A,B] and the compo-sition of a morphism R : A → B followed by a morphism S : B → C by R;S.Last but not least, the identity morphism on A is denoted by IA.
We recall briefly the notion of a Schroder category introduced in [7]. Similarapproaches were taken in [2, 8, 9]. Within the numerous equivalent definitions ofSchroder categories we have chosen the following axiomatization:
Definition 1. A Schroder category R is a category satisfying the following:
1. For all objects A and B the collection R[A,B] is a Boolean algebra. Meet,join, negation, least and greatest element and the induced ordering are de-noted by u,t, , ⊥⊥AB , >>AB and v, respectively. The morphisms are alsocalled relations.
2. There is a unary operation ` (called converse) mapping a relation R : A→B to a relation R` : B → A.
3. For all relations Q : A → B,R : B → C and S : A → C the modular lawQ;R u S v Q; (R uQ`;S) holds.
4. There is a binary operation \ (called right residual) defined by Q;R v S ⇐⇒R v Q\S for all Q : A→ B, R : B → C and S : A→ C.
Notice, that we may define an operation / (called left residual) by S/R =(R`\S`)`. This operation is characterized by Q;R v S ⇐⇒ Q v S/R for allQ : A→ B, R : B → C and S : A→ C. However, both residuals can be definedin terms of the other operations, i.e., we have S/R = S;R` and Q\S = Q`;S.
The RelAPS system uses a formal language introduced in [10]. The languageis based on two kinds of entities - objects and relations. Relational variables aretyped by object variables, and consequently, there are quantifiers for each kindof variable. For details we refer to [10].
Since the system is currently limited to the use of ASCII characters, it wasnecessary to develop a grammar (using ASCII characters) that would representthe language described in [10]. For example, the user may wish to enter formulaerequiring the use of any of the symbols mentioned in Definition 1, but alternaterepresentations would be required within this environment. Table 1 displays thetranslation of the necessary symbols into related ASCII character-tokens.
Expanding all definitions used we finally end up with the following set ofaxioms provided in the language of RelAPS:
(A1) forall a forall b forall Q:a->b forall R:a->b forall S:a->b(Q&R)&S=Q&(R&S)
(A2) forall a forall b forall Q:a->b forall R:a->b forall S:a->b(Q|R)|S=Q|(R|S)
(A3) forall a forall b forall Q:a->b forall R:a->b Q&R=R&Q(A4) forall a forall b forall Q:a->b forall R:a->b Q|R=R|Q(A5) forall a forall b forall Q:a->b forall R:a->b Q|(Q&R)=Q(A6) forall a forall b forall Q:a->b forall R:a->b Q&(Q|R)=Q(A7) forall a forall b forall Q:a->b forall R:a->b
Q<=R <=> Q&R=Q
51
Table 1. RelAPS Tokens
Token ASCII
∀ forall
∃ exists
u &
t |−
⊥⊥ ab Oab
>> ab Lab
Ia Ia
v <=` ˆ
; ;
\ \⇐⇒ <=>
=⇒ =>
R : A → B R:A->B
(A8) forall a forall b forall Q:a->b forall R:a->b forall S:a->bQ&(R|S)=(Q&R)|(Q&S)
(A9) forall a forall b forall Q:a->b Q&Oab = Oab(A10) forall a forall b forall Q:a->b Q|Oab = Q(A11) forall a forall b forall Q:a->b Q&Lab = Q(A12) forall a forall b forall Q:a->b Q|Lab = Lab(A13) forall a forall b forall Q:a->b Q&-Q = Oab(A14) forall a forall b forall Q:a->b Q|-Q = Lab(A15) forall a forall b forall c forall d
forall Q:a->b forall R:b->c forall S:c->d(Q;R);S=Q;(R;S)
(A16) forall a forall b forall Q:a->b Ia;Q=Q(A17) forall a forall b forall Q:a->b Q;Ib=Q(A18) forall a forall b forall c
forall Q:a->b forall R:b->c forall S:a->cQ;R&S<=Q;(R^&Q;S)
(A19) forall a forall b forall cforall Q:a->b forall R:a->c forall X:b->c
X<=Q\R <=> Q;X<=R
3 The System
The RelAPS system is designed in such a manner to allow the greatest amountof flexibility with respect to the style of proving different theorems. The sys-tem accepts Horn-style formulae as input, using the notation explained in theprevious section. The current version of RelAPS accept formulae of the style
52
[quantifiers][(A1,1 ∧ ... ∧A1,N1 ⇒ B1) ∧ . . . ∧ (AM,1 ∧ ... ∧AM,NM⇒ BM )]
where [quantifiers] is a list of universal quantifiers with object and/or relationalvariables, and A1,1, . . . , AM,NM
and B1 . . . BM are arbitrary atomic formulae.Notice that the system also allows A ⇔ B in the mantissa for atomic formulaeA and B since this is equivalent to (A⇒ B) ∧ (B ⇒ A).
The interface itself is divided into different ‘windows’ or areas where theuser can work with different aspects of a single formula. It is this concept thatincreases flexibility with respect to proof-styles. For example, the interface hasareas for dealing with assumptions and assertions respectively, and another areadesignated as the working area where the user performs derivations. Withinthe assumption and assertions areas, the user may select different subterms orsubformulae, move them to the working area, perform some derivation, and thenapply the result to the original assumption or assertion. Hence, the metalogicalrules, i.e., the rules of the sequence calculus restricted to the subset of formulaeused in the system, are actually handled by the layout of the interface.
Other beneficial aspects of the system include, but are not limited to, theoptions to prove monotonicity, associativity, and commutativity - in order toallow the automatic use of these rules without having to continually specifywhen to use them.
4 Example
As an example, we will describe how a proof of the formula
Q v R ⇐⇒ Q uR = ⊥⊥ ab
would be completed using RelAPS. First of all, the formula is entered into thesystem (with the appropriate typing) as
forall a forall b forall Q:a->b forall R:a->b Q<=R <=> Q&-R=Oab
We then specify that the equivalence will be proven by separating the relatedimplications. Both statements are to be proven separately. Starting with the firstimplication
Q v R =⇒ Q uR = ⊥⊥ ab,
we first use the deduction theorem by moving the assumption into the respectiveassumption window. Working with the assertion, we select QuR with the mouse,and move the term to the working area. We then perform a derivation by selectingsubterms and applying appropriate axioms giving
Q uR v R uR = ⊥⊥ ab,
which concludes this proof.
53
Next, we prove the converse implication in a similar manner, namely, by firstseparating the assumption and assertion. Then we select the entire assertion andmove it into the working area. Using axiom (A7) (an equivalence) we modify theassertion getting QuR = Q. We replace the assertion by the modified one, selectthe term Q u R, move it to the working area, and finish the proof equationallysimilar to the first proof.
Since both implications have been derived appropriately, the system consid-ers the proof of the original equivalence to be complete. The theorem is thenautomatically appended to the system’s collection of theorems.
5 Future Work
Although there are many possible extensions to the RelAPS system, the nextphases will involve implementation of modules to consider decidable fragmentsof relational theory, and to generate LATEX2ε output of completed derivations.
As for the first, it has been shown in [1] that binary operations including⟨u, ; , `
⟩are decidable. As for the second, having a LATEX2ε generator will allow
the user to conveniently generate proof-text that may be included in publicationswith little or no modification.
References
1. Dougherty D., Gutierrez C.: Normal Forms and Reduction for Theories of BinaryRelations. LNCS 1833 (2000), 95-109.
2. Furusawa H., Kahl W.: A Study on Symmetric Quotients. Technical Report 1998-06, University of the Federal Armed Forces Munich (1998)
3. Freyd P., Scedrov A.: Categories, Allegories. North-Holland (1990).4. Glanfield J.: ReWiRe – Reasoning With Relations. COSC 4F90 Computing
Project, Brock University (2006)5. Hattensperger C., Berghammer R., Schmidt G.: RALF - A Relation-Algebraic
Formula Manipulation System and Proof Checker. Algebraic Methodology andSoftware Technology (AMAST ’93), Springer (1993), 405-406.
6. Hattensperger C., Kempf P.: Towards a Formal Framework for Heterogeneous Re-lation Algebra. Inf. Sci. 119(3-4) (1999), 193-203.
7. Olivier J.P., Serrato D.: Categories de Dedekind. Morphismes dans les Categoriesde Schroder. C.R. Acad. Sci. Paris 290 (1980), 939-941.
8. Schmidt G., Strohlein T.: Relationen und Graphen. Springer (1989); English ver-sion: Relations and Graphs. Discrete Mathematics for Computer Scientists, EATCSMonographs on Theoret. Comput. Sci., Springer (1993).
9. Winter M.: Strukturtheorie heterogener Relationenalgebren mit Anwendung aufNichtdetermismus in Programmiersprachen. Dissertationsverlag NG KopierladenGmbH, Munchen (1998)
10. Winter M.: A new Algebraic Approach to L-Fuzzy Relations Convenient to StudyCrispness. INS Information Science 139, 233-252 (2001).
54
f-Generated Kleene Algebra
Peter Hofner
Institut fur Informatik, Universitat AugsburgD-86135 Augsburg, Germany
hoefner@informatik.uni-augsburg.de
Abstract. When describing iterations or loops it is well known andcommon to use the Kleene star. We first show an example for iteration,where the star operation is not adequate, since it just iterate and do notmodify the iterated element. Therefore we introduce, as a generalisationof Kleene algebra, the structure of f -generated Kleene algebra, that havean iteration operation which depends on a function f and modify theiterated element in each step.
1 Introduction and Motivation
The use of Kleene star for describing iterations or loops is well known andcommon (see e.g. [3, 5]). From a theoretical point of view, a∗ is the least fixedpoint of λx.1 + a · x and therefore characterises finite iteration. Nevertheless, aswe will see, in some situations it is useful to have an additional function, whichmodifies an iterated element a in each step; i.e., instead of calculating a ·a · . . .·a,we want to get a · f(a) · . . . · fn−1(a). More precisely, λx.1 + a · x is replaced byλx.1+a ·f(x). As far as we know this generalisation of Kleene star has not beendiscussed before. Let us motivate our idea by a concrete example.
Example 1.1 In [4] we presented an algebra of hybrid systems, which is basedon (lazy) Kleene algebra and uses sets of trajectories as elements.1 A trajectoryt is a pair (d, g), where d ∈ IR+
0 and g : [0, d] → V , where d is the duration of thetrajectory and V a set of (possible) values . We define composition of trajectories(d1, g1) and (d2, g2) as
(d1, g1) · (d2, g2) =df
(d1 + d2, g) if g1(d1) = g2(0)undefined otherwise
with g(x) = g1(x) for all x ∈ [0, d1] and g(x + d1) = g2(x) for all x ∈ [0, d2].Since the algebra uses sets of trajectories as elements, the composition is liftedpointwise to those sets.
1 For lack of space, we only recapitulate the definition and composition of trajectoriesand not the whole algebra. Furthermore, we restrict the set of durations to IR+
0 ,which simplifies the structure and excludes trajectories with infinite length.
0 2π
Sketch of tsin
We assume the set, which only includes the trajectory(2π, sin x
5x). This single set is called tsin. It describes a single
swing of a pendulum. The element t∗sin describes sequencesof swings, but does not consider the fact that the pendu-lum gets slower by gravity, friction and so on. ⊓⊔
2 f -Generated Kleene Algebra
Motivated by the previous example, we now define an iteration operator w.r.t.to a function f . In the remainder we will use a, b, c . . . for arbitrary elements ofan idempotent semiring S.
Definition 2.1 Let f : S → S be a homomorphism w.r.t. addition and mul-tiplication, i.e., f(a + b) = f(a) + f(b), f(0) = 0 and f(a · b) = f(a) · f(b),f(1) = 1.2 An f -generated Kleene algebra is a structure (S, +, ·, 0, 1,f∗ ), suchthat (S, +, ·, 0, 1) is an idempotent semiring and f∗ satisfies
1 + a · f(af∗) ≤ af∗ (f1) 1 + a · f(b) ≤ b ⇒ af∗ ≤ b (f2)
Similarly to the Kleene star, f∗ is the least prefixed point of the function λx.1+a·
f(x) and (f1) can be strengthened to an equation. But in contrast to the Kleenestar, we do not postulate the symmetrical laws of (f1) and (f2), since this wouldimply a · af∗ = af∗ · a. Using fixpoint iteration, we calculate for λx.1 + a · f(x):
x0 = 0x1 = 1 + a · f(x0) = 1x2 = 1 + a · f(x1) = 1 + a
x3 = 1 + a · f(x2) = 1 + a + a · f(a)x4 = 1 + a · f(x3) = 1 + a + a · f(a) + a · f(a) · f(f(a))
In general, we get
xn = 1 + a · f(xn−1) =n−1∑
i=0
i−1∏
j=0
f j(a) , (1)
where, as usual,−1∏
i=0
x = 1. Before returning to our example of Section 1, we give
some other simple examples, which illustrate that there are more applications ofthe theory than trajectories.
Example 2.2
1. The standard Kleene star is subsumed by f∗ when choosing f as identity.2. Using infinite lists, the f -generated Kleene star corresponds to
sum scan [1, a, f(a), f2(a), . . .]
in functional programming, which is discussed by Bird in [1]. ⊓⊔
2 In the setting of semirings (monoids) f(0) = 0 does not follow from f(a + b) =f(a) + f(b); this implication only holds in groups, rings, . . ..
56
Example 1.1 continued By setting f((d, g)) =df (d, g
2), we are able to illus-
trate the difference between t∗sin and tf∗sin. A characteristic element of t∗sin just
repeats tsin for a finite number of times; whereas a characteristic element of tf∗sin
repeats and modifies tsin.
0 2nπ
Sketch of an element of t∗sin
0 2nπ
Sketch of an element of tf∗sin
Therefore we are able to describe a pendulum considering changes in time,like gravity, without changing the trajectory itself. Of course the function of ourexample as well as the trajectory are freely chosen and do not reflect reality.If one wants to describe a real pendulum, the trajectory and the function willgetting much more complex; but do not change the idea of f∗. ⊓⊔
Of course, it is also possible to change the duration using another homomorphismf ; e.g., to simulate Zeno effects one can set the function f((d, g(x))) = (d
2, g(x
2)).
3 Properties
In this section we discuss some properties of f∗. Since the Kleene star is a veryspecial f -generated star, we cannot expect to get all the (well-known) propertiesof star in our setting. Therefore we also discuss those properties, which hold forKleene star but not for the f -generated one.
First we give some useful properties of homomorphisms.
Lemma 3.1 Let (M, +, 0) be a monoid and f : M → M be a homomorphismw.r.t. addition.
1. f preserves idempotency.2. f is isotone, i.e, a ≤ b ⇒ f(a) ≤ f(b).
Following Kozen’s approach to Kleene algebra with tests [5], we say that a f -generated Kleene algebra with tests is a f -generated Kleene algebra S with adistinguished Boolean subalgebra test(S) of [0, 1] with greatest element 1 andleast element 0. Using tests yields an interesting result concerning f which followsdirectly from the homomorphism properties.
Lemma 3.2 If test(S) is maximal, i.e., there is no Boolean subalgebra B of[0, 1] with test(S) ⊂ B, then f(p) ∈ test(S) for all p ∈ test(S).
In the remainder of the section we discuss some properties of f∗. First, we getimmediately from (f1) by lattice algebra
1 ≤ af∗ and a · f(af∗) ≤ af∗ . (2)
Furthermore, we get laws similar to the standard Kleene star.
57
Lemma 3.3
1.n∏
j=0
f j(a) ≤ af∗ for all n ∈ IN,
2. af∗ ≤ af∗ · af∗,3. a ≤ 1 ⇒ af∗ = 1,4. a ≤ b ⇒ af∗ ≤ bf∗,5. af∗ ≤ (af∗)f∗.
Proof.
1. By (1) we getn−1∏
j=0
f j(a) ≤ xn and xn−1 ≤ xn. Then the claim follows by
induction.2. By (2) and isotony, we get 1 ≤ af∗ ⇒ af∗ ≤ af∗ · af∗.3. By lattice algebra, homomorphism and (f2), we get
a ≤ 1 ⇔ 1 + a ≤ 1 ⇔ 1 + a · f(1) ≤ 1 ⇒ af∗ ≤ 1.
The other direction is by (2).4. By (f2), assumption, isotony and (f1)
af∗ ≤ bf∗ ⇐ 1 + a · f(bf∗) ≤ bf∗ ⇐ 1 + b · f(bf∗) ≤ bf∗ ⇔ true.
5. By 4., homomorphism and (2) (twice), we getaf∗ ≤ (af∗)f∗ ⇐ a ≤ af∗ ⇔ a · f(1) ≤ af∗ ⇐ a · f(af∗) ≤ af∗ ⇐ true.
⊓⊔
Due to Example 2.2.1 the definition of f∗ is a generalisation of the standardKleene star. Therefore we cannot expect that all properties of ∗, like leapfrog,hold for it. More precisely, we have
Lemma 3.4
1. af∗ · af∗ 6≤ af∗.2. (af∗)f∗ 6≤ af∗.3. af∗ · (b · af∗)f∗ 6≤ (a + b)f∗ and (a + b)f∗ 6≤ af∗ · (b · af∗)f∗.4. a · (b · a)f∗ 6≤ (a · b)f∗ · a and (a · b)f∗ · a 6≤ a · (b · a)f∗.
The proof is straightforward by choosing explicit elements. E.g., a·a ≤ af∗ ·af∗
and a · a 6≤ af∗ implies the first item.Since the function f often simulates physical behaviours, it will explicitly oc-
cur in algebraic expressions. Therefore we briefly discuss the interaction betweenf and f∗.
Lemma 3.5 Assume a f -generated Kleene algebra. Then f(a)f∗ ≤ f(af∗). If f
is even universally disjunctive, then
f(a)f∗ = f(af∗).
Proof. The first claim (f(a)f∗ ≤ f(af∗)) is immediate by induction (f2) and theassumed properties of f . Using µ-fusion together with af∗ = µx(1 + a · f(x))and f(a)f∗ = µx(1 + f(a) · f(x)), we get
f(1 + a · f(x)) ≤ 1 + f(a) · f(f(x)) ⇒ f(af∗) ≤ af∗.
The antecedent holds since f is a homomorphism. ⊓⊔
58
4 Conclusion and Outlook
Sumarising, we have showed that the Kleene star is not the best in some situa-tions. Therefore we introduced an f -generated Kleene star, which modifies theiterated element in each step. The new operator can be used e.g. in describ-ing physical behaviours like a pendulum. We have also presented some basicproperties of f∗.
Since this research is still ongoing, there is a lot of further work. First itwill be interesting to find more properties of the homomorphism f and the f -generated Kleene star. Especially the interaction of both should be discussedin more detail. Also the connection to functional programming (Example 2.2.2)will help to find more useful properties. This will lead to a better understandingof f -generated Kleene algebras.
In the paper we showed how to weaken the finite iteration operator of aKleene algebra. But in the same way it should easily be possible to weaken thefinite iteration of lazy Kleene algebra [6], the infinite iteration operator of omegaalgebras [2, 6] and the strong iteration of refinement algebra [7].
Additionally, as already mentioned, we give an algebra for hybrid systems,which is based on lazy Kleene algebra [4]. Using this approach the homomor-phism f can be interpreted as changing behaviours in (continuous) time. There-fore the operator f∗ fits well in the development, specification and analysis ofhybrid systems. As a first step, a case study will be done.
Acknowledgements. I am very grateful to Bernhard Moller and Kim Solin forvaluable and fruitful discussions.
References
1. R. Bird. Lectures on constructive functional programming. In B. Manfred, editor,Constructive Methods in Computing, Science, volume F55 of NATO ASI Series,pages 151–216, 1989.
2. E. Cohen. Seperation and Reduction. In R. Backhouse and J. Olivera, editors,Mathematics of Program Construction, Lecture Notes in Computer Science 1837,pages 45–59, 2000.
3. J. H. Conway. Regular Algebra and Finite Machines. Chapman and Hall, 1971.4. P. Hofner and B. Moller. Towards an Algebra of Hybrid Systems. In W. MacCaull,
M. Winter, and I. Duentsch, editors, Relational Methods in Computer Science, Lec-ture Notes in Computer Science 3929, pages 121–133, 2006. (in press).
5. D. Kozen. Kleene Algebra with Tests. Transactions on Programming Languages
and Systems, 19(3):427–443, 1997.6. B. Moller. Kleene getting lazy. Science of Computer Programming, Special issue on
MPC 2004, 2006. (to appear)Previous version: B. Moller: Lazy Kleene algebra. In D. Kozen (ed.): Mathematicsof program construction. LNCS 3125. Springer 2004, 252–273.
7. J. von Wright. From Kleene Algebra to Refinement Algebra. In E. Boiten andB. Moller, editors, Proc. of 6th Int. Conf. on Mathematics of Program Construction,
MPC 2002, Lecture Notes in Computer Science 2386, pages 233–262, 2002.
59
Nomadic Time(Extended Abstract)
Andrew Hughes1
Department of Computer Science, University of Sheeld,Regent Court, 211 Portobello Street, Sheeld S1 4DP, UK.
e-mail: a.hughes@dcs.shef.ac.uk
1 Introduction
CCS [1] is commonly used for modelling synchronous communication betweentwo processes, where one sends a signal and the other receives it at the sametime (a concept referred to as local synchronization). However, it cannot directlyrepresent systems involving synchronization of a sender with an arbitrary num-ber of recipient processes (known as global synchronization) in a compositional
manner. Crucially, the semantics of a broadcast agent cannot suitably be rep-resented using CCS. If the agent is dened as transmitting a signal to each ofthe recipients sequentially, through multiple local synchronizations, then its se-mantics will become non-compositional, because such behaviour depends uponthe number of recipients. Each time a new recipient is introduced, or one of theexisting ones is removed, the semantics will have to be changed.
A solution to this deciency lies in providing a way of determining whenall possible synchronizations have taken place. With this facility available, thebroadcast agent can recurse, transmitting signals, until this condition holds. Thefamily of abstract timed process calculi (including TPL[2] and CaSE[3]) allowthis by extending CCS with abstract clocks. These don't represent real time, withunits such as minutes and seconds, but are instead used to form synchronouscycles of internal actions followed by clock ticks. A concept known as maximal
progress enforces the precedence of internal actions over clock ticks, allowing thepossible synchronizations to be monitored. When a synchronization takes place,it appears to the system as an internal action. Thus, with maximal progress,synchronizations prevent the clock from ticking, and a result, the occurrence ofa clock tick also indicates that there are no possible synchronizations.
However, the timed calculi mentioned above lack any notion of distributionor mobility. Thus, while they can adequately represent large static systems, in-volving both local and global synchronization, they fail to model more mobilesystems, where the location of a process can change during execution. In con-trast, the ambient calculus [4] includes both distribution (via structures knownas ambients) and mobility (by allowing these structures to be moved, alongwith their constituent processes, during execution). But, it suers from similardeciencies to CCS when modelling global synchronization.
This extended abstract presents the calculus of Typed Nomadic Time (TNT),which combines the abstract timed calculus, CaSE, with notions of distribu-tion and mobility from the ambient calculus and its variants ([5,6]). This allows
the creation of a compositional semantics for mobile component-based systems,which utilise the notion of communication between arbitrary numbers of pro-cesses within a mobile framework. To extend the example of a broadcast agentgiven above, this extension allow broadcasts to be localised to a particular groupof processes, which can change during execution. Section 2 provides a simpleexample, illustrating the use of the calculus, while section 3 concludes with adiscussion of future work.
2 A Simple Example
Consider the familiar children's game of musical chairs. The conduct of the gamecan be divided into the following stages:
1. The players begin the game standing. The number of players is initially equalto the number of chairs.
2. The music starts.3. A chair is removed from the game.4. The music stops.5. Each player attempts to obtain a chair.6. Players that fail to obtain a chair are out of the game.7. The music restarts. Any players who are still in the game leave their chairs
and the next round begins (from stage three).
The winner is the last player left in the game. A model of this game can becreated using the TNT process calculus.
The game environment is represented using named locations (commonlyknown as localities in the literature). These localities can be nested within eachother and form a forest structure (due to the possibility of multiple localitiesoccurring at the top level). In the musical chairs scenario, each chair is repre-sented by a locality, as is the `sin bin', to which players are moved when theyare no longer in the game. These localities are all nested inside a further local-ity which represents the room itself. This is not a necessity, but makes for acleaner solution; it allows multiple instances of the system to be nested insidesome larger system, each performing its own internal interactions and enteringinto the synchronization cycle of the larger system.
The locality structure is represented in the calculus by the expression shownbelow. The room locality contains multiple chair localities, each of which con-tains 0, a process with no explicit behaviour1. The | operator connecting thechair localities denotes parallel composition; each locality and its constituentprocesses runs concurrently. CB and the σ and ω symbols will be explainedshortly.
room[chair[0]CB∅ | chair[0]CB
∅ ]ωσ. (1)
1 It does exhibit contextual behaviour, due to transitions created by clock ticks.
61
The players themselves are represented by processes. This allows them bothto interact and to move between localities. A gamesmaster process is also in-troduced. This doesn't play an active role in the game itself, but is insteadresponsible for performing the administrative duties of removing chairs from thegame and controlling player movement. The process denitions are summarisedin Table 1, along with the derived syntax used in this example.
Table 1. Summary of Processes and Derived Syntax for Musical Chairs
ωdef= µX.(in.X + out.X + open.X) (2)
σ.Pdef=d0eσ(P ) (3)
CBdef= µX.(in.out.X + open) (4)
SBdef= µX.in.X (5)
GM2def= σ.GM3 (6)
GM3def= open chair.GM5 (7)
GM5def= µX.(din chair sit.Xeσ(GM6)) (8)
GM6def= µX.(din sinbin leave.Xeσ(GM2)) (9)
Playerdef=dsit.P InChaireσ(Loser) (10)
PInChairdef= σ.(out chair stand.0|stand.P layer) (11)
Loserdef= leave.0 (12)
The presence of music is signied by the ticks of a clock σ. A tick from σis also used to represent the implicit acknowledgement that everyone who canobtain a chair has done so, and that the remaining player left in the room haslost. σ appears as part of a set of clocks on the bottom right of the localitydenition to signify that its ticks are visible within the locality (including anynested localities), but not outside. Instead, ticks appear as silent actions outsidethe location boundaries.
The top right of a locality is used to specify a further property of the locality,the bouncer. This is essentially a process with a very limited choice of availableactions. It has no real behaviour of its own, but instead performs the job ofmanaging the locality. It dictates whether processes or other localities may enteror exit the locality, and whether the locality may be destroyed by a process inthe parent locality. Within the musical chairs model, such protection is irrelevantfor the room itself (a bouncer, ω (2), is used which ensures that all possiblemovements are allowed), but is essential for the chairs (4) and the sin bin (5).
62
It is the chair bouncer that enforces the implicit predicate that only one playermay inhabit a chair at any one time, while the sin bin bouncer prevents playersleaving the sin bin once in there.
To model stage one of the game, n player processes and n chair locationsare placed in the room. The advantage of using TNT for this model is that theactual number of players or chairs is irrelevant. They only have to be equal atthe start to accurately model the game. The calculus allows the creation of acompositional semantics, as discussed in section 1, which work with any n.
For the purposes of demonstration, n is assumed to be two to give the fol-lowing starting state:
room[chair[0]CB∅ | chair[0]CB
∅ | σ.σ.P layer | σ.σ.P layer | GM2]ωσ . (13)
The room and chairs appear as shown earlier. The processes of the form σ.σ.P layersimply wait until two clock cycles have passed, the end of each being signalled bya tick from σ. The intermittent period between the ticks (the second clock cycle)represents the playing of the music. This syntactic form, denoted more generallyby σ.P (P being some arbitrary process), is derived from the core syntax of TNTas shown in (3). Like most of the model, it relies on the stable timeout operator,dEeσ(F ), where F acts if E times out on the clock, σ. In this case, E, being 0,will always time out as it has no actions to perform.
The gamesmaster (GM2 (6)) also waits for the rst clock tick (the musicstarting), but then evolves to GM3 (7) and uses the second cycle, prior to themusic stopping, to remove a chair from the game. Maximal progress, as explainedin section 1, ensures that this occurs before the next clock tick, as the removalemits a silent action.
The most interesting part of the model lies in the interaction with the chairs,which forms part of stages ve to seven. The aim of stage ve is to get asmany player processes as possible inside chair localities. This is handled by againrelying on maximal progress to essentially perform a form of broadcast thatcentres on mobile actions. Rather than sending a signal to a number of recipients,a request to move into a chair (see (8) and (10)) is delivered instead.
If a chair is available, then a player process will enter it (the actual chair andplayer chosen is non-deterministic). This will cause an internal action to occur,as illustrated by (14), and this will take precedence over the clock tick. Thus,when the clock eventually does tick, it is clear that no more players can enterchairs. Using clocks in this manner makes the system compositional ; in contrastto other models, players and chairs can be added without requiring changes tothe process denitions.
GM5 | Player | chair[0]CB∅
τ−→ GM5 | chair[0 | PInChair]out.CB∅
(14)
Stages six and seven proceed in a similar way. Stage six sees essentially thesame broadcasting behaviour applied to the losing players (see (9) and (12)).
63
The dierence is that stage six demonstrates something which wouldn't be pos-sible without mobility: the broadcast is limited to those player processes whichremain in the room. Communication between processes in dierent localities isdisallowed in TNT, causing an implicit scoping of the broadcast. The broadcastis again terminated by a tick from σ, which, in this case, also signies the musicstarting up again. The remaining players leave their chairs (11), and the systemessentially returns to stage three, with n− 1 chairs and n− 1 players.
3 Conclusions and Future Work
This extended abstract outlines a calculus which provides a novel combinationof features, allowing arbitrary numbers of agents both to synchronize with otheragents and move around a dynamic topology, constructed from nested localities.Current work on this calculus focuses on the formalisation of an operationalsemantics and the creation of a type system to allow additional validity andsecurity checks to be performed. The existing equivalence theory for CaSE willalso require extension in order to encompass the new features found in TNT.In the longer term, further case studies will be considered, which go beyond thesimple example presented here. In particular, the modelling of quorum sensingbacteria is of interest.
Acknowledgements
This work is supported by a grant from the Engineering and Physical SciencesResearch Council (EPSRC). I would also like to thank my supervisor, Mike Stan-nett, as well as Simon Foster and Georg Struth, for their insightful discussionsand support.
References
1. Milner, R.: Communication and Concurrency. Prentice-Hall, London (1989)2. Hennessy, M., Regan, T.: A process algebra for timed systems. Information and
Computation 117(2) (1995) 2212393. Norton, B., Lüttgen, G., Mendler, M.: A compositional semantic theory for syn-
chronous component-based design. In: Proceedings of the 14th International Con-ference on Concurrency Theory (CONCUR '03). Number 2761 in Lecture Notes inComputer Science, Springer-Verlag (2003) 461476
4. Cardelli, L., Gordon, A.D.: Mobile ambients. In: Proceedings of the 1st InternationalConference on Foundations of Software Science and Computation Structures (FoS-SaCS '98). Volume 1378 of Lecture Notes in Computer Science., Springer-Verlag(1998) 140155
5. Levi, F., Sangiorgi, D.: Mobile safe ambients. ACM Transactions on ProgrammingLanguages and Systems (TOPLAS) 25(1) (2003) 169
6. Teller, D., Zimmer, P., Hirschko, D.: Using ambients to control resources. In Brim,L., Janar, P., Ketinsky, M., Kuera, A., eds.: Proceedings of the 13th InternationalConference on Concurrency Theory (CONCUR '02). Number 2421 in Lecture Notesin Computer Science, Springer-Verlag (2002) 288303
64
Combining Relational Methods and EvolutionaryAlgorithms
Britta Kehden
Christian-Albrechts University of Kiel, 24098 Kiel, Germanybk@informatik.uni-kiel.de
Abstract. We take a relation-algebraic view on the formulation of evolutionaryalgorithms in discrete search spaces. We show how individuals and populationscan be represented as relations and how important moduls of evolutionary algo-rithms can be implemented using relational algebra. For many important prob-lems, the evaluation of a population with respect to certain constraints is the mostcostly step in one generation of an evolutionary algorithm. We show that the eval-uation process for a given population can be sped up by using relational methods.
1 Introduction
Evolutionary algorithms (EAs) have become quite popular in solving problems fromcombinatorial optimization in the recent years. The representation of possible solutionsfor a given problem has been widely discussed (see e.g. [1] and [2]) We study the ques-tion whether representations using relations can be useful. Another impotant issue inthe area of evolutionary computation is hybridization, where one combines evolution-ary algorithms with other approaches in order to get better results. We think that it maybe useful to combine evolutionary algorithms with relational methods. A first step in-top this direction was made in [3]. We consider evolutionary algorithms for the searchspace 0, 1n and examine how the most important modules of an evolutionary algo-rithm can be implemented on the basis of relational operations. Relational algebra hasbeen widely used in computer science. Especially in the case of NP-hard combinatorialoptimization problems on graphs, a lot of algorithms have been developed. Relationalalgebra has a small, but efficiently to implement, set of operations and it allows a for-mal development of algorithms and expressions starting usually with a predicate logicdescription of the problem.We represent a population, which is a set of search points, as one single relation andevaluate this population using relational algebra. It turns out that this approach can beimplemented in a way that mainly relies on the relation-algebraic formulation of thespecific modules. Considering the evaluation of a given population we show that thisprocess can be made more efficient using relational algebra. After giving a brief in-troduction into evolutionary algorithms and relational algebra in sections 2 and 3, wediscuss the relation-algebraic formulation of important modules of evolutionary algo-rithms in Section 4. After that we consider three well-known NP-hard combinatorialoptimization problems, namely minimum vertex covers, maximum cliques, and max-imum independent sets, and show how the whole population can be evaluated using
relational algebra. It turns out that using this approach can reduce the runtime fromΘ(n3) to O(n2.376) for a population of size n compared with a standard approach. Amore detailed presentation of these results can be found in [4].
2 Evolutionary Algorithms
Evolutionary Algorithms (see e.g [5]) are randomized search heuristics that follow Dar-win’s principle of evolution, the survival of the fittest. Given a fitness function to bemaximized (or minmized), a set of search points, called population, is evolved w.r.t thefunction until a stopping criterium is fulfilled. For example the algorithm stops after agiven number of iterations or if the best individual in the population has not been im-proved for a certain number of generations. In each step, a parent population randomlygenerates an offspring population by applying different variation operators. Then a sub-set of individuals of both populations is selected for the next parent generation, so thatthe fitness of the population is increased in each step. Possible variation operators aremutation, where each parent individual generates one child, and crossover, where twoindividuals of the parent population create one child. The selection of the individualsfor the next generation can be done in different ways. One can choose a subset of acertain size consisting the best individuals of both populations, i.e, the elements withthe highest fitness values, or build tournaments of each one parent and one child andchoose the better one for the next generation.
3 Representing populations as relations
We consider evolutionary algorithms working in the search space 0, 1n. We want torepresent each population as a relation P where each individual of P is stored in onesingle column. As we want to show how to use relational algebra in an evolutionaryalgorithm we have to start with some basic definitions. For a more detailed descriptionof relational algebra see [6]. We write R : X ↔ Y if R is a relation with domain Xand range Y , i.e. a subset of X ×Y . In the case of finite carrier sets, we may consider arelation as a Boolean matrix. Since this Boolean matrix interpretation is well suited formany purposes, we often use matrix terminology and matrix notation in the following.Especially, we speak of the rows, columns and entries of R and write Rxy instead of(x, y) ∈ R. The basic operations on relations are R> (transposition), R (negation),R ∪ S (union), R ∩ S (intersection), RS (composition), the special relations O (emptyrelation), L (universal relation), and I (identity relation). A relation v : X ↔ 1 is calledvector, where 1 = ⊥ is a specific singleton set. We omit in such cases the secondsubscript, i.e. write vi instead of vi⊥. Such a vector can be considered as a Booleanmatrix with exactly one column and describes the subset x ∈ X : vx of X . Note,that one search point of the considered search space can be represented as a vector oflength n. A set of k subsets of X can be represented as a relation P : X ↔ [1..k] with kcolumns. For i ∈ [1..k] let P (i) be the i-th column of P . More formally, every columnP (i) is a vector of the type X ↔ 1 with P
(i)x ⇐⇒ Pxi. We assume that we are always
working with populations that have exactly n individuals, i.e., the relation P has exactly
66
n rows and n columns. Under the assumption that we work with n × n relations, theoperations transposition, negation, union and intersection can be implemented in timeO(n2). The standard implementation for the composition needs time Θ(n3). Using thealgorithm proposed by Coppersmith and Winograd (see [7] ) for the multiplication oftwo n× n matrices we can reduce the runtime for the composition to O(n2.376).
4 Relation-algebraic formulation of important modules
Variation operators are important to construct new solutions for a given problem. Weassume that the current population is represented by a relation P and present a relation-algebraic formulation for some well-known variation-operators. In addition we formu-late an important selection method based on relational algebra. It turns out that the run-times for our general framework are of the same magnitude as in a standard approach.
4.1 Mutation
An evolutionary algorithm that uses only mutation as variation operator usually flipseach bit of each individual with a certain probability p. To model the mutation operatorwith relational algebra, we assume that we have constructed a relation M randomly,that gives the mask which entries are flipped in the next step. In this case each entry ofM is set to 1 with probability p. Then we can construct the relation C for the childrenof P using the symmetric difference of P and M .
C = (P ∩M) ∪ (P ∩M).
4.2 Crossover
A crossover operator for the current population P takes two individuals of P to produceone child. To create the population of children C by this process, we assume that wehave in addition created a relation P ′ by permuting the columns of P . Then we candecide which entry to use for the relation C by using a mask M .
C = (M ∩ P ) ∪ (M ∩ P ′)
To implement different crossover operators we have to use different masks in this ex-pression.
4.3 Selection
We focus on tournament selection, and assume that we have a parent population P anda child population C both of size n. To establish n tournaments of size 2 we use arandom bijective mapping that assigns each individual of P to an individual of C. Thiscan be done by permuting the columns of C randomly. Due to the evaluation process weassume that we have a decision vector d that tells us to take the individual of P or theindividual of C for the new population N . Let P,C : X ↔ [1..n] and d : [1..n] ↔ 1,where we assume that the columns of C have already been permuted randomly. We
67
want to construct a new population N , such that for each i ∈ [1..n] either P (i) or C(i)
is the i-th column of N . The vector d specifies which columns should be adopted in thenew population N .
di ⇐⇒ P (i) should be adopted and di ⇐⇒ C(i) should be adopted.
The new population N is determined by
N = (P ∩ Ld>) ∪ (C ∩ Ld>).
It is easy to see that the presented determinations can be done in time O(n2), which isthe same magnitude as in a standard approach. In the following section we will give anexample to show how the decision vector d can be determined.
5 Testing properties of solutions for some graph problems
Assume that we have a relation P that represents a population. One important issue isto test which of the individuals of the population fulfill given constraints which meansthat they are feasible solutions. Given a graph G = (V,E) with n vertices representedas an adjacency relation R we want to test each individual to fulfill a given property.We concentrate on the constraints for some well-known combinatorial optimizationproblems for graphs, namely minimum vertex covers, maximum cliques, and maximumindependent sets. A vertex cover of a given graph is a set of vertices V ′ ⊆ V such thate ∩ V ′ 6= ∅ holds for each e ∈ E. For a clique C ⊆ V the property that Ruv for allu, v ∈ C with u 6= v has to be fulfilled and in an independent set I ⊆ V , Ruv hasto hold for all u, v ∈ I with u 6= v. It is well known that computing a vertex coverof minimum cardinality or cliques and independent sets of maximal cadinality are NP-hard optimization problems (see e.g.[8]). It is easy to see that it affords a runtime ofΘ(n2) to test whether one individual fulfills one of the stated properties with a standardapproach. Working with a population of size n this means that we need time Θ(n3) forevaluating each of these properties. We want to show that the runtime for evaluating apopulation that is represented as a relation can be substantially smaller using relation-algebraic expressions. Note, that the size of the solutions, which means the number ofones in the associated column, can be determined for the whole population P in timeO(n2) . Therefore, the most costly part of the evaluation process for the three mentionedproblems seems to be the test whether the given constraints are fulfilled. Given the tworelations R and P we can compute a vector that marks all individuals of the populationthat are vertex covers. The i−th column in P represents a vertex cover, if the followingcondition holds.
∀u, v : Ruv → (P (i)u ∨ P (i)
v ).This predicate logic expression can be transformed into a relation-algebraic expressionand we achieve the vector
L(RP ∩ P )>
that specifies all vertex cover in P . For the case of independent sets we can use the factthat P (i) is an independent set iff P
(i)is a vertex cover. We obtain the vector
L(RP ∩ P )>
68
that represents all independent sets in the population. Since a set of vertices is a cliqueof G if and only if it is an independent set of the complement graph with adjacencyrelation R ∩ I, we can determine the vector
L((I ∪R)P ∩ P )>
that specifies all columns of P that represent cliques of R. Considering the differentexpressions, the most costly operation that has to be performed is the composition oftwo n × n relations. Therefore the evaluation process for a given population P and arelation R can be implemented in time O(n2.376) by adapting the algorithm of Copper-smith and Winograd (see [7]) for the multiplication of two n× n matrices to relations,which beats the lower bound of Ω(n3) for the standard implementation.
6 Conclusions
We have taken a relation-algebraic view on evolutionary algorithms for some graphproblems. It turns out that the evaluation of a population can be sped up by usingrelation-algebraic expressions to test whether the solutions of the population fulfillgiven constraints. In the case of the three considered graph problems the computationtime for one generation can be reduced from Θ(n3) to O(n2.376).
References
1. Michalewicz, Z. (2004). How to solve it: Modern heuristics. 2nd edition, Springer-Verlag,Berlin.
2. Raidl, G.R. and Julstrom, B.A. (2003). Edge sets: an effective evolutionary coding of spanningtrees. IEEE Trans. on Evolutionary Computation 7, 225–239.
3. Kehden B., Neumann F., Berghammer R. (2005): Relational Implementation of Simple Paral-lel Evolutionary Algorithms In: Proc. of the 8th International Conference on Relational Meth-ods in Computer Science (RelMiCS 8), LNCS 3929, Springer, Berlin, Germany
4. Kehden, B., Neumann F. (2006): A Relation-Algebraic View on Evolutionary Algorithms forSome Graph Problems In: Gottlieb and Raidl (Eds.): EvoCop 2006, LNCS 3906, Springer,Berlin, pages 147 - 158.
5. Eiben, A.E., Smith, J.E.(2003). Introduction to Evolutionary Computing. Springer6. Schmidt, G., and Strohlein, T. (1993). Relations and graphs. Discrete mathematics for com-
puter scientists, EATCS Monographs on Theoret. Comp. Sci., Springer.7. Coppersmith, D., and Winograd, S. (1990). Matrix multiplication via arithmetic progressions.
Journal of Symbolic Computation, 9:251–280.8. Garey, M. R., Johnson, D. S. (1979). Computers and Intractability: A Guide to the Theory of
NP-completeness. Freeman, New York.
69
A topographical analysis of event structures
Jose Juan Palacios Perez?
The University of Manchester
Abstract In the thesis [PP06] we introduce the notion of a topographicalspace to carry out an analysis of event structures, which is a model forconcurrent computation. We show how the notion of a topographicalspace produces a clear and uniform presentation of several kinds of eventstructures and related structures in the literature.
1 Introduction
In the field of mathematical models of concurrent computation, the model knownas an event structure has a distinguished role. Introduced by Nielsen, Plotkinand Winskel in [NWP81] and later extended by Winskel in [Win85,Win89], eventstructures are based in the following basic ideas.
1. The behaviour of a concurrent process is expressed by the occurrence ofevents. An event is an atomic entity, on the same level of abstraction as thatof a point in geometry.
2. There is a notion of consistency among events, that is, whether it is thecase that two (or more) events can occur without any conflict. The notionof consistency is related to the notion of non-determinism which pervadesconcurrent computation.
3. The occurrence of an event may causally depend on the occurrence of previ-ous events. Such a relation of causal dependency can be given by a preorderon events or something more elaborated which is sometimes called an en-abling relation.
A state or configuration of a concurrent system is defined as a coherent set of(the occurrence of) events which is closed under the causal dependency relation.If two events inside a configuration are independent of each other, then they canoccur simultaneously (that is, in parallel).
A number of relations between event structures and several models of con-currency, such as Petri nets, labelled transition systems and trace languageshas been accomplished [WN95]. Event structures first appeared about 25 yearsago. Since then they have re-appeared in various forms, sometimes using differ-ent terminology, and sometimes with the same terminology meaning something
? Thanks to Dr. Andrea Schalk my supervisor, and Dr. Harold Simmons, my adviserfor their guidance and support.
different. Part of the aim of the thesis is to clarify and generalise the relation-ships between these various notions, hence providing a clearer and more uniformaccount of these various patterns.
First, we review the original definition of event structures and point out theimportance of the family of configurations. Then, we introduce the notion oftopographical spaces and describe some properties as well as different kinds oftopographies, each one associated with a particular class of event structure.
2 Topographies from configurations
The following definition is taken from [Win86].
Definition 1. An event structure S is a triple (S,S•,−) which consists of
– a set S of events, its carrier,– a non-empty family S• of finite subsets of S, called the consistency predicate,
which satisfies being downwards closed under inclusion, that is if X ∈ S• andY ⊆ X then Y ∈ S•,
– an enabling relation −⊆ S• × S, which is upwards closed under inclusion,that is if Y − s and Y ⊆ X then X − s (for X, Y ⊆f S).
Example 1. Consider the event structure S1 = (S,S•,−) with carrier S = a, b, c, d,consistency predicate given by S• = Pf − a, b, a, b, c, a, b, c, d, a, b, dand − given by ∅ − a, b, d, a − c, and b − c. The first sentence of theenabling says that events a, b, d are independent each other, the second sentencesays that event c depends on the occurrence of either event a or b1. Note thatthe events a, b are incompatible each other.
In Figure 1 we show the family of configurations (S,⊆) of S1, which formsa partial order under inclusion.
HHHH
HHH
!!!!!!
JJJJJ""
""
⊥
dba
a, c b, c
d, a b, d
Figure1. Family of configurations of the event structure S1.
It is precisely the family of configurations of an event structure that models aconcurrent system. Such family of configurations forms a special kind of domain1 Nothing forbid us to have something like a, d, c − c or b, d − b.
71
(that is, a poset with certain completeness properties), and is naturally describedin terms of topographical spaces.
Definition 2. Let S be a set. A topography on S is a family S of subsets withthe following properties.
(i) ∅ ∈ S (ii)⋃
S = S(iii) For each subfamily X ⊆ S which is locally bounded2 in S, we have
⋃X ∈ S.
A topographical space (S, S) is a set S equipped with a topography S. A regionof the space is a set X ∈ S. For each region X ∈ S the family SX = Y ∈ S
∣∣Y ⊆ X is the down family below X in S.
Indeed, a region of a topographical space captures a configuration of an eventstructure. It is easy to show that the poset (S,⊆) associated to the family ofconfigurations of the event structure from Example 1 is a topographical space.As the name suggest, this is related to the standard notion of a topological space,but more suited to our investigation3.
A topographical space (S, S) is locally topological if for all regions X ∈ S, wehave Y,Z ∈ SX =⇒ Y ∩ Z ∈ SX. In particular, the space is locally Alexandroffif for each region X ∈ S the family SX is closed under arbitrary intersections.The space is locally discrete if SX = PX.
Each topographical space induces two kinds of comparison, a global and alocal comparison. Both are important in describing properties among and insideregions, respectively.
Each topography S has a associated a canonical family, its cover given byX ∈ C(S) ⇐⇒ (∀Y ⊆f X)(∃Z ∈ S)[Y ⊆ Z] (for X ⊆ S). Such a family is thesmallest topography that contains S and is downwards closed under inclusion.
In the following section we consider
Capital Country Commonwealth
spaces, each of which generates a topography which is at least locally topological.
3 From capitals to commonwealth
We think of S• as a consistency predicate in the small, since it deals only withfinite sets. In contrast, a consistency predicate in the large deals with arbitrarysets. Hence the name capital.
Definition 3. A Consistency Predicate in the Large (capital) on a set S is afamily S of subsets of S with the following properties.
(i) ∅ ∈ S (ii)⋃S = S
2 In any poset (S,≤) a subset X ⊆ S is locally bounded iff every finite set Y ⊆f X isbounded in S.
3 In fact, each topological space gives an example of a topographical space.
72
(iii) For each subfamily X ⊆ S which is directed, we have⋃X ∈ S.
(iv) The family S is downwards closed under inclusion, that is Y ⊆ X ∈ S=⇒Y ∈S for subsets X, Y of S.
A capital space (S,S) is a set S equipped with a capital S.
It is immediate to show that each consistency predicate S• is isomorphic toits capital S. Intuitively, a capital space can be seen as an event structure whereall events are independent to each other, that is, the causality relation is justequality. Note that the cover C(S) of a topography S forms a capital space(S, C(S)), and for any other capital S we have C(S) ⊆ S. That is, the cover isthe minimal capital associated to the parent topography.
Each capital space produces a locally discrete topography. Capital spaceshave appeared in the literature as qualitative domains and coherence spaces(the latter using a binary conflict relation).
We now consider the case when the causality relation is given by a partialorder.
Definition 4. Let (S,≤) be a poset. A capital S on S is compatible with thecarried comparison ≤ if for all X ∈ PS we have X ∈ S =⇒ ↓X ∈ S. A countryspace
(S,S,≤)
is a poset with a compatible capital.
The topography S of a country space (S,S,≤) is given as
S = S ∩ LS
that is, each region X ∈ S is a consistent lower section. Such topographies arelocally separated, locally Alexandroff, the partial order ≤ coincides with thecomparison induced by S, and C(S) = S. For each region X ∈ S we havex ≤X y =⇒ x ≤ y (for all x, y ∈ S). As consequence, for Y ∈ LXX we haveY = ↓Y ∩X for each region X ∈ S.
For practical purposes, one can assume that each event in a country space canoccur once a number of events have occurred. A special kind of country spacesare Winskel’s prime event structures (S,S•,≤) [Win86] where the occurrence ofeach event is dependent only on a finite number of events.
In a country space each event depends on (at most) a set of events. We extendthe causal dependency relation by allowing an event to depend of several sets.For this we replace the partial order of a country space by a tree.
Definition 5. (a) Let S be a set, let S be a capital on S and let S be a tree overS. We say (S, S) is a compatible pair if
u ∈ S =⇒ buc ∈ S•
That is, if for each node of S its underlying set is in the finite part of thecapital.
73
(b) A commonwealth space is a structure
S = (S,S, S)
where (S,S) is a capital space and S is a tree over S such that the pair (S, S)is compatible.
From an event structure S = (S,S•,−) it is easy to obtain a commonwealthkS = (S,S, S) by constructing the tree S over S as follows.
L0 = ⊥L1 = ⊥s
∣∣ ∅ − sLi+1 = us
∣∣ u ∈ Li, buc − s, s 6∈ bucfor all s ∈ S. Each Li denotes the tree S up to level i. The converse is alsoimmediate.
We now define the topography S induced by a commonwealth S = (S,S, S).For each s ∈ X ⊆ S we say that the membership s ∈ X is witnessed by the nodeu ∈ S if s ∈ buc ⊆ X.
The harvest HS of S is the family
X ∈ HS ⇐⇒ (∀s ∈ X)(∃u ∈ S)[s ∈ buc ⊆ X]
for X ⊆ S.The harvest HS is indeed a topography on S, but is not necessarily closed
under intersections. We define the topography S of the commonwealth S asfollows
S = S ∩HSwhich is the family of those X ∈ S such that each member s ∈ X is witnessedby a node of S. Such topography is locally separated with very finite character.
For any commonwealth S = (S,S, S) with topography S the pair (C(S), S)is compatible and induces S.
References
[NWP81] Mogens Nielsen, Glynn Winskel, and Gordon Plotkin. Petri nets, Eventstructures and Domains, part 1. Theoretical Computer Science, 13:85–108,1981.
[PP06] Jose Juan Palacios-Perez. The categorical analysis of Event structures. PhDthesis, Computer Science, The University of Manchester, 2006.
[Win85] Glynn Winskel. Petri Nets, Algebras and Morphisms. Technical Report 79,Univ. of Cambridge Computer Laboratory, 1985.
[Win86] Glynn Winskel. Event structures : Lecture notes for the Advanced course onPetri nets. Technical Report UCAM-CL-TR-95, University of Cambridge,1986.
[Win89] G. Winskel. An introduction to event structures. Lecture Notes in Com-puter Science: Linear Time, Branching Time and Partial Order in Logicsand Models for Concurrency., 354:364–397, 1989. NewsletterInfo: 34.
[WN95] G. Winskel and M. Nielsen. Models for concurrency. In S. Abramsky, D. Gab-bay, and T. S. E. Maibaum, editors, Handbook of Logic in Computer Science.Oxford University Press, 1995.
74
Relational Kleene Algebras and theircompilation to modular applicative transducers
Benoıt Razet
Universite Paris 7 - INRIA Rocquencourt
1 Introduction
Finite-state methods are commonly used in computational linguistic and parti-curlarly at the morphology level. Gerard Huet[8] uses those structures to treatthe sanskrit language segmentation problem which deals with the sandhi re-lation inversion. The method uses a technology based on annotated lexiconsimplemented in the Zen toolkit[6]. A more general transducer representationmethod is inspired from this application and leads the introduction of aums[7].We plan to study potential algebraic operators, inspired from Kleene algebras,to describe rational relations useful in the natural language processing field.In the following we suppose that the reader is familiar with rational languagesor relations, automata, transducers and regular expressions.
2 Modular transducers
Let remind that rational sets or rational relations are completely described withKleene algebra models. Basic Operators of the Kleene algebras like ·(concatenation),+(union) and ∗(Kleene’s star) are often used to describe modular automata con-structions. The automata constructions associated to thoses operations give noguaranty to produce a deterministic or mininimal automaton. Since determiniza-tion and miminization have exponentional costs, automata constructions mustnot do those operations too frequently.
An originality of aums for representing automata or transducers is that theyare completely applicative data structures, loops are coded with a virtual ad-dress system. The recognition or transduction is done using a reactive processover aums. In [8] lexicons (finite sets of words) are coded as DAGs with maximalsharing using aums data structure. A reactive engine is introduced to performthe recognition of L∗ for a lexicon L, and it uses continuations to perform thenon-deterministic search. This engine is highly configurable since additional pa-rameters could affect the search and then extensions can be made easily.
We have done one such extension for modular transducers[9]. Let now de-scribe modular automata which is based on the aum technology, modular trans-ducers are a direct extension from modular automata using decorated aums. Letconsider a finite set of lexicons indexed Li, one would like to modify the reactiveengine to perform the recognition of the language defined by a regular expression
over the Li which is still a rational language. Regular expressions are elementsof the following Kleene algebra :
regexp ::= 1| Li
| regexp + regexp| regexp · regexp| regexp∗
As aums can code with the maximal sharing for lexicons, we do not want tochange those aums during the regular expression compilation. We choose to keepseparated lexicons from the geometry over those lexicons, the geometry referingthe regular expression. Let compile the regular expression into an automatonover a new phase alphabet, each phase linked to an aum, we now have modularautomata description with two levels.In the second version of the Zen toolkit, description of modular transducers ispossible using system’s of regular expressions. For example the definition of thesanskrit word morphology could be expressed that way :
INVAR = prev.abso | undeCONJUG = prev? . rootSUBST = iic* .noun | iic+ .ifcVERBAL = CONJUG | iiv.auxiWORD = SUBST | VERBAL | INVAR
WORD, CONJUG, SUBST, VERBAL and INVAR are names for equations. iiv, auxi,noun, iic, ifc, prev, root, abso and unde are lexicons for sanskrit lexical cat-egories.
The way such regular expressions are compiled using the Berry-Sethi algo-rithm[2] into a modular transducers is described in [9]. In this article we in-troduce modular transducers incrementally using three various reactive engines.They differ from the way the power of aums are in use. Firstly aums code forlexicons then for automata and finally for transducers. But the modularity no-tion is the same for the three engines. And at the end of the article we presentthe way it is compiled (using the Berry-Sethi algorithm) into a macro-generateddispatching module used by the various reactive engines. The Berry-Sethi algo-rithm is described in purely functional code guaranted having the theoreticalcomplexity.More generally, the design of all those algorithms exploits and justifies the func-tional programming methodology in which algreabric closure operations are eas-ily described, formal proofs are amenable, concise expression of powerful controlparadigms is possible and the resulting tool is efficient for a concrete linguisticapplication.
76
3 Ongoing work
We have used the Berry-Sethi algorithm because it produces efficiently a com-pact non-deterministic automaton. Such an automaton has the property that forevery state, every edge pointing that state have the same label. This propertyis due to a linearization step of the regular expression which leeds to the defini-tion of a local language[5, 3]. This linearization cannot treat regular expressionswith additional useful operators like complement and intersection. Then we havestudied other automata constructions as defined by Brzozowski[4], Raymond[11]and Antimirov[1]. As a short summary :
– Brzozowski’s algorithm treats regular expressions with additional operatorsand produce a deterministic automaton, this construction is exponential butpractically possible.
– Raymond’s algorithm is very efficient since it produces a non-determnisticwith ε-transition automaton of the linear length of the regular expressionand in linear time. But it does not extend to additional operators and thepresence of ε-transitions could be problematic, looping the reactive engine.
– Antimirov’s algorithm produces a more compact non-deterministic au-tomaton than the Berry-Sethi does, but the algorithm is not as efficient.Antimirov also indicates as a possible further research the question if hisalgorithm can be adapted to extended regular expressions.
We plan to extend our regular expression language in the same spirit ofKaplan and Kay[10] which presented a way to define phonological rewritingrules as rational relations adding some macro operators over the basic ones ofregular expressions. We then aim to present efficient algorithms to compile ourextended language, inspired from relational Kleene algebras, in a Zen style.
References
1. V. Antimirov. Partial derivatives of regular expressions and finite automaton con-structions. Theor. Comput. Sci., 155(2):291–319, 1996.
2. G. Berry and R. Sethi. From regular expressions to deterministic automata. The-oretical Computer Science, 48(1):117–126, 1986.
3. J. Berstel and J.-E. Pin. Local languages and the berry-sethi algorithm. Theor.Comput. Sci., 155(2):439–446, 1996.
4. J. A. Brzozowski. Derivatives of regular expressions. J. Assoc. Comp. Mach.,11(4):481–494, October 1964.
5. S. Eilenberg. Automata, Languages, and Machines, Volume A. Academic Press,Inc., Orlando, FL, USA, 1974.
6. G. Huet. The zen computational linguistics toolkit. ESSLLI 2002 Lectures, Trento,Italy, 2002.
7. G. Huet. Automata mista. verification: theory and practice: essays dedicated to zo-har manna on the occasion of his 64th birthday. Springer-Verlag LNCS, 2772:359–372, 2003.
8. G. Huet. A functional toolkit for morphological and phonological processing, ap-plication to a Sanskrit tagger. J. Functional programming, 15, 2005.
77
9. G. Huet and B. Razet. the reactive engine for modular transducers. In Algebra,Meaning and Computation, Festschrift in Honor of Prof. Joseph Goguen, to appear2006.
10. R. M. Kaplan and M. Kay. Regular models of phonological rule systems. Compu-tational Linguistics 20(3):331-378, 1994.
11. P. Raymond. Recognizing regular expressions by means of dataflows networks.In 23rd International Colloquium on Automata, Languages, and Programming,(ICALP’96), Paderborn, Germany, July 1996. LNCS 1099, Springer Verlag.
78
Resolution Based Natural Deduction For ModalLogic
David Robinson
University Of Manchester
1 Introduction
In resolution based natural deduction (RND) [1], Andrzej Indrzejczak in-troduces a system called RND that mixes some features of two of the mostwell known systems, natural deduction and resolution. This combinationof the two methods gives a proof system that produces proofs that areeasily understood, unlike resolution proofs which can make little senseto understand individual steps, and fairly straight forward to produce,unlike some natural deduction proofs such as proof by contradicition.
The following will introduce and develop the system of RND for modallogic and then introduce a method which makes it possible to automat-ically generate RND proofs using resolution theorem provers. To savespace, only the rules and encodings required for an example will be pre-sented.
2 Modal Logic and RND
The syntax and semantics of modal logic used is that of Gore [2].In this section I will present the resolution based natural deduction
system, RND, introduced by Indrzejczak [1], but presented in a morerecognisable style as introduced in [3].
Figure 1 shows a selection of the rules of RND for modal logic K. Theα rules use the compact notation of Smullyan [4]. The [Sub] rule allowsthe making and discharging of assumptions. Formulae enclosed in squarebrackets are assumptions which are discharged when the rule is applied.The α rules allow manipulation of connectives and the introduction andelimination forms are the mirror of each other. The R’ rule is the resolu-tion rule, and is used here instead of the less general resolution rule givenin the original presentation [1] for simplicity. It is easy to show that theR’ resolution rule is derivable in the original system [1]. The rules arestandard.
[Sub]
[s : ¬ϕ1] [...] [s : ¬ϕk]...
s : γ
s : γ ∨ ϕ1 ∨ ... ∨ ϕk
(αI)s : Γ ∨ α1 s : Γ ∨ α2
s : Γ ∨ α (I)
[R(s, t)]...
t : ϕ
s : ϕ
(R′)s : Γ ∨ ϕ s : ∆ ∨ ¬ϕ
s : Γ ∨∆ (αE)s : Γ ∨ α
s : Γ ∨ α1 s : Γ ∨ α2(E)
s : ϕ R(s, t)
t : ϕ
Fig. 1. RND rules for Modal Logic K
3 Encodings
Any formula can be structurally transformed using the transformationsshown in figure 2. These are applied to connectives present in the formulain turn to get an equivalent set of clauses which are suitable for resolution.The two tables show the encoding depending upon whether the connectiveappears positively or negatively in the formula being encoded.
ϕ negative
ψ1 ∨ ψ2 Qϕ(x) ∨ ¬Qψ1(x)Qϕ(x) ∨ ¬Qψ2(x)
ψ1 ∧ ψ2 Qϕ(x) ∨ ¬Qψ1(x) ∨ ¬Qψ2(x)
¬ψ Qϕ(x) ∨Qψ(x)
¬(ψ1 ∨ ψ2) Qϕ(x) ∨Qψ1(x) ∨Qψ2(x)
ψ Qϕ(x) ∨R(x, f(x))Qϕ(x) ∨ ¬Qψ(f(x))
♦ψ Qϕ(x) ∨ ¬R(x, y) ∨ ¬Qψ(y)
ϕ positive
ψ1 ∨ ψ2 ¬Qϕ(x) ∨Qψ1(x) ∨Qψ2(x)
ψ1 ∧ ψ2 ¬Qϕ(x) ∨Qψ1(x)¬Qϕ(x) ∨Qψ2(x)
¬ψ ¬Qϕ(x) ∨ ¬Qψ(x)
¬(ψ1 ∨ ψ2) ¬Qϕ(x) ∨ ¬Qψ1(x)¬Qϕ(x) ∨ ¬Qψ2(x)
ψ ¬Qϕ(x) ∨ ¬R(x, y) ∨Qψ(y)
♦ψ ¬Qϕ(x) ∨R(x, f(x))¬Qϕ(x) ∨Qψ(f(x))
Fig. 2. Structural Transformations for Connectives
Figure 3 shows encodings for some of the RND rules for modal logicK. C,D represent sets of formulae, possibly empty. A clause containingC or D will be called a derived clause, as it will be a clause that hasbeen derived from previous steps and does not form part of the encodingof the original problem, except in the first application of a rule at thebeginning of a proof where C,D will be empty. The clause under the lineis the resolvent of the clauses above possibly with factoring performed.
80
(αE)
C ∨Qα(t)¬Qα(x) ∨Qαi(x)
C ∨Qαi(t)αI)
C ∨Qα1(t)D ∨Qα2(t)Qα(x) ∨ ¬Qα1(x) ∨ ¬Qα2(x)
C ∨D ∨Qα(t)
(E)
C ∨Qϕ(s)D ∨R(s, t)¬Qϕ(x) ∨ ¬R(x, y) ∨Qϕ(y)
C ∨D ∨Qϕ(t)
(I)
[q(s) ∨R(s, t)]...
C ∨ qR(s) ∨Qϕ(s)Qϕ(x) ∨ ¬qR(x)Qϕ(x) ∨ ¬Qϕ(f(x))
C ∨Qϕ(t)
[Sub]
C ∨ q¬βi(s) ∨Qβj (s)¬q¬βi(x) ∨Qβi(x)Qβ(x) ∨ ¬Qβi(x)Qβ(x) ∨ ¬Qβj (x)
C ∨Qβ(x)
(Res)
C ∨Qψ(t) ∨Qθ(t)D ∨ ¬Qθ(t) ∨Qϕ(t)
C ∨D ∨Qψ(t) ∨Qϕ(t)
Fig. 3. Encodings of RND Rules
All other clauses are definitional clauses that appear in the encoding ofthe problem if the rule can be applied.
In I the square brackets indicate a clause that is not used in therule application but is a clause that appears somewhere in the generationof one of the derived clauses, and relates exactly to the subproof in theRND I rule.
The encoding will also include splitting on any positive clauses gener-ated with q’s introduced into clauses generated by the splitting. These q’scorrespond to assumptions in the RND, and this can be seen in the struc-tural encoding, where the only positive clauses generated are for and ¬formulae, corresponding to the two RND rules that require assumptions.
Theorem 1. It is possible to simulate any RND derivation using theabove structural transformation and rule encodings.
Conjecture 1. I strongly believe that it is possible to automatically gen-erate any RND proof using the same encodings.
4 A Simple Example
The simple example in figure 4 shows the resolution proof on the left handside, beside the RND proof on the right. The first 9 lines of the resolutionproof are the encoding of the formula, with the connective numberingsindicated at the top. Lines 10-13 are the result of splitting on positive
81
definitional clauses. The RND rule to which some of the resolution stepsrelates is also indicated for some lines in brackets.
s : ¬(ϕ ∧ ψ) ∨ϕs : 2 4( 5 ) 1 3
Resolution Proof1 ¬Q1(s)2 Q1(x) ∨ ¬Q2(x)3 Q1(x) ∨ ¬Q3(x)4 Q2(x) ∨Q4(x)5 Q3(x) ∨R(x, f(x))6 Q3(x) ∨ ¬Qϕ(f(x))7 ¬Q4(x) ∨ ¬R(x, y) ∨Q5(y)8 ¬Q5(x) ∨Qϕ(x)9 ¬Q5(x) ∨Qψ(x)
10 q4(x) ∨Q4(x) Split 411 ¬q4(x) ∨Q2(x) Split 412 qR(x) ∨R(x, f(x)) Split 513 ¬qR(x) ∨Q3(x) Split 5
14 qR(x) ∨ q4(x) ∨Q5(f(x)) 12, 10, 7 (E)15 qR(x) ∨ q4(x) ∨Qϕ(f(x)) 14, 8 (αE)15a qR(x) ∨ q4(x) ∨Qψ(f(x)) 14, 9 (αE)16 q4(x) ∨Q3(x) ∨Qϕ(f(x)) 15, 13 (I)17 q4(x) ∨Q3(x) ∨Q3(x) 16, 6 (I)18 q4(x) ∨Q3(x) fact.19 Q2(x) ∨Q3(x) 18, 1120 Q1(x) ∨Q2(x) 19, 321 Q1(x) ∨Q1(x) 20, 222 Q1(x) fact.23 ⊥ 22, 1
RND Proof1 s : (ϕ ∧ ψ) ass.2 R(s, t) ass.3 t : ϕ ∧ ψ E 1
4 t : ϕ αE 34a t : ψ αE 35 s : ϕ I 2, 46 s : ¬(ϕ ∧ ψ) ∨ϕ [Sub] 1, 5
Fig. 4. A Simple Example
Line 14 is the resolvent of lines 12, 10 and 7, using hyperresolutionwhich gives qR(x) ∨ q4(x) ∨Q5(f(x)). The corresponding inference stepsin the RND proof are steps 1-3. 1 is the assumption of s : (ϕ∧ψ) whichcorresponds to clause 10 in the resolution proof, 2 is the assumption ofR(s, t) which corresponds to clause 12. The derivation of t : ϕ∧ψ in step3 using the E rule (and 1 and 2) corresponds to the hyperresolutionstep producing clause 14. We see that Q5(f(x)) corresponds to t : ϕ ∧ ψbecause 5 is the number of ϕ ∧ ψ in the original formula.
Line 15 and 15a are the resolvents of lines 14 and 8, and 14 and 9respectively, giving qR(x)∨q4(x)∨αi for i ∈ 1, 2. The corresponding stepsin the RND proof are steps 4 and 4a. These two steps are the derivationsof the αi’s of t : ϕ ∧ ψ using the αE rule and are still dependent uponthe two assumptions s : (ϕ ∧ ψ) and R(s, t). This corresponds to lines15 and 15a which still contain the q’s indicating these lines still dependon the assumptions, and which now contain Qψ(f(x)) and Qϕ(f(x)), thetwo formulae derived in the RND proof.
82
Line 18 is the resolvent of line 15 with line 13 and 6 and with factoringapplied. This is done in a number of steps at lines 16, 17 and 18 for claritybut could have been done in one hyperresolution step. The correspondingstep in the RND proof is step 5, the derivation of s : ϕ using the Irule and discharging the assumption R(s, t). We see that qR(x) no longerappears in the clause at line 18, and that Q3(x) corresponds to s : ϕsince 3 is the number of ϕ in the original formula.
Line 22 of the proof is the resolvent of line 18 with 11,3 and 2. Thiscan again be combined into one single hyperresolution step, but the stepsare performed separately for clarity. The corresponding step in the RNDproof is step 6, the derivation of the initial formula by the [Sub] rule anddischarging the remaining assumption s : (ϕ ∧ ψ). We again see thatq4(x) which corresponds to s : (ϕ∧ψ) is no longer present in the clauseat line 22, and that Q1(x) corresponds to the initial formula to be proved.
Line 23 completes the resolution proof by deriving ⊥ as required.
5 Conclusion
The example in figure 4 shows that it is possible to simulate RND stepsusing clauses from the encoding of the initial formula. It is also possibleto establish what information is required in the clauses in order that anRND rule can be applied. The rule encodings given in figure 3 provide theclauses that are required in order that the RND rules can be simulated,and the clause that would be derived given this information. I believetherefore that it is possible to generate an RND proof automatically,using these encodings by only ever resolving clauses that map exactly toan RND rule encoding. A proof of this type could then be generated usingmodern resolution theorem provers, and could then easily be translatedinto the corresponding RND proof.
This should give easily and automatically generated proofs which canbe easily read and understood by a human reader. I hope to have devel-oped a proof of this before the conference.
References
1. Andrzej Indrzejczak. Resolution Based Natural Deduction. Bulletin of the Sectionof Logic, pages 159–170, 2002.
2. Reiner Hahnle Marcello D’Agostino, Dov M. Gabbay and Joachim Posegga. Hand-book of Tableau Methods. Kluwer Academic Publishers, 1999.
3. David Robinson. Resolution based natural deduction. Master’s thesis, ManchesterUniversity, Mathematics, 2004.
4. Raymond M. Smullyan. First-Order Logic. Dover Publications, Inc., 1995.
83
Some Notes on Duality in Refinement Algebra
Kim Solin?
TUCS (Turku Centre for Computer Science)Lemminkainengatan 14 A, FIN-20520 Abo, Finland
kim.solin@utu.fi
Abstract. We formulate a duality principle for refinement algebras. Wefirst consider the dual of Kleene star: angelic iteration. Angelic iterationwas introduced by Back, Mikhajlova and von Wright in a predicate-transformer setting, here we propose an abstract-algebraic characterisa-tion. This allows us to formulate the duality principle. We conclude byconsidering iterative choice and by introducing the dual of action sys-tems.
1 Introduction
Duality in different structures has often been used to simplify proofs, to give two-in-one theorems and has inspired the conception of new and useful structures.In the program refinement tradition, duality has proved a useful technical tooland seems to have inspired new structures as well [1]. The purpose of this paperis to cast the duality of some program-refinement concepts in the form of therecent abstract refinement algebras.
Refinement algebras are abstract algebras (simply a set equipped with oper-ators) for reasoning about program refinement [6, 7, 5, 4]. It can be argued thatby reasoning on a more abstract level one obtains a more perspicuous view thanprovided by the classical model-theoretic frameworks: due to the abstractionthere are not so many details that clutter the view. Thanks to this perspicuity,seeing common features amongst already established frameworks is also madeeasier.
2 A refinement algebra with angelic iteration
In [2] Back, Mikhajlova and von Wright introduced the angelic iteration opera-tor φ in a predicate-transformer setting. Angelic iteration can be seen as a finiterepetition of a program statement of any length determined by the user (as op-posed to being determined by the system). It is not hard to consider angeliciteration abstract-algebraically and this is what we shall do in this section ofthe paper. An intuition and a model for the operators involved in the definitionbelow will be given in the next section. We shall introduce the operator into a
? Work done while visiting Institut fur Informatik, Universitat Augsburg.
refinement algebra having a signature containing all the operators that (as ofyet) have been considered. However, by varying the signature and/or by havingthe conjunctivity condition to hold for all elements, we can get other refinementalgebras, such as the ones in [7] and [4], of which the later one also could harbourangelic iteration.
A full refinement algebra is a structure over the signature (u,t,¬, ; ,∗ ,φ ,ω ,† ,⊥,>, 1) such that (u,t,¬,⊥,>) is a Boolean algebra, (; , 1) is a monoid, and thefollowing equations hold (the operator ¬ binds stronger than the equally strong∗,ω ,φ and †, which in turn bind stronger than ;, which, finally, binds strongerthan the equally strong u and t; x v y ⇔df x u y = x; and ; is left implicit):
¬xy = ¬(xy),>x = >, ⊥x = ⊥,
(x u y)z = xz u yz and (x t y)z = xz t yz.
Moreover, if an element x satisfies y v z ⇒ xy v xz we say that x is isotone,and if x and y are isotone, then
x∗ = xx∗ u 1, z v xz u y ⇒ z v x∗y,xφ = xxφ t 1, xz t y v z ⇒ xφy v z,xω = xxω u 1, xz u y v z ⇒ xωy v z,x† = xx† t 1 and z v xz t y ⇒ z v x†y
hold. If x satisfies x(y u z) = xy u xz and x(y t z) = xy t xz we say that x isconjunctive and disjunctive, respectively. Of course, conjunctivity or disjunctiv-ity implies isotony. If an element is both conjunctive and disjunctive, then wesay that it is functional. If x and y are conjunctive, then ∗ and ω are assumedto satisfy
xω = x∗ u xω> and z v zx u y ⇒ z v yx∗,
and if x and y are disjunctive then
x† = xφ t x†⊥ and zx t y v z ⇒ yxφ v z
are assumed to hold.1
Guards and assertions are special elements of the carrier set. An element g isa guard if it is is functional, it has a complement g satisfying gg = > and gu g =1, and for any g′ also satisfying the two first conditions it holds that gg′ = gtg′.An element p is an assertion if it is functional, it has a complement p satisfyingpp = ⊥ and p t p = 1, and for any p′ also satisfying the two first conditions itholds that pp′ = pup′. If G is the set of guards and A is the set of assertions, then(G,u, ; , , 1,>) and (A, ; ,t, ,⊥, 1) are Boolean algebras. We will use g, g1, g2, . . .to denote guards and p, p1, p2, . . . to denote assertions.1 Let C and D be the sets of conjunctive and disjunctive elements, respectively.
When the operators are interpreted as above, the structures (C, ; ,u,∗ ,⊥, 1) and(D, ; ,t,φ ,>, 1) satisfy all the axioms of a Demonic Algebra [3] except right annihi-lation for ⊥ and >, respectively.
85
The enabledness operator ε is a mapping from the set of isotone elementsto the set of guards defined by εx =df x⊥ t 1. The termination operator τ is amapping from isotone elements to the set of assertions defined by τx =df x>u1.
3 Intuition and a model
The elements of the carrier set can be seen as program statements. The operatorsshould be understood so that u is demonic choice (a choice we cannot affect,a choice by the system), t is angelic choice (a choice we can affect, a choicemade by the user), ; is sequential composition, ¬x terminates from any statewhere x would not terminate and the other way around. The constant ⊥ isabort, an always aborting program statement; > is magic, a program statementthat establishes any postcondition; and 1 is skip. If y establishes anything thatx does and possibly more, then x is refined by y: x v y. Weak iteration ∗
(Kleene star) can be seen as an iteration of any finite length determined bythe system. The (weak) angelic iteration φ can be seen as a finite repetition of aprogram statement in which the length of the iteration is determined by the user.Strong iteration, ω, is an iteration that either terminates or goes on infinitely, inwhich case it aborts, and †, the strong angelic iteration [4], is an iteration thatterminates or goes on infinitely, in which case a miracle occurs. The differencebetween the operators can be displayed by the fact that 1∗ = 1, 1ω = ⊥, 1φ = 1and 1† = >.
A conjunctive element can be seen as facilitating demonic nondeterminism,but not angelic, whereas a disjunctive element can have angelic nondeterminism,but not demonic. An isotone element permits both kinds of nondeterminism.
Guards should be thought of as programs that check if some predicate holds,skip if that is the case, and otherwise a miracle occurs. Assertions are similar toguards, but instead of performing a miracle when the predicate does not hold,they abort. The enabledness operator maps any program to a guard that skipsin those states in which the program is enabled, that is, in those states fromwhich the program will not terminate miraculously. The termination operatorapplied to a program denotes an assertion that skips in those states from whichthe program is guaranteed to terminate, that is, states from which it will notabort.
The operators, the guards and the assertions can all be given an interpreta-tion such that the set of predicate transformers over a fixed state space forms afull refinement algebra.
4 A duality principle
Given a statement Φ about a refinement algebra, we formulate the order-dualstatement Φ∂ by replacing occurrences of symbols according to the followingrules: v is replaced by w and vice versa, u is replaced by t and vice versa, ∗ isreplaced by φ and vice versa, ω is replaced by † and vice versa, > is replacedby ⊥ and vice versa, any arbitrary guard g is replaced by an arbitrary assertion
86
p and vice versa, and ε is replaced by τ and vice versa. We assume that a givensignature that contains an opertor o also contains the dual operator o∂ (itsreplacement operator according to the above). By this, we can now formulatea duality principle for refinement algebras: Given statement Φ which holds truein a refinement algebra, the dual statement Φ∂ also holds true in the refinementalgebra.
Note that although εx and τx are a guard and an assertion respectively, theirduality does not follow from that fact, but from the duality of their respectivedefinitions. Moreover, from the properties of Boolean algebra it directly followsthat u and t are de Morgan dual with respect to the negation.
5 Iterative choice and dual action systems
The iterative choice construct [1, 2], bo p1 :: x1〈〉 . . . 〈〉pn :: xn ob, can be seen asan iteration done by the user and in every iteration step the user can choose eitherto execute one of the statements x1, . . . , xn, provided the related assertion holds,and continue the iteration – or choose to skip and end the iteration. The userwill be assumed to choose a statement for which the guard holds. The iterativechoice statement has been used to reason about interactive programs [2]. Anintuitive example of an iterative choice is an interactive dialog box (a menu).
By expressing iterative choice in an abstract refinement algebra we wouldhave the possibility to reason about interactive programs also on a more ab-stract level – and, perhaps, to more easily see connections between differentframeworks intended for reasoning about interaction. It is easy to give iterativechoice an abstract formulation. In fact, in a concrete predicate-transformer al-gebra it was formulated in [2], so the only thing we need to do is to translatethis into the abstract algebra: (p1x1 t . . .t pnxn)φ. By the duality principle andknown results for weak iteration and demonic choice, this directly yields usefulproperties such as decomposition, (p1x1 t p2x2)φ = (p1x1)φ(p2x2(p1x1)φ)φ, andleapfrog, (p1x1x2)φp1x1 v p1x1(x2p1x1)φ. In the concrete predicate-transformeralgebra, these and other results were noted to arise from duality already in [2].
In [4, 5] action systems were considered abstract-algebraically. We now con-sider the dual of an action system. To the best of our knowledge, this structurehas not earlier appeared in the literature and constitutes an example of howduality considerations can give rise to new interesting structures. A dual ac-tion system bo x1〈〉 . . . 〈〉xn ob is abstract-algebraically defined by (x1 t . . . txn)†τx1 . . . τxn, where x1, . . . xn are disjunctive actions.
An intuition is that the user iterates and for every iteration the user shouldchoose one of the terminating actions. The user should choose to end the iterationwhen none of the actions are any longer guaranteed to terminate. If the userwould end the iteration prematurely, the statement τx1 . . . τxn would ensurethat the dual action system would abort and if the user would continue toiterate although no action would be guaranteed to terminate (by choosing a non-terminating action), the dual action system would of course also abort. (One canalso look at it as if the iteration ends automatically when none of the actions
87
will terminate.) The user can also attempt to continue the iteration forever (e.g.by in turn increasing and decreasing a value of variable). This kind of behaviourcould be called angelic nontermination or perpetuum mobile behaviour. If the usersucceeds in doing this, a miracle is brought about (so here we equal perpetuummobile behaviour and miraculous behaviour).
Many interesting properties of dual action systems follow from duality andresults on classical action systems. One such property is leapfrog for dual actionsystems: (x1x2)†τ(x1x2)x1 v x1(x2x1)†τ(x2x1).
A more concrete example of a dual action system is a code lock consistingof a numerical pad and an enter button. The lock works on a state space andthe numerical keys act on this space. Opening the lock corresponds to the ac-tion system terminating, entering a wrong code and thus setting off the alarmcorresponds to the action system aborting, and being able to click the numbersfor ever corresponds to having found an evighetsmaskin. Entering a digit cor-responds to choosing one of the actions, choosing the wrong digit might set offthe alarm. Hitting the enter button corresponds to ending the iteration. (Onecan also look at it as if the iteration automatically ends when a correct code isentered.) There are several codes – possibly of different length – that produce astate so that none of the actions will terminate and thus open the lock.
6 Ending remarks
We considered angelic iteration abstract-algebraically which enabled us to for-mulate a duality principle. The duality principle can be used for proving two-in-one theorems and also inspires the conception of new structures, as exemplifiedby the dual action-system construct. The dual action systems were here onlysketched and deserve further investigation to determine if they, in combinationwith classical constructs, could be employed for reasoning about more elaborateinteractive systems.
Acknowledgements. Peter Hofner and Bernhard Moller both provided con-structive critique that substantially improved the paper.
References
1. R.-J. Back and J. von Wright. Refinement Calculus: A Systematic Introduction.Springer, 1998.
2. R.-J. Back, A. Mikhajlova and J. von Wright. Modeling Component Environmentsand Interactive Programs Using Iterative Choice. Technical Report 200, TUCS, 1998.
3. J.-L. de Carufel and J. Desharnais. Demonic algebra with domain. Accepted toRelMiCS/AKA 2006.
4. K. Solin. On Two Dually Nondeterministic Refinement Algebras. Accepted toRelMiCS/AKA 2006.
5. K. Solin and J. von Wright. Refinement Algebra with Operators for Enablednessand Termination. In Math. of Progr. Constr., vol. 4014 of LNCS, Springer, 2006.
6. J. von Wright. From Kleene Algebra to Refinement Algebra. In Math. of Prog.Constr., vol. 2386 of LNCS, Springer, 2002.
7. J. von Wright. Towards a Refinement Algebra. Sci. of Comp. Prog., 51, 2004.
88