The Algebraic Approach II-V

53
The Algebraic Approach II-V Mark Hopkins *  In this compilation, I included an updated version of the Algebraic Approach II paper delivered in the RelMiCS 2008 conference [16], along with expanded versions of the papers III and IV which were originally meant to be presented at Ramics 2012, and paper V. Most of what was originally in the Algebraic Approach I paper [15] has been expanded on or subsumed (or corrected) by part III and, to a lesser extent, part IV, and so it is n ot included. In addition, the appendix (originally meant to go with Part IV) contains a fairly complete self-contained account of (co-)monads and adjunctions that includes all the elements used in these papers, we well as others. II: A Network of Adjunctions In this section, we will discuss, in outline form, the quantale completion for each variety of natural dioid. This is an updated version of the Algebraic Approach II paper delivered in the RelMiCS 2008 conference [16]. 1. Preliminaries In the standard formulatio n of formal l anguages and automata, which we will refer t o henceforth as the classical theory, a language is usually regarded as a subset of a free monoid *  M X  . In contrast, in the Algebraic Approach, a formal language is viewed as an algebraic entity residing in a partially ordered monoid. Through the conventional identification  x x , the point of view grounded in set theory is algebraized, with each set actually being viewed as a sum of its elements, e.g.,   0 0 : 0 . m m m m m m m m a b m a b a b  In the classical theory, the process of algebraization ended abruptly at the type 3 level in the Chomsky hierarchy: the regular languages and their corresponding algebra of regular expressions. Attempts were made to extend this process to the type 2 level (i.e., context-free expressions) [14], [25], [31], but did not find particularly fruitful applications; e.g., no algebraic reformulation of parsing theory. A significant step, however, in this direction had already been taken early on [6], the result being the Chomsky-Schützenberger Theorem for context-free languages. However, no theory of context-free expressions arose from th is result. In recent times, we’ ve begun to see renewed progress in this direction [12]. Much of what stood in the way may have been the difficulty in clarifying the algebraic foundation underlying the theory of regular expressions. In what algebra(s) do these objects live ? As was noted in [20], in which adjunctions were constructed to embody the h ierarchical relatio n R P , the landscape is populated by a diversity of can didates that seem to get in the way of clearly answering the question. Though the large number of inequivalent formulations may seem to be a setback, what we have seen i s that a complete lattice of natural dioids can be defined which presents no less than an algebraic analogue of the classical notion of language hierarchy. For, in addition to the operators  M F ,  M R ,  M   and  M P  defining, respectively, the finite, rational, countable and general subsets of a monoid  M , we also have operators  M C ,  M S  and  M T  defining, respectively, the context-free, context-sensitive and Turing-computable subsets of  M . Correspondingly, one may then seek to define adjunctions  between the members of the larger hierarchy F R C S T P  and, indeed, between all the members of the natural dioid lattice, itself. A precursor to the results formulated here may be found in [20], where adjunctions are defined connecting the operators R P  and their corresponding categories of dioids, which we shall term DR , D  and DP . The functors D D D R P  * UW-Milwaukee alumnus, not presently affiliated. E-mail: [email protected].

Transcript of The Algebraic Approach II-V

Page 1: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 1/53

The Algebraic Approach II-VMark Hopkins* 

In this compilation, I included an updated version of the Algebraic Approach II paper delivered in the RelMiCS 2008conference [16], along with expanded versions of the papers III and IV which were originally meant to be presented atRamics 2012, and paper V. Most of what was originally in the Algebraic Approach I paper [15] has been expanded on

or subsumed (or corrected) by part III and, to a lesser extent, part IV, and so it is not included. In addition, the appendix(originally meant to go with Part IV) contains a fairly complete self-contained account of (co-)monads and adjunctionsthat includes all the elements used in these papers, we well as others.

II: A Network of AdjunctionsIn this section, we will discuss, in outline form, the quantale completion for each variety of natural dioid. This is anupdated version of the Algebraic Approach II paper delivered in the RelMiCS 2008 conference [16].

1. PreliminariesIn the standard formulation of formal languages and automata, which we will refer to henceforth as the classical theory,

a language is usually regarded as a subset of a free monoid * M X  . In contrast, in the Algebraic Approach, a formallanguage is viewed as an algebraic entity residing in a partially ordered monoid. Through the conventional

identification  x x , the point of view grounded in set theory is algebraized, with each set actually being viewed asa sum of its elements, e.g.,

  00

: 0 .m mm m m m

mm

a b m a b a b

 

In the classical theory, the process of algebraization ended abruptly at the type 3 level in the Chomsky hierarchy: theregular languages and their corresponding algebra of regular expressions. Attempts were made to extend this process tothe type 2 level (i.e., context-free expressions) [14], [25], [31], but did not find particularly fruitful applications; e.g.,no algebraic reformulation of parsing theory. A significant step, however, in this direction had already been taken earlyon [6], the result being the Chomsky-Schützenberger Theorem for context-free languages. However, no theory ofcontext-free expressions arose from this result. In recent times, we’ve begun to see renewed progress in this direction[12].

Much of what stood in the way may have been the difficulty in clarifying the algebraic foundation underlying the

theory of regular expressions. In what algebra(s) do these objects live? As was noted in [20], in which adjunctions wereconstructed to embody the hierarchical relation R P , the landscape is populated by a diversity of candidates thatseem to get in the way of clearly answering the question.

Though the large number of inequivalent formulations may seem to be a setback, what we have seen is that a completelattice of natural dioids can be defined which presents no less than an algebraic analogue of the classical notion oflanguage hierarchy.

For, in addition to the operators  M F ,  M R  ,  M   and  M P  defining, respectively, the finite, rational, countable andgeneral subsets of a monoid  M  , we also have operators  M C ,  M S  and  M T  defining, respectively, the context-free,context-sensitive and Turing-computable subsets of  M  . Correspondingly, one may then seek to define adjunctions

 between the members of the larger hierarchy F R C S T P  

and, indeed, between all the members of the natural dioid lattice, itself.

A precursor to the results formulated here may be found in [20], where adjunctions are defined connecting theoperators R P   and their corresponding categories of dioids, which we shall term DR  , D   and DP . Thefunctors

D D DR P  

*UW-Milwaukee alumnus, not presently affiliated. E-mail: [email protected].

Page 2: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 2/53

are constructed by defining appropriate families of ideals for the respective algebras, while the opposite members of therespective adjoint pairs

D D DR P  give us the structure-reducing forgetful functors. Conway [7] had earlier provided a construction for the adjunction

formed of the pair :   Q D DP

R   R P  and :   Q D D

P  P R  .

These constructions may also be viewed as results in Kleene algebra, whereby a given *-continuous Kleene algebra isextended to a form that has closure and distributivity under a larger family of subsets. Expanding on this point of view,the adjunctions relating the pairs R C, R S  and R T  may be viewed as operations that give us a fixed-pointclosure of a given *-continuous Kleene algebra for C , or a relational closure for S  and T . Concrete realizations ofthese constructions, in particular for C , would then provide us with an algebraization of the classical result known asthe Chomsky-Schützenberger theorem (thus, also resolving a question raised in the closing section of [12]).

More generally, denoting by DA  the category of A -diods and A -morphisms, a desired outcome would be to reflect

the hierarchy of natural dioids by a hierarchy of adjunctions :   Q D DA

B  A B  where A B , such that Q Q Q

B   B C

C A A,

whenever A B C .

For reference, the following results from the previous sections are used below:

Theorem 1 (The Universal Property). The free A -dioid extension of a monoid  M   is  M A . Equivalently, this may be

stated as follows: that : M    m M m M   A   is a monoid homomorphism and that a monoid homomorphism

:  f M D  to an A -dioid  D  extends uniquely to an A -morphism * :  f M DA ; i.e., such that *

 M   f f   .

Theorem 2  ( Hierarchical Completeness). Natural families form a complete lattice with top  M M A P  and bottom M M A F , with lattice meet defined for a family Z  be a family of natural families by

  . M M M 

A

P A

Z

Z  

We will denote the lattice ordering relation by

, . A B A B A B A B Av 

2. Ideals, Basic PropertiesCorresponding to each operator A   is a variety of ideals to be termed A -ideals. The definition makes use of thefollowing closure, which is generic to partial orderings.

Definition 1. For a partially ordered set  D , let :U x D y U y x .

If a set U   has a least upper bound U  , then the relation  y U   is equivalent to  y U  . Therefore, defining the

interval   :a x D x a  we have the following properties.

Theorem 3. For a partially ordered set  D :

 –   a a ;-- if 0  is the minimal element of  D , then 0 ; and

-- if U D  has a least upper bound U   then U U  .

We may define the family  DA  of A -ideals. The sole requirement we impose on such ideals  I D  is that (I1): for

all U DA  and ,a b D , if aUb I   , then aU b I     . The definition applies in the general setting of partially ordered

monoids, not just for A -dioids.

Page 3: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 3/53

Since a a , property I1  implies that an A -ideal  I   must also be closed downward with respect to the partial

ordering , (I2):  x d I x I  .

Though the definition is generic to partially ordered monoids, its primary application will be to A -dioids,  D . In such

a case, an A -ideal of  D  may be equivalently defined by property (I3): U D U I U I   A . We prove this in

the following.

Corollary 1. For A -dioids,  D , I1 is equivalent to I2 and I3.Proof: Taking 1a b  in I1, leads to the result I3. For the converse, we note that the A -separability property D1 of D  implies for U DA  and ,a b D  that

  .a Ub aU b aUb aUb  

Combined with I2 and I3, this leads to I1.

For ,A F R  , equivalent definitions of A -ideals may be formulated in the general setting of dioids. In particular,

since 0 , property I1 requires that 0   I  .

Corollary 2. Let  D  be a dioid. Then for an A -ideal  I D ,IF0   I   ;IF1  0   I  ;IF2  ,d e I d e I   .Moreover, an F -ideal  I D  is equivalently defined by I2, IF1 (or, equivalently, IF0) and IF2.Proof: All three properties IF0, IF1 and IF2 follow from I3, for the case A F . Taking 1a b  with U    yields

IF1  from which IF0  follows, while taking 1a b  with ,U d e   yields IF2. Similarly, for A -dioids, the result

follows in virtue of the inclusion  D DF A .

Conversely, suppose I2, IF1 and IF2 hold, and that 1, , nU u u D  with 0n . Then we have

0 0n U I 

 

 by IF1 and I2, and

10 nn U u u I    

 by IF2.

For the operator R  , we have the following characterization:

Corollary 3. An R  -ideal  I D  of an R  -dioid  D  is an F -ideal of  D  for which:

IR 1    *0   nn ab c I ab c I   .

Proof: If  I D  is an R  -ideal, from   *

: 0n

a b c ab c n I   , we conclude that **ab c a b c I   , by I3. To

 prove the converse, for an F -ideal  I D   satisfying IR 1, we need to inductively establish, for U DR  , that

aUd I a U d I   . The argument is quite analogous to that used to establish the equivalence of R  -dioids and

*-continuous Kleene algebras. We already have the property for finite subsets, by assumption. Showing that the property is preserved by sums, products, stars is easy, noting the following

Page 4: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 4/53

 

*

0

,

,v V 

n

n

a U V d a U d a V d  

a UV d a U V d a U vd  

a U d a U d  

 

and using IR 1 in conjunction with the last equality.

In general A -ideals will form a hierarchy closed under intersection. This is a consequence of the following:

Theorem 4. For a partially ordered monoid  D ,  D D A AY Y .

Proof: Let  D AY . Then suppose U DA  with aUb    Y . Then for any A -ideal  I  Y , we have

,aUb I aU b I   Y  

 by I1. Hence, aU b     Y , thus proving that Y   is an A -ideal. For the special case where Y , we set

 DY  and note that  D  is an ideal of itself.

As a result it follows that  A D   forms a complete lattice under the subset ordering   with  D   as the maximal

element. One may therefore define the ideal-closure of arbitrary sets:

Definition 2. Let  D  be a partially ordered monoid. Then

  : .U I D U I U D A

A  

Basic properties, generic to partially ordered monoids, include the following:

Theorem 5. In any partially ordered monoid  D , if ,U V D  then

, , .U U U V U V U D U U   A A A A

A  

Restricted to the case of A -dioids, the following results also hold:

Corollary 4. Let  D  be an A -dioid. Then 0 A

 is the minimal A -ideal in  D ; and each interval a aA

,

for a D , is a principal A -ideal in  D .

More generally, if  D   is already an A -dioid, then U U    for any U DA , so that these subsets generate

 principal ideals.

Lemma 1. Let  D  be an A -dioid. Then for any U DA , then U U  A.

This then shows that the ideals generated by the subsets from  DA  will be in a one-to-one correspondence with  D  itself, when  D  has the structure of an A -dioid. Taking the ideals generated from a larger family  DB  provides thenatural candidate for the extension of  D  to a B -dioid. If we could define the product and sum operations on ideals,then this would provide a basis for extending the A -dioid  D  to a B -dioid for an operator B A . We would simplytake those ideals generated from  DB .

In the most general case, where B P \, the family of ideals generated is just  DA , itself. The entire collection of

ideals should then yield a full-fledged quantale structure. In fact, this is what we will examine next.

Page 5: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 5/53

3. Defining a Quantale Structure on Ideals

The family  DA , when provided with a suitable algebraic structure, will define the extension of  D  to a dioid with

the structure characteristic of a P -dioid or quantale with identity 1 : a complete upper semilattice in which

distributivity applies to all subsets. As a result, we will be able to define the map : D DQA

  A  that yields a functor

:   Q D DA

  A P   from the category DA   of A -dioids and A -morphisms to the category DP   of quantales (with

units) and quantale (unit-preserving) morphisms.

3.1. Products

The product of two ideals should preserve the correspondence U U  A that holds in A -dioids  D  with respect

to A -ideals generated by subsets U DA . But this would require that

.U V UV UV   A 

Therefore, the product should satisfy the property

1 2 1 2 1 1 2 2   .U U V V U V U V   A A A A A A

 

We will prove this is so by showing, in particular, the following result.

Lemma 2 (The Product Lemma). Suppose  D  is a dioid. Then

.UV U V  A A A A

 

Proof: One direction is already immediate: from

.U U 

UV U V UV U V  V V 

 

A

A A A A A A

A

 

In the other direction, if we can show that U V UV  A A A

 then it would follow that

.U V UV UV   A A A AA A

 

To this end, let

: , : .Y y D yV UV Z z D U z UV   A A A

 

Then clearly, .U Y YV UV  

So, if we can show that Y   is an ideal, then we could argue.U Y Y U V UV  

A A A A 

From this, in turn, it would follow that, .V Z U Z UV  

A A 

So, if we can also show that  Z   is an ideal, then we could conclude.V Z Z U V U Z UV  

A A A A A A 

Suppose, then, that aWb Y   , where ,a b D  and W DA . Then, for each v V  , by definition of Y   , we have

.aWbv UV aWbv UV   A A  The last inference comes from applying property I1 to the ideal UV 

A. Therefore, it follows that aW bV UV    

A,

and, from this, that aW b Y     . Thus, Y   is an ideal.

The argument showing that  Z   is an ideal is similar. Suppose aWb Z   , again, with ,a b D  and W DA . Then, foreach u U  , by definition of  Z  , we have

.uaWb UV uaW b UV   A A

 

Page 6: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 6/53

The last inference, again, comes from applying property I1  to the ideal UV A

. Therefore, we conclude that

uaW b UV     A

, from which it follows that U aW b UV     A A

 and aW b Z     .

This clears the way for us to define products over subsets of  D .

Definition 3. Let  D  be a dioid. Then, define ,U V D U V UV   A .

Lemma 3. Let  D  be a dioid. Then  DA  is a partially ordered monoid with product ,U V U V   , identity 1  and

ordering .Proof: Let , ,U V W D . Then

1 1 1 1 ,

.

V V V V V  

U V W U VW UVW UV W U V W  

A A AA A

A A A A A A A A A A A

 

We can treat this algebra as an inclusion of the monoid structure of  D , itself, through the correspondence  x x .

But in general, it will not be an embedding, unless  D   also possesses the structure of an A -dioid. This result is

captured by the following property:

Theorem 6. Let  D  be a A dioid. Then

, .a b ab a b D  

