I consider a deterministic pushdown automaton.
Given that there are some differences between definitions, here is mine:
- the syntax is given $A = (Q, \Sigma, \Gamma, \Delta, q_0, Z_0, F)$, with $q_0\in Q$ is the initial state, $Z_0\in \Gamma$ is the starting stack symbol, $F\subseteq Q$ is the set of final states, and $\Delta : Q\times \Sigma_{\varepsilon}\times \Gamma \to q\times \Gamma^*$ is the transition function, with $\Sigma_{\varepsilon} = \Sigma \cup \{\varepsilon\}$.
- the semantic is as follow: if $q\in Q$, $Z\in \Gamma$ and $\gamma \in \Gamma$, there is a transition from $(q, Z\gamma)$ to $(q', \beta\gamma)$, reading $a\in \Sigma_{\varepsilon}$, if and only if $(q', \beta) \in \Delta(q, a, Z)$. Meaning: when reading $Z$, we pop it from the stack, and push $\beta$ in the stack. A computation of a word $u = a_1…a_n$ is a sequence of transitions $(q_0, Z_0) \overset{b_1}{\longrightarrow} (q_1, \gamma_1) \overset{b_2}{\longrightarrow} … \overset{b_k}{\longrightarrow} (q_k, \gamma_k)$, with $b_i\in \Sigma_{\varepsilon}$ and $b_1…b_k = u$. The length of the computation is the integer $k$.
$A$ is said to be deterministic if, for any $(q, a, Z)\in Q\times \Sigma \times \Gamma$, $|\Delta(q, a, Z) \cup \Delta(q, \varepsilon, Z)|\leqslant 1$. It is said to be complete if it can read any input word, meaning among other things that there is no infinite cycle labeled by $\varepsilon$.
I am trying to bound the length of a computation of a word $u$ in a complete DPDA. The hard part is to bound the size of the stack, and to bound the length of a computation of $\varepsilon$.
I tried to decompose a computation $(p_0, \gamma_0) \overset{\varepsilon}{\longrightarrow} (p_1, \gamma_1) \overset{\varepsilon}{\longrightarrow} … \overset{\varepsilon}{\longrightarrow} (p_k, \gamma_k)$ considering the indices $0 < i_1 < … < i_\ell$ such that $|\gamma_0| < |\gamma_{i_1}| < … < |\gamma_{i_\ell}|$, but to no avail.
I browsed the book by Sipser (theory of computation) and Hopcroft et al (Introduction to automata theory, languages and computation), but there was nothing about the complexity of a computation.
Unfortunately, the upper bound can be exponential in the size of the automaton. If you consider the two-states automaton defined by:
- $\Gamma = \{Z_0, Z_1, …, Z_N\}$
- $\Delta$ contains the transitions:
- $q_0\overset{\varepsilon,Z_0\mid Z_1Z_0}{\longrightarrow}q_1$
- $q_1\overset{a,Z_0\mid Z_0}{\longrightarrow} q_1$
- for $0<i<N$: $q_1\overset{\varepsilon, Z_i\mid Z_{i+1}Z_{i+1}}{\longrightarrow}q_1$
- $q_1 \overset{\varepsilon,Z_N\mid \varepsilon}{\longrightarrow}q_1$
Then there is a computation of $\varepsilon$ that is of length (roughly) $2^N$: each $Z_i$ is transformed into two $Z_{i+1}$.