Algebraic elimination of ε -transitions
G´erard H. E. Duchamp
1, Hatem Hadj Kacem
2and ´Eric Laugerotte
21LIPN, UMR CNRS 7030. Institut Galil´ee - Universit´e Paris-Nord 99, avenue Jean-Baptiste Cl´ement 93430 Villetaneuse, France.
email: [email protected]
2LIFAR, Facult´e des Sciences et des Techniques, 76821 Mont-Saint-Aignan Cedex, France.
email: {hatem.hadj-kacem, eric.laugerotte }@univ-rouen.fr
received Sep 15, 2004,revised Dec 7, 2004, Feb 20, Mar 6, Apr 23, 2005,accepted Apr 26, 2005.
We here describe a method of removing theε-transitions of a weighted automaton. The existence of a solution for this removal depends on the existence of the star of a single matrix which, in turn, is based on the computation of the stars of scalars in the ground semiring. We discuss two aspects of the star problem (by infinite sums and by equations) and give an algorithm to suppress theε-transitions and preserve the behaviour. Running complexities are computed.
Keywords:Automata with multiplicities,ε-transitions, behaviour, star of matrices.
1 Introduction
Automata with multiplicities (or weighted automata) are a versatile class of transition systems which can modelize as well classical (boolean), stochastic, transducer automata and be applied to various purposes such as image compression, speech recognition, formal linguistic (and automatic treatment of natural languages too) and probabilistic modelling. For generalities over automata with multiplicities see [1] and [10], problems over identities and decidability results on these objects can be found in [11], [12] and [13].
A particular type of these automata are the automata withε-transitions denoted byk-ε-automata which are the result, for example, of the application of Thompson method to transform a weighted regular ex- pression into a weighted automaton [14].
The aim of this paper is to study the equivalence betweenk-ε-automata andk-automata. Indeed, we will present here an algebraic method in order to compute, for a weighted automaton withε-transitions (choosen in a suited class) an equivalent weighted automaton withoutε-transitions which has the same behaviour. Here, the closure ofε-transitions implies the existence of the star of transition matrix forε. Its running time complexity is deduced from that of the matrix multiplication inkn×n. In the case of well- known semirings (like boolean and tropical), the closure is computed inO(n3)[15]. We fit the running time complexity to the case whenkis a ring.
The structure of the paper is the following. We first recall (in Section 2) the notions of a semiring and the computation of the star of matrices.
1365–8050 c2005 Discrete Mathematics and Theoretical Computer Science (DMTCS), Nancy, France
After introducing (in Section 3 ) the notions of a k-automaton and k-ε-automaton, we present (in Section 4 and 5 ) our principal result which is a method of elimination ofε-transitions and show particular cases of series on which our result can be applied. In Section 6 , we give the equivalence between the two types of automata and discuss its validity. A conclusion section ends the paper.
Acknowledgements
We thank the anonymous referees for careful reading and fruitful remarks.
2 Semirings
In the following, a semiring(k,⊕,⊗,0k,1k)is a set together with two laws and their neutrals. More precisely(k,⊕,0k)is a commutative monoid with0k as neutral and(k,⊗,1k)is a monoid with1k as neutral. The product is distributive with respect to the addition and zero is an annihilator (0k ⊗x = x⊗0k= 0k) [7]. For example all rings are semirings, whereas(N,+,×,0,1), the boolean semiringB= ({0,1},∨,∧,0,1)and the tropical semiringT= (R+∪ {∞},min,+,∞,0)are well-known examples of semirings that are not rings. The star of a scalar is introduced by the following definition:
Definition 1 Letx∈k, the scalaryis a right (resp. left) star ofxif and only if(x⊗y)⊕1k=y(resp.
(y⊗x)⊕1k=y).
Ify∈kis a left and right star ofx∈k, we say thatyis a star forxand we writey=x. Remark 1 Left or right stars need not exist and need not coincide (see examples below).
Example(s) 1
(1) Fork=C, any complex numberx6= 1has a unique star which isy= (1−x)−1. In the case|x|<1, we observe easily thaty= 1 +x+x2+· · ·.
(2) Letk be the ring of all linear operators(R[x] → R[x]). LetX andYα defined byX(x0) = 1, X(xn) =xn−nxn−1withn >0andYα(xn) = (n+1)−1xn+1+αwithα∈R. ThenXYα+1 =Yα
and an infinite number of solutions exist for the right star (which is not a left star ifα6= 0).
(3) Fork=T(tropical semiring), any numberx >0has a unique stary= 1.
We can observe that if the opposite−xofxexists then right (resp. left) stars ofxare right (resp. left) inverses of(1⊕(−x))and conversely. Thus, if they exist, any right starxr equals any left starxlas xl=xl⊗((1⊕(−x))⊗xr) = (xl⊗(1⊕(−x)))⊗xr =xr. In this case, the star is unique.
If Qis a finite set, the spacekQ×Q of square matrices with indices inQ and coefficients ink has a natural semiring structure with the usual operations (sum and product). A (right) star ofM ∈ kQ×Q (when it exists) is a solution of the equationM Y + 1Q×Q =Y (where1Q×Qis the identity matrix). Let M∈kQ×Qbe given by
M =
a11 a12 a21 a22
wherea11∈kQ1×Q1,a12∈kQ1×Q2,a21∈kQ2×Q1anda22∈kQ2×Q2such thatQ1+Q2=Q. Let N ∈kQ×Qgiven by
N =
A11 A12
A21 A22
with
A11= (a11+a12a22∗
a21)∗ (1)
A12=a11∗a12A22 (2)
A21=a22∗
a21A11 (3)
A22= (a22+a21a11∗a12)∗ (4) Theorem 1 If the right hand sides of formulas (1), (2), (3) and (4) are defined, the matrixMadmitsN as a right star.
Proof. Suppose, without loss of generality, thatQ = [1, n]N; n = p+q; Q1 = [1, p]N; Q2 = [p+ 1, p+q]N. We have to show thatN is a solution of the equationM y+ 1n×n =y. By computation, one has
M N+ 1 =
a11 a12
a21 a22
A11 A12
A21 A22
+
1p×p 0p×q
0q×p 1q×q
=
a11A11+a12A21+ 1p×p a11A12+a12A22
a21A11+a22A21 a21A12+a22A22+ 1q×q
where0p×q is the zero matrix inkp×q. We verify the relations (1), (2), (3) and (4) by:
a11A11+a12A21+ 1p×p = a11A11+a12a∗22a21A11+ 1p×p= A11(a11+a12a22∗
a21) + 1p×p = A11
a11A12+a12A22 = a11a11∗a12A22+a12A22= (a11a11∗+ 1)a12A22 = a11∗a12A22=A12
a21A11+a22A21 = a21A11+a22a22∗a21A11= (1 +a22a22∗)a21A11 = a22∗a21A11=A21
a21A12+a22A22+ 1q×q = a21a11∗a12A22+a22A22+ 1q×q = (a22a21a11∗a12)A22+ 1q×q = A22
Remark 2
(i) In [8] and [16], similar formulas are expressed for the computation of the inverse of matrices when kis a division ring (this can be extended to the case of rings).
It must be emphasized that the converse of Theorem (1), of course, does not hold as shows the example below (the coefficients are taken in a ring and here the star is unique).
M=
1 −1 1 −1
M∗=
2 −1 1 0
(5) However, if the formulas are defined at each step of the computation (see below for a formalization of this), it provides a recursive way to compute a star of a matrix.
(ii) Similar formulas can be stated in the case of a left star. The matrixNis the left star ofMwith A11= (a11+a12a22∗a21)∗
A12=A11a12a22∗
A21=A22a21a11∗
A22= (a22+a21a11∗a12)∗
(iii) When all their terms are defined, formulas above (as well as (1), (2), (3) and (4)) are valid with matrices of any size with any block partitionning. Matrices of even size are often, in practice, partitionned into square blocks but, for matrices with odd dimensions, the approach called dynamic peeling is applied. More specifically, letM∈kn×na matrix given by
M =
a11 a12
a21 a22
wheren∈2N+ 1. The dynamic peeling [9] consists of cutting out the matrix in the following way:
a11is a(n−1)×(n−1)matrix,a12is a(n−1)×1matrix,a21is a1×(n−1)matrix anda22
is a scalar.
If desired, formulation of Theorem (1) can be seen as recursive in essence. In this respect, it implies that stars of submatrices could be already computed by the same scheme. This type of computation will be formalized by the notion ofadmissible tree of computationwhich we describe below.
LetQbe a finite set andA[Q]be the set of binary trees with leaves inQ. It can be defined by the grammar
A[Q] =Q+ (A[Q],A[Q]) (6)
or, if one prefers a graded version
A1[Q] = Q An[Q] = P
i+j=n(Ai[Q],Aj[Q])ifn≥2.
Now, the list of leaves of a treeT ∈ An[Q]is a wordlv(T)∈Qndefined by lv(T) = T ifT ∈ A1[Q]
lv(T) = lv(T1)lv(T2)(concatenation) ifT = (T1, T2).
The set of leaves ofT is thenalph(lv(T)), wherealph(w)is classically the alphabet of the wordw.
We will say thatT ∈ A[Q]is an admissible tree of computation forM∈kQ×Qif
1. the wordlv(T)is standard (with no repetition) and contains all the indices (i.e.|lv(T)|=|Q|and alph(lv(T)) =Q)
2. if|Q|= 1(thusM∈kQ×Q 'kis a scalar),Madmits a star inkQ×Q
3. • if |Q| ≥ 2, set T = (T1, T2) andQi = lv(Ti)(i = 1,2) then T1 is admissible for the submatrixM
Q1×Q1andT2is admissible for the submatrixM Q2×Q2.
• formulas above (1), (2), (3) and (4) are defined for the partitionningQ=Q1+Q2.
The conditions above assures that the recursive computation of Theorem (1) is defined at each step and, in this case, we will say that the star ofMis computed along the (admissible) tree of computationT.
Theorem 2 Letkbe a semiring,M ∈kQ×Qa square matrix andT a tree of computation admissble for M. Then, the right star of a matrix of sizen∈Ncan be computed inO(nω)operations with:
• ω≤3ifkis not a ring,
• ω≤2.808ifkis a ring,
• ω≤2.376ifkis a field.
Proof. Forn= 2m∈N, letTm+,Tm×andTm∗ denote the number of operations⊕,⊗andinkthat the addition, the multiplication and the star of matrix respectively perform with an input of sizen. Then
T0∗= 1
Tm∗ = 2Tm−1+ + 8Tm−1× + 4Tm−1∗ (7) by Theorem 1. For arbitrary semiring, one hasTm−1+ = 22(m−1). Ifkis a ring, using Strassen’s algorithm for the matrix multiplication [19], it is known that at mostnlog2(7)operations are necessary. Ifkis a field, using Coppersmith and Winograd’s algorithm [3], it is known that at mostn2.376operations are necessary.
Suppose thatTm−1× = 2(m−1)ω. The solution of the recurrence relation (7) is
4m+1
2(m+ 1)4m−(6 + 2ω−1)
2ω−4 +8·2mω 2ω−4
where the leading term is2mω.
Remark 3 In some situations, any treeT with|Q|leaves and standardlv(T)is admissible. This is the case, for example, of matrices of series without constant term (matrices of proper series [1]).
The running time complexity for the computation of the right (resp. left) star of a matrix depends onT, TandT, but it depends also on the representation of coefficients in machine. In the casek =Zfor example, the multiplication of two integers is computed in O(mlog(m) log(log(m))), using FFT ifm bits are necessary [18].
Theorem 3 With the same hypotheses as in (2) (M∈kQ×Qa square matrix andTa tree of computation admissible forM), the space complexity of the right star of a matrix of sizen∈NisO(n2log(n)).
Proof. Forn= 2m∈Nandka semiring, letEm∗ denote the space complexity of operation∗that the star of matrix perform with an input of sizen. Then
E0∗= 1
Em∗ = 12·22m−1+ 4Em−1∗ (8) The solution of the recurrence relation (8) is
−5·4m+ (6m+ 6)4m
where the leading term ism·4m.
The running of the algorithm needs the reservation of memory spaces for the resulting matrix (the star of the input matrix) and for intermediate results stored in temporary locations.
LetkhhΣiibe the set of noncommutative formal series withΣas alphabet (i.e. functions on the free monoidΣ∗with values ink). It is a semiring equipped with+the sum and·the Cauchy product.
We denote byα(?)and(?)αthe left and right external product respectively. The star(?)∗of a formal series is well-defined if and only if the star of the constant term exists [10, 1].
WhenΣis finite, the set RATk(Σ) is the closure of the alphabetΣby sums, external and Cauchy products and the star.
3 Automata with multiplicities
Let Σ be a finite alphabet and k be a semiring. A weighted automaton (or linear representation) of dimensionnonΣwith multiplicities inkis a triplet(λ, µ, γ)where:
• λ∈k1×n(the input vector),
• µ: Σ→kn×n(the transition function),
• γ∈kn×1(the output vector).
Such an automaton is usually drawn as a directed valued graph (see Figure 1). A transition(i, a, j)∈ {1, . . . , n} ×Σ× {1, . . . , n}connects the stateiwith the statej. Its weight isµ(a)ij. The weight of the initial (final) stateiisλi(respectivelyγi). The mappingµinduces a morphism of monoids fromΣ∗to
1 a | 1 2
a |3 b |1
a |1 b |4
3 1
Figure 1:AN-automaton
kn×n. The behaviour of the weighted automatonAbelongs tokhhΣii. It is defined by:
behaviour(A) = X
u∈Σ∗
(λµ(u)γ)u.
More precisely, the weight hbehaviour(A), uiof the worduin the formal series behaviour(A)is the weight ofufor thek-automatonA(this is an accordance with the scalar product denotationhS|ui:=S(u) for any functionS: Σ∗→k[2]).
Example(s) 2 The behaviour of the automatonAof Figure 1 is behaviour(A) = X
u,v∈Σ∗
3|u|a+14|v|buav.
Letu=aba. Then, its weight inAis:
λµ(u)γ=λµ(a)µ(b)µ(a)γ
= 3 0
3 1 0 1
1 0 0 4
! 3 1 0 1
! 0 1
= 21.
The set RECk(Σ)is known to be equal to the set of series which are the behaviour of ak-automaton. We recall the well-known result of Sch¨utzenberger [17]:
RECk(Σ) =RATk(Σ).
Ak-ε-automatonAεis ak-automaton over the alphabetΣε = Σ∪ε˜(see Figure 2). We must keep the reader aware thatε˜is considered here as a new letter and that there exists an empty word forΣ∗ε= (Σ∪ε)˜∗ denoted here byε. The transition matrix ofε˜is denotedµε˜.
Example(s) 3 In Figure 2, the behaviour of the automatonAεis behaviour(Aε) = 18˜ε X
i∈N
2i(a˜ε)i
!
˜
ε= 18˜ε(2a˜ε)∗ε.˜
1 2 ε ˜ |3 3
3 1
˜ ε |2
a | 1
Figure 2:AN-ε-automaton
4 Algebraic elimination
LetΦbe the morphism fromΣ∗εtoΣ∗induced by
Φ(x) =x ifx∈Σ, Φ(˜ε) =ε.
It is classical that the morphismΦcan be uniquely extended to the polynomials ofkhΣεias a morphism of algebraskhΣεi 7→khΣiby, forPa polynomial,
Φ(P) = Φ(X
u∈Σ∗
hP|uiu) = X
u∈Σ∗
( X
Φ(v)=u
hP|vi)u (9)
as, in this case, the sum
X
Φ(v)=u
hP|vi (10)
is finite-supported and then well defined. But, we remark that the set of preimages of u=a1a2. . . anbyΦis
{v|Φ(v) =u}= ˜ε∗a1ε˜∗a2· · ·ε˜∗anε˜∗ (11) This shows that, in this case, all preimages are infinite and we will discuss on the convergence of the sum P
Φ(v)=uhP|vi.
ßIn the sequel, we will extend formula (9) in two ways:
1. To the series for which the sum (10) remains with finite support (this set is larger than the polyno- mials and includes also the behaviours ofε-automata with an acyclic-transition matrix). We will call themΦ-finite series (FFseries).
2. Having supposed the semiring endowed with a topology (or, at least, an “infinite sums” function) we define the set of series for which the sums (10) converge (this definition covers the behaviour of classical booleanε-automata). We will call themΦ-convergent series (FCseries).
After these extensions, we will prove that the behaviour of the automaton obtained by algebraic elimina- tion is the image byΦ(the erasure ofε) of the behaviour (inkhhΣεii) of the initial automaton.
5 FF and FC series
5.1 FF ( Φ -finite) series
LetS∈khhΣεiibe a formal series, we recall that the support ofSis given by:
supp(S) ={v∈Σ∗ε:hS, vi 6= 0}.
We will call (FF) the following condition:
(FF) For anyu∈Σ∗, the set supp(S)∩(Φ−1(u))is finite.
If the formal seriesS satisfies (FF), we say that it isΦ-finite. The set ofΦ-finite series inkhhΣεiiis denoted(khhΣεii)Φ-finite.
Theorem 4 The set(khhΣεii)Φ-finiteis closed under+,·,α(?)and(?)α.
Proof. As supp(S1+S2)⊆supp(S1)∪supp(S2), supp(αS1)⊆supp(S1)and supp(S1α)⊆supp(S1) forS1, S2∈khhΣεiiandα∈k, the stability is shown for+,α(?)and(?)α.
Now, for the Cauchy product, one can check that : supp(S1S2)∩Φ−1(u)⊆ [
u=u1u2
(supp(S1)∩Φ−1(u1))(supp(S2)∩Φ−1(u2)) (12)
which is a finite set ifS1, S2∈(khhΣεii)Φ-finite.
Remark 4
• Every polynomial isΦ-finite.
• The starS∗need not beΦ-finite even ifSisΦ-finite. The simplest example is provided byS= ˜ε.
Next, we show thatΦ :khΣεi 7→khΣican be extended tokhhΣεiiΦ-finite as a polymorphism.
Theorem 5 For anyS, T ∈(khhΣεii)Φ-finite,
Φ(S+T) = Φ(S) + Φ(T), Φ(ST) = Φ(S)Φ(T) Φ(αS) =αΦ(S), Φ(Sα) = Φ(S)α
IfS∗isΦ-finite,Φ(S∗)is a star ofΦ(S). In particular, ifΦ(S)has no constant term, one has Φ(S∗) = (Φ(S))∗
Proof. For sum and Cauchy product, we obtain the result by the following relations:
X
v∈Φ−1(u)
hS+T, vi= X
v∈Φ−1(u)
hS, vi ⊕ X
v∈Φ−1(u)
hT, vi
X
v∈Φ−1(u)
hST, vi= X
u=u1u2
( X
v∈Φ−1(u1)
hS, vi ⊗ X
v∈Φ−1(u2)
hT, vi)
ThenΦ(S∗)is a solution of the equationY =ε+ Φ(S)Y asS∗=ε+SS∗, and thenΦ(S∗) = Φ(S)∗.
AΦ-finite series may be not rational.
Example(s) 4 The series inNhhΣii
S= X
|u|a=|u|ε˜
u.
is not rational and howeverΦ-finite.
We recall that a matrixM ∈kn×nis nilpotent if there exists a positive integerNsuch thatMN= 0.
Proposition 1 LetSbe a rational series inkhhΣεiiwith(λ, µ, γ)a linear representation ofS.
i) Ifµis nilpotent thenSisΦ-finite.
ii) Conversely, ifSisΦ-finite,ka field and(λ, µ, γ)is of minimal dimension thenµis nilpotent.
Proof. i) With the notations of the theorem, suppose that there is an integerNsuch thatµ(˜ε)N = 0n×n. Then, foru=a1a2· · ·akone has
X
Φ(v)=u
hS|vi= X
n0, n1,···nk∈N
hS|˜εn0a1ε˜n1a2ε˜n2· · ·akε˜nki=
X
n0, n1,···nk∈N
λµ(˜ε)n0µ(a1)µ(˜ε)n1µ(a2)µ(˜ε)n2· · ·µ(ak)µ(˜ε)nkγ=
X
n0, n1,···nk<N
λµ(˜ε)n0µ(a1)µ(˜ε)n1µ(a2)µ(˜ε)n2· · ·µ(ak)µ(˜ε)nkγ
which is obviously finite.
ii) If(λ, µ, γ)is of minimal dimensionn, then there exists words(ui)1≤i≤n, (vj)1≤j≤n inΣεsuch that then×nmatrices
L=
λµ(u1) λµ(u2)
...
λµ(un)
andG= µ(v1)γ µ(v2)γ · · · µ(vn)γ (13)
are regular (Lis a block matrix ofnlines of size1×nandGis a block matrix ofncolumns of sizen×1;
indeed,LandGaren×nsquare matrices.) [1].
Now, for1≤i, j≤nthe family
(hS|uiε˜nvji)n≥0= (λµ(ui)µ(˜εn)µ(vj)γ)n≥0 (14) as a subfamily of(hS|vi)Φ(v)=Φ(uivj)must be with finite support. This implies that(Lµ(˜εn)G)n≥0 is with finite support. AsLandGare invertible,µ(˜ε)must be nilpotent.
5.2 FC ( Φ -convergent) series
If we want to go further in the extension ofΦ(and so doing to cover the - boolean - classical case), we must extend the domain of computability of the sums (10) to (some) countable families.
Many approaches exist in the literature [10], mainly by topology, ordered structure or “sum” function.
Here, we adopt the last option with a minimal axiomatization adapted to our goal.
The semiringkwill be supposed endowed with a sum functionsum taking some (at most) countable families(ai)i∈I (called summable) and computing an element ofkdenotedsumi∈I ai. This function is subjected to the following axioms:
ßCS1. — If(ai)i∈I is finite, then it is summable and sumi∈Iai=X
i∈I
ai (15)
CS2. — If(ai)i∈I and(bi)i∈I are summable, so is(ai+bi)i∈Iand
sumi∈Iai+bi= (sumi∈Iai) + (sumi∈I bi) (16) CS3. — If(ai)i∈I and(bj)j∈Jare summable, so is(aibj)(i,j)∈I×Jand
sum(i,j)∈I×Jaibj= (sumi∈Iai)(sumj∈Jbj) (17) CS4. — If(ai)i∈Iis summable andI =tλ∈ΛJλis partitionned in finite subsets. Then(P
j∈Jλaj)λ∈Λ
is summable and
sumi∈Iai=sumλ∈Λ(X
j∈Jλ
aj) (18)
CS5. — IfI =tλ∈ΛJλwithΛfinite and each(aj)j∈Jλ is summable. Then so is(ai)i∈I and sumi∈I ai=X
λ∈Λ
sumj∈J
λaj (19)
CS6. — If(ai)i∈I is summable andφ:J 7→Iis one-to-one then(aφ(j))j∈Jis summable and sumi∈I ai =sumj∈Jaφ(j) (20) Definition 2 A semiring withsumfunction (as above) which fulfillsCS1..6will be called a CS-semiring.
Ifkis a CS-semiring, the semiring of square matrices kn×n will be equipped with the following sum function:
A family(M(i))i∈I of square matrices will be saidsummable iff it is so componentwise i.e. then2 families(Mr,s(i))i∈I (for1≤r, s≤n) are summable. In this case, the sum of the family is the matrixL such that, for1≤r, s≤n,Lrs =sumi∈I Mrs(i)(i.e. the sum is computed componentwise). It can be easily checked that, with this sum function,kn×nis a CS-semiring.
Remark 5 Letkbe a topological semiring (i.e.kis endowed with some Hausdorff topologyT such that the two binary operations - sum and product - are continuous mappingsk×k 7→ k). We recall that a family(ai)i∈Iis said summable with sumsiff it satisfies the following property, whereB(s)is a basis of neighbourhoods ofs.
∀V ∈B(s)
∃F ⊂f initeI
∀F0
F ⊂F0 ⊂f initeI =⇒ X
i∈F0
ai∈V
. (21)
In this case the axiomsCS12456are automatically satisfied for the preceding (usual) notion of summa- bility.
Example(s) 5 Below some examples of CS-semirings which are metric semirings (i.e. the notion of summability and the sum function are given as in Remark (5)).
1. The fieldsQ, R, Cwith their usual metric.
2. Any semiring with the discrete topology, given by the metricd(x, y) = 1ifx6=yandd(x, x) = 0.
3. The extended integers(N∪ {+∞},+,×)with the Frechet topology given by the metricd(n, m) =
|n1 −m1|andd(+∞, n) =n1.
4. The(min, plus)closed half-ray([0,+∞]R¯, min,+)with the metric transported by the rational homomorphism x 7→ x+1x from[0,+∞]R¯ to[0,1]Ri.e. with d(x, y) = |x+1x − y+1y | and with
x
x+1|x=+∞= 1.
LetS∈khhΣεiibe a formal series, we will call (FC) the following condition:
(FC) For anyu∈Σ∗, the (countable) family(hS|vi)v∈Φ−1(u)is summable.
If the formal seriesS satisfies (FC), we say that it isΦ-convergent. The set ofΦ-convergent series in khhΣεiiis denotedkhhΣεiiΦ-conv.
It is straightforward that aΦ-finite series isΦ-convergent. We have now a theorem similar to Theorem (4) forkhhΣεiiΦ-conv.
Theorem 6 The setkhhΣεiiΦ-convis closed under+,·,α(?)and(?)α.
Proof. Stability by+,α(?)and(?)αis straightforward using the axiomsCS123. Let us give the details of the proof for the Cauchy product. We have to prove that, for everyS, T ∈khhΣεiiΦ-conv andu∈Σ∗, the (countable) family
(hST|vi)v∈Φ−1(u)= (hST|vi)Φ(v)=u (22)
is summable.
From the definition of the Cauchy product we have the finite sums hST|vi= X
v1v2=v
hS|v1ihT|v2i
and, from CS4, the summability would be a consequence of that of the family (hS|v1ihT|v2i)Φ(v)=u
v=v1v2 = (hS|v1ihT|v2i)Φ(v1v2=u)
(with the same sum). This family can be partitionned in a finite sum of families (with the same sum) tu1u2=u(hS|v1ihT|v2i)v1∈Φ−1(u1 )
v2∈Φ−1(u2 )
(23) each of which, byCS3, is summable. Thus, byCS5, the family (23) is summable and hence summability
of (22) (with the same sum) follows.
Next, we show thatΦ : (khhΣεii)Φ-conv →khhΣiiis a polymorphism.
Theorem 7 For anyS, T ∈(khhΣεii)Φ-conv,
Φ(S+T) = Φ(S) + Φ(T), Φ(ST) = Φ(S)Φ(T) Φ(αS) =αΦ(S), Φ(Sα) = Φ(S)α
IfS∗isΦ-conv,Φ(S∗)is a star ofΦ(S). In particular, ifΦ(S)has no constant term, one has Φ(S∗) = (Φ(S))∗
Proof. The proof is similar to that of Theorem (5), using the axioms of CS-semirings.
In the sequel, as in the classical case, the summability of(µ(˜ε)n)n∈Nwill play a central rˆole. We will then call closable a square matrixM ∈kn×nsuch that the family(Mn)n∈Nis summable. Note that, in this case, the sumsumn∈NMnis a two-sided (we could say “topological”) star ofM.
For example, with the boolean semiring endowed with the discrete topology, everyM∈Bn×nis closable (i.e. the sequenceSN =PN
k=0Mkis stationnary).
We have the following theorem, very similar to (1).
Proposition 2 LetSbe a rational series inkhhΣεii(ka CS semiring) with(λ, µ, γ)a linear representa- tion ofS.
(i) Ifµ(˜ε)is closable thenSisΦ-convergent.
(ii) Conversely, ifSisΦ-convergent,k=R, Cand(λ, µ, γ)minimal thenµ(˜ε)is closable.
.
Proof. The proof (i) is similar to that of Theorem (1). The first computation of (ii) is similar, but, to conclude, we use the property (which holds inRandC) that a family is summable iff it is absolutely summable (because of CS6) and then subfamilies of summable families are summable.
6 Equivalence
We now deal with an algebraic method to eliminate theε-transitions from a weightedε-automatonAε. The result is a weighted automaton with behaviourΦ(behaviour(Aε)).
Theorem 8 Letkbe a CS semiring andAε= (λ, µ, γ)be a weightedε-automaton with weights ink.
We suppose thatµ(˜ε)is closable. Then i) the series behaviour(Aε)isΦ-convergent.
ii) there exists a (algorithmically constructible) weighted automatonA= (λ0, µ0, γ0)such that behaviour(A) = Φ(behaviour(Aε)).
Proof. The point i) is a reformulation of Proposition (2). Remark that, if(µ(˜ε)n)n∈Nis summable its sum is a (two sided) star ofµ(˜ε)that, for convenience, we will denoteµ(˜ε)∗.
LetBbe the behaviour ofAεone has Φ(B) = X
u∈Σ∗
( X
Φ(v)=u
hB|vi)u= X
u∈Σ∗
( X
Φ(v)=u
λµ(v)γ)u
Let, nowu=a1a2· · ·an ∈Σ∗, one has X
Φ(v)=u
λµ(v)γ=λ X
k0,k1,···kn∈N
µ(˜ε)k0µ(a1)µ(˜ε)k1· · ·µ(an)µ(˜ε)kn γ=
λµ(˜ε)∗µ(a1)µ(˜ε)∗· · ·µ(an)µ(˜ε)∗γ=λ(µ(˜ε)∗µ(a1))(µ(˜ε)∗µ(a2))· · ·(µ(˜ε)∗µ(an))(µ(˜ε)∗γ) the conclusion follows taking, for alla∈Σ,
(λ0, µ0(a), γ0) = (λ, µ(˜ε)∗µ(a), µ(˜ε)∗γ).
Letkbe a semiring andAε= (λ, µ, γ)ak-ε-automaton withS∈khhΣεii)Φ-convas behaviour. Theorem (2) gives the lower bounds if the set of coefficients is the semiringk(resp. ring, field).
Proposition 3 We suppose that, inkn×n, stars are unique. Let(λ, µ, γ)ak-ε-automaton such thatµ(˜ε) admits a tree of computation and is closable, then the complexity of the elimination ofε-transitions which produces the weighted automatonA= (λ0, µ0, γ0), is O(nω).
Proof. The unique matrixµ∗˜εgiven by the algorithm of Theorem (1) satisfies the relation:
µ∗˜ε=µ∗˜εµm+1ε˜ +µmε˜ +· · ·+µ˜ε+ 1n×n. for allm >0. In fact, by induction,
µ∗µm+2+µm+1+· · ·+µ+ 1 = (µ∗µm+1+µm+· · ·+ 1)µ+ 1 =µ∗µ+ 1 =µ∗. As(µm)m∈Nis summable, one hasµ∗ =P
µm. Next setλ0 =λ,γ0 = µ∗˜εγ andµ0(a) =µ∗ε˜µ(a)for
each lettera∈Σ.
1 2
3 4
1
1 1
a, ε ˜
b
b, ε ˜ b
˜ ε
a b
a, b
Figure 3:AB-ε-automaton
Remark 6 One could also with the same result setλ0 =λµ∗ε˜,µ0(a) =µ(a)µ∗ε˜for each lettera∈Σand γ0=γ.
In the following, we have an example of a boolean automaton withε-transitions.
Example(s) 6 The linear representation of Figure 3 is:
λ= 1 0 0 0 ,µ˜ε=
0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
,µ(a) =
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
, µ(b) =
0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 1
andγ=
0 0 1 1
.
By computation:
µ∗ε˜=
1 1 1 1 0 1 1 1 0 0 1 0 0 0 0 1
, λ0= 1 0 0 0 , µ0(a) =µ∗ε˜µ(a) =
1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1
,
µ0(b) =µ∗ε˜µ(b) =
0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 1
andγ0 =µ∗˜εγ=
1 1 1 1
,
The resulting boolean automaton is presented in Figure 4 and its linear representation is(λ0, µ0, γ0).
1 2
3
1 4
1
1
1
1 a, b
b
a, b
b
a, b a
b
a, b
Figure 4:AB-automaton
1 2 3 4
1
11
2
a
1 4
b
1 2
a
1 2
b,
13ε ˜
1 2
ε ˜
1 3
ε ˜
Figure 5:AQ-ε-automaton
1 2 3 4
1 1
1 2
a
1 4
b
1 2
a
b
1 2
b
a
Figure 6:AQ-automaton
In the next example, our algebraic method is applied on aQ-ε-automaton.
Example(s) 7 The linear representation of Figure 5 is:
λ= 1 0 0 0 ,µ˜ε=
0 0 0 0 0 0 12 0 0 13 13 0 0 0 0 0
,µ(a) =
0 12 0 0 0 0 0 0 0 0 0 12 0 0 0 0
,µ(b) =
0 0 14 0 0 0 0 0 0 12 0 0 0 0 0 0
,
andγ=
0 0 0 1
. By computation:
µ∗ε˜=
1 0 0 0 0 43 1 0 0 23 2 0 0 0 0 1
, λ0= 1 0 0 0 ,µ0(a) =µ∗ε˜µ(a) =
0 12 0 0 0 0 0 12 0 0 0 1 0 0 0 0
,
µ0(b) =µ∗ε˜µ(b) =
0 0 14 0 0 12 0 0 0 1 0 0 0 0 0 0
andγ0=µ∗˜εγ=
0 0 0 1
.
The resulting automaton is presented in Figure 6 and its linear representation is(λ0, µ0, γ0).
7 Conclusion
Algebraic elimination forε-automata has been presented. The problem of removing the ε-transitions is originated from genericε-removal algorithm for weighted automata [15] using Floyd-Warshall and generic single-source shortest distance algorithms. Here, we have the same objective but the methods and algorithms are different. In [15], the principal characteristics of semirings used by the algorithm as well as the complexity of different algorithms used for each step of the elimination are detailed. The case of acyclic and non acyclic automata are analysed differently. Our algorithm here works with any semiring (supposing only thatµ(˜ε)is closable and with unique star) and the complexity is unique for the case of
acyclic or non acyclic automata. This algorithm is even more efficient when the considered semiring is a ring.
References
[1] Berstel J., Reutenauer C., “Rational Series and Their Languages”.EATCS, Monographs on Theo- retical Computer Science, Springer Verlag, Berlin (1988).
[2] Champarnaud J.-M., Duchamp G., “Brzozowski’s derivatives extended to multiplicities”.Lectures Notes in Computer Science2494(2001), 52-64.
[3] Coppersmith D., Winograd S., “Matrix Multiplication via arithmetic progressions”.Journal of Symbolic Computation9(1990), 251-280.
[4] Conway J.H., “Regular Algebra and Finite Machines”.Chapman and Hall(1971).
[5] Duchamp G., Flouret M., Laugerotte ´E., Luque J-G., “Direct and dual laws for automata with multiplicities”.Theoretical Computer Science267(2000) 105-120.
[6] Duchamp G., Reutenauer C., “Un crit`ere de rationalit´e provenant de la g´eom´etrie non- commuta- tive”.Inventiones Mathematicae128(1997).
[7] Hebisch U., Weinert H. J., “Semirings - Algebraic Theory and Applications in computer Science”.
Word Scientific Publishing, Singapore (1993).
[8] Heyting A., “Die Theorie der Linearen Gleichungen in einer Zahlenspezies mit nichtkommuta- tiver Multiplikation”.Math. Ann.98(1927) 465-490.
[9] Huss-Lederman S., Jacobson E.M., Johnson J.R., Tsao A., Turnbull T., “Implementation of Strassen’s Algorithm for Matrix Multiplication”. Proceeding of the ACM/IEEE conference on supercomputing, Pittsburgh, Pennsylvania, USA (1996).
[10] Kuich W., Salomaa A., “Semirings, Automata, Languages”.EATCS, Monographs on Theoretical Computer Science Volume 5, Springer Verlag, Berlin (1986).
[11] Krob D., “The equality problem for rational series with multiplicities in the tropical semiring is undecidable” .International Journal of Algebra and Computation,4(3) (1994) 405-425.
[12] Krob D., “Some automata-theoretic aspects of Min-Max-Plus semirings”.Chapter in Idempotency Analysis. Number 11 in Publications of the Newton Institute (1998).
[13] Krob D., “ Algorithms, automata, complexity and games”. Theoretical Computer Science89(2) (1991) 207-345.
[14] Laugerotte ´E., Ziadi D., “Weighted recognition”.Journal of Automata, Langugages and combi- natorics, (in preparation).
[15] Mohri M., “Genericε-Removal Algorithm for Weighted Automata”.Lecture Notes in Computer Science volume2088(2001) 230-242, Springer Verlag, Berlin, (2001).
[16] Richardson A. R., “Simultaneous Linear equations over a division ring”.Proc. Lond. Math. Soc.
28(1928) 395-420.
[17] Sch¨utzenberger, “On the definition of a family of automata”.Inform. and Contr.4(1961) 245-270.
[18] Sch¨onhage A., Strassen V., “Schnelle Multiplikation grosser Zahlen”.Computing7(1971) 281- 292.
[19] Strassen V., “Gaussian Elimination is not optimal”.Numerische Mathematik13(1969) 354-356.