Thus,  _ _ : D D A

A , is a monoid embedding with the unit 1 .

Proof: This follows from the relation between principal ideals and intervals, which generally holds in dioids:

  .a b a b a b ab ab A A A A

 

The one-to-one ness of a a  is a consequence of the anti-symmetry property of partial orders.

3.2. Sums

In a similar way, we would like to preserve the correspondence U U 

 with respect to the sum operator. So, if

U D A , then we should be able to write a reduction formula in terms of component principal ideals,

.u U    u U 

U u u  

In order for this to work, we need to know that if

  . A A

 A U V U V 

A A

A A

 

In particular, we will prove the following result:

Lemma 4 (The Sum Lemma). Let  D  be a dioid. Then

.V 

 D

A

AA

P

Y

Y V Y  

Proof:  Unlike the Product Lemma, this result may be established directly without an inductive proof. Suppose D PY . For V   Y , we then have the following line of argumentation

.V V V  A

A

Y Y  

Here, we can continue and argue as follows

.V V 

V V 

A A

A A AAAY Y

Y Y Y  

Page 7: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 7/53

Going in the opposite direction, we have the inclusions V V A

, for each V   Y . Therefore,

.V V 

V V 

A A

A

AY Y

Y Y  

This clears the way for us to define a summation operator over  DP .

Definition 4. Let  D  be a dioid. Then define  D   A

PY Y Y .

Theorem 7. Let  D  be a dioid. Then Y Y  is the least upper bound operator over  DA .

Proof: Suppose  I D A  is an upper bound of  D PY . That is, assume that V I   for all V   Y . Then it follows

that

. I I I    AA

Y Y Y  

But clearly Y  is, itself, an upper bound of Y . Indeed, for all V   Y , we have

.V   A

Y Y Y  

Therefore, Y  is the least upper bound of Y .

We can also prove that the  _   operator is distributive.

Lemma 5. Let  D  be a dioid. Then

, , .W 

U V U W V U V D D

  P

Y

Y Y  

Proof: This is a direct consequence of definition 4 and theorem 7 with

U V U V U V UWV  

  A   A

AY

Y Y Y  

while

.W W    W 

U W V UWV UWV    

  A

AY Y   Y

 

3.3. Quantale StructureFinally, this leads to the result

Theorem 8. For any dioid  D  and natural family A ,  DA  is a quantale with a unit 1 . Moreover, if  D  is an A -

dioid, then the map : D DQA

  A  is an A -morphism.

Proof: In general, the restriction of the map

 _ : D DA

A  is an order-preserving monoid homomorphism since

1 1 , .U V UV   A A AA

 

When  D   also happens to have the structure of an A -dioid, then the correspondence reduces to an embedding

: D DQA

  A   into the principal ideals of  D , for in that case, we have U U  A, for all U DA . The

result is then an extension of the A -dioid  D  to a quantale  DA .

3.4. Morphisms

Page 8: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 8/53

Finally, we should have consistency with respect to A -morphisms :  f D E  . In particular, we’d like to have the

 property that

  .U V f U f V   A A A A

 

This result, too, will be true. We will prove it in the following form:

Lemma 6 (The Morphism Lemma). Let , D E   be dioids and :  f D E   an A -morphism. Then     .  f U f U U D

AA   A

 

Proof: The forward inclusion is easy since

        .U U f U f U f U f U   A A AA   A

 

To prove the converse inclusion, define

: . X x D f x f U  A

 

Then  X   is an A -ideal. For if V D A  and ,a b D  with aVb X   , then

  .  f aVb f U A

 

Since  f   is a monoid homomorphism, then

  f aVb f a f V f b . Moreover, by property A4, since V DA ,

then   f V E  A . Therefore,

  ,  f a f V f b f U  A

 

where we apply I1 to the ideal   f U A

. If we can then show that   f V f V     , then it will follow that

  ,  f aVb f a f V f b f a f V f b f U  A

 

so that aV b X     , thus proving that  X    is an ideal. With that given, we could then conclude with the followingargument

    .U X U X X f U f X f U   A A A A

 

It is at this point that the A -additivity of  f   comes into play. Let  x V  . Pick any upper bound  y f V  . Then by

the A -additivity of  f   , we have  y f v  for some v V  . By definition of V  , it then follows that  x v . In turn, by

the order-preserving property of  f     (which is a part of the definition of an A -morphism), it follows that

  f x f v y . Thus,   f x f V   .

This result clears the way to unambiguously defining the lifting of  f     to a mapping :  f D E A

  A A   over the

respective quantales.

Definition 5. Let , D E   be dioids, and :  f D E   an A -morphism. Then define

.  f U f U U D

AA

 

Theorem 9. Let , D E   be dioids, and :  f D E   an A -morphism. Then :  f D E A

  A A  is an identity-preserving

quantale homomorphism; or, equivalently, a P -morphism.

Proof: The identity 1 1A

 is clearly preserved, since

  1 1 1 .  f f   A

A

 

Products are preserved, since

Page 9: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 9/53

        f U V f UV f UV f U f V  A A A A A

 

while

  ,  f U f V f U f V f U f V  A A

A A A

 

for ,U V D . Finally, suppose  D PY . Then

        ,U 

  f f f f U 

A AA   A

AY

Y Y Y  

while

  ,U U    U 

  f U f U f U   

AA

AY Y   Y

 

which establishes our result. In particular, the Morphism Lemma is made use of in the second equality of eachreduction to remove the inner bracket.

3.5. Free Quantale Extensions

This is the final ingredient needed to show that :   Q D DA

  A P  is a functor. Moreover, we may also show that the

extension provided by the function is a free extension, in the sense of satisfying an appropriate universal property.

A functor must preserve identity morphisms. This is almost immediate. In fact, letting  D  be an A -dioid, then for theidentity morphism 1 : D   D D , we have for

1 1 . D DU U U U D A AA

 

Restricted to U D A , this produces the result 1 D   U U U  A A

. The preservation of the functor under

composition is given by the following result.

Theorem 10. Let , , D E F  be dioids with :  f D E   and : g E F   being A -morphisms. Then   f g f g   A AA

.

Proof: Let U D . Then

      .  f g U f g U f g U f g U  A   A A

A A   AA

 

Reducing the left-hand side, we get

  .  f g U f g U f g U  A AA

 

Thus, we finally arrive at the result

Corollary 5. Let :   Q D DA

  Ad P  be given by  D DQA

  A , for A -dioids  D , and   f f  QA A

, for A -morphisms

:  f D E   between A -dioids , D E  . Then ˆ,A A  is a functor.

The universal property is stated as follows. Letting Q  denote a quantale with identity, we may define : QQA  as the

algebra Q , itself, with only the A -dioid structure. This map is actually a functor :   Q D DA

P A  which is termed a

 forgetful functor . It is nothing more than the identity map, where the extra structure associated with aP

-dioid, notalready present as part of the A -dioid structure, is forgotten.

The universal property states that any A -morphism :  f D Q QA  from an A -dioid  D  should extend uniquely to a

unit-preserving quantale morphism (or P -morphism) * :  f D QA . The sense in which this is an extension is that

it works in conjunction with the unit A -morphism : D   d D d D A  with   *  f d f d  . The functor pair

 A A A  comprises an adjunction between DA  and DP  with a unit  D D   . We will not directly prove this resulthere, since it will be superseded by the more general result in the following section.

Page 10: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 10/53

 4. The Adjunction NetworkIf we restrict the family of A -ideals to those generated by B -subsets, then we may obtain a representation for a B -algebra. Therefore, let us define the following:

Definition 6. Let  D  be a dioid, and ,A B  be natural families. Then define : D U U D QB

A AB .

This is a generalization of our previous construction, with  D D QP

AA ; or, Q Q

P

A A. The algebra  DQ

B

A is closed

under products. For, if ,U V DB , then

,U V UV D QB

AA A A 

since ,U V DB , by A2. Similarly,  DQB

A  is also closed under sums from  DQ

B

AB . Let  D   Q

B

ABZ . Since

U D U D QB

AAB   is a monoid homomorphism, then by A6  it follows that :U U 

AZ Y   for some

 DBB\Y . But, then we can write

,U 

U D

  QB

AAA

Y

Z Y  

since, by A3,  D BY . Together, this proves the following result:

Theorem 11. Let  D  be a dioid, and ,A B  be natural families. Then  DQB

A is a B -dioid.

We also have closure under the lifting of A -morphisms:

Theorem 12. Let A  and B  be natural families. If , D D  are dioids and :  f D D  is an A -morphism, then

  . I D f I D Q QB B

A A A 

Proof: Let  I U A

, with U DB . Then   f U D B , by A4. Therefore

  .  f I f U E  QB

A AA

 

This allows us to generalize our previous result to the following:

Theorem 13. Let A  and B  be natural families. Define

: , D U U D f f   Q QB B

A A AAB  

for A -dioids  D  and A -morphisms :  f D D . Then QB

A is a functor.

Theorem 14.  Let A   and B   be natural families with A B . Then :   Q D DA

A  A B   is the forgetful functor. In

 particular, for QA

A is the identity functor on DA .

.Proof: Under the stated condition, every ideal reduces to a principal ideal

.U D D U U   AB A  

This establishes a one-to-one correspondence between  DQB

A and  D . Previously, we pointed out that the product is

 preserved with  x y xy  for , x y D , and we already know that  I I A

 is the identity. This shows that

 DQB

A and  D  are isomorphic as monoids.

Page 11: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 11/53

Here, we can show that sums over  DQB

AB  exist in  DQ

B

A without using property A6 for B . Suppose  DQ

B

AZ . Since

the map   1

:   x x

QB

A is a monoid isomorphism then

    1

: ,V x D x D

QB

A  BZ Z  

 by A4. Therefore,

  .v V v V  

v v V D

  QA

B

A

A A

Z  

Therefore,  DQB

A is a B -dioid.

Thus, we only need to show that : x D xQB

A is B -additive. To that end, let U DB . Then, we have

  .u U    u U 

U u u U U    

QB

A A

A

 

This shows that, as a B -dioid,  DQB

A is isomorphic to  D .

Finally, we already know that   f f  QB

A A  preserves arbitrary sums, for A -morphisms :  f D D . Therefore, QB

A  isa B -morphism. This establishes our result.

Finally, the following theorem shows the sense in which the hierarchy of natural dioids may be considered as a chain offree extensions.

Theorem 15. Let A  and B  be natural families with A B . Then QB

A is a left adjoint of QA

B.

Before proceeding with the proof, it will first be necessary to describe in more detail the result being sought out here.

We are seeking to show that the functors E QB

A and U Q

A

B forms an adjunction between the categories DA  and

DB . This requires showing that there is a one-to-one correspondence between A -morphisms :  f A B U  and B -

morphisms : g A BE , for any A -dioid  A  and B -dioid  B ; that is natural, in the sense that it respects compositions

on both sides. Let the correspondence be denoted by the following rules

**

: :, .

::

  f A B g A B

 g A B  f A B

U E

UE 

To implement the one-to-one nature of the correspondence, we require

  **

**

: :, .

  f A B g A B

  f f     g g 

 

U E 

To implement the naturalness condition, we require

* *

: , : , :.

 g A A f A B h B B

h f g h f g  

U

U E 

The candidate chosen for this correspondence is   *

  f U f U  A . But we must first show that this is well-

defined. This is done through the following lemma, which is an elaboration of an argument presented originally in [20].

Lemma 7. Let  A  be an A -dioid and  B  a B -dioid with :  f A B U  an A -morphism. Then

    .  f U f U U A   AB  

Page 12: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 12/53

Proof: It is important to note that this is also an existence result. Though   f U B B , by A4, it need not be the case

that   f U BA

B . Therefore, there is no guarantee at the outset that the latter be summable in  B .

However, we do have the following result. Making use of the Morphism Lemma (lemma 6), we know that

    .  f U f U U A

AA   A

B  

Moreover, since   f U B B , by A4, then the sum   f U B  is defined, and we can write

    .  f U f U f U  A AA

 

This shows that   f U   is an upper bound of   f U A

. But it is already the least upper bound of the smaller set

  f U  . Therefore, it must be the least upper bound of the larger set, as well.

On the basis of this result, the map * :  f A BE  is well-defined. With this matter resolved, we can then proceed to the

 proof of Theorem 15.

Proof:  (of Theorem 15). That fact that

*  f f    is one-to-one comes from showing that

 f    is recovered from the

 principal ideals by   *  f x f x . In particular, since  x  is an interval, then

  .  f x f x f x  

Therefore,

  * .  f x f x f x f x  

To show that * :  f A BE  is actually a B -morphism, we must first show that the monoid structure is preserved. For

the identity, noting that 1 1  f B U , we have:

    * 1 1 1 1 1 1.  f f f f    

For products, we can write .  f UV f U f V f U f V   

 Noting that the sum on the right distributes and applying the definition of * f   , we obtain the result

* * * .  f U V f U f V  A A A A

 

 Next, we must show that the summation operator is preserved over  AEB . Let  A A E QB

AB BZ . It’s at this point that

we use property A6. Since U A U A QB

AAB  is a monoid homomorphism, then we may assume that there is a

set  ABBY   such that :U U  A

Z Y . Then the summation   *  f f     A

Z Z  can be rewritten,

using the Sum Lemma, with

.U U 

U U 

A

A A

A AY Y

Z Y  

Using the Morphism Lemma, we then have

  .  f f f   A A

Z Y Y  

The application to the union can be broken down to that on the component sets,

  .U 

  f f U 

Y

Y  

Page 13: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 13/53

Since each set   f U B B  (by property A4), the least upper bound   f U B  is defined. The associativity of least

upper bounds, which is a general property of partially ordered sets, can then be used to write  –  making use, again, ofthe Sum Lemma –  

  .U U U 

  f U f U f U 

  A

Y YY

 

Similarly, applying associativity again, we can write

  * .U U 

  f f U f U 

A A

Y Y

Z  

From the other direction, we may write,

  * * .U U 

  f Z f U f U 

A A

Y Y

 

which establishes preservation of sums over  AEB .

The additional property of naturalness requires showing that this correspondence be well-behaved with respect tocomposition with morphisms from the respective categories. In particular, for an A -morphism : g A A  and a B -

morphism :h B B , we need to show that * *h f g h f g  U E .

To this end, let U AB  and let  I   denote the interval   f g U B   UA

. Noting, by the Morphism Lemma, that

 I f g U    A, we can write

    * *h f g U h f g U h I   E EA A

 

while

      *

.h f g U h f g U h I   U U UA A

 

Since  I   is an interval in  B , then   h I h I   U  follows, which establishes the result.

It is worth pointing out that  B BEU . The ideal U U 

A

 is principal, noting that U B

 is defined for all

U B B , since  B  is a B -dioid. The map  g A

 applied to this ideal results in

     g U g U g U g U g U  A A A   AA

 

for a B -morphism : g B B . Therefore, the composition E U  is just the identity functor on DB .

Corollary 6. Let ,A B  be natural families with A B . Then Q QB A

A B is the identity functor on DB .

In addition, we may show that the adjunctions behave consistently under compositions.

Corollary 7. Let , ,A B C  be natural families with A B C . Then Q Q QU   V U

V W W, for any permutation , ,U V W  of

, ,A B C .

Proof: It is actually only necessary to take , ,A B C  or , ,C B A  as the permutations of , ,U V W  since the other

cases can be derived by composition using corollary 6.

These two cases result from showing that adjunctions are closed under composition which is a general category-theoretic result. The adjunctions here involve left-adjoints of forgetful functors. However, since the forgetful functorsclose under composition, and the composition of adjunctions is also an adjunction, then the result follows directly fromthe uniqueness of left adjoints [23, Corollary 1, p. 83].

Expand this proof in order to serve as a set up for the subsequent discussion on power series.  

Page 14: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 14/53

Theorem 16. The functor :   Monoid DA A  and the forgetful functor ˆ :   D MonoidA A  form an adjunction pair.

Proof: This is the essence of the properties A1-A4. Here, the unit : M    m M m M   A   is the inclusion. The

extension of the monoid homomorphism ˆ:  f M A A  to an A -morphism * :  f M AA  is related to the least upper bound operator by

