🤖 AI Summary
This study addresses the runtime distribution of probabilistic programs with counters and discrete states (GCP). Building upon probabilistic pushdown automata, we formalize an operational semantics for such programs and rigorously establish, for the first time, that the (sub-)probability generating function of their runtime is algebraic. By characterizing this algebraic function through the roots of its kernel polynomial and leveraging singularity analysis together with the theory of formal power series, we devise a complete algorithm to compute the dominant singularities and radius of convergence. This enables the derivation of precise asymptotic expansions and exponential upper bounds for the runtime distribution. In the single-state subclass, our method achieves theoretical completeness.
📝 Abstract
We present an algebraic method for analyzing probabilistic programs with counters and discrete states, Generalized Constant Probability (GCP) programs. We define the operational semantics of GCP in terms of the runs of a type of probabilistic pushdown automata (pPDAs). We characterize the resulting (sub-)probability generating function (pgf) $Δ(z)$ as an algebraic function, representable via the roots of a kernel polynomial associated with the program. Next, we provide algorithms that, leveraging this information, compute under mild algebraic conditions the dominant singularities and the exact radius of convergence of $Δ(z)$, leading to an exact asymptotic expansion and to exponential bounds for its coefficients. Our approach is sound for GCP programs and complete for the single-state subclass.