Runtime Analysis of Probabilistic Programs with Unbounded Recursion
We study termination time and recurrence time in programs with unbounded recursion, which are either randomized or operate on some statistically quantified inputs. As the underlying formal model for such programs we use probabilistic pushdown automata (pPDA) which are equivalent to probabilistic recursive state machines. We obtain tail bounds for the distribution of termination time for pPDA. We also study the recurrence time for probabilistic recursive programs that are not supposed to terminate (such as system daemons, network servers, etc.). Typically, such programs react to certain requests generated by their environment, and hence operate in finite request-service cycles. We obtain bounds for the frequency of long request-service cycles.
💡 Research Summary
The paper addresses the quantitative analysis of execution times for programs that combine unbounded recursion with probabilistic behavior. To capture such programs, the authors adopt probabilistic push‑down automata (pPDA), a model that extends classical push‑down automata by assigning a probability distribution to each transition. pPDA are shown to be equivalent to probabilistic recursive state machines, thereby linking the work to a broad body of existing research on probabilistic verification.
The study is divided into two main parts. The first part concerns programs that are guaranteed to terminate. The authors define termination time as the number of steps required to reach a configuration with an empty stack starting from an arbitrary initial configuration. By constructing a potential (or “energy”) function that simultaneously accounts for stack depth and transition probabilities, they obtain a super‑martingale over the execution trace. Applying the Azuma–Hoeffding inequality to this super‑martingale yields exponential tail bounds of the form P(T > n) ≤ c·e^{‑λn} for a wide class of pPDA. For transition structures that are not strictly linear, they also derive polynomial tail bounds (P(T > n) ≤ c·n^{‑k}), demonstrating that the technique adapts to various recursion patterns.
The second part focuses on non‑terminating programs such as system daemons or network servers that must run indefinitely. Here the authors introduce the notion of a request‑service cycle: a cycle begins when an external request arrives and ends when the system has completed the corresponding service and returns to a waiting state. They model the length of such cycles as a recurrence (or return) time and construct a “recurrence martingale” that controls stack fluctuations between cycles. Using the same concentration tools, they prove that the probability of a cycle exceeding length n decays exponentially or polynomially, depending on the underlying transition dynamics. This result provides a rigorous guarantee that long service delays are statistically rare.
Methodologically, the paper contributes several technical innovations: (1) a “stack compression” technique that reduces the infinite‑state pPDA to a finite‑state Markov chain suitable for analysis; (2) a systematic way to design potential functions that yield super‑martingales for arbitrary pPDA; (3) the integration of Azuma–Hoeffding concentration bounds with classic Markov‑chain convergence theory to obtain explicit tail estimates; and (4) an extension of the martingale framework to handle recurrence times in non‑terminating settings.
The authors validate their theoretical results with experiments on representative probabilistic recursive algorithms (e.g., randomized quicksort, random‑walk‑based search) and on a simulated server model. Empirical distributions of termination and cycle lengths closely match the derived exponential or polynomial bounds, confirming the practical relevance of the analysis. In the server scenario, the tail bounds enable designers to set quantitative safety margins for response‑time guarantees.
In conclusion, the paper delivers a robust analytical framework for both termination and recurrence times of probabilistic programs with unbounded recursion. By leveraging martingale concentration inequalities within the pPDA formalism, it provides strong, mathematically grounded performance guarantees that can be directly applied in program verification, performance modeling, and reliability engineering. Future work is outlined to extend the approach to multi‑stack systems, concurrent recursion, and real‑time constraints, promising further applicability to complex probabilistic software systems.