* ` .  f U f U U M 

  A  

The naturalness of this correspondence is, in fact, the essential point of Theorem 1. In fact, the construction of A -dioids is a special case of a general construction, through adjunctions, of what are known in category theory as T-algebras [23]. To complete the proof will actually require establishing properties

D4  ,m m m D  

D5    ,U 

U D

  AA

Y

Y Y  

D6   

a A

  f A f a A M 

  A , where :  f M DA  is an A -morphism

which are all elementary consequences for partially ordered sets.

It follows, also, from these considerations that QB

A  A B   for A B   and that, under the same condition,

ˆˆ QB

AB A .

III: A Unified Framework for Grammars and TransductionsExpanding part I of the Algebraic Approach series, a more refined framework is provided for grammars andtransductions over arbitrary monoids in which the key role is played by a generalization of bisimulation equivalence togrammars.

Two varieties of grammar are introduced: “separable”  and “contextual”  grammars, which not only generalizegrammars respectively of types 2 and 0 in the Chomsky hierarchy to arbitrary monoids, but also generalize thecorresponding transduction classes (the simple syntax directed translations and Turing transductions, respectively) to

 product monoids.

To capture the latter result, an algebraic formulation for transducers is employed in which a distinction is drawn between generators, translators and recognizers. Closely paralleling the underlying structure of monoids as a braidedmonoidal category, a duality result connecting the respective varieties of automata is established.

Keywords:Language, Grammar, Transduction, Translation, Monoid, Context-Free, Syntax-Directed, Automata, Turing, TensorProduct

1. BackgroundIn part I of this series [15], a hierarchy of monoid subset families was defined, in which each subset family isassociated with a monad connecting it to the category of monoids. From this, using the T-Algebra construction [23], acorresponding hierarchy of algebras was devised, resulting in what are known as Eilenberg-Moore Categories. Suchsubset families are referred to, here, as natural families, and the corresponding algebras - which all include the

structure of a dioid (= idempotent semiring) - as natural dioids. The range of possible families mirrors the classicallanguage hierarchy, and includes representatives for types 0, 2 and 3 in the Chomsky hierarchy. A brief discussion ofthese topics appears in section 3.

Through this device, we formulated the backbone of what we termed the  Algebraic Approach, whose essence is that alanguage or transduction is no longer regarded as a set of words or word pairs constructed out of one or more alphabets,

 but as an element of an algebraic structure. In the classical formulation, languages are subsets of free monoids

Page 15: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 15/53

* M X  .1 Within our more general framework, the subset families for free monoids comprise the free members ofeach T-algebra, while the subset families for more general monoids give us the Kleisli subcategory. Thus, for instance,corresponding to the respective families  M F ,  M R   and  M P  of finite, rational and general subsets of monoids  M   are the categories of dioids, *-complete Kleene algebras and quantales with unit. The free elements of this category arethe finite, regular and general languages, while the Kleisli subcategory consists of the subset families of the monoidsthemselves.

In the classical formulation, the specificity to free monoids applies not just to languages, but to grammars, translations,automata and transducers, with an apparent absence of formalisms in the literature other than for free monoids. Thisabsence is felt most significantly in the unfortunate duplication of formalisms. Since a transduction between alphabets

 X   and Y   is just a subset of the product monoid * * X Y  , then a consequence of generalizing grammars and languagefamilies to arbitrary monoids is that we bring both languages and transductions into a unified formalism; for instance,

 providing a unifying framework for “context free languages”  and “simple syntax directed translations”. In [15], wemade only passing mention of this generalization, relegating its outlines to an appendix. Here, in section 2 we will

 provide a treatment of generalized grammars, and of transductions in section 4.

Finally, in section 5, concluding remarks (and corrections) are made concerning the type 1 languages, and the roles thaterasure, transductions, and the Duality Theorem (theorem 4.3) play in a broader formalism suitable for embodyingmulti-channel, multi-party communications. The emergence in formal language theory of algebras such as quantales

and monoidal categories reveals what appears to be a cross-connection with the mathematics used in the foundations of both classical and quantum physics, perhaps bringing us one step closer to realizing von Neumann’s goal of providinga framework for automata theory cast in the same mould as that which he helped establish for foundational Physics. 2 

In the following, we will assume familiarity with the semigroups, monoids, partial orderings, semi-lattices and lattices.In addition, we will assume basic familiarity with categories, and the related concepts of functors and naturaltransformations. References include [3], [8], and for category theory, [22], [23], [24]. We also make reference tomonoidal categories, which are discussed further in [23], [26]. We use the notation 1 X    to denote the identity

function/homomorphism on a set/structure  X  . We use * X    and  X    to refer respectively to the free monoid and

semigroup generated by  X  . Monoid identities are generally denoted 1 , thus * 1 X X  . Monoid homomorphisms

are generally referred to as morphisms, and images under map by a function are denoted :  f A f a a A  rather

than   f A . We will also use  _ _    to denote both Cartesian products and direct monoid products, relying on

context to distinguish between the two (e.g. if , M N   are monoids and Q   is an ordinary set then  N Q M    is a

Cartesian product). Finally, references to [15] will be prefixed by I (e.g. Lemma I.1, the Composition Lemma, for [15]Lemma 1).

2. Grammars over Monoids2.1. Free Extensions as a Categorical AlgebraIn I.A.1, a central role is played by free extensions in a formulation of grammars for general monoids. Associated withthe free extension  M Q  of an algebra  M   by a set Q  is a pair of destructors:3 a morphism ,   : M Q   M M Q  and a

map ,   : M Q   Q M Q , denoted  and  for brevity. A constructor  is defined by the universal property as the unique

morphism , :  f s M Q M    associated to each morphism :  f M M    and map : s Q M    such that

reconstruction identities 

,  f s f    and

,  f s s  hold. In the following, we treat

 and  as inclusions, and

1 “Let T  F V   be the free monoid generated by

T V  , i.e. the set of all strings in the vocabulary

T V  . A language is, then, a subset of T 

 F V  ”, [3, p.

8].2 “We are very far from possessing a theory of automata which deserves that name, that is, a properly mathematical -logical theory” [28]. It was von

 Neumann who earlier established the foundational roles played by Boolean logic and Quantum logic, respectively, in classical and quantum physics.3 In here and the following, the term constructor  is used to designate an operation that constructs a morphism for composite types from morphismsfor simpler types, while the destructors are morphisms that break a composite type down to its component types. 

Page 16: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 16/53

regard ,  f s  as a simultaneous extension of both  f   and  s .4 The uniqueness required by the universal property is

ensured by the uniqueness identities  , , g f g s g f s   (for morphisms : g M M  ) and

, ,, 1

 M Q M Q   M Q .5 

An important application of the universal property is the construction of the degree function   deg : 0,1, 2, M Q   ,

which combines the constant functions : 0  f M     and : 1 s Q . Thus deg   counts the number of variables

from Q   in  M Q . Additional applications of the universal property allow us to establish the following

isomorphisms

      *, , M Q Q M Q Q Q Q M M Q Q 1  

where 01  is the 1-element monoid. For instance,

   

, , ,

, ,, , ,

, , : ,

, : ,

 M Q Q M Q Q M Q QQ Q

 M Q M Q M Q Q M Q Q M Q Q

 M Q Q M Q Q

 M Q Q M Q Q

 

In addition, for free monoids, we have the following consequences

    ** *, . X Q X Q X Q X Q X Q 1 1 1 1  

2.2. General Grammars

In the classical account (e.g. [5]), a grammar , , ,G Q X S H     contains a set Q   of variables, a relation  H    over

*

 X Q  comprising the  phrase structure rules and a  starting configuration  *

S X Q . It is normally assumed

that S Q . If not, one can add a new variable S Q  and a new rule ˆ,S S H   to yield an equivalent grammar with

this property. In addition, it is assumed classically that  X Q . This reduces *

 X Q  algebraically, to the free

extension of * X   by the set Q . Thus, when we generalize from * X    to arbitrary monoids  M  , the configuration set

 becomes the free extension  M Q . Accordingly, we define a grammar over a monoid  M   as a structure , ,G Q S H    

composed of a set Q  of variables; the starting configuration S M Q  and a relation  H M Q M Q .

A transition relation  H   over  M Q  (denoted  for brevity) is generated from  H   by the rules

 

   

, ,,: , : , : , : ,

, , ,   , , , ,: , : , : .

 R L

 M Q   H H 

 H M Q   H H 

 

R T H H

P H H

 

We may also write n  to indicate the number 0n  of times  H   is used in a derivation  (i.e. the number

of applications from , , , L RH H H P ). One may readily verify that R   taken with any of the sets , ,T C H ,  RH ,

 LH   or ,T P  suffices to equivalently define the relation  H  . Finally, corresponding to each  M Q   is the

4 In place of ,  f s , which we used in I.A.1, we use the notation ,  f s , drawing an analogy with the coproduct constructor in [22, Section I.1].

5 To make this truly a categorical algebra requires making explicit the forgetful functors ˆ :   M Monoid Set , writing ,ˆ:

 M Q  Q M Q M  and

replacing the second of equations reconstruction identities respectively by

, ,ˆ , , , .

 M Q M Q  f s s f s f   M  

In here and the following we will take the shortcut of treating M  as an identity functor.

Page 17: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 17/53

monoid subset   :  H  H   m M m   (denoted   for brevity) derivable from . We have the inclusion

 by C , while  follows from  by R   and T . Finally,    H 

 L G S   defines the subset of

 M   generated by the grammar.

2.3. Simulation Ordering and Contextual Grammars

In the classical account of grammars for free monoids*

 M X  , one also assumes that  H    is finite and, for each ,   H  , that deg 0 . As we will shortly see, this permits the conversion of the grammar to a form we call

contextual : a form in which S Q  and  H   is reduced to a subset  H Q M Q . However, when generalizing to

arbitrary monoids, the condition deg 0  does not suffice to yield this type of grammar nor even a grammar that

generates a morphism of a classical type 0 language. When a monoid is not free, if factoring over the monoid is notrecursive, then matching of the left-hand sides phrase structure rules may be non-recursive. Classical proofs of keytheorems (e.g. substitution closure, property

5A  which is described briefly below) may cease to hold in the general

context of grammars over arbitrary monoids.6 

To correct this problem, we adopt an approach analogous to that taken in [27]. For free monoids * M X  , we define M T  as the family of languages represented by type 0 grammars over alphabets drawn from finite subsets of  X  . Since

the classical type 0 languages are closed under morphisms between free monoids (e.g. [30, theorem 9.2.3]), with thefree monoids comprising a  full   subcategory of the category of monoids, then we may define the family  M T , for

general monoids  M   by taking any generating subset  X   along with the canonical surjective morphism *: X M   

and setting

  * *: . M X L L X  T   T T  

The independence of the generating subset chosen is, then, a consequence of the closure of the family under morphisms

 between free monoids. Thus, if *: X M    another canonical surjective morphism, we then choose

1ˆ x x  and define a morphism * *ˆ :  X X   by ˆ ˆ x x . Then it follows that ˆ    and that

  * * *ˆ   . X X X  T T T  

The reverse inclusion is obtained analogously.

A similar approach may be adopted for the subset families  M C  and  M R   corresponding, respectively, to the extensionof type 2 and 3 languages to general monoids. However, as we will soon see, direct proofs of the morphism closure

 property are possible using the concept of simulation ordering.

A partial resolution is provided by the following result.

Theorem 2.1: Simulation Ordering and Bisimulation Equivalence 

Let ˆ ˆ ˆ   ˆ, ,G Q S H     and , ,G Q S H    be grammars respectively over monoids ˆ M    and  M  , and suppose there is a

morphism ˆˆ:h M Q M Q    such that

        1 1ˆ ˆ ˆ   ˆ, , , .h S S h Q Q h Q Q M h M M    

Consider the following assumptions:1.  for all ˆ   ˆˆ ,   H  ,   ˆˆ

 H h h ,

2.  for all ,   H   and ,m m M    , if ˆh m m  then ˆˆˆ

 H   for some 1ˆ   h m m

,

3.  for all ,   H   and ,m m M    , if ˆh m m  then ˆˆˆ

 H   for some 1ˆ h m m

.

6 For instance, the proof of5

A  in Lemma I.1 tacitly assumes the freeness underlying monoid at key points.

Page 18: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 18/53

Page 19: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 19/53

where we define the morphism * *ˆˆ :   X Q Q  by

ˆˆ ˆ ˆ: , 1 ,QQ x X x X   

and the morphism   * *ˆ:h X Q X Q  by

ˆˆ1 , : . X Q X Qh h x X x X  

   

Condition 1 is satisfied since *

ˆ   1 X Q

h

. For condition 2, we first note that by an inductive argument we have

  ˆ  ˆˆ

 X  H    for any 1ˆ   h . So, suppose ,   H    and ˆh m m . Then ˆ

ˆ ˆ H  H 

. Taking

ˆ   ˆ   m m , it follows by P   that ˆˆ   ˆ

 H  H   m m . Since   ˆ

ˆˆ X  H 

m m , it follows from T   that

ˆˆˆ

 H  . Thus, applying theorem 2.1 and noting that * *1

 X X h   , it follows that     ˆ L G h L G L G . The

assumption that deg 0   for each ,   H    means that the grammar G   has the form ˆ ˆS Q   and

*ˆ ˆˆ H Q Q X   which is a further specialization of the contextual form.

For contextual grammars, a simpler account of simulation ordering may be established by the following result.

Theorem 2.3: Simulation ordering (contextual form) 

With the same notation of theorem 2.1, assume that the grammars G  and G  are contextual and in place of 3, assume

that: 4) for ˆ ,h H    there exists 1ˆ h   such that ˆˆ ˆ

 H  . Then it follows for all ˆˆˆ   M Q   and

 M Q  where ˆ H h   , that ˆ

ˆˆ H 

 for some 1ˆ h .

Proof:

As in the proof of theorem 2.1, for the inductive step, we assume by way ofL

H  that

  ˆ   , , , . H h H Q  

Then since 1 ˆh Q Q  we must have a factoring ˆ ˆˆ ˆ , with

  ˆ ˆ ˆ   ˆ, , .h h Q h  

By 4, it follows that ˆˆ   ˆ

 H   for some 1ˆ   h . Therefore, we may set ˆ ˆ ˆ ˆ   and use P  and T   to conclude

ˆˆˆ

 H  .

QED

As we shall see, a consequence of theorem 2.3 is that the classical reduction of type 0 grammars to contextual formholds true for the family  M T  for general monoids  M  , with an analogous restriction to the form where S Q  and

* H Q Q X  , where  X M   is a finite subset.

2.4. Separable and Algebraic Grammars

We next consider the family of grammars subject to the restriction that the phrase structure rules comprise a finitesubset  H Q M Q , thus generalizing the family of grammars known classically as context-free. However, though

the classical terminology is well-established, a more apt term for these grammars - which we will adopt here - isalgebraic. In its place, a better characterization of context-freeness is one that captures the essence of the term: namely,that sets  be independent of context, i.e. . To this end, we call a grammar separable if

1.  whenever m , where m M  , then m , and

2.  whenever , then there exists a factoring  such that  and .

Page 20: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 20/53

Page 21: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 21/53

idempotent semiring), *-complete Kleene algebra, “countable semiring”7 and quantale with unit. In addition, we also

have the algebras corresponding to C , which are equivalent to the “ -continuous Chomsky algebras” of [13]; i.e.

dioids closed under the least solutions of finite least fixed point systems, possessing a certain continuity property. Here,we shall even be able to go as far as to provide a topological underpinning to both this form of continuity and the “* -continuity” property of the *-continuous Kleene algebra.

To review, an A -dioid  D  is a partially ordered monoid which is closed under least upper bounds supU U   from

U D A   such that distributivity holds   UU U U     for ,U U DA . For consistency, this requires

that we define a natural family A  to be a correspondence that:

0A : associates with each monoid  M   a subset family  M M A P ,

1A : such that  M M F A .

2A :  M A  to be closed under products, endows the family with the structure of a monoid partially ordered by subset

inclusion, thus allowing us to consider the family  M AA .

3A : By also requiring that  M A  be closed under unions from  M AA , we endow  M A  with the further structure of

an A -dioid.

4A : Finally, we require that  M A   be closed under morphisms :  f M M  ; that is, for any U M  A ,

:  f U f m M m U M  A \.As a result, A  becomes an endofunctor on the category of monoids and morphisms. A consequence of these properties(Theorem I.9) is:

6A : ( surjectivity) if the morphism :  f M M   is surjective, then so is :  f M M A A .

3.2. Morphism Closure for R  , C  and T .

The morphism closure property4

A  for R  , C  and T  may be directly established as a consequence of theorem 2.3 by

the following.

Example 3.1: Construction I  

Let ˆ ˆ ˆ   ˆ, ,G Q S H     be a contextual grammar over a monoid ˆ M    and let ˆ:h M M    be a morphism. Define the

grammar , ,G Q S H   , where

  ˆ ˆ ˆ ˆ ˆ ˆ   ˆ, , : , ,S h S Q Q H h h H    

where we extend the morphism to ˆˆ:h M Q M Q    by setting 1QQh   . Then property 1 of theorem 2.1, along with

its assumptions on h , are satisfied, as is property 4 of theorem 2.3. Thus, we conclude that   ˆh L G L G . A key

 point in establishing 4 for this construction is noting that   1h h  for Q , since h  is bijective on Q .

Example 3.2: Construction II  Conversely, suppose that we start out with a grammar , ,G Q S H    over a monoid  M   of this form. Then define the

free monoid *ˆ ˆ M X  , the set ˆ   ˆ : X x x X    and a morphism ˆ:h M M    by ˆh x x . Define the contextual

grammar ˆ ˆ   ˆ, ,G Q S H    over ˆ M   by selecting any 1S h S   and setting

  *ˆ   ˆ, : , . H H Q Q x x H  8 

7 Equivalently described as a dioid possessing countable distributivity and least upper bounds for countable subsets.  8 If  X   is infinite, then we only take a finite number of ˆ, x , sufficient in number to represent all the , x H  .

Page 22: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 22/53

Then, once again, we have a construction satisfying theorem 2.3. Thus, it follows that   ˆ L G h L G , with

ˆ   ˆ L G M  T . Similar results hold if G  is algebraic or one-sided linear.

We note that in both constructions, if either grammar is one-sided linear, algebraic or contextual, then the other sharesthis feature. Therefore, we establish the morphism closure property for R  , C  and T . Moreover, since the reduced

contextual form *ˆ ˆˆ ˆ H Q Q X   is preserved by this construction, yielding a grammar of the form where S Q  

and * H Q Q X   for some finite subset  X M  , then the classical reduction of type 0 grammars to this form

applies generally.

3.3. Naturality for R  , C  and T .

A key result (Theorem I.8) is that the conjunction of3A  and

4A  is equivalent to:

5A : (closure under substitutions) an A   substitution, i.e. a morphism : M M  A , lifts to a morphism

* :U M U M   A A .

For , ,R C T , the corresponding property for free monoids * M X    recovers the well-known classical results forsubstitution closures of types 0, 2 and 3 languages ([30, Theorems 9.2.1, 9.2.2, 9.2.3]). We may generalize the result

with the following construction that we describe generically for , ,A R C T .

Let : M M  A  be an A -substitution and U M  A  given by U h L G  for a grammar , ,G Q S H    of type

A  over * X  , via the morphism *:h X M  . For each  x X  , let  s x M  A  be given by    x s h x h L G  for

a grammar , , x x x xG Q S H    of type A  over a monoid *

 x X  , via the morphisms*

: . x

 x X 

h X M 

 

We assume, without loss of generality, that the sets : x X x X   are mutually disjoint from one another and from  X  .

Define the A -substitution ˆ :  x x X L G . Then, it follows that ˆh h  over * X  . Therefore,

        * * *ˆ   .U h L G h L G h L G h L G h L G  

Thus, the classical closure result –  which entails

*

*

 x

 x X 

 L G X 

 

A  

 –   combined with the closure of the A -subsets under the morphism h   yields the corresponding closure result

* U M  A  for general monoids.

Corollary 3.3:  R  , C  and T  are natural families.

3.4. Finite GenerativityFollowing the proof of Theorem I.10, brief mention was made of the property we termed

7A : ( Finite Generativity): for each U M  A , there is a finitely generated submonoid 0 M M   such that 0U M A .

For a given grammar , ,G Q S H    over a monoid  M  , if  H   is finite, then we may reduce each ,   H   and S   to

a form 0 1 1   k k m q m q m   where 1 , , k q q Q   extracting out all the factors 0 , , k m m M    of S    and of all the

,   H   and collecting them into a finite subset  X M  . Then, it follows that  M 

 L G X  , where M 

 X M   

is the submonoid generated by  X  . Thus, we obtain the following result

Page 23: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 23/53

Page 24: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 24/53

 

1

1

1

1

 _ ,1 : , : ,

1 , _ : , : .

 M M M M  M 

 M M M M  M 

 M M M M 

 M M T M M 

1 1

1 1 

For reference, the isomorphisms M   and

 M   are respectively referred to as the left unitor  and right unitor , while the

other two isomorphisms

: , : MNP MN  M N P M N P M N N M   

are respectively the associator  and commutor .

Additional requirements are also readily verified, but will only be noted in passing, since they will not be used in thefollowing. These are: that the isomorphisms be natural, e.g.

1 , 1 , M M M M   f f f f   1 1  

for morphisms :  f M M   and that the category be coherent, meaning that any two morphisms constructed out of

, T    and  _, _   with compositions and identities are equal if they have the same source and target. The braided

monoidal categories are distinguished from the more general family of monoidal categories which need not have thecommutor nor any of its associated identities.

4.2. Transducers and Automata

A transducer , , ,T Q I F H    over a monoid  M N   consists of a state set Q , subsets , I F Q  respectively of initialand final states and a (possibly infinite) subset  H Q M N Q . The relation  H   is defined on  N Q M   as the

closure of the one-step relations  H qm nq  for , , ,q m n q H      under applications of the following

, ,,: , : , : .

 H  H H 

 MN MN 

 H H H 

m n M N   N Q M 

n m n m

R T P  

Finally, the subset generated by the transducer is

, : , , . H  L T m n M N im nf i I f F   

For the case  M   1   the transducer reduces to a  generator   for  N  ; and for  N   1 , to a recognizer   for  M  , allcollectively referred to as automata. One may then write, in the respective cases,  H Q N Q  or  H Q M Q .

These conversions are both an application and reflection of the natural isomorphisms   N N  1  and  M M  1 .

4.3. The Duality Theorem

A transducer may be equivalently expressed as a recognizer or generator, where the one-step transition  H qm nq  is

replaced respectively by the read relation ,   R H q m n q   and write relation ,W  H 

q m n q . These conversions

correspond to the natural isomorphisms

  . M N M N M N  1 1  

However, instead of proving these results directly, we may take advantage of the monoidal category structure formed by the monoids and prove a more general result: the one corresponding to the natural isomorphism

 M N P M N P  .

Theorem 4.1:  Duality Theorem Let , , M N P  be monoids and 0 0, , ,T Q I F H    and 1 1, , ,T Q I F H    transducers, respectively, over  M N P   

and  M N P   such that

  0 1, , , , , , , , .q m n p q H q m n p q H    

Then

0 10 0 0 1, , , . H H MNP q m n p q qm n p q L T L T    

Proof:

Page 25: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 25/53

The second part of the theorem follows trivially from the first, by using the definitions for 0 L T   and 1 L T  . For the

first part, we argue inductively from0 H 

 to1 H 

, the argument for the converse being similar. The induction is non-

trivial, since it needs to account for the reversal of the roles played by  N    from reading to writing. The inductive

assertion is that if 0

, , H  pq m n p q m n , then there exists a factoring 0n n n   such that

  1   01, , H  p qm n p q m . This recovers the first part of the theorem as a special case.

For the one-step transitions and for R  , the assertion is trivial. Therefore, we need only establish the result inductivelyfor T  and the restricted forms of P . For T , suppose

0 0

, , , . H H  pq m n p q m n p q m n  

Then applying the inductive hypothesis to each step and applying T , we factor 0n n n , 1n n n  and write

1 10 11, , , 1, , . H H  p qm n p q m p q m n p q m  

Multiplying the second transition on the left by0

n  (i.e. applying P ), and using T , we get

  1   0 1 0 11, , , . H  p qm n n p q m n n n n  

For P , suppose

0

, , H  ppq mm nn pp q m m n n  

arises from

0, , , , , . H  pq m n p q m n m M n N p P   

Again, applying the inductive step, we have a factoring

  10 0, 1, , . H n n n p qm n p q m  

Applying P  to this, we obtain the result

    1   0 01, , , , H  pp qmm n pp q m m nn n n n  

thus rounding out the induction.QED

4.4. The Transduction TheoremBecause of the duality theorem, we can represent a transducer between  M   and  N   as a generator over  M N   with  H   

replaced by W  H  , which is (possibly infinite) right-linear and then treat it as a grammar. This correspondence iscaptured by the following result.

Theorem 4.2: Transduction Theorem Let , , ,T Q I S H     be a transducer over  M N  , and define the (possibly infinite) right-linear grammar

, ,T G Q S H    where S Q  is chosen as the start symbol, and

  , , : ,1 : .W Q Q S H H S i i I f f F    

Then T  L G L T  .

Proof:

Since the only one-step transitions from S    are to start states i I    and the only one-step transitions of the form

, H q m n  are those which arise from ,W  H q m n f      for a final state   f F  , then it follows that , H S m n  if

and only if , H i m n f       for some i I    and   f F  . This is the defining condition for ,m n L T   . Thus,

 L G L T  .

QED

4.5. Rational Transductions

The classical definition of a finite transducer (e.g. [30, section 7.2, p. 340]) over * * M N X Y    is a structure

, , , , ,T Q X Y H S F    with S Q  and  F Q . The configurations comprise the set  N Q M   (with the assumption

Page 26: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 26/53

Page 27: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 27/53

context-free grammar over the product monoid, and vice versa. Having established the correspondence for free

monoids * M X   and * N Y  , we may then proceed to lift the result to general monoids with Constructions I and II.

Therefore, we arrive at the following result:

Theorem 4.4: The syntax-directed translations between monoids  M    and  N   are given by the family  M N C  of

context-free subsets of the product monoid.

A similar process may be applied to push down transducers over * * M N X Y  . Classically (e.g., [30, section 5.2, p.

259]), it is defined as a structure , , , , , ,T Q X Y Z H I F    with and

* * *. H Q X Z Q Z Q Z Y   

The configurations are reduced to the space * * *Y Z Q X    with  H   generated by closure under C , R   and T  from the one-step relations

  , , , , , , , , , , , . zqx n q q x z q n H qx n q q x q n H   

The language is defined by

* *, : . L T m n X Y sm n f f F   

When we rewrite the state set as *Q Z  , the corresponding automaton is * , 1 , 1 ,Q Z I F H    over the free

monoid * X  . In  H  , while the one-step transition qx q   is replaced by ,1 , H q x q   , each one-step

transition  zqx q  must be replaced an entire set of relations: , , H q z x q  for all * B . The result is

an automaton with the following symmetry condition: if 1 , then , , H q x q     implies

, , H q x q  for all * Z  . The conversion of  F    to 1 F    imposes the empty stack condition. If we

were to relax this condition, then we would replace  F   by * F Z  , instead. Then a second symmetry condition would

arise, stating that if ,  f     is a final state then , ,  f      is a final state, for all * Z  .10 

5. Conclusion and Further Topics5.1. The 2008 Treatment of S  

Classically, a family  M S  for type-1 languages may be defined for free monoids * M X   which satisfies properties,

0A ,

1A   and

2A , but not

3A   even at the classical level: the morphism closure of type 1 languages are type 0

languages. Instead, it is the non-erasing  morphisms that type 1 languages are closed under. To be able to account forthis requires either restricting to a subcategory of monoids with non-erasing  morphisms, or adding structure to themonoids (e.g. normed monoids, following the treatment in Appendix I.A.3) to serve in place of the category ofmonoids. A similar approach was adopted by Ésik and Ito [10] and Straubing [27], the latter introducing the C -variety,which lifts a subcategory C   of the category of finitely generated free monoids to the subcategory of the finitelygenerated monoids. Typically, the restriction placed on morphisms is that they be length-preserving (and thus non-erasing).

5.2. The Duality Theorem and CommunicationsErasing morphisms also come into play with multi-layered communications. When modelling how the sender andreceiver each appear to one another, part of what lies on one end comprises “hidden degrees of freedom” seen from the

vantage point of the other end. One may thus think of a spoken expression as an element of  M N  , where  M   containsthe hidden or “non-verbal” channels, and  N   contains the part which is expressed by orthography or verbally (or onseparate channels by prosody). From the vantage point of the sender, the interaction is represented by an element of the

10 So, perhaps lending partial fulfillment to von Neumann’s attempt [28] at expanding his foundational work in physics to automata theory, we maydraw the analogous correspondence of  H   to the Hamiltonian for a dynamics, the restriction on the forms of one-step rules to  selection rules, and thesymmetry conditions to symmetries imposed on the dynamics of a physical system and its states.

Page 28: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 28/53

 product monoid  M N P  , where  P    is the reaction of the receiver. On the receiving end, the reader maps the

expression that is heard or otherwise perceived as an element of  N P  , and the interaction from the vantage point of

the receiver is an element of  M N P  . Ideally,  P    is a reflection of  M  , while  N    is used to establish that

reflection. This is where the duality theorem comes fully into play. Here, underlying the duality is the monoidequivalence  M N P M N P  , where the dual roles of  N    as output (for the sender) and input (for the

receiver) are made explicit.

IV: Natural Families and Natural DioidsFurther expanding the treatment in part I of the Algebraic Approach series of what we here term “natural families” and“natural diods”, define topologies associated with the respective families, and provide algebraic generalizations ofword reversal within the framework of involutive monoids, of tensor products within the framework of braided tensorcategories, as well as of free extensions and matrix closure.

Expanding on part II of the Algebraic Approach series, we generalize our formulation of the hierarchy of natural dioidsdownward to partially ordered monoids. In addition, we broaden the scope of the natural family construction toidempotent semirings, and lay out the framework for a theory of idempotent power series.

Keywords:

Tensor Category, Tensor Product, Category, Adjunction, Monad, Free Extension, Topology, Locale, Frame, PowerSeries, Idempotent, Dioid, Quantale, Semiring

1. Summary and ConventionsExpanding on the treatment in parts I and II of this series [15], [16], we will provide a deeper formulation of thehierarchy of natural families and natural dioid that brings to the forefront more of the elements of the underlyingcategorical algebra.

In section 2, we review the hierarchy of natural families and dioid categories. The basic constructions (free extensions,tensor products) are discussed in section 3, along with closure properties that embody classical word reversal andmatrix algebras. In section 4, we outline the basic features of the network of adjunctions that link the members of thedioid hierarchy. Two extensions beyond the treatment in [16] are discussed here: the downward extension of thehierarchy that includes the category of partially ordered monoids as its minimal member, and the generalization of the

natural dioid hierarchy to a form suitable for representing power series over idempotent semirings.

Finally, we close with some concluding remarks in section 5, where we discuss the extension of the dioid hierarchy tosemirings. An appendix (section A) has added to provide further detail on adjunctions and (co-)monads, and toestablish the notation we use for their categorical algebras in the spirit of [17, part 1] and [22, part 1]. A more detailedtreatment of adjunctions, monads and co-monads may be found in [23]. Tensor categories are discussed further in [24],[26].

Items in [15], [16], section III are prefixed respectively by I, II and III (e.g. Lemma II.4, the Sum Lemma). We observethe conventions described in section III.1. In addition, we use , ,A B D  to refer to generic natural families. A morphismmeans a monoid homomorphism, similarly an antimorphism is a monoid anti-homomorphism, an A -[anti-]morphismis a[n] [anti-]homomorphism over the category DA  (defined in section 2.1).

2. Naturality2.1. Natural Families and Dioids

A natural dioid  D  contains the structure of a monoid: a product ,d d D dd D  and identity 1   D . In addition,a partial ordering is imposed that is complete and distributive with respect to a distinguished family of subsets, denoted

generically  DA . Thus, if  D   is an A -dioid, then each subset  A D A   has a least upper bound,  A D   (A -

Page 29: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 29/53

completeness), such that    AA A A   for , A A DA   ([strong] A -distributivity). As noted in

definition I.2, the distributivity property can be replaced by the following property (weak A -distributivity):11 

  , , .dAd d A d d d D A D   A  

We term the algebras A -dioids, and define an A -morphism : F D D  as an order-preserving morphism such thatthe following property, which we call A -additivity, holds:

      f A f A A D   A  

where :  f A f a a A . The result is a category we denote DA .

The archetypical members of DA  are the subsets families  M A  of monoids  M  , the partial ordering given by subsetordering, the least upper bound by union. The product operation on  M    lifts to one over  M A   given by

: , AB ab M a A b B   for , A B M A . This endows the subset family, itself, with the structure of a monoid

that contains an isomorphic copy of the original monoid through the unit morphism : M    a M a M   A . The

A -dioid structure is obtained by requiring that the subset family be closed under unions taken from the iterated family

 M AA . The resulting morphism : M    M M  AA   AY Y   then yields an instance of a A -morphism: i.e., an

order-preserving morphism that is additive with respect to least upper bounds of A -subsets. Finally, each monoidhomomorphism :  f M M    lifts to an A -morphism :  f M M A A , given by  A f A . Thus, the

 preconditions required for the subset families  M A  are that they0

A  be subset families, that1

A  contain the finite

subsets,2A  are closed under products,

3A  are closed under unions taken from the iterated family and

4A  are closed

under morphisms. Together, these conditions define the natural families.

For instance, if the subset family A  includes the family of all finite subsets, denoted here F , then the corresponding

category contains least upper bounds 0  and ,a b a b , thus endowing it with the structure of a dioid (=

idempotent semiring). In particular, DF  is the category of dioids and dioid-morphisms. At the opposite extreme arethe families of general subsets, denoted here P . The corresponding category DP  consists of quantales with unit. As

seen in Corollary III.3.3, natural families exist, denoted respectively R  , C  and T  whose free algebras * X R  , *

 X C  

and * X T  are respectively the type 3, 2 and 0 languages over a given alphabet  X  .

2.2. Review of Basic PropertiesWhat we have done is complete the construction of what is known as a T-Algebra [23] or an Eilenberg-Moore Algebra.The category DA  is referred to as an Eilenberg-Moore category.12 The functor A  can therefore be regarded as a map

 between the categories Monoid  and D A . Since the algebras in DA  contain the structure of monoids, then what we

actually have is an adjunction with a forgetful functor ˆ:   D MonoidA: A   that reduces each A -dioid  D   to itsunderlying monoid  D DA   and each A -morphism : F D D   to its underlying monoid homomorphism

ˆ ˆ ˆ: F F D D A A A . The adjunction relation is established by the following theorem.

Theorem 2.1: The functor A  and the forgetful functor A  form an adjunction pair ˆ,A A .

Proof:An adjunction that (up to equivalence) arises from a T-algebra construction is referred to as monadic. This is what weare actually verifying. In the following, we will use the notation and conventions defined in the appendix. The proof

that A   is actually a functor requires showing closure under identity functions and composition: 1 1 M M   A

  and

  f g f g  , which are both trivial consequences of set theory.

11 In Definition I.2, the names for the two forms of distributivity were inadvertently swapped.12 The subcategory of DA  consisting only of the free A -extensions  M A  of monoids  M   gives us what is called a Kleisli category.

Page 30: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 30/53

Page 31: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 31/53

  * ,m U 

U m M U M  

P P  

yields an A -morphism upon restriction: *:   M M  A A . Moreover, property 5A   may be taken as an equivalent

replacement for3

A  and4

A  (Theorem I.8).

In addition, a partial recapitulation of the classical property of closure under inverse homomorphisms can be obtainedwith the surjectivity property (  6A ), which asserts that a surjective morphism :  f M N    yields a surjective A -

morphism :  f M N A A  as was proven in Theorem I.9. In addition, finite generativity13 (  7A ) which asserts that each

subset  A M  A  is a subset 0 A M  A  of a finitely-generated submonoid 0 M M  .

Under the assumption of0A ,

1A   and

2A , this property is equivalent to the combination of3

A  and4A   (Theorem

I.8). Finite generativity is trivially satisfied by F . In Corollary III.2, it was also proven for , ,R C T .

2.3. ExamplesExample 2.2: Chomsky Families From our prior discussion on generalized grammars, we have the Chomsky hierarchy, which consists of the followingfamilies  M R  ,  M C  and  M T  ordered by R C T .

Example 2.3: Cardinality Families We may define the following cardinality-limited subset families

# #: , : , M U M U M U M U  k c

k cF P  

for each regular transfinite cardinal k  and transfinite cardinal c . The closure of each of these families under products,unions and monoid homomorphisms are easy consequences of set theory, 14  thus proving the naturality of each family.As special cases, we have the natural families

0F F  and0 P  of finite and countable subsets, respectively.

Example 2.4:  Finite Dioids All finite dioids have a complete lattice ordering. Therefore, each category DA  contains the same finite algebras. The

smallest dioid 01  is uniquely defined by the identity 0 1 .

The next smallest dioid is 0,12 .

Beyond this are the dioids of cardinality 3, defined by the presentations2 2 2

0 2 3: 1 , :1 , : 0, 1 . x x x x x x x x x 3 3 3  

Example 2.5: Generalized Frames and Locales A quantale Q  with the unit 1   is a complete lattice. Because of the identity 1 x  , it follows that ab a , ab b . In

addition, if a x   and b x   then 2ab x x . Thus the product coincides with the lattice meet (therefore it is

commutative), and the lattice meet has infinite distributivity with respect to the lattice join. This equivalently defineframes and locales15, the varieties differing from each other only in what is considered a morphism: frame morphismscoinciding quantale morphisms, locale morphisms going the opposite way. The most important example of frames and

locals are the lattices of open sets comprising a topology. Here, the frame and locale morphisms are respectively theopen maps and continuous maps.

13  This property was adopted by [14, p. 356], following lemma 2.5 as a condition for context-free subsets of arbitrary free monoids. It was alsomentioned at the end of section I.2, but was not discussed in any further detail. 14 For

kF , property

3A  is the definition of a regular cardinal.

15 As well as complete Heyting lattices.

Page 32: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 32/53

We may generalize our example and define an A -restricted frame/locale as an A -dioid in which the unit is maximal,and the respective morphism types as the A -morphisms and their reversals, respectively.

Example 2.6:  Binary Matrices 

For each ordinal , the matrix algebra  M      2  is a quantale with the monoid structure given by the matrix product

and identity matrix, and the ordering given component wise:  A B  iff ij ij A B  for all ,i j .16 For finite ordinals

n , the dioid n n2   is finite. Since

0 M   and

1 M   are dioids respectively of sizes 1 and 2, the isomorphisms 0 M    1  

and 1 M   2  are immediate.

Example 2.7:  Relations The relations over a set  X    form an involutive quantale  X X P   ordered by subset inclusion. The product is

relational composition , R R R R , the identity is the diagonal , : X  I x x x X  , and the involution is the

transpose T  R R . By3

A , the natural family  X X A  is closed under A -sums and is therefore an A -dioid. For

ordinals  a one-to-one correspondence with 2  is given by

, : 1 .ij A i j A 2  

For finite ordinals n , n n n n A P . Using the bijection ,i k m n ni k mn , we may establish m n m n mn mn P P P  

as an isomorphism. Since this correspondence is preserved by unions this also yields a quantale isomorphism. As aconsequence, it also follows that m n mn M M M  .

Add th is example:

Example.  Finite Generativity Families Each A  can be restricted to the subfamily formed from finitely generated submonoids:

0   . M 

 X M 

 M X 

F

A A  

The largest such family is0P . For the other natural families, we have 0 0 A A P  in the lattice ordering of natural

families. To prove equality requires that the submonoid ordering property (  M M M M   A A

) be strengthenedto a form (    M N M N  A P A ) that is too strong to be derivable from the axioms0

A  to4

A .

2.4. TopologyStrong and weak A -distributivity, and A -continuity all require A -completeness as a precondition. However, the

 properties can be generalized to partially ordered monoids and made independent of completeness, with the followingdefinition.

Definition 2.8:  Let  M    be a partially ordered monoid and write m U    if m M    is an upper bound of a subsetU M  . Then  M    is strongly A -separable if for all m UU  , there exists u U   and u U   such that m uu ,

where m M    and ,U U M  A ;  M    is weakly A -separable  if for all m aUb , there exists u U  , such that

m aub , where ,a b M    and U M  A . Finally, an order-preserving monoid homomorphism :  f M M    to a

 partially ordered monoid  M   is A -continuous, if for all m f U  , there exists u U  , such that m f u , whereU M  A  and m M  .

16 We are identifying each ordinal with the set of the ordinals that precede it; thus, 0, , 1n n , for finite ordinals n . 

Page 33: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 33/53

In an A -dioid  D , the condition u U    is equivalent to u U  , when U DA . Therefore, one may verify that

when restricted to the category DA , the strong and weak forms of A -separability are equivalent to one another and to both forms of A -distributivity, while A -continuity equivalently defines an A -morphism.

The family  M A   can be endowed with a topological structure with respect to which a monoid homomorphism

:  f M M    is A -continuous if and only if :  f M M A A   is continuous. A sufficient condition for thiscorrespondence is given by the following:

Definition 2.9: A partially ordered monoid  M   is A -directed if the set of upper bounds of each U M  A  form a non-

empty downward-directed subset of  M    (i.e. for every two upper bounds 0 1,u u U    there is a third upper bound

u U   such that 0 1,u u u .) For such monoids, it follows that the neighborhoods : x M U M U x A A  generate

a topology that we will adopt as the A -topology  of  M A . The open sets are defined as arbitrary unions ofneighborhoods.

We can then state the following results:

Theorem 2.10: Let , M M   be A -directed partially ordered monoids. Then :  f M M   is A -continuous if and only

if :  f M M A A   is continuous. In addition,  M    is weakly A -separable if and only if for each ,a b M  , the

function U M aUb M   A A   is continuous; and  M    is A -separable if and only if the product

,U V M UV M   A A  is continuous.Proof:

Both directions of each of the three correspondences rely on the equivalence  x x U U M  A . This is illustrated for

A -continuity, the other correspondences being similar.17 

First, suppose :  f M M   is A -continuous and O M  A  is an open set. Let 1U f O ; i.e.,   f U O . Then,

there is a neighborhood  y M O A   containing   f U  ; or, equivalently,  y f U  . By A -continuity, we have

 y f u , for some u U  . Since  f     is monotonic, then u y  f M M A A , while uU M  A . Thus, 1  f O   is

open.

 Next, suppose :  f M M A A   is continuous. Let U M  A   and   f U y . Then   y  f U M  A . Therefore, by

continuity, there is a neighborhood u M A   containing U  , such that u y  f M M A A . In particular, since

  uu M  A , then   y  f u M  A , or   f u y . Since uU M  A , then u U  . Thus, we establish the A -continuity

of  f   .QED

3. Constructions and Closure Properties3.1. Initial and Terminal Objects

In each category DA , the dioids 1  and 2  are respectively the terminal and initial objects, possessing the universal

 properties that associated with each algebra  D   are unique morphisms  _ : D

  D 1   and  _ : D

  D2 . The

uniqueness is expressed by the identities

17 For the continuity of the product, we use the product topology on  M M A A .

Page 34: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 34/53

 

: _ 1 , ,

 _ _ 

: _ 1 , .

 _ _ 

 D D

 D D

 F D D

 F 

 F D D

 F 

11

22

 

where  F  denotes an A -morphism. Because 0 1  in 1 , no dioid morphism :  f D1  exists, except for  D 1 .

Since the monoid 1   is also the initial object in the category of monoids (c.f. discussion in section III.4.1), then itfollows from their respective universal properties that

ˆ ˆˆ _ _ _ and _ _ _ .

 M M D D

1 2A A A AA A  

3.2. Free Extensions

The description of free extensions we gave in section III.2.1 as a categorical algebra applies also to the category DA  

of A -dioids. Here, the destructors are the A -morphism ,   : D Q   D D Q , the map ,   : D Q   Q D Q , respectively

denoted   and   for brevity, and the constructor defined by the universal property is the unique A -morphism

, :  f s D Q D   associated to each A -morphism :  f D D   and map : s Q D   such that reconstruction

identities ,  f s f    and ,  f s s  hold.

To define the free extension  D Q  which we defined in terms of the monoid free extension by  D QA A , subject to

the a suitable set of relations. From the monoid destructors ˆ ,ˆ :

 D Q

A  and ˆ ,

ˆ D Q

A

, we define ˆ D   and

ˆ D . In order to ensure that the former is an A -morphism we need to impose the free-extension relations:

  ˆˆ ˆ   .a A a A

a a A D

  AA  

From the monoid constructor, we define   *ˆ, ,  f s f s A . The preservation of the reconstruction identities, uniqueness

identities and free-extension relations are routine, but lengthy exercises in categorical algebra. As a consequence of the

free extension universal property, isomorphisms analogous to those established in III.2.1 for monoids may be obtained,where the role played by the monoid 1  is now played by the initial object, the dioid 2 :

   

 

*

**

, , ,

.

 M Q Q M Q Q Q Q M M Q Q

 X Q X Q X Q X Q X Q

2

2 2

A

A A

 

Finally, the relation to the monoid free extension is established by the following theorem.

Theorem 3.1:     M Q M QA A .

Proof:

Explicitly, the isomorphism is given explicitly in terms of the monoid destructors ,ˆ

 M Q , ,ˆ

 M Q  and constructors

in the forward direction by

ˆ   ˆ,  and the reverse direction by ˆˆ   ˆ,

A , which one may readily verify are inverses.

QED

3.3. Tensor ProductsThe description of monoid direct products in section III.4.1 as a categorical algebra applies to natural dioid categoriesDA , to yield a tensor product  D D

A  (also denoted  D D   for brevity) of two A  dioids , D D . We start by

defining the tensor product as ˆ ˆ D DA A A   and subject to the minimal set of relations required to make the

Page 35: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 35/53

destructors A -morphisms. Denoting the monoid destructors by ˆ ˆ,ˆ ˆ

 D D

A A and ˆ ˆ,

ˆ ˆ D D

T T 

A A

, when we define the dioid

destructors  DD  and  DDT T     by

    ˆ ˆ , , ,d T d d T d d d d D d D  

noting that their mutual commutativity trivially follows. To make this an A -morphism, we impose the tensor product

relations:

 

,

ˆ ˆ, , , .a a A A

a a A A A D A D

  AA AA  

The constructor associated with a pair of mutually commuting A -morphisms : F A A  and : F A A  is defined

in terms of the monoid constructor by*

ˆ ˆ, F F  A A . Again, it is a lengthy but straightforward application of categorical

algebra to show that this preserves the tensor product relations and satisfies the reconstruction identities , F F F     

and , F F T F   and uniqueness identities , ,G F G F G F F    and , 1 DD DD D DT  A

. By an argument

analogous to that in section III.4.1, the tensor product endows DA  with the structure of a braided tensor category, withthe following natural isomorphisms

, , . D D D D D D D D D D D D D 2 2A A A A A A A A

 

In addition, we have the following result:

Theorem 3.2: For any A -dioid  D ,  D D 1 1 1A A

.

Proof:

Since there is no dioid morphism from 1  other than to itself, then the destructors :   D 1 1A

 and :T D 1 1A

 

immediately yield the stated dioid isomorphisms.QED

Finally, we have the following property, as an exercise in categorical algebra

Corollary 3.3:   M M M M  A

A A A  

Proof:

We note in passing that we can actually go further and establish :   Monoid DA A  as a monoidal adjunction with thestated isomorphism being natural. But for the following, we will only need the isomorphism. Let  and T   denote the

tensor product destructors for  M M A

A A  and  and T   the monoid product destructors for  M M  . Then forward

direction is given by ˆ ˆˆ ˆ, M M T    A A , and the reverse direction by ˆ ˆ, ,   T  A A .

QED

As a consequence of this result and Theorem III.4.3 and III.4.4, we have the following characterizations:

Corollary 3.4: The rational transductions and syntax-directed translations between monoids  M   and  N   form algebrasrespectively isomorphic to  M N 

R R R   and  M N 

CC C .

3.4. Reversal and InvolutionAn antimorphism :  f M M   is a map with the properties

1 1, , .  f f mm f m f m m m M   

A special case is an involution: a bijection onto  M M    with 1  f f   . Such a morphism   †  f m m   may be

equivalently defined by the properties

  † †† † † †1 1, , ,m m mm m m  

Page 36: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 36/53

for ,m m M  . A similar definition applies to the category DA , where we require that an A -involution in an A -dioid  D  also be A -additive,

  †

† ,a A

 A a A D

  A  

and that an A -antimorphism : F D D  be an antimorphism that also satisfies A -additivity. However, in order forsuch operations to be meaningful, we need to know that the sum can actually be defined. That is, we need theinvolution closure property:

8A : under an involution †m M m M   , † † : ,U M U u M u U M   A A  

thus yielding an involution on  M A .

Example 3.5: Word Reversal  

Over the free monoid * X   the unique involution satisfying  R x x  for  x X   is word reversal. For subsets *U X   we

define : R RU w w U   , thus endowing each natural family * X A  with an A -involution.

An equivalent statement can be expressed in terms of A -antimorphisms.

Theorem 3.6: Involution closure is equivalent to closure under A -antimorphisms.Proof:

Suppose A   satisfies8

A  and that :  f M M    is an antimorphism. Let  X M   be a generating subset of  M  , and*

: X M   the canonical surjection onto  M  . Then we define the morphism

*: . R  f w X f w M     

Given U M  A , by surjectivity (   6A ), we can find a *U X A  such that U U  . By

8A , *ˆ  R

U X  A . Therefore,

 by3

A ,   ˆ  R  f U f U M    A .

QED

Example 3.7:  Involution on free extensions and tensor products The constructors for monoid free extensions and products in sections III.2.1 and III.4.1 can be generalized to

antimorphisms. If :  f M M   and :  f M M   are antimorphisms and : Q M   a map. Then we define theconstructors ,  f s  and ,  f f     in the obvious way:

  , , , , .  f s mq q m f m s q s q f m f f m m f m f m  

Both sets of reconstruction identities apply, e.g. ,  f s f    and ,  f s s .

Similar constructors for A -dioids in terms of the monoid constructors. Let : F D D , : F D D   be A -morphisms and : s Q D   a map. Then, making use of the free extension and tensor product constructions

respectively in sections 3.2 and 3.3, we define   *

ˆ, , F s F s A   and   *

ˆ ˆ, , F F F F  A A . To show that these are

well-defined requires that they respectively preserve the free extension and tensor product relations, which is a routine but lengthy verification. Similarly, it is routine to verify that these satisfy the reconstruction and uniqueness identities,

e.g.

        *

ˆ ˆ ˆˆ ˆ, , , . F s d F s d F s d F d F d  A A A  

As an application of the universal property: given involutions  Di  and  Di    respectively on A -dioids  D  and  D  these

constructions yield involutions  D Qi  on  D Q  and  D Di   A

 in  D DA

 satisfying the following identities:

Page 37: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 37/53

 

 

,

,

, ,

, ,

, , , .

 D Q DQ D D D DD DD D D Q

 D Q DQ D D D DD DD D D Q

 DQ D DQ D D DD D DD D D Q

i i i i

i i i T T i

i i i i T i

A

A

A

 

For cardinality-limited natural families, F  or , for P , and more generally fork

F ,cP , and for the finite generativity

class0P , involution closure

8A   holds. In addition, by the following theorem, we have involution closure for the

Chomsky hierarchy.

(Add S to this list)

Theorem 3.8:  , ,R C T  each satisfy8

A .

Proof:

Let , ,G Q S H    be a grammar over a monoid  M   that has an involution †m m . Then, extending the involution to

 M Q , and defining the grammar † † †, ,G Q S H     by   † † †, : , H H  , it follows that  H    iff

† †

 H  . Therefore,   †

† †

 H   H   and as a consequence   † † L G L G . Moreover, the type of grammar (one-

sided linear, context-free, contextual) is preserved by the conversion, with left-linear grammars converting to right-

linear grammars and vice versa.QED

3.5. Matrix Closure

Using the binary matrix algebra and tensor product, a matrix algebra in DA  may be defined by ,

n n

n M D D 2A A

.

As a consequence of the isomorphisms noted in Example 2.6 and the tensor product identities, we have

0 1, , .n n m n mn M M M D M D D M M D M D 2 1  

Closely related to n M D , in the category DF  of dioids, the set n n D    can be given the structure of a dioid with the

matrix product, identity matrix and matrix sums. An involution †d d   on  D  yields an involution on n n D    given by

    †† , . ji

ij A A i j n  

However, in order to define matrix algebras of the form n n D    in DA , we need to be able to define the sums

  ,ij ijij

 A U 

U U A

 

for each ,i j n , where n nU D

  A . This requires that each of the sets :ij ijU A A U    have least upper bounds. At

 best, we can infer the following: denoting the unit matrix for row i  and column  j   by ije , and noting the identity

ij kl ki jk  U e e Ue , we have n n

ij kl  U e D   A . Summing over k l n , it also follows that n n

ij nU I AD   , where n I   is the

identity matrix. However, to further conclude ijU D A  requires the matrix closure condition on A ,

9A : if n n

U D  A  then ijU D A  for all ,i j n .

Assume thatA

 satisfies matrix closure. Then associated with the matrix algebras are the following constructors: : : , , : ,n n n n n n n n

ij D F A D F A i j n D I d D dI D  

where : F D D   is an A -morphism. In addition, as the following result shows, the two constructions for matrixalgebras become isomorphic for such natural families.

Theorem 3.9: If A  satisfies9

A , then for each A -dioid and finite ordinal n , ,

n n

n M D D   A

.

Proof:

The forward direction is given by 1  _ ,n nn D D  I 

, and the reverse direction by the A -morphism

Page 38: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 38/53

      ,

,

: , .n n n n

n ij n

i j n

 A D i j T A D M D

  2A A

A  

QED

Matrix closure9

A  is easily verified for the natural families F , , P  and more generally for  M k

F  and  M c

P . The

case for R   is established in [19], where the Kleene star is inductively defined by the following decomposition** * * *

*

* * * * * *   , . A B   E E BD

 E A BD C C D   D CE E D CE BD

   

 

However, the question of whether 9A  holds for C  and T , is here left unresolved. A direct proof involving grammarscan be formulated.

Theorem 3.10:  , ,R C T  each satisfy matrix closure9

A .

Proof: 

 Not yet written. This makes use of the morphisms   ˆ:n n

n n

nh D Q D Q

, where Q Q n n .

Use submonoid ordering.

4. Adjunction Networks4.1. Review

In section II.3 a network of functors :   Q D DB

A  A B  was defined satisfying the properties that (Theorems II.14, II.15,

Corollaries II.6 and II.7):

-  QA

A is the identity functor on DA ,

-  for A B , QA

B is the forgetful functor which restricts the range of the sum operator to A -subsets and has

QB

A as a left adjoint (thus making DB  an Eilenberg-Moore category relative to DA ), and

-  for A D B , Q Q QA   D A

D B B and Q Q Q

B   D B

D A A.

In addition, using the uniqueness of left adjoints to forgetful functors, we also have that for A B , QB

AB A  and

ˆˆ   QB

AB A .

4.2. Closure Results

Since each of the natural dioid categories shares the same finite algebras, then the isomorphisms  D DQB

A follow for

any finite dioid  D . In particular, the terminal dioid 1  and initial dioid 2  remain the same in each category DA , up toisomorphism. In particular,

, , .n n M M n Q 1 1 Q 2 2 QB B B

A A A 

When A B   the functors ,Q QB A

A B form a monoidal adjunction pair which, by an argument analogous to that in

corollary 3.3, have the following natural isomorphisms

  , ,, n n D D D D M D M D Q Q Q Q QB B B B B

A A A A A A A B A 

where , D D   are A -dioids and n . The second of these follows from n n M M QB

A, since the finite dioid

n nn M    2  is the same in every category, up to isomorphism.

In addition, when A B , then for free extensions we have an isomorphism    D Q D QQ QB B

A A, where  D  is an

A -dioid. This is implemented by the following two mutually inverse morphisms (omitting indices for brevity)

    * 1

* , : , , : ,h D Q D Q k D Q D Q Q Q Q Q QB B B B B

A A A A A 

where

      : , :h D Q D Q k D Q D Q Q Q Q Q Q QB A B B A B

A B A A B A 

Page 39: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 39/53

are identity maps defined by the forgetful functor QA

B, and

  : D Q

  D Q D Q Q QA B

B A 

is the unit morphism for  D Q .

4.3. Downward Extension to I  

To have the structure of a monad does not require including all finite sets in natural families. We actually only need theunit map m M m M   A . Therefore,

1A  can be weakened by only requiring singleton sets to be members of a

natural family, thus resulting in the condition 1   :W    m m M  A   A , for each m M  . Then, the minimal family

F  is replaced by the “singleton” family : M m m M  I , resulting in an extension of the hierarchy downward to

a family of algebras that have partially ordered monoid structures, but not necessarily an upper semilattice structure. Itsminimal member is the category DI  of partially ordered monoids with monotonic monoid homomorphisms.

The corresponding functor I   takes a monoid  M   and maps it to the partially ordered monoid  M I , which has the

same underlying set  M   equipped with the flat-ordering, m m m m . Conversely, the forgetful functor ˆI  takesa partially ordered monoid produces the monoid without the partial ordering. Correspondingly, we have the factorings

ˆ   ˆ, . Q QA I

I AA I Av I  

Thus, the hierarchy of natural dioids is, itself, embedded in the network of adjunctions.

4.4. Expansion to Idempotent Power SeriesIdempotency is the feature critically involved in the appearance of the partially ordered monoid structure. It is thereplacement of a sum operator by a partial ordering that made it possible to define adjunctions, grammars,transductions for the full category of monoids, rather than just for the subcategory of free monoids. In contrast, in theformal power series approach [2], [11], [21], addition no longer need be idempotent. Therefore, the generalization ofthe monad hierarchy from dioids to semirings is not clear. However, a closer study of the history of the power seriesformalism reveals a compromise.

At the outset [6], the power series was employed as a means to measure ambiguity. If we were to attempt to generalize power series to arbitrary monoids, we would immediately run into the problems just described, unless furtherrestrictions were made. One restriction, which is in the spirit of the approach adopted in this paper, is to replace

numerical coefficients by coefficients in a quantale, such as the Boolean lattice of subsets. Then, we may factor the“ambiguity count” function into the composition of two operations: (1) the output set for a given input under the actionof a transduction and (2) the cardinality function applied to output sets. The ill-definedness of power series is factoredout with (2), leaving behind (1) - the well-defined notion of an idempotent power series.

In general, for a given semiring with unit S  , we may define the following partial (and not necessarily well-defined)

operations over the function space  M S  : for each m M  , the unit is defined as   ˆ: M    m m , where

ˆ  : mmm m M    . For each  s S  , we also have 1  M 

 s S  , which we may denote by  s . Thus, we can write out the

decomposition

 ˆ

m M 

m m

 

which gives us the representation of each M 

S   as a power series. For ,

  M 

S  , and

 M S 

S   we define,   , ,

 M nn m   S 

m n n m m  

 

where m M  . The summation yields the product  M  . Finally, we define the lifting of each function

:  f M M   to the power series algebra by

: . M M 

m M 

  f S m f m S  

 

Page 40: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 40/53

The analogues of axioms0A  to

4A  for the semiring S   are:

0S A :  M 

S  M S A ,

1S A : S S  M M F A , where S  M F  denotes the family of functions : M S   with finite support,

2S A : , S S  M M  A A ,

3S A :S S S  M M 

A A A  and

4S A : S S  M f M  A A , where : M M   is a monoid homomorphism.

Finally, we can expand the hierarchy by relaxing1S 

A  to

1WS A :   ˆS m M m m M   A .

The weaker axiom1WS 

A  yields a minimal natural family ˆ  :S  M m m M  I .

The category S DA  is then defined analogously by S A -additivity and S A -distributivity:

  , D    

respectively, where , S  D A . Equivalently in place of the latter, we may adopt weak S A -distributivity

  ˆ ˆ , , .S d d d d D d d D   A  

Finally, an S A -morphism is defined by the condition that     f f   , where S  D A .

The natural dioid families are recovered as a special case   2A A  obtained with the finite dioid 0,1S   2 , by

treating  M 2  synonymously with  M P . When we restrict S   to quantales, the power series operations all become well-

defined and the analogue  M 

S  M S P  to  M P  is defined. Similarly, if S   is a semring closed under arbitrary sums, with

infinite associativity and distributivity, then the maximal element S  M P  may be defined.

5. Further Extensions: Natural Families for SemiringsThe classification of natural families S A , for a given semiring S  , satisfying axioms 0S A   to 4S A   has remainedunresolved in this work. In general, the product, sum and morphism operators need not be well-defined unless one

makes restrictions on their domain, on the class of monoids under consideration, or on the semiring, itself. Therefore,while  M M P  yields a natural family, the analogue  M 

S  M S P  need not be natural, unless the semiring S   is closed

under arbitrary sums, with infinite associativity and distributivity, then the maximal element S  M P  may be defined.

Because of the absence of infinite summability over S  , there is no longer a clear-cut analogue to any portion of thehierarchy of natural families S A , satisfying axioms 0S A  to 4S A . Nor is it clear whether the hierarchy even extends

 beyond the family S F  of power series with finite support. In particular, the question remains unanswered here as to

what conditions are required to define analogues S R  , S C , S T  (for Chomsky types 3, 2 and 0 respectively).

V: A Calculus for Context-Free Expressions and Translation ExpressionsThe foundation is laid out here for the generalization and expansion of the Kleene algebra of regular expressions to a

new calculus for context-free expressions and translation expressions. At the center of this development is a result,which we establish here: an algebraic reformulation and generalization of the Chomsky-Schützenberger Theorem, inwhich the notion of tensor products plays a key role.

Note:  Bear in mind that this section, which has not been completed, was originally written to be presented along with

 parts III and IV at the RelMiCS2012 conference, which was held in Cambridge  –  where Isaac Newton taught.

Note to Self: Add in the opening remarks of the 2009 “CFE” article. 

Keywords:

Page 41: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 41/53

Chomsky-Schützenberger Theorem, Context-Free Expression, Translation Expression, Regular Expression, Polycyclic,Tensor Product, Dyck Language

1. Algebra, Analysis and CalculusIn this section, we develop the framework for a representation, cast in the same mould as regular expressions, suitablefor context-free languages and transductions. For the following, we will adopt the notations and conventions developed

in section III and section IV, referring to their items by prefixing them respectively by III and IV (e.g. section III,theorem 1 is theorem III.1). In particular, we adopt the notation established in appendix IV.A for the categoricalalgebra of adjunctions.

However, before proceeding, we should clarify exactly what this development involves and what a framework forcontext-free expressions actually entails.

Two broad categories of mathematical theories and structures may be distinguished: those expressed in first orderlogic, and in second order logic. Any first order theory may be recast as a multi-sorted algebraic theory, if necessary,

 by adding an equality predicate and a Boolean type to represent predicates as operators. Thus, we may classify thesetheories under the name algebra. An example of this includes affine geometry, which we may represent as a 2-sortedalgebra containing a field  F  , and a set  A   equipped with ternary operators , ,a b c A a b c A   and

, , 1a b A f F f a fb A  that represent the affine equivalents of vector addition and vector multiplication

 by a scalar. Another example of an algebraic structure is the theory of ordered fields; particularly the theory of realclosed fields and algebraically closed fields.

Second order theories, on the other hand, involve predicates, operations of functions that refer to sets, functions orother predicates. Examples include the theory of real numbers (expressed as the theory of complete ordered fields),arithmetic (via the Peano axioms), real affine geometry (as a two-sorted theory over the real numbers) and the theory ofreal manifolds. In each case, contained in the formalism are one or more axioms that stand out from the others in beinga catch-all that make a broad assertion not about individual objects, but about properties or sets. For real numbers, realaffine spaces, or real manifolds, the extra axiom makes a statement about metric space completeness. For arithmetic,the extra axiom is the axiom of induction. Such theories contain a seemingly transcendental element and may beclassified under the header analysis.

Historically, the question arose of whether a second order theory could be completely and consistently represented in

first order logic, the most prominent case historically18

 being differential and integral calculus. Is there any system ofrules that completely accounts for what an analyst does in calculus? Calculus was formalized with the limit concept inthe 1800’s, about two centuries after its formulation by Newton, Leibnitz and their predecessors. Thi s only shifted thespotlight of the issue onto the completeness axiom of real number theory and, in turn, on second order logic. With the

 perspective of history, we can more clearly see that the primary impetus behind the  finitist   programme19, that later

came in the 20th century, was simply to find a way of reducing analysis to algebra, and second order logic to first orderlogic. The most important application of this programme would have been to somehow eliminate the transcendentalelement from the differential and integral calculus and to reduce it to algebra.

We know today that this is not possible. A first order logic has a complete formalization. (Goedel’s Completeness

Theorem, [9, p. 128]). A second order theory containing the Peano axioms or any other content sufficiently powerful toembody the Peano axioms can never be completely axiomatized in first order logic (Goedel’s Incompletness Theorem

[9, p. 229]). The simplest and clearest statement of these results is that there is no finite first order axiomatization of thePeano axioms from second order logic. But it’s important to notice that the theorem does not place limitations on

mathematics, itself. Rather it drives a permanent wedge between first and second order logic, between the two major branches of mathematics and the two forms of logic. Analysis is not algebra, and Calculus does not reduce to a systemof first order rules.

In 2008, in [15], [16], we established a framework for second order formalisms suitable for representing a hierarchy ofcategories that contain the dioids (= idempotent semirings), *-continuous Kleene algebras, and unital quantales. Each

18 “Whether  the same things which are now done by infinities may not be done by fini te quantities” [1, Question 54].  19 Represented, for instance, by [29].

Page 42: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 42/53

category DA  is defined in terms of a functor that associates each monoid  M   with a distinguished family of subsets M A . The objects in the category are called A -dioids. Each such algebra  D  has the structure of a partially ordered

monoid in which (a) every subset  A D A  has a least upper bound  A D , (b) distributivity holds between two

such subsets,    AA A A , for , A A DA . The morphisms :  f D D  of this category are order-

 preserving morphisms that (c) are additive with respect to such subsets,   a A  f a f A    for all  A DA . Theresult is a second order theory for the category DA  containing three Peano-like axioms.

In some cases, we can reduce the theory to a first order formalism. Defining,  M I and  M F  respectively as the familiesof singleton and finite subsets of  M  , the categories DI   and DF  are respectively equivalent to the categories of

 partially ordered monoids (with order-preserving morphisms) and dioids (with dioid morphisms). These formalisms arecompletely expressible in first order logic. Corresponding to this are the formal language families that (for I )comprise a single-element language and (for F ) a finite language.

For the “rational subset” family  M R  , the associated language family, of course, are the regular languages  –  or type 3in the Chomsky hierarchy, and the corresponding theory is the category of *-continuous Kleene algebras, We know

now that there is a first-order formalism [19] whose free algebras coincide with the free elements * X R   of the category

DR    –   the theory of Kleene algebras. But we also know there is no first order formalism that characterizes thesubcategory comprising the objects  M R  , because the conditional word problem is unsolvable for Kleene algebras[18]*.

One can, in fact, go quite far with the rational subset families. For instance, let  X   be a finite set, let the family * X T  of

type 0 languages be enumerated 0 1 2, , , L L L , and let each language *

i L X    for i   also be enumerated

0 1 2, , ,i i i i L w w w , where *

ijw X    for ,i j . Then defining ˆ , , , X X p o O q   where , , , p o O q X  , we

may define a monoid *ˆ M X  , where   is the following set of relations : ,i j

ij pO o q w i j . Within the

monoid  M R   are rational expressions *i

i pO o q L  that contain each type 0 language. In addition, the entire family

*:

i pO o q i M  R R   is, itself, a rational family of rational subsets. Equivalence of Turing languages and of even

the subset * * X X C T , is undecidable (e.g. [30, Theorem 10.3.4], [6, section 6]). Therefore,  M R R   has an unsolvableword problem and cannot be completely characterized by any finite first order axiom system.

For the “context-free subset” family  M C , the category DC  defines a variety we term the Chomsky-Schützenberger

dioids  (or CS-dioids), which in recent times has also been equivalently described as the “ -continuous Chomsky

algebras” [13]. For the reasons just described, there can be no algebraic formalism suitable for serving as a basis for therepresentation of context-free subsets in a manner analogous to the representation obtained with the Kleene algebra of

regular expressions. Therefore, in devising a representation powerful enough to have * X C  as its free members, whatwe are developing, of necessity, is not merely an algebraic theory but an algebraically-grounded framework foranalysis –  a calculus.

2. The Gruska-McWhirter-Yntema Approach

In the early 1970’s, Gruska [14], McWhirter [25] and Yntema [31] devised essentially equivalent formalisms forcontext-free languages. Each approach converged on the idea of the least fixed point operator. In the family  M C , we

may define  x f x  as the least solution to the inequality  x f x , where :  f M M C C  is a function expressible

in terms of a toolbox of algebraic primitives whose constituency was assumed to contain a minimum set of elements(i.e. finite unions, products and finite subsets), but otherwise be open-ended20. The construction devised by Gruska wasgiven in our notation by

* Or [19] or [20]. I lost the reference link.20 The idea of inheriting a formalism, possibly yet-to-be developed, was built into [14, Theorem 2] and [14, Corollary 3].

Page 43: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 43/53

     x f x f x f f x f f f x M   

Yntema’s approach, on the other hand, started by defining the iterated substitution 

  0 1, ,n n  f x x f x f f x n  

and expressed the fixed point operator as nn

 x f x f  

, this being called the “cap expression”. Finally,

McWhirter’s approach was a non-linear generalization of the Kleene star *  f y x f x y , since this made possible a more direct characterization of both the regular languages and linear languages.

It is possible to generalize these approaches by permitting multivariate functions :   n n  f M M C C   and considering

simultaneous fixed points n x M f x C . This is the approach taken by Ésik and Leiss [12] in the more general

context of semiring theory: the formulation of a multivariate fixed-point calculus.

However, these attempts at constructing a representation for context free languages along these lines have failed to finda representation as transparent and elegant as that used for regular expressions. As Gruska wrote in the introduction, inanticipation of his own work and that of his contemporaries, “one can hardly expect to get a characterization of CFL’s

so elegant and simple as the one we have developed for regular expressions.”  

The approach based on fixed-point operators to solving systems of equations representing context free grammars wasanalogous to the method for solving a division problem, such as 3 4 x  , by writing 4 3 x  . What’s missing is the

extra step that allows us to write 1.333 x  . For example, consider the language : 0n n

 L u v n M  C , where

*

, M u v . The solution analogous to writing 4 3 x    is 1 L x M u x v C . Is there an extra step that

corresponds to writing 1.333 x  ?

As we will see, there is a formalism that fits the characterization offered by Gruska in denial. In fact, suppose thatinstead of using the algebra  M C , we start with the Kleene algebra  M R  . Add to this algebra a set of indeterminates

, , ,Y b d p q  and subject them to the relations  xy yx  for  x M   and  y Y  , along with the relations 1bd pq  

and 0bq pd   . Then, we can write

    * *1 . L x a x b b u p q v d   That is the “extra step” whose inclusion is the main topic of this paper. 

3. Chomsky-Schützenberger Theorem3.1. The Semi-Classical FormulationThe operator algebra we made brief allusion to arises as a structure buried within the classical result known as theChomsky-Schützenberger Theorem ([4], [6, section 5]). What the theorem asserts is that by “adding” an extra set  of

 parentheses and requiring that they be balanced, one may express a context-free language  L   in terms of a regular

language ˆ L  that we term its Chomsky-Schützenberger kernel  (or CS kernel ). Here, we restate the classical result forgeneral monoids  M  , making use of the monoid product to simplify our construction  –  referring to this as the  semi-

classical  formulation of the theorem.

We start by affixing a new monoid * N P Q , with a set of left brackets 0 1 1, , , n P p p p  and matching right

 brackets 0 1 1, , , nQ q q q . In this construction, it is not necessary for 2n  . If we need 2n   bracket pairs, we

can always encode the bracket pairs, e.g. i

i p bp  and  j

 jq q d   for 0 , 1i j n  and 1

1

n

n p p     , 1

1

n

nq q     . With

this encoding, sequences formed from  P Q  form properly nested bracket sequences if and only if their encodings do.

The monoid  N   may be equipped with involution given by the following:

†† † † † †1 1, , , .i i i iuv v u p q q p  

for all ,u v N   and 0   i n .

Page 44: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 44/53

 The way we attach the monoid  N   to  M  , however, is not  by free extension. Had we done so, we would be speaking ofthe classical  formulation of the theorem. Instead, we shall combine the two monoids by taking their common extensionmodulo commutativity. As described in section III, this is precisely what characterizes the product  M N  . The kernel

is therefore written as a rational subset ˆ L M N  R  . To impose the bracketing constraint we first require that the

elements of ˆ L  all have properly nested bracket sequences; that is, we take the intersection

ˆ L M D , where  D  is

the Dyck language of all properly nested sequences of brackets taken from  P Q ; i.e. the language given by thegrammar

1, 0 .i i D D p Dq D i n  

Then to obtain the original language, we “erase” the bracket symbols, i.e. we apply the monoid homomorphism

: , .m n M N m M    

If the kernel is chosen properly, the result is the language ˆ L L M D . These observations lead to the version

Chomsky-Schützenberger theorem, described in Section 3.3, which we term the semi-classical formulation.

Contained in this result, as we shall see, is the kernel21 of a representation for context-free languages cut from the samecloth as the regular expressions. Before going on, however, it is worth pointing out a few observations. The particular

representation we shall devise has the form 0 0ˆ L p q  where the subexpression  contains no occurrences of0 0, p q , possibly other than in the combinations 0 0

q p . For such expressions, we can equivalently write

* *ˆ ˆ , . L M C L M D C DQ D PD  

Entirely absent from the classical formulation, the importance of C   shall shortly become clear.

3.2. Canonical OrderingAs a preliminary result, we require an alternate means of expressing derivation sequences. In classical theory,derivations can be reduced to left-most or right-most form. This requires the following strengthening of the separabilitycondition (section III).

Lemma 3.2. Let , ,G Q S H    be an algebraic grammar. Then for each n  there exists derivations n  

andn

 such that n n n  and .Proof: 

Suppose n . We argue inductively. If 0n  , then , and we choose ,   and 0n n .

Otherwise 0n  , we have 1n q , ,q H    and . By inductive hypothesis, we have n ,n , 1n n n   and q . Since q Q   is prime in  M Q   then either q   and   or

q   and . In the former case, 1n   byR 

H   and1n n   by C . In the latter

case,1n  by R H  and

1n n  by C .

QED

Using this result we have the following.

Theorem 3.3. Let , ,G Q S H    be an algebraic grammar over a monoid  M   containing a generating subset  X  . Then

 H   m M   iff  L

 H   m  iff  R

 H   m , where , L R

 H   are the closures under C , R   and T  of the following sets

of one-step derivations:

(Shift) L

 H  x x    R

 H  x x    x X   

(Generate) L

 H     R

 H    ,   H   

21 Pun intended.

Page 45: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 45/53

Proof: 

One direction is immediate: if , L R

 H    then  H  . For the converse, we may establish inductively that

from n

 H   m M    follows  L

 H m m m  for all m M   and  M Q , with a similar argument applying to

show that  R

 H m mm . For 0n  , m  and we use repeated applications of Shift. Otherwise, for 0n  , we

have q ,

,q H    and 1n

 H 

  m . By Lemma 3.2, we have n m

,n

m

, m m m

    and

1n n n . Then  L

 H m q m m q , by inductive hypothesis,  L

 H m m q m m  by application of

Generate and  L

 H m m m m m  again by inductive hypothesis.

QED

3.3. The Semi-Classical Chomsky-Schützenberger Theorem

Theorem 3.3: Let  M   be a monoid. For each  L M C , there exists ˆ L M N  R   such that ˆ . L M D L  

Proof: 

Let , , ,G Q X S H    be a context-free grammar over * X   such that  L L G . Define 0 Z X Q  and associate

each  z Z   with a pair of brackets , z z  p q . Extend this notation to , p q  for * Z   by setting 1 p   ,  p p p  

and †q p   for *,   Z  , where we use   to denote the empty word in * Z  . Then the kernel is given directly interms of the grammar by

*

0 0

,

ˆ ˆ ˆ ˆ, , .S x q

 x X q H 

 L p p X H q X q x H q p

 

The algebraic nature of this result has apparently eluded notice up to now. To better understand what it is, note firstwhat the filtering operation is doing. The non-membership of a word v N    in C   requires that v  not be containedinside any properly nested sequence of brackets. This may only occur if and only if v  has an unbalanced subword; i.e.,

a subword of the form i j p dq , where d D  and i j . Therefore, the operation ˆ ˆ L N L , which yields subsets

of  N   that we called reduced , may be characterized by the removal ofi i

 p q  pairs and the elimination of anything that

involves clashing pair i j p q  where i j .

So, this is where the hidden algebraic structure emerges. Define the following reduction on  N   I , i j ij p q   ,

where we introduce the Kronecker delta

1 ,

.ij

i j

i j

   

 

We extend this relation as a quantale congruence on  N P  by taking its closure under products and arbitrary unions. In

 particular, since the reduction is length-reducing, each singleton n   for n N   has a normal form n N  I .

From this, we may define the normal form of a subset U N  P  by

.

n U 

U U n

 

Where do the normal forms of this reduction lie? First consider the regular set * *Q P    and its complement* *

. N Q P NPQN    Every singleton n   taken from elements n NPQN    has a redex, while none of those from* *Q P   do. As we shall see, the inverse image of 1 , under the reduction, is just  D , itself, while that of * *Q P   is C  .

The compliment  NPQN  has, as its inverse image  NPDQN . In particular, to i j Np q N  corresponds i j Np Dq N  , which

reduces to ij N  . This leads to a partition of  N   into the union of subsets of the forms

  ,q q p p DqD Dq DpD Dp D    

Page 46: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 46/53

and the remaining subset

  .i j

i j

 N C Np Dq N 

 

We shall prove these points by establishing inductively (Lemma 3.4) that for every non-empty U D , 1U   , while

(Lemma 3.5) the reduction   i j ijnp q n nn  preserves the class membership of both the left-hand and right-hand

sides, where ,n n N  . As a consequence, it follows that every U N  P  is partitioned into equivalence classes throughwhich its normal form may be expressed as a binary idempotent power series:

* * * *

, ,Q P Q P  

U U U U U  

 

where

 

1 ,

. z 

U z U 

U z 

   

 

 Note, in particular, that U U C  . The filtering operation of the Chomsky-Schützenberger theorem is part of the

construction. Finally, we may extend the reduction and equivalence relation to  M N    by simply taking

mn m n , for m M   and n N  . Correspondingly, each subset T M N   has an idempotent power series 

(with coefficients in the quantale  M P ) as a normal form:

* * * *

, ,Q P Q P  

T T T T T  

 

where now  z T T M z   . By virtue of our construction, it follows that T T M C   . In addition, we

have T M D T M D .

So, now at last we come to the proof. Using Lemma 3.3, we may establish by induction over 0 p   that

  0 0ˆ ˆ : .

 p L p

 H  p p X H mp p m  

Using *-continuity, we then have

  * *0 0

ˆ ˆ :   L H 

 p p X H mp p m  

and, upon application of0

q  to the right,

      *

* *

0 0 0 0ˆ ˆ : : . L L

 H H  p p X H q mp p q m m m  

Thus     ˆ ˆ ˆ ˆ . L L G S L L C L D L D  

QED

3.4. The Algebraic Underpinning to the Chomsky-Schützenberger Theorem

Lemma 3.4: For every non-empty U D , 1U   .

Proof: By additivity, we are reduced to proving that

1d     for each d D . This is a trivial induction over the

defining grammar of  D : either 1d   , in which case the reduction becomes trivial, or 0 1i id p d q d   , where 0 1,d d D ,

in which case we have by inductive hypothesis   0 11d d  . Then

0 1   1 1 1 .i i i i i id p d q d p q p q  

QED

As a consequence, we have the following reductions. For any u Dq q Dp p D , we have a reduction of the form

1 1 1 .u dq q d p p d q q p p q q p p  

Page 47: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 47/53

Hence, each non-empty U     reduces as U   . Second, for any i ju Np Dq N   , where i j , we have a

reduction of the form

      .i j i ju np dq n n p q n n n  

Thus, each subset U    reduces as U   .

Lemma 3.6: If nn D  then n  and †n   , for some * P  .

Proof: We argue inductively over the length of elements nn   of  D . In the trivial case, 1nn , which yields theunique factoring 1n n  and correspondingly 1 . Otherwise, we have a reduction 0 1i inn p d q d    for some i n  

and 0 1,d d D , which results in one of the factorings

0

0 1

0 0 0

0 1 1 1

0 1

1: , : , : .

i

i i

i i

i

n p nn n p d q n

n n d Dn p d q d n n d D

n n q d  

         

1 2 3  

In case 1, we have 1n  and 1n D   , so we may again choose 1 . In case 2, by inductive assumption,

we have 0 0n    and †

0 0n     , for some *

0  P  . From this, it follows that

        † †0 0 0 1 0 0, 1 ,i i i i in p n p n n q d q q  

which yields the desired result with the choice 0i p  (and consequently, † †

0   iq ). Finally, for case 3, again by

inductive assumption, we have 1n    and n  

 for a suitable choice of * P  . Thus, it follows that

    0 1   1i i i in p d q n p q  

so that we may use the same  for the pair nn  as we do for the pair1

n n .

QED

Lemma 3.5: For each ,n n N  , if   ijnn z     then   i jnp q n z     .

Proof: The case where i j  is trivial: for both sides of the equivalence  z   . Therefore, assume i j . To complete

the proof, we use the decomposition property in Lemma 3.6, so that we may factor each nn , where *Q  and* P   must into one of the following two ways:

 

 

*

*

, , , ,

, , , .

n n Qnn

n n P 

       

 

Similarly, using Lemma 3.6, we may factor each nn  in one of the following three ways:

 

† *

, ,

, , ,

, .

i j

n N n

nn n N p n q N P i j

n n N 

     

 

 Note that since the Dyck language satisfies the identity  DD D , we have the following identities

 

   

* * * *

† *

, , ,

1 .

Q Q P P  

 D Q

 

 

Therefore, from each of the factorings we may carry out the following constructions

Page 48: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 48/53

   

    ,

i i

i i

i i

 p qnp q n

 p q

       

 

and

 

   

   

† † .

k k 

k k i k k j i j i j

k k 

 N p q N 

np q n N p p q q N N p q N N p q N N N  

 p q N N 

 

 

 

QED

Since the only normal forms are  and , for *Q  and * P  , then lemma 3.4 and lemma 3.5 together

show that  N   is covered by the equivalence classes given by these normal forms. To prove the covering is a partition

requires showing that none of the equivalence classes overlap and coincide. The relations    are trivial.

To determine the intersections , note that if *,   Q  and *,   P   and , then it would

follow that   † † † †  D , and therefore that † †  D , from which it must follow that  and†   for some *Q . Similarly, we’d have   and †   for some *Q , and therefore that

. This is not possible unless 1   . Therefore, .

The role that subset * *

C DQ D PQ   plays throughout is that it is the language of subwords taken from  D .

Similarly, as we’ve just seen, *

 DQ D  and *

 D PQ  respectively comprise the prefixes and suffices of words taken

from  D .

The foregoing suggests the “matrix” interpretation of the elements of  M N  . Using the partition formula, we have(with a slight abuse of notation, and a suitable extension of the Kronecker delta notation)

* *

* *

* *

1

,

1

,

1 1

,

, , ,

, , ,

, , .

 p

Q P 

q

Q P 

Q P 

 p p p p P 

q q q q Q

m m m m m M  

 

Matrix addition may be defined componentwise. However, the definition of the matrix product is not trivial. The

 product , where *,   Q  and *,   P  , may decompose in one of three ways, based on the relation between  

and . If † , then the product is . If † , the product is . Otherwise, if no such factoring

relations exist, the product is just . Thus, we have the following reduction

 

† †

† †

, , ,

, , , , , ,

,   , , , ,

.

UV U V  

U V U V  

U V U V  

 

 

 

Consequently, the formula for the product components UV 

 is given by:

† †

, , , ,

.UV U V U V  

 

 

Page 49: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 49/53

 The remaining sections, 3.5 and 3.6, have not yet been fully worked out.

3.5. The Algebraic Chomsky-Schützenberger Theorem

Then, based on these considerations, we may write ˆ ˆ L M C L , and   ˆ L L . The inverse is given by

  ˆ ,1 :  MN  L u u L L , with  MN    L L . Let  _   denote the normal form quantale automorphism

on  M N P .. Then, what we have proven is that  MN    M M N  C R  , and  M M N  C R  .

To capture this result algebraically, define the object ,nC 

A in each category DA  as the A -algebra generated from the

set  P Q  modulo the relations i j ij p q   , where we define the Kronecker delta 1ij  if i j  and 0ij  if i j .

Making use of our encoding, we may use the value 2n    uniformly for all kernels ˆ L . Denote the canonical R  -morphism for

2,C 

R  by 2,:   N C 

  R R  .

Using this, we may establish an isomorphism 2,  ˆ M C M N 

R R R R  . Through this, in turn, we obtain an

injection2,

 M M C  QR 

C R R C R  . This is what we shall prove. Then, we shall characterize the subalgebra using a

result analogous to the Schur Lemma.

Theorem 3.6. As a *-continuous Kleene algebra, the context-free subsets  M C  of a monoid  M   are mapped injectivelyinto the subalgebra 2, M C 

R R R   consisting of elements that commute with the elements of 2,C 

R .

Finally, applying section III, we obtain a representation for the class of translation expressions corresponding to pushdown transductions.

Corollary 3.7. As a *-continuous Kleene algebra, the push-down transductions  M N C  between monoids  M   and

 N    are mapped injectively into 2, M M C  R R R 

R R    as the subalgebra of expressions that commute with the

elements of 2,C 

R .

3.6. The Categorical Chomsky-Schützenberger TheoremAt this point, the result obtained applies to the Kleisli subcategory of DC . We wish to extend this to the full category.This requires first generalizing the way by which we obtain the completion of objects  K M  R    in the Kleisli

subcategory of DR   to objects  K M  C  in the Kleisli subcategory of DC  and in turn to the same object  K M  QR 

CC ,

regarded as a member of DR  . Noting that  M M QC

R R C , we define  K K  Q

C

R  and  K K K  Q Q Q

R R C

C C R . Then,

the theorem we seek to establish is that  K   is mapped injectively into 2, K C R R 

 as the subalgebra of expressions that

commute with elements of 2,C R 

.

To prove this requires establishing a normal form and calculus on 2, K C R R 

o . We do this, making use of a

representation of this tensor product as idempotent power series over2,

C R 

 with coefficients in  K  .

4. ConclusionsAs mentioned in the concluding section of [16] and the close of section II: classically, attempts at extending the processof algebraization beyond the type 3 level in the Chomsky hierarchy (i.e. the regular languages and the correspondingalgebra of regular expressions) to the type 2 level did not yield a framework that found application as widespread as theregular expressions did  –   for instance, no context-free-expression version of GREP. The renewed progress we’ve

 begun to see in more recent times in this direction [12], [13] was still built essentially on the same basis as the olderformalisms, although in the latter case [13], a second order algebraic formalism equivalent to the one presented in [15],[16] was devised, but with a result weaker than that derived in [15]. In essence, the problem was solved in the same

Page 50: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 50/53

way the division problem 4 3  is solved by decreeing the solution to be 4 3 . Although it is true we can formulate

axioms that pin down the behavior of this “solution”, e.g. 

1 , 1,a a a a a c b c a b  

which is suitable for defining an inverse 1a a a a   and (possibly non-commutative) product 1ab a b   of a

group; or

,a a b b a b c c b a  which suffices for defining a commutative product of an Abelian group, and we can carry out a similar process (at leastin the framework of second order logic) for the type 2 level in the Chomsky hierarchy; it still fails to take the extra steprequired to obtain the analogue of the result 4 3 1.333 . The absence would have been just as acutely felt in thecase of division: we’d be using pairs of integer numerals (or maybe finite sequences of integer -valued numerals for

 prime exponents) instead of fixed point or floating point numerals for computer programming. Instead of FPU add-onsto CPU’s, we’d have ZZPU add-ons (zwei zahlen co-processing units). By analogy, instead of a utility like CEX (fordoing pattern-matching on context-free expressions), we’d have to content ourselves with much less powerful and

satisfactory utilities like REX (for regular expression matching)  –   or an even less functional utility, like GREP  –  without even realizing how much we’re missing out on by living in a world without CEX.

However, as it turns out, a significant step in this direction had already been taken early on [6]: the Chomsky-Schützenberger theorem for context-free languages. Yet, no theory of context-free expressions arose from it, becauseits algebraic underpinning largely eluded attention up to now. As we have seen here, there is indeed a representationanalogous to the regular expressions suitable for the context-free subsets of monoids. This includes not only freemonoids (i.e. context-free languages), but products of monoids (push down transductions). We have only touched onthe outlines of this representation. The full development of these ideas lies outside the scope of this paper, as does thefull realization of a world with CEX.

References[1] Berkeley: “The Analyst”. In: Men of Mathematics, Volume 1, 288-293.[2] J. Berstel, C. Reutenauer: Les Séries Rationelles et Leurs Langages. Masson (1984). English edition: Rational

Series and Their Languages. Springer-Verlag (1988).[3] G. Birkhoff: Lattice Theory. American Mathematical Society (1967).[4] N. Chomsky, “Context-free grammars and pushdown storage”, Quarterly Prog. Report No. 65, MIT Research

Lab. in Electronics, Cambridge, 187-194, (1962).

[5] N. Chomsky: Three Models for the Description of Language. IRE Transactions on Information Theory 2, 113-124 (1956).

[6] N. Chomsky and M. P. Schützenberger: “The algebraic theory of context-free languages”. In: P. Braffort and D.Hirschberg (eds.): Computer Programming and Formal Systems, 118-161, North Holland, Amsterdam (1963).

[7] J. H. Conway: Regular Algebra and Finite Machines. Chapman and Hall, London (1971).[8] B. A. Davey, H. A. Priestley: Introduction to Lattices and Order. Cambridge University Press (1990).[9] H. B. Enderton: A Mathematical Introduction to Logic, Academic Press, New York and London (1972).

[10] Z. Ésik and M. Ito: Temporal logic with cyclic counting and the degree of aperiodicity of finite automata. ActaCybernetica 16, 1-28 (2003).

[11] Z. Ésik, W. Kuich: Rationally Additive Semirings. Journal of Computer Science 8, 173-183 (2002).[12] Z. Ésik, H. Leiss: Algebraically complete semirings and Greibach normal form. Ann. Pure. Appl. Logic. 133,

173-203 (2005).[13] N. Grathwohl, F. Henglein, D. Kozen, “Infinitary Axiomatization of the Equational Theory of Context-Free

Languages”, in D. Baelde and A. Carayol (Eds.): _Fixed Points in Computer Science_ 2013 (FICS 2013),EPTCS ??, 2013 pp. 44-55[14] J. Gruska: A Characterization of Context-Free Languages. Journal of Computer and System Sciences 5, 353-364

(1971).[15] M. W. Hopkins: The Algebraic Approach I: The Algebraization of the Chomsky Hierarchy. RelMiCS/AKA

2008, LNCS 4988, 155-172 (2008).[16] M. W. Hopkins: The Algebraic Approach II: Dioids, Quantales and Monads, RelMiCS/AKA 2008, LNCS 4988,

173-190 (2008).[17] G. Huet: Logical Foundations of Functional Programming. Addison-Wesley (1990).[18] D. Kozen, Automata and Computability, Springer-Verlag, 1997.

Page 51: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 51/53

Page 52: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 52/53

Similarly, functor :   U D M   is a right-adjoint if to each  M    M   can be assigned an initial morphism

*: M    M M  U   from some object*

 M    D . The defining condition is that every other morphism : F M D U  

should factor into *   M  F F  U . When a left-adjoint E  exists, it is uniquely characterized (again, up to equivalence)

as the functor for which * M M  E , with  M   becoming the unit, and*

 F   the natural bijection.

A.2. Monads and Co-MonadsFor the category M , a self-contained structure , , T , called a monad, can be defined for the endofunctor

:   T M M , with the introduction of the product *

1 M M M  EU T U . By the identity

*

: , M M   f f f f M M    TT U T T  

this yields a natural transformation : T T T   which also satisfies the two coherence conditions that play the

respective analogues to associativity and identity

*

, 1 . M M M M M M M M M M  T TT U T T  

For both the monad and co-monad, information from the original adjunction is lost. In particular, the two equationsenclosed in square brackets are no longer present. We can partially recover the unit and co-unit by

, , D D M M  U E

U T E L  

and attempt to approximate the adjunction by trying to define natural transformations : 1   MT  and :1 D   L  suchthat

, . D D M M  U EU E  

However, these natural transformations are only defined, respectively, over the subcategories U D M   and

E M D  within each category that reflect the other. This observation serves as the basis for constructing a minimal

adjunction from either the monad or co-monad.

A.3. Adjunctions from Monads and Co-Monads

A T-Algebra  is constructed from the monad , , T   as a category T M   whose objects are the morphisms

: M    M M  T  that satisfy

, 1 . M M M M M M M 

T  

The morphisms :  M M  F      are the subclass of morphisms : F M M    for which  M M  F F  T . This is

enough information to define the functor E  by

  , : . M  M M f f f M M  E M E T  

In addition, the functor U  may be defined by

  , : . M M M  M M F F F    U M U  

The natural operations are given by

*

*: , : . M M M M   f f f M M F F F  T  

These definitions suffice to recover an adjunction, the identity T U E , and a co-monad structure given by.

 M M  M M  T  

The category TM   is referred to as an  Eilenberg-Moore category  of the monad , , T , and its members as

Eilenberg-Moore algebras, or just T-Algebras. The full subcategory of free algebras  M    M M  TT T   yields a

category TM  called the Kleisli category of the monad , , T . An adjunction that (up to equivalence) arises from a

T-algebra construction is referred to as monadic.

The analogous construction for a co-monad , , L  is a category LD  whose objects are the morphisms : D   D D L  

satisfying

Page 53: The Algebraic Approach II-V

8/12/2019 The Algebraic Approach II-V

http://slidepdf.com/reader/full/the-algebraic-approach-ii-v 53/53

  1 . D D D D D D D L  

Its morphisms   :  D D  f      are the morphisms :  f D D  for which  D D  f f   L . The functors are defined by

 

 

, : ,

, : .

 D

 D D D

 D D F F F D D

 D D f f f    

U D U L

E D E 

The natural correspondences are given by

**: , : . D D D D  f f f F F F D D   L  

Finally, the corresponding monad operators are, ,

 D D D L  

and we recover the factoring L E U .

A.4. Natural Dioids and Natural Semirings

In section 2, we laid out the construction for natural dioid family A   as an adjunction between M Monoid   and

D DA , and actually as a T-algebra for M  with functors E T   A  and ˆU   A . For the category M  this led to thefollowing definitions

*, , , , . M M  M M M f f f f U f U m m E T E TA   Y Y  

\For the category D  the corresponding data were given by

    *, , , : , . D D D D F F F F m F m U u u D U U  U L U L  

Properties0

A , 2A  and4

A  yield the functor T ,1

A  the unit , and3

A  the product . As we mentioned in section

4.3, one needs only the weaker property 1W A  to be able to define the unit morphisms. With this extension, the result is

a larger hierarchy that goes beyond the additively closed structure of dioids and includes the partially ordered monoids.This construction generalizes to arbitrary semirings S  , yielding a hierarchy of monads S A . The dioid hierarchy

corresponds to the special case   2A A  constructed from the dioid 2 . In place of property 0A , we assume 0S A : that

 M 

S  M S A . The remaining properties 1WS A , 1S A , 2S A , 3S A  and 4S A  are then defined by analogy.