Weighted omega-Restricted One Counter Automata

Let $S$ be a complete star-omega semiring and $\Sigma$ be an alphabet. For a weighted $\omega$-restricted one-counter automaton $\mathcal{C}$ with set of states $\{1, \dots, n\}$, $n \geq 1$, we show that there exists a mixed algebraic system over a …

Authors: Manfred Droste, Werner Kuich

Logical Methods in Computer Science V ol. 14(1:21)2018, pp . 1–14 https://lmcs.episciences.org/ Submitted Jan. 31, 2017 Published Mar. 06, 2018 WEIGHTED ω -RESTRICTED ONE-COUNTER A UTOMA T A MANFRED DR OSTE AND WERNER KUICH Univ ersit ¨ at Leipzig, Institut f ¨ ur Informatik e-mail addr ess : droste@informatik.uni-leipzig.de T echnische Univ ersit ¨ at W ien, Institut f ¨ ur Diskrete Mathematik und Geometrie e-mail addr ess : kuich@tuwien.ac.at A B S T R AC T . Let S be a complete star-ome ga semiring and Σ be an alphabet. For a weighted ω -restricted one-counter automaton C with set of states { 1, . . . , n } , n ≥ 1 , we show that there exists a mix ed algebraic system over a complete semiring-semimodule pair (( S  Σ ∗  ) n × n , ( S  Σ ω  ) n ) such that the behavior kC k of C is a component of a solution of this system. In case the basic semiring is B or N ∞ we show that there e xists a mixed context-free grammar that generates kC k . The construction of the mix ed context-free grammar from C is a general- ization of the well-kno wn triple construction in case of restricted one-counter automata and is called now triple-pair construction for ω -restricted one-counter automata. 1. I N T R O D U C T I O N Restricted one-counter pushdown automata and languages were introduced by Greibach [ 13 ] and considered in Berstel [ 1 ], Chapter VII 4. These restricted one-counter pushdown automata are pushdo wn automata ha ving just one pushdo wn symbol accepting by empty tape, and the family of restricted one-counter languages is the family of languages accepted by them. Let L be the Lukasie wicz language, i.e., the formal language o ver the alphabet Σ = { a , b } generated by the context-free grammar with productions S → aS S , S → b . Then the family of restricted one-counter languages is the principal cone generated by L, while the family of one-counter languages is the full AFL generated by L. All these results can be transferred to formal po wer series and restricted one-counter automata ov er them (see K uich, Salomaa [ 16 ], Example 11.5). Restricted one-counter automata can also be used to accept infinite words and it is this aspect we generalize in our paper . W e consider weighted ω -restricted one-counter automata and their relation to algebraic systems ov er the complete semiring-semimodule pair ( S n × n , V n ) , where S is a complete star-ome ga semiring. 2012 ACM CCS: [ Theory of computation ]: Formal languages and automata theory — Automata over infinite objects — Quantitativ e automata. 2010 Mathematics Subject Classification: Primary: 68Q45, 68Q70; Secondary: 68Q42. K e y wor ds and phrases: weighted pushdown automata, algebraic series, weighted contextfree grammar , formal power series, complete semiring. This work was partially supported by DFG Graduiertenk olleg 1763 (QuantLA). The second author was partially supported by Austrian Science Fund (FWF): grant no. I1661 N25. LOGICAL METHODS l IN COMPUTER SCIENCE DOI:10.23638/LMCS-14(1:21)2018 c  M. Droste and W . K uich CC  Creative Commons 2 M. DR OSTE AND W . KUICH It turns out that the well-kno wn triple construction for pushdo wn automata in case of unweighted restricted one-counter automata can be generalized to a triple-pair construction for weighted ω - restricted one-counter automata. In the classical theory , the triple construction yields for a given pushdo wn automaton an equiv alent context-free grammar . (See Harrison [ 14 ], Theorem 5.4.3; Bucher , Maurer [ 3 ], S ¨ atze 2.3.10, 2.3.30; Kuich, Salomaa [ 16 ], pages 178, 306; Kuich [ 15 ], page 642; ´ Esik, Kuich [11], pages 77, 78.) The paper consists of this and three more sections. In Section 2, we revie w the necessary preliminaries. In Section 3, restricted one-counter matrices are introduced and their properties are studied. The main result is that, for such a matrix M , the p -block of the infinite column vector M ω , k is a solution of the linear equation z = ( M p , p 2 ( M ∗ ) p , ε + M p , p + M p , p 2 ) z . In Section 4, weighted ω -restricted one-counter automata are introduced as a special case of weighted ω -pushdo wn automata. W e sho w that for a weighted ω -restricted one-counter automaton C there exists a mixed algebraic system such that the behavior kC k of C is a component of a solution of this system. In Section 5 we consider the case that the complete star -omega semiring S is equal to B or N ∞ . Then for a gi ven weighted ω -restricted one-counter automaton C a mixed context-free grammar is constructed that generates kC k . This construction is a generalization of the well-known triple construction in case of restricted one-counter automata and is called triple-pair construction for ω -restricted one-counter automata. 2. P R E L I M I N A R I E S For the con venience of the reader , we quote definitions and results of ´ Esik, Kuich [ 7 , 8 , 10 ] from ´ Esik, Kuich [11]. The reader should be familiar with Sections 5.1-5.6 of ´ Esik, Kuich [11]. A semiring S is called complete if it is possible to define sums for all families ( a i | i ∈ I ) of elements of S , where I is an arbitrary index set, such that the follo wing conditions are satisfied (see Conway [4], Eilenber g [6], Kuich [15]): (i) X i ∈∅ a i = 0, X i ∈{ j } a i = a j , X i ∈{ j , k } a i = a j + a k for j 6 = k , (ii) X j ∈ J  X i ∈ I j a i  = X i ∈ I a i , if [ j ∈ J I j = I and I j ∩ I j 0 = ∅ for j 6 = j 0 , (iii) X i ∈ I ( c · a i ) = c ·  X i ∈ I a i  , X i ∈ I ( a i · c ) =  X i ∈ I a i  · c . This means that a semiring S is complete if it is possible to define “infinite sums” (i) that are an extension of the finite sums, (ii) that are associative and commutativ e and (iii) that satisfy the distribution la ws. If S is a monoid and conditions (i) and (ii) are satisfied then S is called a complete monoid . A semiring S equipped with an additional unary star operation ∗ : S → S is called a starsemiring. In complete semirings for each element a , the star a ∗ of a is defined by a ∗ = X j ≥ 0 a j . Hence, each complete semiring is a starsemiring, called a complete starsemiring . Suppose that S is a semiring and V is a commutati ve monoid written additi vely . W e call V a (left) S -semimodule if V is equipped with a (left) action WEIGHTED ω -RESTRICTED ONE-COUNTER AUT OMA T A 3 S × V → V ( s , v ) 7→ sv subject to the follo wing rules: s ( s 0 v ) = ( ss 0 ) v 1 v = v ( s + s 0 ) v = sv + s 0 v 0 v = 0 s ( v + v 0 ) = sv + sv 0 s 0 = 0, for all s , s 0 ∈ S and v , v 0 ∈ V . When V is an S -semimodule, we call ( S , V ) a semiring-semimodule pair . Suppose that ( S , V ) is a semiring-semimodule pair such that S is a starsemiring and S and V are equipped with an omega operation ω : S → V . Then we call ( S , V ) a starsemiring- ome gasemimodule pair . ´ Esik, Kuich [ 9 ] define a complete semiring-semimodule pair to be a semiring-semimodule pair ( S , V ) such that S is a complete semiring and V is a complete monoid with s  X i ∈ I v i  = X i ∈ I sv i  X i ∈ I s i  v = X i ∈ I s i v , for all s ∈ S , v ∈ V , and for all families ( s i ) i ∈ I ov er S and ( v i ) i ∈ I ov er V ; moreov er , it is required that an infinite pr oduct operation ( s 1 , s 2 , . . . ) 7→ Y j ≥ 1 s j is gi ven mapping infinite sequences o ver S to V subject to the follo wing three conditions: Y i ≥ 1 s i = Y i ≥ 1 ( s n i − 1 +1 · · · · · s n i ) s 1 · Y i ≥ 1 s i +1 = Y i ≥ 1 s i Y j ≥ 1 X i j ∈ I j s i j = X ( i 1 , i 2 , ... ) ∈ I 1 × I 2 × ... Y j ≥ 1 s i j , where in the first equation 0 = n 0 ≤ n 1 ≤ n 2 ≤ . . . and I 1 , I 2 , . . . are arbitrary inde x sets. Suppose that ( S , V ) is complete. Then we define s ∗ = X i ≥ 0 s i s ω = Y i ≥ 1 s , for all s ∈ S . This turns ( S , V ) into a starsemiring-omegasemimodule pair . Observe that, if ( S , V ) is a complete semiring-semimodule pair , then 0 ω = 0 . 4 M. DR OSTE AND W . KUICH For a starsemiring S , we denote by S n × n the semiring of n × n -matrices ov er S . If ( S , V ) is a complete semiring-semimodule pair then, by ´ Esik, Kuich [ 12 ], ( S n × n , V n ) is again a complete semiring-semimodule pair . A star -ome ga semiring is a semiring S equipped with unary operations ∗ and ω : S → S . A star-ome ga semiring S is called complete if ( S , S ) is a complete semiring semimodule pair , i.e., if S is complete and is equipped with an infinite product operation that satisfies the three conditions stated above. For the theory of infinite words and finite automata accepting infinite words by the B ¨ uchi condition consult Perrin, Pin [17]. 3. R E S T R I C T E D O N E - C O U N T E R M A T R I C E S In this section we introduce restricted one-counter (roc) matrices. Restricted one-counter matrices are a special case of pushdown matrices introduced by Kuich, Salomaa [ 16 ]. A matrix M ∈ ( S n × n ) Γ ∗ × Γ ∗ is termed a pushdown tr ansition matrix (with pushdown alphabet Γ and set of states { 1, . . . , n } ) if (i) for each p ∈ Γ there e xist only finitely many blocks M p , π , π ∈ Γ ∗ , that are non-zero; (ii) for all π 1 , π 2 ∈ Γ ∗ , M π 1 , π 2 =  M p , π if there exist p ∈ Γ, π , π 0 ∈ Γ ∗ with π 1 = pπ 0 and π 2 = π π 0 , 0 otherwise. Theorem 10.5 of Kuich, Salomaa [ 16 ] states that for pushdown matrices ov er power series semirings with particular properties, ( M ∗ ) π 1 π 2 , ε = ( M ∗ ) π 1 , ε ( M ∗ ) π 2 , ε holds for all π 1 , π 2 ∈ Γ ∗ . This result is generalized in the case of roc-matrices to arbitrary roc-matrices ov er complete starsemirings in Corollary 3.2. Then we pro ve some important equalities for roc-matrices. In Theorem 3.1 and Corollary 3.2, S denotes a complete starsemiring; afterwards in this section, ( S , V ) denotes a complete semiring-semimodule pair . A restricted one-counter (abbreviated r oc ) matrix (with counter symbol p ) is a matrix M in ( S n × n ) p ∗ × p ∗ , for some n ≥ 1 , subject to the following condition: There exist matrices A , B , C ∈ S n × n such that, for all k ≥ 1 , M p k , p k +1 = A , M p k , p k = C M p k , p k − 1 = B , and these blocks of M are the only ones which may be non-zero. (Here, p ∗ = { p n | n ≥ 0 } . A block of M is an element of the matrix M which is itself a matrix in S n × n .) Observe that, for k ≥ 1 , M p k , p k +1 = M p , p 2 = A , M p k , p k = M p , p = C , M p k , p k − 1 = M p , ε = B , M ε , p k = M ε , ε = 0 . Also note that the matrix A (resp B , C ) in S n × n describes the weight of transitions when pushing (resp., popping, not changing) an additional symbol p to (resp., from) the pushdown counter . Theorem 3.1. Let S be a complete starsemiring and M be a r oc-matrix. Then, for all i ≥ 0 , ( M ∗ ) p i +1 , ε = ( M ∗ ) p , ε ( M ∗ ) p i , ε . WEIGHTED ω -RESTRICTED ONE-COUNTER AUT OMA T A 5 Pr oof. First observe that ( M ∗ ) p i +1 , ε = X m ≥ 0 ( M m +1 ) p i +1 , ε = X m ≥ 0 X i 1 , ... , i m ≥ 1 M p i + 1 , p i 1 M p i 1 , p i 2 . . . M p i m - 1 , p i m M p i m , ε , where, for m = 0 , the product equals M p i +1 , ε . No w we obtain ( M ∗ ) p i +1 , ε = X m ≥ 0 X i 1 , ... , i m ≥ 1 M p i +1 , p i 1 . . . M p i m − 1 , p i m M p i m , ε = X m 1 ≥ 0  X j 1 , ... , j m 1 ≥ 1 M p i +1 , p i + j 1 . . . M p i + j m 1 − 1 , p i + j m 1 M p i + j m 1 , p i  · X m 2 ≥ 0  X i 1 , ... , i m 2 ≥ 1 M p i , p i 1 . . . M p i m 2 − 1 , p i m 2 M p i m 2 , ε  = X m 1 ≥ 0  X j 1 , ... , j m 1 ≥ 1 M p , p j 1 . . . M p j m 1 − 1 , p j m 1 M p j m 1 , ε  ( M ∗ ) p i , ε = ( M ∗ ) p , ε ( M ∗ ) p i , ε . Clearly , in each sequence leading from p i +1 to ε , there is a first time at which the top p is reduced to ε and at which p i is seen. This moment is reached at the end of the second line. Hence, in the second line the pushdo wn contents p i + j 1 , . . . , p i + j m 1 , m 1 ≥ 0 are always nonempty . Corollary 3.2. F or all i ≥ 0 , ( M ∗ ) p i , ε = (( M ∗ ) p , ε ) i . Lemma 3.3. Let ( S , V ) be a complete semiring-semimodule pair . Let M ∈ ( S n × n ) p ∗ × p ∗ be a r oc-matrix. Then ( M ω ) p 2 = ( M ω ) p + ( M ∗ ) p , ε ( M ω ) p . Pr oof. Subsequently in the first equation we split the summation so that in the first summand there is no factor M p 2 , p , while in the second summand there is at least one factor M p 2 , p ; since k 1 , . . . , k m ≥ 2 , M p k m , p is the first such factor . In the second equality we use the property of M being a roc-matrix: M p i , p j = M p i − 1 , p j − 1 for i ≥ 2 , j ≥ 1 . W e compute: ( M ω ) p 2 = X i 1 , i 2 , ···≥ 2 M p 2 , p i 1 M p i 1 , p i 2 · · · + X m ≥ 0 X k 1 , k 2 , ... , k m ≥ 2 M p 2 , p k 1 M p k 1 , p k 2 . . . M p k m , p X j 1 , j 2 , ···≥ 1 M p , p j 1 M p j 1 , p j 2 . . . = X i 1 , i 2 , ···≥ 2 M p , p i 1 − 1 M p i 1 − 1 , p i 2 − 1 · · · + X m ≥ 0 X k 1 , k 2 , ... , k m ≥ 2 M p , p k 1 − 1 M p k 1 − 1 , p k 2 − 1 . . . M p k m − 1 , ε ( M ω ) p = ( M ω ) p + X m ≥ 0 ( M m +1 ) p , ε ( M ω ) p = ( M ω ) p + ( M ∗ ) p , ε ( M ω ) p . 6 M. DR OSTE AND W . KUICH Intuiti vely , our next theorem states that infinite computations starting with p on the pushdo wn tape yield the same matrix ( M ω ) p as the sum of the follo wing three matrix products: • M p , p 2 ( M ω ) p (i.e., changing the contents of the pushdo wn tape from p to pp and starting the infinite computations with the leftmost p ; the second p is ne ver read), • M p , p 2 ( M ∗ ) p , ε ( M ω ) p (i.e., changing the contents of the pushdo wn tape from p to pp , emptying the leftmost p by finite computations and starting the infinite computations with the rightmost p ), • M p , p ( M ω ) p (i.e., changing the contents of the pushdown tape from p to p and starting the infinite computations with this p ). The forthcoming Theorem 3.7 has an analogous intuiti ve interpretation. Theorem 3.4. Let ( S , V ) be a complete semiring-semimodule pair and let M ∈ ( S n × n ) p ∗ × p ∗ be a r oc-matrix. Then ( M ω ) p = ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p )( M ω ) p . Pr oof. W e obtain, by Lemma 3.3 ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p )( M ω ) p = M p , p 2 (( M ω ) p + ( M ∗ ) p , ε ( M ω ) p ) + M p , p ( M ω ) p = M p , p 2 ( M ω ) p 2 + M p , p ( M ω ) p = ( M M ω ) p = ( M ω ) p . Corollary 3.5. Let M ∈ ( S n × n ) p ∗ × p ∗ be a r oc-matrix. Then ( M ω ) p is a solution of z = ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p ) z . When we say “ G is the graph with matrix M ∈ ( S n × n ) p ∗ × p ∗ ” then it means that G is the graph with adjacency matrix M 0 ∈ S ( p ∗ × n ) × ( p ∗ × n ) , where M 0 corresponds to M with respect to the canonical isomorphism between ( S n × n ) p ∗ × p ∗ and S ( p ∗ × n ) × ( p ∗ × n ) . Let now M be a roc-matrix and 0 ≤ k ≤ n . Then M ω , k is the column vector in ( V n ) p ∗ defined as follows: For i ≥ 1 and 1 ≤ j ≤ n , let (( M ω , k ) p i ) j be the sum of all weights of paths in the graph with matrix M that have initial v ertex ( p i , j ) and visit vertices ( p i 0 , j 0 ) , i 0 ∈ N , j 0 ∈ { 1, . . . , k } , infinitely often. Observe that M ω ,0 = 0 and M ω , n = M ω . Later on it will be seen that this formalizes the B ¨ uchi acceptance condition with repeated states { 1, . . . , k } . Let P k = { ( j 1 , j 2 , . . . ) ∈ { 1, . . . , n } ω | j t ≤ k for infinitely many t ≥ 1 } . Then for 1 ≤ j ≤ n , we obtain (( M ω , k ) p ) j = X i 1 , i 2 , ···≥ 1 X ( j 1 , j 2 , ... ) ∈ P k ( M p , p i 1 ) j , j 1 ( M p i 1 , p i 2 ) j 1 , j 2 ( M p i 2 , p i 3 ) j 2 , j 3 . . . . By Theorem 5.4.1 of ´ Esik, K uich [ 11 ], we obtain for a finite matrix A ∈ S n × n and for 0 ≤ k ≤ n , 1 ≤ j ≤ n , ( A ω , k ) j = X ( j 1 , j 2 , ... ) ∈ P k A j , j 1 A j 1 , j 2 A j 2 , j 3 . . . . Observe that again A ω ,0 = 0 and A ω , n = A ω . WEIGHTED ω -RESTRICTED ONE-COUNTER AUT OMA T A 7 In the next lemma, we use the following summation identity: Assume that A 1 , A 2 , . . . are matrices in S n × n . Then for 0 ≤ k ≤ n , 1 ≤ j ≤ n , and m ≥ 1 , X ( j 1 , j 2 , ... ) ∈ P k ( A 1 ) j , j 1 ( A 2 ) j 1 , j 2 ... = X 1 ≤ j 1 , ... , j m ≤ n ( A 1 ) j , j 1 . . . ( A m ) j m − 1 , j m X ( j m +1 , j m +2 , ... ) ∈ P k ( A m +1 ) j m , j m +1 . . . . Lemma 3.6. Let ( S , V ) be a complete semiring-semimodule pair . Let M ∈ ( S n × n ) Γ ∗ × Γ ∗ be a r oc-matrix and 0 ≤ k ≤ n . Then ( M ω , k ) p 2 = ( M ω , k ) p + ( M ∗ ) p , ε ( M ω , k ) p . Pr oof. W e use the proof of Lemma 3.3, i.e., the proof for the case M ω , n = M ω . F or 1 ≤ j ≤ n , we obtain (( M ω , k ) p 2 ) j = X i 1 , i 2 , ···≥ 2 X ( j 1 , j 2 , ... ) ∈ P k ( M p , p i 1 − 1 ) j , j 1 ( M p i 1 − 1 , p i 2 − 1 ) j 1 , j 2 · · · +  X 1 ≤ j 0 ≤ n X m ≥ 0 X k 1 , k 2 , ... , k m ≥ 2 X 1 ≤ j 1 , ... , j m ≤ n ( M p , p k 1 − 1 ) j , j 1 . . . ( M p k m − 1 , ε ) j m , j 0  ·  X k m +2 , k m +3 , ···≥ 1 X ( j m +2 , j m +3 , ... ) ∈ P k ( M p , p k m +2 ) j 0 , j m +2 ( M p k m +2 , p k m +3 ) j m +2 , j m +3 . . .  = (( M ω , k ) p ) j + X 1 ≤ j 0 ≤ n (( M ∗ ) p , ε ) j , j 0 (( M ω , k ) p ) j 0 = (( M ω , k ) p ) j + (( M ∗ ) p , ε ( M ω , k ) p ) j = (( M ω , k ) p + ( M ∗ ) p , ε ( M ω , k ) p ) j . Theorem 3.7. Let ( S , V ) be a complete semiring-semimodule pair and let M ∈ ( S n × n ) p ∗ × p ∗ be a r oc-matrix. Then ( M ω , k ) p = ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p )( M ω , k ) p , for all 0 ≤ k ≤ n . Pr oof. W e obtain, by Lemma 3.6, for all 0 ≤ k ≤ n , ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p )( M ω , k ) p = M p , p 2 (( M ω , k ) p + ( M ∗ ) p , ε ( M ω , k ) p ) + M p , p ( M ω , k ) p = M p , p 2 ( M ω , k ) p 2 + M p , p ( M ω , k ) p = ( M M ω , k ) p = ( M ω , k ) p . Corollary 3.8. Let M ∈ ( S n × n ) p ∗ × p ∗ be a r oc-matrix. Then, for all 0 ≤ k ≤ n , ( M ω , k ) p is a solution of z = ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p ) z . 8 M. DR OSTE AND W . KUICH 4. ω - R E S T R I C T E D O N E - C O U N T E R AU T O M A T A In this section, we define ω -roc automata as a special case of ω -pushdo wn automata. W e show that for an ω -roc automaton C there exists an algebraic system ov er a complete semiring-semimodule pair such that the behavior kC k of C is a component of a solution of this system. In the sequel, ( S , V ) is a complete semiring-semimodule pair and S 0 is a subset of S containing 0 an 1 . An S 0 - ω -pushdown automaton P = ( n , Γ, I , M , P , p 0 , k ) is gi ven by (i) a finite set of states { 1, . . . , n } , n ≥ 1 , (ii) an alphabet Γ of pushdown symbols , (iii) a pushdown transition matrix M ∈ ( S 0 n × n ) Γ ∗ × Γ ∗ , (i v) an initial state vector I ∈ S 0 1 × n , (v) a final state vector P ∈ S 0 n × 1 , (vi) an initial pushdown symbol p 0 ∈ Γ , (vii) a set of repeated states { 1, . . . , k } , 0 ≤ k ≤ n . The definition of a pushdown transition matrix is gi v en at the be ginning of Section 3. (See also Kuich, Salomaa [ 16 ], Kuich [ 15 ] and ´ Esik, Kuich [ 11 ].) Clearly , an y roc-matrix is a pushdown transition matrix. The behavior of P is an element of S × V and is defined by kP k = ( I ( M ∗ ) p 0 , ε P , I ( M ω , k ) p 0 ) . Here I ( M ∗ ) p 0 , ε P is the behavior of the S 0 - ω -pushdo wn automaton P 1 = ( n , Γ, I , M , P , p 0 , 0) and I ( M ω , k ) p 0 is the behavior of the S 0 - ω -pushdo wn automaton P 2 = ( n , Γ, I , M , 0, p 0 , k ) . Ob- serve that P 2 is an automaton with the B ¨ uchi acceptance condition: if G is the graph with adjacency matrix M , then only paths that visit the repeated states 1, . . . , k infinitely often contrib ute to kP 2 k . Furthermore, P 1 contains no repeated states and behav es like an ordinary S 0 -pushdo wn automaton. An S 0 - ω -roc automaton is an S 0 - ω -pushdo wn automaton with just one pushdo wn symbol such that its pushdo wn matrix is a roc-matrix. In the sequel, an S 0 - ω -roc automaton P = ( n , { p } , I , M , P , p , k ) is denoted by C = ( n , I , M , P , k ) with beha vior kC k = ( I ( M ∗ ) p , ε P , I ( M ω , k ) p ) . Remark 4.1. Consider an S 0 - ω -pushdo wn automaton P with just one pushdown symbol. By the construction in the proof of Theorem 13.28 of Kuich, Salomaa [ 16 ], an S 0 - ω -roc automaton C can be constructed such that kC k = kP k . The next definitions and results are taken from ´ Esik, Kuich [ 11 , Section 5.6]. F or the definition of an S 0 -algebraic system over a quemiring S × V we refer the reader to [ 11 ], page 136, and for the definition of quemirings to [ 11 ], page 110. Here we note that a quemiring T is isomorphic to a quemiring S × V determined by the semiring-semimodule pair ( S , V ) , cf. [11], page 110. Observe that the forthcoming system (4.1) is a system over the quemiring S n × n × V n . Compare the forthcoming algebraic system (4.2) with the algebraic systems occurring in the proofs of Theorem 14.15 of Kuich, Salomaa [16] and Theorem 6.4 of K uich [15], both in the case of a roc-matrix. Let M be a roc-matrix. Consider the S 0 n × n -algebraic system over the complete semiring- semimodule pair ( S n × n , V n ) y = M p , p 2 y y + M p , p y + M p , ε . (4.1) WEIGHTED ω -RESTRICTED ONE-COUNTER AUT OMA T A 9 Then by Theorem 5.6.1 of ´ Esik, Kuich [ 11 ] ( A , U ) ∈ ( S n × n , V n ) is a solution of (4.1) if f A is a solution of the S 0 n × n -algebraic system ov er S n × n x = M p , p 2 xx + M p , p x + M p , ε (4.2) and U is a solution of the S n × n -linear system ov er V n z = M p , p 2 z + M p , p 2 Az + M p , p z . (4.3) Theorem 4.2. Let S be a complete starsemiring and M be a r oc-matrix. Then ( M ∗ ) p , ε is a solution of the S 0 n × n -algebr aic system (4.2) . If S is a continuous starsemiring , then ( M ∗ ) p , ε is the least solution of (4.2) . Pr oof. W e obtain, by Theorem 3.1 M p , p 2 ( M ∗ ) p , ε ( M ∗ ) p , ε + M p , p ( M ∗ ) p , ε + M p , ε = M p , p 2 ( M ∗ ) p 2 , ε + M p , p ( M ∗ ) p , ε + M p , ε = ( M M ∗ ) p , ε = ( M + ) p , ε = ( M ∗ ) p , ε . This prov es the first sentence of our theorem. The second sentence of Theorem 4.2 is proved by Theorem 6.4 of Kuich [15]. Theorem 4.3. Let ( S , V ) be a complete semiring-semimodule pair and M be a r oc-matrix. Then (( M ∗ ) p , ε , ( M ω , k ) p ) , is a solution of the S 0 n × n -algebr aic system (4.1) , for each 0 ≤ k ≤ n . Pr oof. Let 0 ≤ k ≤ n , and consider the S n × n -linear system z = ( M p , p 2 + M p , p 2 ( M ∗ ) p , ε + M p , p ) z . By Corollary 3.8, ( M ω , k ) p is a solution of this system. Hence, by Theorem 5.6.1 of ´ Esik, Kuich [ 11 ] (see the remark abov e) and Theorem 4.2, (( M ∗ ) p , ε , ( M ω , k ) p ) is a solution of the system (4.1). Observe that, if S is a continuous semiring, then the S n × n -linear system in the proof of Theorem 4.3 is in fact an Alg ( S 0 ) n × n -linear system (see Kuich [15, p. 623]). Theorem 4.4. Let ( S , V ) be a complete semiring-semimodule pair and let C = ( n , I , M , P , k ) be an S 0 - ω -r oc-automaton. Then ( kC k , (( M ∗ ) p , ε , ( M ω , k ) p )) is a solution of the S 0 n × n -algebr aic system y 0 = I y P , y = M p , p 2 y y + M p , p y + M p , ε (4.4) over the complete semiring-semimodule pair ( S n × n , V n ) . Pr oof. By Theorem 4.3, (( M ∗ ) p , ε , ( M ω , k ) p ) is a solution of the second equation. Since I (( M ∗ ) p , ε , ( M ω , k ) p ) P = ( I ( M ∗ ) p , ε P , I ( M ω , k ) p ) = kC k , ( kC k , (( M ∗ ) p , ε , ( M ω , k ) p )) is a solution of the gi ven S 0 n × n -algebraic system. 10 M. DR OSTE AND W . KUICH Let now S be a complete star-ome ga semiring and Σ be an alphabet. Then by Theorem 5.5.5 of ´ Esik, Kuich [11], ( S  Σ ∗  , S  Σ ω  ) is a complete semiring-semimodule pair . Let C = ( n , I , M , P , k ) be an S h Σ ∪ { ε }i - ω -roc automaton. Consider the algebraic system (4.4) ov er the complete semiring-semimodule pair (( S  Σ ∗  ) n × n ,( S  Σ ω  ) n ) and the mixed algebraic system (4.5) ov er (( S  Σ ∗  ) n × n , ( S  Σ ω  ) n ) induced by (4.4) x 0 = I xP , x = M p , p 2 xx + M p , p x + M p , ε , z 0 = I z , z = M p , p 2 z + M p , p 2 xz + M p , p z . (4.5) Then, by Theorem 4.4, ( I ( M ∗ ) p , ε P , ( M ∗ ) p , ε , I ( M ω , k ) p , ( M ω , k ) p ), 0 ≤ k ≤ n , is a solution of (4.5). It is called solution of or der k . Hence, we ha ve pro ved the next theorem. Theorem 4.5. Let S be a complete star -ome ga semiring and C = ( n , I , M , P , k ) be an S h Σ ∪ { ε }i - ω -r oc automaton. Then ( I ( M ∗ ) p , ε P , ( M ∗ ) p , ε , I ( M ω , k ) p , ( M ω , k ) p ), 0 ≤ k ≤ n , is a solution of the mixed algebr aic system (4.5) . Let no w in (4.5) x = ([ i , p , j ]) 1 ≤ i , j ≤ n be an n × n -matrix of variables and z = ([ i , p ]) 1 ≤ i ≤ n be an n -dimensional column vector of v ariables. If we write the mixed algebraic system (4.5) component-wise, we obtain a mixed algebraic system ov er (( S  Σ ∗  ),( S  Σ ω  )) with v ari- ables [ i , p , j ] ov er S  Σ ∗  , where 1 ≤ i , j ≤ n , and variables [ i , p ] ov er S  Σ ω  , where 1 ≤ i ≤ n . Observ e that we do not really need p in the notation of the v ariables. But we want to sa ve the form of the triple construction in connection with pushdo wn automata. Let M p , p 2 = ( a ij ) 1 ≤ i , j , ≤ n , M p , p = ( c ij ) 1 ≤ i , j , ≤ n , M p , ε = ( b ij ) 1 ≤ i , j , ≤ n and write (4.5) with the matrices x and z of variables component-wise then we obtain: x 0 = X 1 ≤ m 1 , m 2 ≤ n I m 1 [ m 1 , p , m 2 ] P m 2 [ i , p , j ] = X 1 ≤ m 1 , m 2 ≤ n a im 1 [ m 1 , p , m 2 ][ m 2 , p , j ]+ X 1 ≤ m ≤ n c im [ m , p , j ] + b ij z 0 = X 1 ≤ m ≤ n I m [ m , p ] [ i , p ] = X 1 ≤ m ≤ n a im [ m , p ] + X 1 ≤ m 1 , m 2 ≤ n a im 1 [ m 1 , p , m 2 ][ m 2 , p ]+ X 1 ≤ m ≤ n c im [ m , p ] (4.6) for all 1 ≤ i , j ≤ n . WEIGHTED ω -RESTRICTED ONE-COUNTER AUT OMA T A 11 Theorem 4.6. Let S be a complete star -ome ga semiring and C = ( n , I , M , P , k ) be an S h Σ ∪ { ε }i - ω -r oc automaton. Then ( σ 0 , (( M ∗ ) p , ε ) ij , τ 0 , ( M ω , k ) p ) is a solution of the system (4.6) with kC k = ( σ 0 , τ 0 ) . Pr oof. By Theorem 4.5. 5. M I X E D A L G E B R A I C S Y S T E M S A N D M I X E D C O N T E X T - F R E E G R A M M A R S In this section we associate a mixed conte xt-free grammar with finite and infinite deriv ations to the algebraic system (4.6) . The language generated by this mix ed context-free grammar is then the behavior kC k of the ω -roc automaton C . The construction of the mixed context-free grammar from the ω -roc automaton C is a generalization of the well-known triple construction in case of roc automata and is called now triple-pair construction for ω -r oc automata . W e will consider the commutati ve complete star-omega semirings B = ( { 0, 1 } , ∨ , ∧ , ∗ , 0, 1) with 0 ∗ = 1 ∗ = 1 and N ∞ = ( N ∪ {∞} , +, · , ∗ , 0, 1) with 0 ∗ = 1 and a ∗ = ∞ for a 6 = ∞ . If S = B or S = N ∞ and 1 ≤ k ≤ n , then we associate to the mixed algebraic system (4.6) ov er (( S  Σ ∗  ), ( S  Σ ω  )) the mixed context-fr ee grammar G k = ( X , Z , Σ, P X , P Z , x 0 , z 0 , k ) . (See also ´ Esik, Kuich [11, page 139].) Here (i) X = { x 0 } ∪ { [ i , p , j ] | 1 ≤ i , j ≤ n } is a set of variables for finite derivations ; (ii) Z = { z 0 } ∪ { [ i , p ] | 1 ≤ i ≤ n } is a set of variables for infinite derivations ; (iii) Σ is an alphabet of terminal symbols ; (i v) P X is a finite set of pr oductions for finite derivations giv en belo w; (v) P Z is a finite set of pr oductions for infinite derivations giv en belo w; (vi) x 0 is the start variable for finite derivations ; (vii) z 0 is the start variable for infinite derivations ; (viii) { [ i , p ] | 1 ≤ i ≤ k } is the set of r epeated variables for infinite derivations . In the definition of G k the sets P X and P Z are as follo ws: P X = { x 0 → a [ m 1 , p , m 2 ] b | ( I m 1 , a ) · ( P m 2 , b ) 6 = 0, a , b ∈ Σ ∪ { ε } , 1 ≤ m 1 , m 2 ≤ n } ∪ { [ i , p , j ] → a [ m 1 , p , m 2 ][ m 2 , p , j ] | ( a im 1 , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ i , j , m 1 , m 2 ≤ n } ∪ { [ i , p , j ] → a [ m , p , j ] | ( c im , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ i , j , m ≤ n } ∪ { [ i , p , j ] → a | ( b ij , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ i , j ≤ n } , P Z = { z 0 → a [ m , p ] | ( I m , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ m ≤ n } ∪ { [ i , p ] → a [ m , p ] | ( a im , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ i , m ≤ n } ∪ { [ i , p ] → a [ m 1 , p , m 2 ][ m 2 , p ] | ( a im 1 , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ i , m 1 , m 2 ≤ n } ∪ { [ i , p ] → a [ m , p ] | ( c im , a ) 6 = 0, a ∈ Σ ∪ { ε } , 1 ≤ i , m ≤ n } . 12 M. DR OSTE AND W . KUICH A finite leftmost derivation α 1 ⇒ ∗ L α 2 , where α 1 , α 2 ∈ ( X ∪ Σ) ∗ , by productions in P X is defined as usual. An infinite (leftmost) derivation π : z 0 ⇒ ω L w , for z 0 ∈ Z , w ∈ Σ ω , is defined as follo ws: π : z 0 ⇒ L α 0 [ i 0 , p ] ⇒ ∗ L w 0 [ i 0 , p ] ⇒ L w 0 α 1 [ i 1 , p ] ⇒ ∗ L w 0 w 1 [ i 1 , p ] ⇒ L . . . ⇒ ∗ L w 0 w 1 . . . w m [ i m , p ] ⇒ L w 0 w 1 . . . w m α m +1 [ i m +1 , p ] ⇒ ∗ L . . . , where z 0 → α 0 [ i 0 , p ], [ i 0 , p ] → α 1 [ i 1 , p ], . . . , [ i m , p ] → α m +1 [ i m +1 , p ], . . . are productions in P Z and w = w 0 w 1 . . . w m . . . . W e no w define an infinite deriv ation π k : z 0 ⇒ ω , k L w for 0 ≤ k ≤ n , z 0 ∈ Z , w ∈ Σ ω : W e take the abov e definition π : z 0 ⇒ ω w and consider the sequence of the first elements of the v ariables of X that are rewritten in the finite leftmost deri vation α m ⇒ ∗ L w m , m ≥ 0 . Assume this sequence is i 1 m , i 2 m , . . . , i t m m for some t m , m ≥ 1 . Then, to obtain π k from π , the condition i 0 , i 1 1 , . . . , i t 1 1 , i 1 , i 1 2 , . . . , i t 2 2 , i 2 , . . . , i m , i 1 m +1 , . . . , i t m +1 m +1 , i m +1 , · · · ∈ P k has to be satisfied. Then L ( G k ) = { w ∈ Σ ∗ | x 0 ⇒ ∗ L w } ∪ { w ∈ Σ ω | π : z 0 ⇒ ω , k L w } . Observe that the construction of G k from C is nothing else than a generalization of the triple construction in the case of a roc-automaton, if C is vie wed as a pushdown automaton, since the construction of the conte xt-free grammar G = ( X , Σ, P X , x 0 ) is the triple construction. (See Harrison [ 14 ], Theorem 5.4.3; Bucher , Maurer [ 3 ], S ¨ atze 2.3.10, 2.3.30; Kuich, Salomaa [ 16 ], pages 178, 306; Kuich [15], page 642; ´ Esik, Kuich [11], pages 77, 78.) W e call the construction of the mix ed context-free grammar G k , for 0 ≤ k ≤ n , from C the triple-pair construction for ω -r oc automata . This is justified by the definition of the sets of variables { [ i , p , j ] | 1 ≤ i , j , ≤ n } and { [ i , p ] | 1 ≤ i ≤ n } of G k and by the forthcoming Corollary 5.2. In the ne xt theorem we use the isomorphism between B  Σ ∗  × B  Σ ω  and 2 Σ ∗ × 2 Σ ω . Theorem 5.1. Assume that ( σ , τ ) is the solution of or der k of the mixed algebraic system (4.6) over ( B  Σ ∗  , B  Σ ω  ) for k ∈ { 0, . . . , n } . Then L ( G k ) = σ x 0 ∪ τ z 0 . Pr oof. By Theorem IV .1.2 of Salomaa, Soittola [ 18 ] and by Theorem 4.6, we obtain σ x 0 = { w ∈ Σ ∗ | x 0 ⇒ ∗ L w } . W e now show that τ z 0 is generated by the infinite deri vations ⇒ ω , k L from z 0 . First observe that the rewriting by the typical [ i , p , j ] - and [ i , p ] - production corresponds to the situation that in the graph of the ω -restricted one counter automaton C the edge from ( pρ , i ) to ( ppρ , j ), ( pρ , j ) or ( ρ , j ) , ρ = p t for some t ≥ 0 is passed after the state i is visited. The first step of the infinite deri v ation π k is gi ven by z 0 ⇒ L α 0 [ i 0 , p ] and indicates that the path in the graph of C corresponding to π k starts in state i 0 . Furthermore, the sequence of the first elements of v ariables that are rewritten in π k , i.e., i 0 , i 1 1 , . . . , i t 1 1 , i 1 , i 2 2 , . . . , i t 2 2 , i 2 , . . . , i m , i 1 m +1 , . . . , i t m +1 m +1 , i m +1 , . . . indicates that the path in the graph of C corresponding to π k visits these states. Since this sequence is in P k the corresponding path contributes to kC k . Hence, by Theorem 4.6 we obtain τ z 0 = { w ∈ Σ ω | π : z 0 ⇒ ∗ L w } . Corollary 5.2. Assume that, for some k ∈ { 0, . . . , n } , the mixed context fr ee grammar G k associated to the mixed algebr aic system (4.6) is constructed fr om the B h Σ ∪ { ε }i - ω -r oc automaton C . Then L ( G k ) = kC k . Pr oof. By Theorems 4.6 and 5.1. WEIGHTED ω -RESTRICTED ONE-COUNTER AUT OMA T A 13 For the remainder of this section our basic semiring is N ∞ , which allows us to draw some stronger conclusions. Theorem 5.3. Assume that ( σ , τ ) is the solution of or der k of the mixed algebr aic system (4.6) over ( N ∞  Σ ∗  , N ∞  Σ ω  ) , k ∈ { 0, . . . , n } , wher e I m 1 , P m 1 , a m 1 m 2 , b m 1 m 2 , c m 1 m 2 , 1 ≤ m 1 , m 2 ≤ n are in { 0, 1 }h Σ ∪ { ε }i . Denote by d ( w ) , for w ∈ Σ ∗ , the number (possibly ∞ ) of distinct finite leftmost derivations of w fr om x 0 with r espect to G k ; and by c ( w ) , for w ∈ Σ ω , the number (possibly ∞ ) of distinct infinite leftmost derivations π of w fr om z 0 with r espect to G k . Then σ x 0 = X w ∈ Σ ∗ d ( w ) w and τ z 0 = X w ∈ Σ ω c ( w ) w . Pr oof. By Theorem IV .1.5 of Salomaa, Soittola [ 18 ], Theorems 5.5.9 and 5.6.3 of ´ Esik, Kuich [ 11 ] and Theorem 4.6. In the forthcoming Corollary 5.4 we consider , for a given { 0, 1 }h Σ ∪ { ε }i - ω -roc automaton C = ( n , I , M , P , k ) the number of distinct computations from an initial instantaneous description ( i , w , p ) for w ∈ Σ ∗ , I i 6 = 0 , to an accepting instantaneous description ( j , ε , ε ) , with P j 6 = 0 , i , j ∈ { 0, . . . , n } . Here ( i , w , p ) means that C starts in the initial state i with w on its input tape and p on its pushdo wn tape; and ( j , ε , ε ) means that C has entered the final state j with empty input tape and empty pushdo wn tape. Furthermore, we consider the number of distinct infinite computations starting in an initial instantaneous description ( i , w , p ) for w ∈ Σ ∞ , I i 6 = 0 . Corollary 5.4. Assume that, for some k ∈ { 0, . . . , n } , the mixed context-fr ee grammar G k associated to the mixed alg ebraic system (4.6) is constructed fr om the { 0, 1 }h Σ ∪ { ε }i - ω -r oc automaton C . Then the number (possibly ∞ ) of distinct finite leftmost derivations of w ∈ Σ ∗ fr om x 0 equals the number of distinct finite computations fr om an initial instantaneous description for w to an accepting instantaneous description; mor eover , the number (possibly ∞ ) of distinct infinite (leftmost) derivations of w ∈ Σ ω fr om z 0 equals the number of distinct infinite computations starting in an initial instantaneous description for w . Pr oof. By Corollary 3.4.12 of ´ Esik, K uich [ 11 , Theorem 4.3] and the definition of infinite deriv ations with respect to G k . The conte xt-free grammar G k associated to (4.6) is called unambiguous if each w ∈ L ( G ) , w ∈ Σ ∗ has a unique finite leftmost deri v ation and each w ∈ L ( G ) , w ∈ Σ ω , has a unique infinite (leftmost) deri v ation. An N ∞ h Σ ∪ { ε }i - ω -roc automaton C is called unambiguous if ( kC k , w ) ∈ { 0, 1 } for each w ∈ Σ ∗ ∪ Σ ω . Corollary 5.5. Assume that, for some k ∈ { 0, . . . , n } , the mixed context-fr ee grammar G k associated to the mixed alg ebraic system (4.6) is constructed fr om the { 0, 1 }h Σ ∪ { ε }i - ω -r oc automaton C . Then G k is unambiguous iff kC k is unambiguous. In the forthcoming paper Droste, ´ Esik, Kuich [ 5 ] we extend the results of this paper to weighted ω -pushdo wn automata and obtain the triple-pair construction for them. In the classical theory this triple-pair constructions extends the well-known triple construction that, gi ven an ω -pushdo wn automaton, yields an equi v alent context-free grammar . 14 M. DR OSTE AND W . KUICH A C K N O W L E D G M E N T The ideas of and personal discussions with Zolt ´ an ´ Esik were of great influence in preparing this paper . Thanks are due to two unkno wn referees for their helpful remarks. R E F E R E N C E S [1] Berstel, J.: Transductions and Context-Free Languages. T eubner , 1979. [2] Bloom, S. L., ´ Esik, Z.: Iteration Theories. EA TCS Monographs on Theoretical Computer Science. Springer, 1993. [3] Bucher, W ., Maurer, H.: Theoretische Grundlagen der Programmiersprachen. B. I. W issenschaftsverlag, 1984. [4] Conway , J. H.: Regular Algebra and Finite Machines. Chapman & Hall, 1971. [5] Droste, M., ´ Esik, Z., Kuich, W .: The triple-pair construction for weighted ω -pushdown automata. In: Automata and Formal Languages (AFL 2017), EPTCS (2017) 101-113. [6] Eilenberg, S.: Automata, Languages and Machines. V ol. A. Academic Press, 1974. [7] ´ Esik, Z., Kuich, W .: A semiring-semimodule generalization of ω -context-free languages. In: Theory is Forev er (Eds.: J. Karhum ¨ aki, H. Maurer , G. Paun, G. Rozenber g), LNCS 3113, Springer , 2004, 68–80. [8] ´ Esik, Z., Kuich, W .: A semiring-semimodule generalization of ω -regular languages II. Journal of Automata, Languages and Combinatorics 10 (2005) 243–264. [9] ´ Esik, Z., Kuich, W .: On iteration semiring-semimodule pairs. Semigroup Forum 75 (2007), 129–159. [10] ´ Esik, Z., Kuich, W .: A semiring-semimodule generalization of transducers and abstract ω -families of po wer series. Journal of Automata, Languages and Combinatorics, 12 (2007), 435–454. [11] ´ Esik, Z., Kuich, W .: Modern Automata Theory . http://www.dmg.tuwien.ac.at/kuich [12] ´ Esik, Z., Kuich, W .: Continuous semiring-semimodule pairs and mixed algebraic systems. Acta Cybernetica 252 (2017) 43-59. [13] Greibach S. A.: An infinite hierarchy of context-free languages. Journal of the A CM 16 (1969) 91–106. [14] Harrison, M. A.: Introduction to Formal Language Theory . Addison-W esley , 1978. [15] Kuich, W .: Semirings and formal power series: Their relev ance to formal languages and automata theory . In: Handbook of Formal Languages (Eds.: G. Rozenberg and A. Salomaa), Springer , 1997, V ol. 1, Chapter 9, 609–677. [16] Kuich, W ., Salomaa, A.: Semirings, Automata, Languages. EA TCS Monographs on Theoretical Computer Science, V ol. 5. Springer , 1986. [17] Perrin, D., Pin, J. - E.: Infinite W ords Automata, Semigroups, Logic and Games, Else vier , 2004. [18] Salomaa, A., Soittola, M.: Automata - Theoretic Aspects of Formal Power Series, Springer , 1978. This work is licensed under the Creative Commons Attribution License. T o view a cop y of this license, visit https://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, 171 Second St, Suite 300, San Francisco , CA 94105, USA, or Eisenacher Strasse 2, 10777 Berlin, Ger many

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment