Žižkova 22, 616 62 Brno, Czech Republic
11email: masopust@math.cas.cz
A Note on Limited Pushdown Alphabets in Stateless Deterministic Pushdown Automata
Abstract
Recently, an infinite hierarchy of languages accepted by stateless deterministic pushdown automata has been established based on the number of pushdown symbols. However, the witness language for the th level of the hierarchy is over an input alphabet with elements. In this paper, we improve this result by showing that a binary alphabet is sufficient to establish this hierarchy. As a consequence of our construction, we solve the open problem formulated by Meduna et al. Then we extend these results to -state realtime deterministic pushdown automata, for all . The existence of such a hierarchy for -state deterministic pushdown automata is left open.
1 Introduction
Pushdown automata, and especially deterministic pushdown automata, play a central role in many applications of context-free languages. Considering state complexity, it is well-known that any pushdown automaton can be transformed to an equivalent pushdown automaton with a single state. Thus, the hierarchy based on the number of states collapses to only one level. In that case, the sole state is not important and one-state automata are also called stateless in the literature. On the other hand, however, no such transformation is possible for deterministic pushdown automata since it is shown in [7] that the number of states in deterministic pushdown automata establishes an infinite state hierarchy on the family of deterministic context-free languages. The reader is referred to [7] for more details, including binary witness languages.
Recently, Meduna et al. [17] have established an infinite hierarchy of languages on the lowest level of the state hierarchy, on the level of stateless deterministic pushdown automata, based on the number of pushdown symbols. They have shown that there exist languages accepted by stateless deterministic pushdown automata with pushdown symbols that cannot be accepted by any stateless deterministic pushdown automaton with pushdown symbols. However, the size of the input alphabet of the witness language for each level of the hierarchy is almost twice bigger than the size of the pushdown alphabet, which is linear with respect to the level of the hierarchy. More specifically, they constructed an infinite sequence of languages , for all , such that the alphabet of the language is of cardinality , and they proved that any stateless deterministic pushdown automaton accepting the language requires at least pushdown symbols. Thus, their construction requires a growing alphabet and it was left open whether the hierarchy can be shown with witness languages over a fixed alphabet. In addition, they formulated an open question of what is the role of non-input pushdown symbols in this hierarchy, that is, can a similar infinite hierarchy be established based on the number of non-input pushdown symbols?
In this paper, we improve their result by constructing a sequence of witness languages over a binary alphabet, which is the best possible improvement because any unary language accepted by a stateless deterministic pushdown automaton is a singleton. In other words, languages accepted by deterministic pushdown automata (by empty pushdown) are prefix-free [7]. As an immediate consequence of our construction, we obtain a solution to the open problem. Then we show that a similar idea can be used for realtime pushdown automata to establish infinite hierarchies based on the number of pushdown symbols on each level of the state hierarchy. Again, the witness languages are binary. However, the case of general deterministic pushdown automata is left open.
Stateless automata of many types are of great interest and have widely been investigated in the literature. For instance, stateless multicounter machines have been studied in [2], hierarchies of stateless multicounter Watson-Crick automata have been investigated in [1, 18], multihead finite and pushdown automata have been studied in [4, 9], stateless restarting automata in [11, 12], and stateless automata and their relationship to P systems in [24]. Pushdown store languages, that is, languages consisting of strings occurring on the pushdown along accepting computations of a pushdown automaton, have been studied in [15, 16], including the languages of stateless pushdown automata. Some decision results concerning stateless and deterministic pushdown automata can be found in [5, 22].
2 Preliminaries
In this paper, we assume that the reader is familiar with automata and formal language theory [7, 8, 19]. For a set , denotes the cardinality of , and denotes the powerset of . An alphabet is a finite nonempty set. For an alphabet , represents the free monoid generated by , where the unit (the empty string) is denoted by .
A pushdown automaton (PDA) is a septuple , where is the finite set of states, is the input alphabet, is the pushdown alphabet, is the transition function from to the set of finite subsets of , is the initial state, is the initial pushdown symbol, and is the set of accepting states. A configuration of is any element of . For a configuration , denotes the current state of , denotes the content of the pushdown (with the top as the rightmost symbol), and denotes the unread part of the input string. The automaton changes the configuration according to the transition function . This one-step relation is denoted by and defined so that if is in , where and are strings of pushdown symbols, is a pushdown symbol, is an input symbol or , and is a string of input symbols. Let denote the reflexive and transitive closure of the relation . The language accepted by (by a final state and empty pushdown) is denoted by and defined as .
Automaton is deterministic (DPDA) if there is no more than one move the automaton can make from any configuration, that is, , for any state , pushdown symbol , and input symbol , and if is defined, that is, , then is not defined for any input symbol .
Automaton is realtime (RPDA) if it is deterministic and if no -transitions are defined, that is, if is defined, then .
Automaton is stateless (SPDA) if it has only one state, that is, . Moreover, in stateless pushdown automata, we allow an initial pushdown string instead of an initial pushdown symbol. Thus, in this case, we simply write . Note that unlike the general case of deterministic pushdown automata, in the case of stateless deterministic pushdown automata, the realtime restriction does not decrease the power of the machine [7].
In what follows, the notation , for in and in , denotes the computational step , and for a string , the notation denotes the maximal computation , that is, no other -transitions are possible from the configuration . For stateless automata, the state is eliminated from this notation.
We now recall the definition of families of languages accepted by stateless deterministic pushdown automata with pushdown symbols.
Definition 1
A stateless deterministic pushdown automaton is -pushdown-alphabet-limited, for , if . The family -SDPDA denotes all languages accepted by an -pushdown-alphabet-limited stateless deterministic pushdown automaton. Similarly, the family -SRPDA denotes all languages accepted by an -pushdown-alphabet-limited stateless realtime pushdown automaton.
3 Main results
Recall that it is known [7] that any language accepted by a stateless deterministic pushdown automaton is prefix-free. Thus, if contains , then . It is also known that any stateless deterministic pushdown automaton accepting a language different from can be transformed to an equivalent stateless realtime pushdown automaton. To simplify proves, we extend this result by showing that the resulting stateless realtime pushdown automaton does not require any new pushdown symbol.
Theorem 3.1
For any stateless deterministic pushdown automaton with pushdown symbols accepting a language , there exists an equivalent stateless realtime pushdown automaton with no more than pushdown symbols.
Proof
Assume that all pushdown symbols appear in an accepting computation. Let be an -transition of . If appears in , then any computation reaching on top of the pushdown is not accepting because cannot be eliminated from the pushdown; it is always replaced with containing again, which contradicts our assumption. Modify the automaton by replacing all occurrences of on right-hand sides of transitions with , and by removing from and from . The accepted language is not changed because the only action of was to be replaced with , and the resulting automaton has one -transition less. Repeating this substitution results in an equivalent stateless realtime pushdown automaton with no more than pushdown symbols.
This result can be rewritten as follows.
Corollary 1
For all , .
In the following subsection, we improve the result presented in [17] by giving binary witness languages and answering the open problem formulated there.
3.1 Binary alphabet
First, note that from the fact that any language accepted by a stateless deterministic pushdown automaton is prefix-free, any such a unary language is of the form , for some . Every such language can be accepted by a stateless deterministic pushdown automaton with only one pushdown symbol (equal to the input symbol) starting from the initial string with . Thus, to establish the infinite hierarchy based on the number of pushdown symbols using only a binary alphabet is the best possible improvement that can be done. To do this, we define the following sequence of languages
(1) | ||||
We now prove that for all , any stateless deterministic pushdown automaton accepting the language requires at least pushdown symbols. First, we show that pushdown symbols is sufficient.
Lemma 1
For any , there exists a stateless deterministic pushdown automaton with pushdown symbols accepting the language defined in (1).
Proof
As mentioned above, there exists a stateless deterministic pushdown automaton with one pushdown symbol accepting the language . Thus, consider the language for . This language is accepted by the stateless pushdown automaton , where the transition function is defined as follows:
-
1.
, for ,
-
2.
, for .
Symbols are used to count the number of ’s and to restrict this number to . Notice that is deterministic (realtime) and that .
We next prove that at least pushdown symbols are necessary for the language .
Lemma 2
For any , there does not exist a stateless deterministic pushdown automaton accepting the language defined in (1) with pushdown symbols.
Proof
The case is trivial and follows from the definition. Thus, consider the case . Let be a stateless deterministic pushdown automaton accepting the language . By Theorem 3.1, we can assume that is realtime. Consider the computations on strings for all . Then
As symbol is accepted from all configurations , it implies that and , for all , that is,
Assume that there exist such that . Since , the automaton accepts the string that does not belong to the language because . Hence, all the pushdown symbols , for , are pairwise different. It remains to show that the automaton needs at least one more pushdown symbol. To do this, consider the form of the initial string . If , then because , for all . Thus, the automaton needs at least pushdown symbols.
As a consequence of the previous two lemmas, we have the following result. The strictness of the inclusion has been shown in [17]. We have added binary witness languages.
Theorem 3.2
For each , -SDPDA -SDPDA. In addition, the witness languages are binary.
3.2 Non-input pushdown symbols
In [17], the authors formulated a question of whether an infinite hierarchy can be established based on the number of non-input pushdown symbols, that is, whether there exists a similar hierarchy when Definition 1 is modified as follows.
Definition 2
A stateless deterministic pushdown automaton is an -non-input-pushdown-alphabet-limited, for , if the number of non-input pushdown symbols is limited by , that is, if . The family -niSDPDA denotes all languages accepted by an -non-input-pushdown-alphabet-limited stateless deterministic pushdown automaton.
As an immediate consequence of the previous results, we get the answer to this question.
Theorem 3.3
For each , -niSDPDA -niSDPDA.
Proof
We define languages . Then any stateless deterministic pushdown automaton accepting the language requires pushdown symbols. Since the input alphabet is binary, we immediately get , as required.
4 Generalization to realtime pushdown automata
It is a natural question to ask whether a similar hierarchy can be obtained for the other levels of the state hierarchy. To prove this for realtime pushdown automata, we define the following sequence of languages
(2) | ||||
We now prove that for all , any -state deterministic pushdown automaton accepting the language requires at least pushdown symbols. The sufficiency is shown first.
Lemma 3
For any , there exists an -state realtime pushdown automaton with pushdown symbols accepting the language defined in (2).
Proof
Consider the language for and . This language is accepted by the -state deterministic pushdown automaton
where the transition function is defined as follows:
-
1.
, for and ,
-
2.
, for ,
-
3.
, for ,
-
4.
, for and .
Pushdown symbols in combination with states are used to count the number of ’s and to restrict this number to . Notice that is realtime and that .
We now prove that at least pushdown symbols are necessary for any -state realtime pushdown automaton to accept the language .
Lemma 4
For any , there does not exist any -state realtime pushdown automaton accepting the language defined in (2) with pushdown symbols.
Proof
Let be fixed, but arbitrary. The case is trivial and follows from the definition. Thus, consider the case . For the sake of contradiction, assume that there exists an -state realtime pushdown automaton with pushdown symbols accepting the language . Consider the computations on strings for all . Then
where . As symbol is accepted from all configurations , it implies that , for some , and , for all , that is,
As we have states and pushdown symbols, there must exist such that . Since , the automaton accepts string that does not belong to the language because , which is a contradiction. Thus, the automaton needs at least pushdown symbols.
We now present definitions of families of languages accepted by -state deterministic pushdown automata with pushdown symbols.
Definition 3
A pushdown automaton is -pushdown-alphabet-limited, for , if . The family -RPDA denotes all languages accepted by an -state realtime pushdown automaton with pushdown symbols.
Definition 4
A pushdown automaton is an -non-input-pushdown-alphabet-limited, for , if . The family -niRPDA denotes all languages accepted by an -state realtime pushdown automaton with non-input pushdown symbols.
As a consequence of the previous two lemmas, we have the following results.
Theorem 4.1
For each , -RPDA -RPDA. In addition, the witness languages are binary.
Theorem 4.2
For each and , -niRPDA -niRPDA.
Proof
We define languages . Then any -state realtime pushdown automaton accepting the language requires pushdown symbols. Since the input alphabet is binary, we immediately get , as required.
Finally, note that Theorem 3.1 does not hold for deterministic pushdown automata that are not stateless. The following example shows that there exists a two-state deterministic automaton with two pushdown symbols accepting the language , for all . This implies that to establish a similar infinite hierarchy for deterministic pushdown automata based on the number of states and pushdown symbols over a binary (constant) input alphabet requires more sophisticated approaches.
Example 1
Let be fixed, but arbitrary. Then the automaton , where is defined so that
-
1.
,
-
2.
,
-
3.
,
-
4.
,
accepts the language . The automaton reads the first input symbol , changes its state, and pushes a string of symbols to the pushdown. Then it compares input symbol against on the pushdown until it reads symbol with on the pushdown. In that case, it goes to the other state where it empties the whole pushdown without reading any other input symbol.
5 Conclusion
It is a natural question to ask whether a similar hierarchy can be obtained for deterministic pushdown automata. It is likely that such a hierarchy exists on each level, however, we have not established it in this paper. Can such a hierarchy be established with witness languages over a binary (constant) alphabet?
Languages accepted by stateless deterministic pushdown automata are also called simple languages because they are generated by so-called simple grammars [7]. It was shown in [10] that the equivalence problem for simple grammars is decidable, which is, together with the general result by Sénizergues [20, 21], in contrast to the fact that containment is undecidable even for simple languages as shown in [3]. It is remarkable that the best known algorithm for the equivalence of simple languages works in time , where is the size of the grammar, see [13]. Hence, simple languages are in some sense the simplest languages for which containment is undecidable. Note that further simplification results in so-called very simple languages, for which the containment was shown decidable in [23], and the algorithm improved and simplified in [14]. Simple languages also play a role in process algebras, see, e.g., [6].
Finally, note that it is unsolvable to decide whether for a context-free language there exists an integer such that is accepted by a stateless deterministic pushdown automaton with a pushdown alphabet of cardinality . This follows immediately from the undecidability of the problem whether a context-free language can be accepted by a stateless deterministic pushdown automaton, see [7] where this problem is formulated as an exercise. As far as the author knows, it is also an open problem whether there exists an algorithm to compute, for a given deterministic context-free language , the minimal such that belongs to the th level of the state hierarchy.
Acknowledgement.
Research supported by the GAČR grant no. P202/11/P028 and by RVO: 67985840.
References
- [1] O. Eğecioğlu, L. Hegedüs, and B. Nagy. Hierarchies of stateless multicounter Watson-Crick automata languages. Fund. Inform., 110(1-4):111–123, 2011.
- [2] O. Eğecioğlu and O. H. Ibarra. On stateless multicounter machines. In K. Ambos-Spies, B. Löwe, and W. Merkle, editors, Proc. of CiE 2009, volume 5635 of LNCS, pages 178–187. Springer, Heidelberg, 2009.
- [3] E. P. Friedman. The inclusion problem for simple languages. Theoret. Comput. Sci., 1:297–316, 1976.
- [4] P. Frisco and O. H. Ibarra. On stateless multihead finite automata and multihead pushdown automata. In V. Diekert and D. Nowotka, editors, Proc. of DLT 2009, volume 5583 of LNCS, pages 240–251. Springer, Heidelberg, 2009.
- [5] J. H. Gallier. DPDA’s in ’atomic normal form’ and applications to equivalence problems. Theoret. Comput. Sci., 14(2):155–186, 1981.
- [6] J. F. Groote and H. Hüttel. Undecidable equivalences for basic process algebra. Inform. and Comput., 115(2):354–371, 1994.
- [7] M. Harrison. Introduction to Formal Language Theory. Addison-Wesley, Boston, USA, 1978.
- [8] J. E. Hopcroft and J. D. Ullman. Formal languages and their relation to automata. Addison-Wesley, Boston, USA, 1969.
- [9] O. H. Ibarra, J. Karhumäki, and A. Okhotin. On stateless multihead automata: Hierarchies and the emptiness problem. In E. S. Laber, C. Bornstein, L. T. Nogueira, and L. Faria, editors, Proc. of LATIN 2008, volume 4957 of LNCS, pages 94–105. Springer, Heidelberg, 2008.
- [10] A. Korenjak and J. Hopcroft. Simple deterministic languages. In Proc. of SWAT (FOCS), pages 36–46, Berkeley, California, USA, 1966.
- [11] M. Kutrib, H. Messerschmidt, and F. Otto. On stateless deterministic restarting automata. Acta Inform., 47(7):391–412, 2010.
- [12] M. Kutrib, H. Messerschmidt, and F. Otto. On stateless two-pushdown automata and restarting automata. Internat. J. Found. Comput. Sci., 21(5):781–798, 2010.
- [13] S. Lasota and W. Rytter. Faster algorithm for bisimulation equivalence of normed context-free processes. In R. Královič and P. Urzyczyn, editors, Proc. of MFCS 2006, volume 4162 of LNCS, pages 646–657. Springer, Heidelberg, 2006.
- [14] E. Mäkinen. On the inclusion problem for very simple deterministic pushdown automata. J. Autom. Lang. Comb., 6(3):351–357, 2001.
- [15] A. Malcher, K. Meckel, C. Mereghetti, and B. Palano. Descriptional complexity of pushdown store languages. In M. Kutrib, N. Moreira, and R. Reis, editors, Proc. of DCFS 2012, volume 7386 of LNCS, pages 209–221. Springer, Heidelberg, 2012.
- [16] A. Malcher, K. Meckel, C. Mereghetti, and B. Palano. Descriptional complexity of pushdown store languages. IFIG Research Report 1203, Institut für Informatik, Universität Giessen, Germany, 2012.
- [17] A. Meduna, L. Vrábel, and P. Zemek. An infinite hierarchy of language families resulting from stateless pushdown automata with limited pushdown alphabets. In M. Kutrib, N. Moreira, and R. Reis, editors, Proc. of DCFS 2012, volume 7386 of LNCS, pages 236–243. Springer, Heidelberg, 2012.
- [18] B. Nagy, L. Hegedüs, and O. Eğecioğlu. Hierarchy results on stateless multicounter Watson-Crick automata. In J. Cabestany, I. Rojas, and G. Joya, editors, Proc. of IWANN 2011, Part I, volume 6691 of LNCS, pages 465–472. Springer, Heidelberg, 2011.
- [19] A. Salomaa. Formal languages. Academic Press, New York, 1973.
- [20] G. Sénizergues. T(A)=T(B)? In Proc. of ICALP 1999, volume 1644 of LNCS. Springer, Heidelberg, 1999.
- [21] G. Sénizergues. L(A)=L(B)? decidability results from complete formal systems. Theoret. Comput. Sci., 251(1-2):1–166, 2001.
- [22] L. G. Valiant. Decision procedures for families of deterministic pushdown automata. Technical Report CS-RR-001, Department of Computer Science, University of Warwick, Coventry, UK, 1973.
- [23] M. Wakatsuki and E. Tomita. A fast algorithm for checking the inclusion for very simple deterministic pushdown automata. IEICE Trans. Inform. Sys., E76-D:1224–1233, 1993.
- [24] L. Yang, Z. Dang, and O. H. Ibarra. On stateless automata and P systems. Internat. J. Found. Comput. Sci., pages 1259–1276, 2008.