Weighted omega-Restricted One Counter Automata
Manfred Droste, Werner Kuich

TL;DR
This paper establishes a mathematical framework connecting weighted omega-restricted one-counter automata with algebraic systems and context-free grammars, generalizing existing constructions for analyzing their behaviors.
Contribution
It introduces a novel algebraic system and a generalized triple-pair construction linking automata behavior to algebraic solutions and context-free grammars.
Findings
Existence of a mixed algebraic system for automaton behavior
Construction of a mixed context-free grammar from automata
Generalization of the triple construction for omega-restricted automata
Abstract
Let be a complete star-omega semiring and be an alphabet. For a weighted -restricted one-counter automaton with set of states , , we show that there exists a mixed algebraic system over a complete semiring-semimodule pair such that the behavior of is a component of a solution of this system. In case the basic semiring is or we show that there exists a mixed context-free grammar that generates . The construction of the mixed context-free grammar from is a generalization of the well-known triple construction in case of restricted one-counter automata and is called now triple-pair construction for -restricted one-counter automata.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
\lmcsheading
1–LABEL:LastPageJan. 31, 2017Mar. 06, 2018
\ACMCCS[Theory of computation]: Formal languages and automata theory — Automata over infinite objects — Quantitative automata \amsclassPrimary: 68Q45, 68Q70; Secondary: 68Q42
Weighted -Restricted One-Counter Automata
Manfred Droste
Universität Leipzig, Institut für Informatik
and
Werner Kuich
Technische Universität Wien, Institut für Diskrete Mathematik und Geometrie
Abstract.
Let be a complete star-omega semiring and be an alphabet. For a weighted -restricted one-counter automaton with set of states , , we show that there exists a mixed algebraic system over a complete semiring-semimodule pair such that the behavior of is a component of a solution of this system. In case the basic semiring is or we show that there exists a mixed context-free grammar that generates . The construction of the mixed context-free grammar from is a generalization of the well-known triple construction in case of restricted one-counter automata and is called now triple-pair construction for -restricted one-counter automata.
Key words and phrases:
weighted pushdown automata, algebraic series, weighted contextfree grammar, formal power series, complete semiring
This work was partially supported by DFG Graduiertenkolleg 1763 (QuantLA)
The second author was partially supported by Austrian Science Fund (FWF): grant no. I1661 – N25.
1. Introduction
Restricted one-counter pushdown automata and languages were introduced by Greibach [13] and considered in Berstel [1], Chapter @slowromancapvii@ 4. These restricted one-counter pushdown automata are pushdown automata having just one pushdown 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 Lukasiewicz language, i.e., the formal language over the alphabet generated by the context-free grammar with productions . 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 power series and restricted one-counter automata over them (see Kuich, 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.
We consider weighted -restricted one-counter automata and their relation to algebraic systems over the complete semiring-semimodule pair , where is a complete star-omega semiring. It turns out that the well-known triple construction for pushdown 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 pushdown automaton an equivalent context-free grammar. (See Harrison [14], Theorem 5.4.3; Bucher, Maurer [3], Sätze 2.3.10, 2.3.30; Kuich, Salomaa [16], pages 178, 306; Kuich [15], page 642; Ésik, Kuich [11], pages 77, 78.)
The paper consists of this and three more sections. In Section 2, we review 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 , the -block of the infinite column vector is a solution of the linear equation . In Section 4, weighted -restricted one-counter automata are introduced as a special case of weighted -pushdown automata. We show that for a weighted -restricted one-counter automaton there exists a mixed algebraic system such that the behavior of is a component of a solution of this system. In Section 5 we consider the case that the complete star-omega semiring is equal to or . Then for a given weighted -restricted one-counter automaton a mixed context-free grammar is constructed that generates . 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. Preliminaries
For the convenience of the reader, we quote definitions and results of Ésik, Kuich [7, 8, 10] from Ésik, Kuich [11]. The reader should be familiar with Sections 5.1-5.6 of Ésik, Kuich [11].
A semiring is called complete if it is possible to define sums for all families of elements of , where is an arbitrary index set, such that the following conditions are satisfied (see Conway [4], Eilenberg [6], Kuich [15]):
[TABLE]
This means that a semiring is complete if it is possible to define “infinite sums” (i) that are an extension of the finite sums, (ii) that are associative and commutative and (iii) that satisfy the distribution laws. If is a monoid and conditions (i) and (ii) are satisfied then is called a complete monoid.
A semiring S equipped with an additional unary star operation is called a starsemiring. In complete semirings for each element , the star of is defined by
[TABLE]
Hence, each complete semiring is a starsemiring, called a complete starsemiring.
Suppose that is a semiring and is a commutative monoid written additively. We call a (left) -semimodule if is equipped with a (left) action
[TABLE]
subject to the following rules:
[TABLE]
for all and . When V is an -semimodule, we call a semiring-semimodule pair.
Suppose that is a semiring-semimodule pair such that is a starsemiring and and are equipped with an omega operation . Then we call a starsemiring-omegasemimodule pair.
Ésik, Kuich [9] define a complete semiring-semimodule pair to be a semiring-semimodule pair such that is a complete semiring and V is a complete monoid with
[TABLE]
for all , , and for all families over and over ; moreover, it is required that an infinite product operation
[TABLE]
is given mapping infinite sequences over to subject to the following three conditions:
[TABLE]
where in the first equation and are arbitrary index sets. Suppose that is complete. Then we define
[TABLE]
for all . This turns into a starsemiring-omegasemimodule pair. Observe that, if is a complete semiring-semimodule pair, then .
For a starsemiring , we denote by the semiring of -matrices over . If is a complete semiring-semimodule pair then, by Ésik, Kuich [12], is again a complete semiring-semimodule pair.
A star-omega semiring is a semiring equipped with unary operations ∗ and . A star-omega semiring is called complete if is a complete semiring semimodule pair, i.e., if 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üchi condition consult Perrin, Pin [17].
3. Restricted one-counter matrices
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 is termed a pushdown transition matrix (with pushdown alphabet and set of states ) if
- (i)
for each there exist only finitely many blocks , , that are non-zero; 2. (ii)
for all ,
[TABLE]
Theorem 10.5 of Kuich, Salomaa [16] states that for pushdown matrices over power series semirings with particular properties, holds for all . This result is generalized in the case of roc-matrices to arbitrary roc-matrices over complete starsemirings in Corollary 2. Then we prove some important equalities for roc-matrices. In Theorem 1 and Corollary 2, denotes a complete starsemiring; afterwards in this section, denotes a complete semiring-semimodule pair.
A restricted one-counter (abbreviated roc) matrix (with counter symbol ) is a matrix in , for some , subject to the following condition: There exist matrices such that, for all ,
[TABLE]
and these blocks of are the only ones which may be non-zero. (Here, . A block of is an element of the matrix which is itself a matrix in .)
Observe that, for ,
[TABLE]
Also note that the matrix (resp ) in describes the weight of transitions when pushing (resp., popping, not changing) an additional symbol to (resp., from) the pushdown counter.
Theorem 1**.**
Let S be a complete starsemiring and be a roc-matrix. Then, for all ,
[TABLE]
Proof 3.1**.**
First observe that
[TABLE]
where, for , the product equals . Now we obtain
[TABLE]
Clearly, in each sequence leading from to , there is a first time at which the top is reduced to and at which is seen. This moment is reached at the end of the second line. Hence, in the second line the pushdown contents , are always nonempty.
Corollary 2**.**
For all , .
Lemma 3**.**
Let be a complete semiring-semimodule pair. Let be a roc-matrix. Then
[TABLE]
Proof 3.2**.**
Subsequently in the first equation we split the summation so that in the first summand there is no factor , while in the second summand there is at least one factor ; since , is the first such factor. In the second equality we use the property of being a roc-matrix: for , . We compute:
[TABLE]
Intuitively, our next theorem states that infinite computations starting with on the pushdown tape yield the same matrix as the sum of the following three matrix products:
- •
(i.e., changing the contents of the pushdown tape from to and starting the infinite computations with the leftmost ; the second is never read),
- •
(i.e., changing the contents of the pushdown tape from to , emptying the leftmost by finite computations and starting the infinite computations with the rightmost ),
- •
(i.e., changing the contents of the pushdown tape from to and starting the infinite computations with this ).
The forthcoming Theorem 7 has an analogous intuitive interpretation.
Theorem 4**.**
Let be a complete semiring-semimodule pair and let be a roc-matrix. Then
[TABLE]
Proof 3.3**.**
We obtain, by Lemma 3
[TABLE]
Corollary 5**.**
Let be a roc-matrix. Then is a solution of
[TABLE]
When we say “ is the graph with matrix ” then it means that is the graph with adjacency matrix , where corresponds to with respect to the canonical isomorphism between and .
Let now be a roc-matrix and . Then is the column vector in defined as follows: For and , let be the sum of all weights of paths in the graph with matrix that have initial vertex and visit vertices , , , infinitely often. Observe that and . Later on it will be seen that this formalizes the Büchi acceptance condition with repeated states .
Let . Then for , we obtain
[TABLE]
By Theorem 5.4.1 of Ésik, Kuich [11], we obtain for a finite matrix and for , ,
[TABLE]
Observe that again and .
In the next lemma, we use the following summation identity: Assume that are matrices in . Then for , , and ,
[TABLE]
Lemma 6**.**
Let be a complete semiring-semimodule pair. Let be a roc-matrix and . Then
[TABLE]
Proof 3.4**.**
We use the proof of Lemma 3, i.e., the proof for the case . For , we obtain
[TABLE]
Theorem 7**.**
Let be a complete semiring-semimodule pair and let be a roc-matrix. Then
[TABLE]
for all .
Proof 3.5**.**
We obtain, by Lemma 6, for all ,
[TABLE]
Corollary 8**.**
Let be a roc-matrix. Then, for all , is a solution of
[TABLE]
4. -restricted one-counter automata
In this section, we define -roc automata as a special case of -pushdown automata. We show that for an -roc automaton there exists an algebraic system over a complete semiring-semimodule pair such that the behavior of is a component of a solution of this system.
In the sequel, is a complete semiring-semimodule pair and is a subset of containing [math] an . An --pushdown automaton
[TABLE]
is given by
- (i)
a finite set of states , , 2. (ii)
an alphabet of pushdown symbols, 3. (iii)
a pushdown transition matrix , 4. (iv)
an initial state vector , 5. (v)
a final state vector , 6. (vi)
an initial pushdown symbol , 7. (vii)
a set of repeated states , .
The definition of a pushdown transition matrix is given at the beginning of Section 3. (See also Kuich, Salomaa [16], Kuich [15] and Ésik, Kuich [11].) Clearly, any roc-matrix is a pushdown transition matrix.
The behavior of is an element of and is defined by
[TABLE]
Here is the behavior of the --pushdown automaton and is the behavior of the --pushdown automaton . Observe that is an automaton with the Büchi acceptance condition: if is the graph with adjacency matrix , then only paths that visit the repeated states infinitely often contribute to . Furthermore, contains no repeated states and behaves like an ordinary -pushdown automaton.
An --roc automaton is an --pushdown automaton with just one pushdown symbol such that its pushdown matrix is a roc-matrix.
In the sequel, an --roc automaton is denoted by with behavior
[TABLE]
Remark 9**.**
Consider an --pushdown automaton with just one pushdown symbol. By the construction in the proof of Theorem 13.28 of Kuich, Salomaa [16], an --roc automaton can be constructed such that .
The next definitions and results are taken from Ésik, Kuich [11, Section 5.6]. For the definition of an -algebraic system over a quemiring we refer the reader to [11], page 136, and for the definition of quemirings to [11], page 110. Here we note that a quemiring is isomorphic to a quemiring determined by the semiring-semimodule pair , cf. [11], page 110.
Observe that the forthcoming system (1) is a system over the quemiring . Compare the forthcoming algebraic system (2) with the algebraic systems occurring in the proofs of Theorem 14.15 of Kuich, Salomaa [16] and Theorem 6.4 of Kuich [15], both in the case of a roc-matrix.
Let be a roc-matrix. Consider the -algebraic system over the complete semiring-semimodule pair
[TABLE]
Then by Theorem 5.6.1 of Ésik, Kuich [11] is a solution of (1) iff is a solution of the -algebraic system over
[TABLE]
and is a solution of the -linear system over
[TABLE]
Theorem 10**.**
Let be a complete starsemiring and be a roc-matrix. Then is a solution of the -algebraic system (2). If is a continuous starsemiring, then is the least solution of (2).
Proof 4.1**.**
We obtain, by Theorem 1
[TABLE]
This proves the first sentence of our theorem. The second sentence of Theorem 10 is proved by Theorem 6.4 of Kuich [15].
Theorem 11**.**
Let be a complete semiring-semimodule pair and be a roc-matrix. Then
[TABLE]
is a solution of the -algebraic system (1), for each .
Proof 4.2**.**
Let , and consider the -linear system
[TABLE]
By Corollary 8, is a solution of this system. Hence, by Theorem 5.6.1 of Ésik, Kuich [11] (see the remark above) and Theorem 10, is a solution of the system (1).
Observe that, if is a continuous semiring, then the -linear system in the proof of Theorem 11 is in fact an -linear system (see Kuich [15, p. 623]).
Theorem 12**.**
Let be a complete semiring-semimodule pair and let be an --roc-automaton. Then is a solution of the -algebraic system
[TABLE]
over the complete semiring-semimodule pair .
Proof 4.3**.**
By Theorem 11, is a solution of the second equation. Since
[TABLE]
* is a solution of the given -algebraic system.*
Let now be a complete star-omega semiring and be an alphabet. Then by Theorem 5.5.5 of Ésik, Kuich [11], is a complete semiring-semimodule pair.
Let be an --roc automaton. Consider the algebraic system (4) over the complete semiring-semimodule pair and the mixed algebraic system (5) over induced by (4)
[TABLE]
Then, by Theorem 12,
[TABLE]
is a solution of (5). It is called solution of order . Hence, we have proved the next theorem.
Theorem 13**.**
Let be a complete star-omega semiring and be an --roc automaton. Then , is a solution of the mixed algebraic system (5). ∎
Let now in (5)
[TABLE]
be an -matrix of variables and
[TABLE]
be an -dimensional column vector of variables. If we write the mixed algebraic system (5) component-wise, we obtain a mixed algebraic system over with variables over , where , and variables over , where . Observe that we do not really need in the notation of the variables. But we want to save the form of the triple construction in connection with pushdown automata.
Let
[TABLE]
and write (5) with the matrices and of variables component-wise then we obtain:
[TABLE]
for all .
Theorem 14**.**
Let be a complete star-omega semiring and be an --roc automaton. Then
[TABLE]
is a solution of the system (6) with .
Proof 4.4**.**
By Theorem 13.
5. Mixed algebraic systems and mixed context-free grammars
In this section we associate a mixed context-free grammar with finite and infinite derivations to the algebraic system (6). The language generated by this mixed context-free grammar is then the behavior of the -roc automaton . The construction of the mixed context-free grammar from the -roc automaton is a generalization of the well-known triple construction in case of roc automata and is called now triple-pair construction for -roc automata. We will consider the commutative complete star-omega semirings with and with and for .
If or and , then we associate to the mixed algebraic system (6) over the mixed context-free grammar
[TABLE]
(See also Ésik, Kuich [11, page 139].) Here
- (i)
is a set of variables for finite derivations; 2. (ii)
is a set of variables for infinite derivations; 3. (iii)
is an alphabet of terminal symbols; 4. (iv)
is a finite set of productions for finite derivations given below; 5. (v)
is a finite set of productions for infinite derivations given below; 6. (vi)
is the start variable for finite derivations; 7. (vii)
is the start variable for infinite derivations; 8. (viii)
is the set of repeated variables for infinite derivations.
In the definition of the sets and are as follows:
[TABLE]
A finite leftmost derivation , where , by productions in is defined as usual. An infinite (leftmost) derivation , for , is defined as follows:
[TABLE]
where are productions in and .
We now define an infinite derivation for , , : We take the above definition and consider the sequence of the first elements of the variables of that are rewritten in the finite leftmost derivation , . Assume this sequence is for some , . Then, to obtain from , the condition has to be satisfied.
Then
[TABLE]
Observe that the construction of from is nothing else than a generalization of the triple construction in the case of a roc-automaton, if is viewed as a pushdown automaton, since the construction of the context-free grammar is the triple construction. (See Harrison [14], Theorem 5.4.3; Bucher, Maurer [3], Sätze 2.3.10, 2.3.30; Kuich, Salomaa [16], pages 178, 306; Kuich [15], page 642; Ésik, Kuich [11], pages 77, 78.)
We call the construction of the mixed context-free grammar , for , from the triple-pair construction for -roc automata. This is justified by the definition of the sets of variables and of and by the forthcoming Corollary 16.
In the next theorem we use the isomorphism between and .
Theorem 15**.**
Assume that is the solution of order of the mixed algebraic system (6) over for . Then
[TABLE]
Proof 5.1**.**
By Theorem @[email protected] of Salomaa, Soittola [18] and by Theorem 14, we obtain . We now show that is generated by the infinite derivations from . First observe that the rewriting by the typical - and - production corresponds to the situation that in the graph of the -restricted one counter automaton the edge from to or , for some is passed after the state is visited. The first step of the infinite derivation is given by and indicates that the path in the graph of corresponding to starts in state . Furthermore, the sequence of the first elements of variables that are rewritten in , i.e., indicates that the path in the graph of corresponding to visits these states. Since this sequence is in the corresponding path contributes to . Hence, by Theorem 14 we obtain
[TABLE]
Corollary 16**.**
Assume that, for some , the mixed context free grammar associated to the mixed algebraic system (6) is constructed from the --roc automaton . Then
[TABLE]
Proof 5.2**.**
For the remainder of this section our basic semiring is , which allows us to draw some stronger conclusions.
Theorem 17**.**
Assume that is the solution of order of the mixed algebraic system (6) over , , where , are in . Denote by , for , the number (possibly ) of distinct finite leftmost derivations of from with respect to ; and by , for , the number (possibly ) of distinct infinite leftmost derivations of from with respect to . Then
[TABLE]
Proof 5.3**.**
By Theorem @[email protected] of Salomaa, Soittola [18], Theorems 5.5.9 and 5.6.3 of Ésik, Kuich [11] and Theorem 14.
In the forthcoming Corollary 18 we consider, for a given --roc automaton the number of distinct computations from an initial instantaneous description for , , to an accepting instantaneous description , with , .
Here means that starts in the initial state with on its input tape and on its pushdown tape; and means that has entered the final state with empty input tape and empty pushdown tape.
Furthermore, we consider the number of distinct infinite computations starting in an initial instantaneous description for , .
Corollary 18**.**
Assume that, for some , the mixed context-free grammar associated to the mixed algebraic system (6) is constructed from the --roc automaton . Then the number (possibly ) of distinct finite leftmost derivations of from equals the number of distinct finite computations from an initial instantaneous description for to an accepting instantaneous description; moreover, the number (possibly ) of distinct infinite (leftmost) derivations of from equals the number of distinct infinite computations starting in an initial instantaneous description for .
Proof 5.4**.**
By Corollary 3.4.12 of Ésik, Kuich [11, Theorem 4.3] and the definition of infinite derivations with respect to .
The context-free grammar associated to (6) is called unambiguous if each , has a unique finite leftmost derivation and each , , has a unique infinite (leftmost) derivation.
An --roc automaton is called unambiguous if for each .
Corollary 19**.**
Assume that, for some , the mixed context-free grammar associated to the mixed algebraic system (6) is constructed from the --roc automaton . Then is unambiguous iff is unambiguous.
In the forthcoming paper Droste, Ésik, Kuich [5] we extend the results of this paper to weighted -pushdown automata and obtain the triple-pair construction for them. In the classical theory this triple-pair constructions extends the well-known triple construction that, given an -pushdown automaton, yields an equivalent context-free grammar.
Acknowledgment
The ideas of and personal discussions with Zoltán Ésik were of great influence in preparing this paper. Thanks are due to two unknown referees for their helpful remarks.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Berstel, J.: Transductions and Context-Free Languages. Teubner, 1979.
- 2[2] Bloom, S. L., Ésik, Z.: Iteration Theories. EATCS Monographs on Theoretical Computer Science. Springer, 1993.
- 3[3] Bucher, W., Maurer, H.: Theoretische Grundlagen der Programmiersprachen. B. I. Wissenschaftsverlag, 1984.
- 4[4] Conway, J. H.: Regular Algebra and Finite Machines. Chapman & Hall, 1971.
- 5[5] Droste, M., Ésik, Z., Kuich, W.: The triple-pair construction for weighted ω 𝜔 \omega -pushdown automata. In: Automata and Formal Languages (AFL 2017), EPTCS (2017) 101-113.
- 6[6] Eilenberg, S.: Automata, Languages and Machines. Vol. A. Academic Press, 1974.
- 7[7] Ésik, Z., Kuich, W.: A semiring-semimodule generalization of ω 𝜔 \omega -context-free languages. In: Theory is Forever (Eds.: J. Karhumäki, H. Maurer, G. Paun, G. Rozenberg), LNCS 3113, Springer, 2004, 68–80.
- 8[8] Ésik, Z., Kuich, W.: A semiring-semimodule generalization of ω 𝜔 \omega -regular languages II. Journal of Automata, Languages and Combinatorics 10 (2005) 243–264.
