C AHIERS DE
TOPOLOGIE ET GÉOMÉTRIE DIFFÉRENTIELLE CATÉGORIQUES
K IMMO L. R OSENTHAL
Relational monoids, multirelations, and quantalic recognizers
Cahiers de topologie et géométrie différentielle catégoriques, tome 38, n
o2 (1997), p. 161-171
<http://www.numdam.org/item?id=CTGDC_1997__38_2_161_0>
© Andrée C. Ehresmann et les auteurs, 1997, tous droits réservés.
L’accès aux archives de la revue « Cahiers de topologie et géométrie différentielle catégoriques » implique l’accord avec les conditions générales d’utilisation (http://www.numdam.org/conditions). Toute utilisation commerciale ou impression systématique est constitutive d’une infraction pénale. Toute copie ou impression de ce fichier doit contenir la présente mention de copyright.
RELATIONAL MONOIDS, MULTIRELATIONS,
AND QUANTALIC RECOGNIZERS by Kimmo
LROSENTHAL
CAHIERS DE TOPOLOGIE ET
GEOMETRIE DIFFERENTIELLE CATEGORIQUES
Volume XXXVIII-2 (1997)
RESUME. Dans cet
article,
on montre1’equivalence
de 3 structuresalgdbriques
àpremi6re
vue assez differentes. Ce sont les monoides relationnels(i.e.
des mono-ides dans la
catdgorie
autonome des ensembles etrelations),
les"quantales-parties"
(ensembles
departies
munis d’une structure dequantale),
et les"multipréordres
avec factorisation"
(une
sorte demultirelation, qui generalise
la notion derelation).
Cetteequivalence
est utilisde pour proposer une nouvelleapproche
deslangages "context-free",
en utilisant lesquantales
pour reconnaitre ceslangages.
The notion of multirelation and the
equivalence
between relational monoids andmultipreorders
with factorizations was established in the work of Ghilardi and Meloni[2]
on n-ary connectives inlogic.
In[9],
it was shown that the work of Walters[12], [13], [14]
on acategorical approach
to context-freelanguages
wasequivalent
to anapproach using
multirelations. We shall see thatChomsky
normalform for a context-free grammar is
captured by
the notion of amultipreorder
withfactorizations,
whichby
theequivalence
mentioned above leads us to relationalmonoids,
and from there to powerquantales.
A powerquantale
over a set X refersto
having
a unitalquantale
structure on the power setP(X)
of a set X.(Quantales
are
partially
orderedalgebraic
structures which have received much attention in recent years. For a detailed treatment ofquantales,
see Rosenthal[6].)
From thiswe obtain the notion of a
quantalic recognizer
of alanguage
and we show thatcontext-free
languages
in analphabet
A areprecisely
thelanguages recognized by
certain
quantales equipped
with the structure of aP(A*)-algebra,
whereP(A*)
isthe free
quantale
on the free monoid A* of A.In the first section of the paper, we establish the
equivalence
of thecategory
of power
quantales
with thecategory
of relational monoids andhomomorphisms,
i.e. the
category
of monoidobjects
in thesymmetric,
monoidal(i.e. autonomous)
category
Rel of sets and relations. Wethen,
in the nextsection, develop
thetheory
of multirelations and
multipreorders (following
Ghilardi and Meloni[2]),
culminat-ing
with the definition of amultipreorder
withfactorizations,
which turns out to beequivalent
to the notion of relationalmonoid,
and hence powerquantale.
Wedescribe how one can associate a
multipreorder
with factorizations to every multi-preorder.
This construction will turn out to be related toChomsky
normal form forcontext-free grammars on an
alphabet
A(described
as certain kinds of multirela-tions) allowing
us to concentrate onmultipreorders
with factorization forderiving
context-free
languages.
This leads to ourdefining quantalic recognizers for
A to bepower
quantales equipped
with aP(A*)-algebra
structure. The main theorem is that thesequantales
serve asrecognizers
for the context-freelanguages.
§1.
Powerquantales
and relational monoidsQuantales
arecomplete
lattices with an associativebinary operation
o, which preserves sups in both variables.Examples
of these structures abound inalgebra
and
analysis (various quantales
ofideals)
and include such fundamental mathemat- ical structures as relations on a set.They
haverecently sparked
much interest in theoreticalcomputer
science via their connections with linearlogic ( [6]),
processsemantics
[1],
and automatatheory [7], [8].
For an overviewof quantale theory,
seeRosenthal
[6] (for
a brieferintroduction,
there is[5]).
Let us now
formally give
the definition ofquantale
and powerquantale,
andthen look at the
examples
that will be of interest to us.Definition 1.1 A
quantale is
acomplete
latticeQ equipped
with an associativebinary operation
o such thatfor
all a EQ, {bac} g Q,
we have thata o
(supaba)
=stip,(a
oba)
and(supacbac)
o a =supa(ba
oa) Q is
called unitalif
there exists 1 EQ
such that 1 o a = a = a o 1for
all a EQ.
Definition 1.2
If Q
and S are unitalquantales,
afunction f : Q -
S is a homo-morphism iff
it preserves sups, o and 1.Now,
let us turn our attention to powerquantales.
Webegin
with a definition.Definition 1.3. A power
quantale
on a set Xrefers
to a unitalquantale
structureon the power-set
P(X).
Examples
1) P(X)
viewed as a Booleanalgebra
is aquantale
under theoperation
of intersec- tion n.2)
If M is a monoid inSets,
thenP(M)
is aquantale
under concatenation ofsubsets,
i.e. A o B= {a . bla
EA, b
EB}.
The unit isgiven by {e},
where e is theidentity
element of M.3)
thequantale Rel(X)
of relations on X is a powerquantale,
when viewed as the setP(X
xX)
with the usualcomposition
of relations. The unit is thediagonal
relation A.
We shall
usually
denote allquantale operations by
o, unless the contextrequires
otherwise.
. Let
PowerQuant
denote thecategory
ofpowerquantales
andhomomorphisms.
Since a
homomorphism
is asup-preserving
map F :P(X ) -+ P(Y),
it comesfrom a relation U : X -+
Y,
where(x, y)
E Uiff y
EF({x}). Thus,
for A CX,
F(A) = {y there
exists a E A with(a, y)
EU)}.
We shall now see that the notion of power
quantale
isequivalent
to that ofa monoid in the autonomous
category
Rel of sets and relations. We shall refer to these as relational monoids.Definition 1.4 A relational
monoid
consistsof
a set Xtogether
with a relationp : X
x X -+ X and a subset SZC
Xsatisfying
1) (associativity) for
all y, w, u E X there exists z E X such that((z, y)
~03BC x and(w, u)
"’p. ziff
there exists v E X such that((w, v)
-, x and(u, y)
-, v2) (identify) (a) for
all x E X there exists e E 11 such that(x, e)
"’-Jp. x andfor
allx E X there exists
f
E Q such that( f, x)
~u x(b) for
all x, yE X,
eE S2, if (x, e)
~03BC y, then x = yand if (e, x)
-, y, then x = y.We shall sometimes write
((x, y), z)
E J-l or suppress mention of p,simply writing (x, y) ~
z.The notion of
homomorphism
is the usual one,expressed internally
in Relusing
relational
composition.
In thefollowing definition,
we write this outexplicitly
forthe benefit of the reader..
Definition 1.5. Let X and Y be relational monoids. A relational monoid homo-
morphism
is a relation LT : X -+ Y such that(1) Qy
=f y
EYI3e
ESZX
’with(e, y)
EU}
(2)
For all x1, x2 EX, y E Y,
there exists a E X such that((x1, x2), a)
E pxand
(a, y)
E Ui,ff
there exists Yl, Y2 E Y such that(xi, Yl)
EU, (X2, Y2)
E U and((y1, y2), y)
E pi- -We thus obtain the
category
RelMon of relational monoids.Theorem 1.1. The
categories PowerQuant
and RelMon areequivalent.
Proof: If X is a relational monoid with
multiplication p
andidentity S2,
define apower
quantale
structure onP(X) by
A o B ={x E X|
there exists a EA, b
E Bwith
(a, b)
~03BCx}.
S2 becomes the unit element for o. On the levelof morphisms,
we have indicated that relations U : X -+ Y
correspond
tosup-preserving
mapsP(X) -+ P(Y).
It is not hard to see that U : X - Y is a monoidhomomorphism
in Rel
precisely
when thecorresponding P(X) -+ P(Y)
is ahomomorphism
ofunital
quantales.
This process isevidently functorial,
and to see that it defines anequivalence,
we observe that the relational monoid structure on X can be recovered fromP( X) by stipulating
that((x, y), z)
E it iff z E{x} o {y}. .
If X is a relational monoid with
operation 03BC
andidentity S2X,
and Y is a rela-tional monoid with
operation
1J andidentity S2y,
then there is a relational monoid structure on X xY,
defined as follows.(x1, y1), (x2, y2) ~ (x, y)
iff(x1, x2)
~03BC x and(y1, y2)
~n y. It is not hard to check thatS2X
xQy
serves as theidentity
for this newoperation.
Using
theequivalence
of Theorem1.1.,
we can define a tensorproduct
of powerquantales P(X)
0P(Y), by P(X)
0P(Y) = P(X
xY),
where ifA, B
C X xY,
then A o B ={(x, y)|
there exists(al, a2) E A, (bl, b2) E B
with(a1, b1) ~
x and(a2, b2) - y}.
§2.
Multirelations andmultipreorders
with factorizationIn this
section,
we consider the notion of a multirelation on a set, and various refinements of it. Much of this section comes from the work of Ghilardi and Meloni[2].
The idea of a multirelation and theoperation
of substitution owe, of course, a debt to the work of Lambek[4]
onmulticategories.
Multirelations can beelegantly
described as the
multigraph morphisms
from a rathersimple multigraph
to themultigraph
Rel of sets and relations(see [2]
or[9], [10], [11]),
however we eschewthat
approach
in order to avoidhaving
to introduce the notion ofmultigraph,
whichwe shall not need in what follows.
We shall use xn to denote the n-fold cartesian
product X
x X x .... x X ofa set X with itself and shall use Greek letters to stand for elements of
X n ,
e.g.a =
(.Ci,.C2,...,.Cn) .
Definition 2.1. Let X be a set. A multirelation M on X consists
of
the unionU Mn of
setsMn,
where Mng
Xn x Xfor n >
0.We refer to Mn as the n - level of M. We write
(a, x)
EM,
whenever we wishto discuss a
typical
element of themultirelation M,
withoutspecifically referring
toits level. Sometimes we may write ac ~ x, when M is clear from the context. Given
an
n-tuple
a, we shall use ai to refer to itsith component
and ifB
is anm-tuple,
we shall use
ac|iB
to denote the(m
+ n -I)-tuple
obtainedby replacing
asby ,Q.
We shall also use concatenation ac .
B
to denote thejuxtaposition
of ann-tuple
aand an
m-tuple /3
toproduce
a new(n
+m)-tuple.
If a is an
n-tuple
of elements ofX ,
we use[ac]
to refer to thecorresponding
word ala2....an in the free monoid X*
generated by
X.We shall use
Multi(X)
to denote the set of multirelations on X.We can definean
ordering
onMulti(X) by specifying
thatM
K iffMn
CKn
for all n > 0.Note that
Multi(X)
is in fact acomplete
lattice under thisordering,
as it isclearly
closed under both
arbitrary
suprema andinfima, by taking
unions and intersections at each level.Definition 2.2
If
M is a multirelation on X and Ii is a multirelation onY,
a relational mapof
multirelations is a relation U : X -+ Y such thatfor
allxl, ....xn E
X (n > 0)
andfor
all y EY,
there exists x E X with(xl, ...xn)
-M xand
(x, y) E U iff
there exists yi, ....yn E Y with(xi, yi)
E Ufor
all n >0,
and(Yl ...Yn)
~K y.Note that if n =
0,
we have that y EK0
iff there exists x EMo
with(x, y)
E U.We denote the
resulting category
of multirelationsby
Multirel.We now wish to describe the
operation
of substitution(composition)
for mul-tirelations. Let M and N be multirelations on X. We define a new
multir.elation M[N]
as follows.(a, X)
EM[N]
iff there exists 3and y
such that(B, x)
EM, (y, Bi)
E N andof =
B|iy.
Definition 2.3.
If
M and N are multirelations on a setX,
werefer
toM[N]
asthe substitution
of .N
into M(or
as thecomposition of
M withN).
Note that if M and N are
ordinary binary
relations onX,
thenM[N]
isjust
the usual
composition
of relations M o N ={(z, x) 13y
with(y, x)
EM, (z, y) E N}.
Also,
note that theidentity
for substitution isgiven by
the multirelation4Y,
where
D1
is thediagonal (x, x)
on the set X x X.An
isempty
for alln #
1 andso 0
only
lives at level 1.In
analogy
with thetheory
ofbinary relations,
we can talk about a multirelationbeing
reflexive andtransitive, leading
to the notion of amultipreorder.
Definition 2.4. A multirelation M on a set X is called a
multipreorder if
andonly if M satisfies
that D M andM[M]
M.For a detailed look at the role of
multipreorders
instudying logic
with n-aryconnectives,
see the work of Ghilardi and Meloni[2].
There are several natural
examples
ofmultipreorders.
1)
Let ,S’ be a monoid withbinary operation ..
Define a multirelationMs by ((m1, m2 ,....mk), m)
E(MS)k
iff Ml - m2 . .... . mk = m. Moregenerally,
if S is apartially
orderedmonoid,
we couldchange
the multirelation to mi.m2. ...mk
m.2) Generalizing (1),
we could consider a small andlocally
smallcategory C,
letX be the set
of morphisms
of C and defineMc by ((f1, f2, .... fk), f) E (Mc) k
ifffl
of2
o .... ofk = f ,
where o denotes thecomposition
in thecategory.
If C is alocally partially
orderedbicategory,
that is to say the hom-sets arepartially
orderedwith
composition respecting
theordering,
then we canreplace
=by .
Denote the n-fold substitution of M into
itself, M[M[M...M]..] by
Mn . It is nothard to see that if M is a multirelation on
X,
then themultipreorders generated by
Mis
given by
M*= U Mn,
where n > 0 and Mo is understood to be the multirelation 4l.The notion of
multipreorder
can be refined furtherby discussing multipreorders
with factorization. Let us
begin
with the definition.Definition 2.5. A
multipreorder
M on a set X is called amultipreorder
withfactorizations if
andonly if
1) (x,y) E M => x = y forallx,yEX.
2) (ac . -,8, x)
E M =>3y, z
E X such that(a, y)
EM, (B, z)
E M and(y .
z,x)
E Mfor
allac, B
with[a], [B]
E X*.Note that we are
allowing [ac], [3]
to be theempty
word in X* Of course,(2)
extends in a natural way to
(-yi
yn,x )
E M =>3x1,
... x" E X with(,i, xi)
E Mand
(x 1
..,. ’ x,,,x)
E M.Exampl es
1) Clearly,
themultipreorder
associated to any monoid S(described earlier),
is amultipreorder
with factorizations.2)
Consider thefollowing multipreorder
on X xX,
where X is a set.((Xl, Yl), ...(Xn, yn)) ~ (x, y)
iff Yl = X2, Y2 = Xs, ....yn-1 = Xn and x, = x, yn = y for n > 1 and at the 0-level of -, wepick
out the subset of allpairs (x, x).
This isclearly
amultipreorder
with factorizations.We have the
following lemma,
whoseproof
followsdirectly
from the above defi-nition,
which says that amultipreorder
with factorizations iscompletely
determinedby
whathappens
at levelsPf2
andMo,
of the multirelation.Lemma 2.1
Suppose
amultipreorder
M on Xsatisfies
that(x, y)
E M => x = yfor
all x, y E X.Then,
M is amultipreorder
withfactorizations iff M = (M2UMo)*
Thus, example (2)
above can be describedby ((x, y), (y, z)) ~ (x, z).
Weshall refer to this as the relational
multipreorder
withfactorizations
onX, although technically speaking
it is on X x X.We shall denote
by Mpf
thecategory
ofmultipreorders
with factorization with multirelationmorphisms
as maps.Theorem 2.1. There is an
equivalence of categories Mpf =
RelMon.Proof: Given a
multipreorder
with factorizations M onX,
we consider the relationM2 : X
x X - Xtogether
with the subsetMo ç
X.Suppose
3z E X suchthat
((z, y)
~03BC x and(w, u)
~03BC z. Since M is amultipreorder,
it follows that(w . u .
y,x)
E M. Nowapply
factorization to the factors w and u - y to obtain that 3v E X such that(((w, v)
~03BC x and(u, y)
~03BC v. The otherpart
ofassociativity
follows
similarly.
For the
identity laws, (a)
followsdirectly
from the definition ofmultipreorder
with factorization(Def.2.1. (2))
where aor B
are allowed torepresent
theempty
word.For
(b)
of theidentity laws,
if(e, x)
~M y, sincemultipreorders
are closed undercomposition
and e EMo ,
we canreplace
eby
theempty
wordyielding
x -M y, which forces x = y.Similarly,
for the otherpart.
The notion of relational rnap of
multirelations,
when restricted to level2,
cap- turesprecisely
the definition of monoidhomomorphism.
For n =0, y
EKo
iff3x E
Mo
with(x, y)
E U is the desiredproperty
for identities. To see that this functor is anequivalence, if p :
X x X -+ X and SZ C X define a relational monoid structure onX,
consider(p
Uf2)*
andapply
Lemma 2.1. to obtain amultipreorder
with factorizations. A relational monoid
homomorphism
becomes a mapin Mpf.
Associativity
for Xyields
factorizations at level2,
whicheasily
extend to other lev-els and condition
(1)
for factorization follows from theidentity
laws. This functor isclearly
inverse to the functorMpf
-+ RelMon described above. *It follows
by combining
Theorems 1.1. and2.1.,
that there is anequivalence
ofcategories
between thecategory Power Quant
of powerquantales
and thecategory Mpf.
Forexample,
the relationalmultipreorder
with factorizations on X described inExample
2corresponds
to the powerquantale Rel(X)
of relations on X.We now wish to present a construction of how we can obtain a
multipreorder
with factorizations from a
given multipreorder
in a very natural way. This con-struction will prove to be very
important
in the next section when we consider context-free grammars andlanguages.
Suppose
that M is amultipreorder
on a set X.Then,
it is closed under com-position.
It follows that if(x, y)
EMl ,
then x can be substituted in for any y that appears at some n-level of M. In other words if(B, z)
E M withBi
= y, then(B|ix, z)
E M.Thus,
since we arealready starting
with apreorder,
we canfreely
removelevel 1 from M without
losing
anyinformation,
since the fact that M is closed undercomposition
gua.rantees us that we still have all therelationships arising
from( x, y)
E M . In additionto removing level 1,
let usreplace
the base set Xby X * ,
the free monoid on X . Recall that
if B = (x1, x2, ....xn)
is ann-tuple
of elements ofX ,
we use[B]
to denote thecorresponding
word in the free monoid X*. Given sucha
,Q,
define a sequence as follows.Let
81
=B, B2
=(x2, ....xn), B3 = (x3, .... x,,),
etc. withfinally /3n
=(xn)
Let us define a new
multipreorder p(M))
on X*(with B
in thefollowing
asabove) .
1)
If(Xl,
x2, ....xn,x)
E1BIf,
then([Xl] . [x2] . ... . [xn], [x])
Ep(M)
2)
define new elements ofp(M)
as follows :Notice that we have
only
added relations at level 2 in themultipreorder p(M)
onX. To see that we now have a
multipreorder
withfactorizations,
observe that if wehave a relation in
p(M),
which does not live at level2,
such as([x1].[x2]. .... .[xn], [x]),
then this can be viewed as a
composite
of a sequence of level 2 elements ofp(M), namely
([x1] . [B2], M) composed
with([x2] . [B3], [B2]) yields ([x1] . [X 21 - [B3], [x]).
This in turn when
composed
with([X3].[B4], [,83]) gives
rise to([x1].[x2].[x3].[B4], [x]).
Continuing
in thisvein,
we arrive at theoriginal
element([x1]. [X2]’’’’’’ [X,,], [x]) of p(M), showing
that the elements of level 2(together
with those of level0) generate
the
multipreorder p(M),
thusmaking
it amultipreorder
with factorizations.It is not hard to see that
given
xE X,
there are no new relations added relative to x;by
this we mean that theonly
relations inp(M)
of the form([y], x)
are theones
required
to beby
thedefinition, namely
the relations([x1]. [x2J
...[xn], [x])
where
(x1, x2, .... xn, x)
E M . The use of the[Bi]
above will notimpact
on these.We summarize the above in a
proposition.
Proposition
2.1If M is
amultipreorder,
thenp(M)
is amultipreorder
withfac-
torizations.
§3
Context-free grammars andlanguages
andquantalic recognizers
We wish to describe an
algebraic
way ofpresenting
the notions of context-free grammar andlanguage using multirelations, ultimately using
theequivalence
of thecategories Mpf
andPowerQuant
to arrive at the notion of aquantalic recognizer
for context-free
languages.
Thisapproach
isinspired by
the work of Walters on acategorical approach
to context-free grammars andlanguages using multigraphs
andthe free
category
withproducts
on amultigraph [12],[13].
In[9],
it was observed that thisapproach
wasequivalent
tousing
the notion of a multirelation with constants.We shall
begin
with this definition.Definition 3.1. Let X and A be sets. A
context-free
grammar withalphabet A, (or
a multirelation with constants
A),
is a multirelation M EMulti(X) together
witha
function p :
A -+P(X) assigning
to every a E A a subset03BC(a) of
X.Let
M*,
asbefore,
denote themultipreorder generated
from M. Atypical
el-ement
(B, x) c
M* arises from M via a finite sequence ofsubstitutions, utilizing
Definition 2.3.
To see the connection with the traditional
approach ([3]),
the elements ofM,
(a, x), correspond
toproductions
x +- a and we have x Ep(a)
iff there is a pro- duction X f- a.Elements
(B, x)
E M* are referred to as derivations of x fromB.
We can now present a definition of context-free
language
verysimply
in termsof the above definition.
Definition 3.2. Let
(M, p)
be acontext-free
grammar on a set X withalphabet
A.Let x E X . The
context-free language
associated to x is the subsetLx of
thefree
monoid A*
defined by
alaz...an ELx iff
thereexists B
E Xn with(fl, x)
E M* andBi
E03BC(ai).
A moment’s reflection shows that this coincides with the usual definition.
Recall from
§2,
that to everymultipreorder M,
we can associate amultipreorder
with
factorizations,
which we denotedp(M) . p(M)
has as itsunderlying
setX*,
the free monoid on the set X. Definep(p) :
A -P(X*) by p(p)(a) = 03BC(a);
that isp(p) picks
out subsets of X*consisting only
of words oflength
one, i.e.p(p) (a)
hasno elements of
length >
2 and if a: EX,
then xE J-l(a)
iff[x]
Ep(p(a))
We shall refer to
(p(M), p(03BC))
as theChorrasky
normalform
of(M, 03BC).
It isnot hard to see that the usual
prescription
ofChomsky
normal form for context- free grammars(e.g.
see[3])
coincides with our constructionof multipreorders
withfactorization from a
given multipreorder
and theensuing (p(M), p(p)).
As thefollowing
lemmaindicates,
the end result withregard
to context-freelanguages
isthe same.
Lemma 3.1. Let
(M, p)
be acontext-free
grammar on a set X withalphabet
A. Thecontext-free language
associated to xfor
this grammar is the same as thecontext-free language of
x calculatedaccording
to the grammar(p(M), P) -
To understand what is
going
on in the abovelemma,
note that if[B]
and[a]
arewords in X with
[B]
=B1B2...Bn
and[a]
= ac1ac2...acm, then we have([B].[ac], x)
Ep(M)
iff(B.ac, x)
E M iff[B1][B2]...[Bn][ac1][ac2]...[acm], x)
Ep(M)
iff
(B1B2...Bnac1ac2...acm, x)
E M -The above definition of Lx shows that we will obtain the same
language
whetherwe do our calculations with
(M, p)
or with( p(M), (p(p)).
Thus,
for the purposes oflanguage recognition,
it suffices to restrict our atten-tion to context-free grammars, which are
mpf’s. So,
let us suppose that we havea context-free grammar
(M, p)
on a set X withalphabet A,
where M is a multi-preorder
with factorizations.Hence,
from Theorem2.1.,
it follows that there is the structure of a powerquantale
onP(X).
This power
quantale
structure isgiven by A o B = {x E X|3a E A, b E B
with(ab, x)
EM}
whereA,
B are subsets of X.Since A* is the free monoid on the set
A,
and in turn,P(A*)
is the freequantale
on the monoid
A* ,
we have that the information ofhaving
a map p : A -+P(X)
is
equivalent
tohaving
a monoidhomomorphism p :
A* -P(X ),
which in turn isequivalent
to aquantale homomorphism 03BC : P(A*) -+ P(X).
We can think of this
quantale homomorphism p : P(A*) -+ P(X)
asendowing
the
quantale P(X)
with the structure of aP(A*)-algebra,
in the sensethat p
leadsto a definition of an action of
P(A*)
onP(X) analogous
to the usual notion of analgebra
from commutativealgebra.
For our current purposes, it suffices to deal with the map p :
P(A*)
-+P(X).
This leads to the
following
definition.Definition 3.3. A
quantalic recognizer for
thealphabet
A is apair (P(X), 03BC),
whereP(X) is
a powerquantale and p : P(A*) - P(X) is
aquantale homomorphism.
Let
(P(X), 03BC)
be aquantalic recognizer
for thealphabet
A. Given xE X,
thenQx
=10- E A*|x
E03BC(o-)}
is called thelanguage recognized by (P(X), P).
Definition 3.4. A
languages
L in thealphabet
A is calledquantally recognizqble if
and
only if
there exists aquantalic recognizer for A,
whichrecognizes
L.Note that in the above
definition,
if a = a 1 a2 .... a", then the statement xE 03BC(o-)
is
equivalent
tosaying
that x Ewhere
o denotes thequantale operation
of the powerquantale P(X).
Thefollowing
theorem is the main resultwe have been
leading
up to.Theorem 3.1. Let A be a set.
Then,
the setof context-free languages
in thealphabet
A coincides with the setof quantally recognizable languages
in thealphabet
A.
Proof: Let L be the context-free
langua.ge
associated to x, where x E X and(M, 03BC)
is a context-free grammar on X.
Thus,
a word o- is in Lprecisely
if a = a1 a2 · · · ·an and there is(B, x)
E M* with3i
E03BC(ai)
for all i =1, 2....n. By
Lemma3.1.,
it suffices to assume that M is a
multipreorder
with factorizations on X. In thecorresponding
powerquantale
structure onP(X),
x E{B1}
o ... o{Bn}
and sinceBi
EIt (ai),
it follows that o- E Lprecisely if x E 03BC(a1)o....o03BC(an),
in other words L isrecognized by
thequantalic recognizer (P(X), 03BC)
and thus isquantally recognizable.
Conversely,
suppose L isquantally recogniza.ble by
thequantalic recognizer (P(X), p),
with L =Qx
for some x E X . To the powerquantale P(X)
we can asso-ciate a
multipreorder
with factorizations M on X and thequantale homomorphism
p :
P(A" )
-+P(X)
restricts to a map p : A -*P(X).
Thus we have a context-free grarnmar withalphabet
A. A word a = ala2....an is in L if andonly
if x E03BC(o-)
ifand
only
if x E{B1}
0...0{Bn}
where8i
E03BC(ai). If 13
is then-tuple
in X with8i
as its
ith component,
then x E{B1}
o ... o{Bn}
if andonly
if(B, x)
E M and thusL is the context-free
language
of x relative to the context-free grammar(M, 03BC). .
We should note that
by
theequivalence
of powerquantales
andmultipreorders
with
factorization,
via relationalmonoids,
it follows thatif P(X)
denotes the powerquantale
obtained from a context-free grammar(M, jJ),
with M amultipreorder
with factorizations on a set
X ,
thenP(X) recognizes precisely
the context-freelanguages
Lxgenerated by
the grammar(M, 03BC). Thus,
there is anunderlying equivalence
ofcategories
between context-free grammars and theirrecognizers.
Tosomeone with a
good
grasp of the relationalcalculus,
the use of multirelations and their substitutionoperation provides
an effective and efficient way to describe context-free grammars andlanguages.
It ishopeful
that thisapproach
will lead tosome
interesting
observations aboutrecognizers.
REFERENCES
[1]
S.Abramsky
and S.Vickers, Quantales,
observationallogic
and process seman-tics,
Mathematical Structures inComputer Science, Vol.3, No. 2,
1993[2]
S. Ghilardi and G. C.Meloni,
Modallogics
with n-aryconnectives,
Zeit.fur Math.Logik
und Grund.derMath.36, 1990,
193-215[3]
J. M.Howie,
Automata andLanguages,
OxfordUniversity Press,
1991[4]
J.Lambek, Multicategories revisited,
inCategories
inComputer
Scienceand
Logic,
Cont. Math. Vol.92,
Amer. Math. Soc.1989, 217-240
[5]
S. B. Niefield and K. I.Rosenthal, Constructing
localesfrom quantales,
Math.Proc. Camb. Phil. Soc.
104, 1988,
215-234[6]
K. I.Rosenthal, Quantales
and theirApplications,
Pitman Research Notes inMathematics,
Vol.234, Longman
Scientific andTechnical,
1990[7]
K. I.Rosenthal,
Girardquantalcids,
Mathematical Structures inComputer
Sci-ence,
Vol.2, No. 1, 1992,
93-108[8]
K. I.Rosenthal, Quantaloidal nuclei,
thesyntactic
congruence and tree automata, Jour. PureApplied Algebra 77, 1992,
189-205[9]
K. I.Rosenthal,
Acategorical
look at tree automata andcontext-free languages,
Mathematical Structures in
Computer Science, Vol.4, 1994,
287-293[10]
K. I.Rosenthal, Quantaloids,
enrichedcategories
and automatatheory, Applied Categorical
Structures3, 1995,
279-301[11]
K. I.Rosenthal,
TheTheory
ofQuantaloids,
Pitman Research Notes inMathematics,
Vol. 348,Longman
Scientific andTechnical,
1995[12]
R. F. C.Walters,
A note oncontext-free languages,
Jour. Pure andApplied Algebra 62, 1989, 199-203
[13]
R. F. C.Walters,
Thefree
category withproducts
on am,ultigraph,
Jour. Pureand
Applied Algebra 62, 1989,
205-210[14]
R. F. C.Walters, Categories
andComputer Science, Cambridge University Press,
1992Kimmo I. Rosenthal
Department
of Mathematics UnionCollege Schenectady,
New York 12308 e-mail: