Positive Almost-Sure Termination -- Complexity and Proof Rules
Abstract
We study the recursion-theoretic complexity of Positive Almost-Sure Termination () in an imperative programming language with rational variables, bounded nondeterministic choice, and discrete probabilistic choice. A program terminates positive almost-surely if, for every scheduler, the program terminates almost-surely and the expected runtime to termination is finite. We show that for our language is complete for the (lightface) co-analytic sets (-complete). This is in contrast to the related notions of Almost-Sure Termination () and Bounded Termination (), both of which are arithmetical ( and complete respectively). Our upper bound implies an effective procedure to reduce reasoning about probabilistic termination to non-probabilistic fair termination in a model with bounded nondeterminism, and to simple program termination in models with unbounded nondeterminism. Our lower bound shows the opposite: for every program with unbounded nondeterministic choice, there is an effectively computable probabilistic program with bounded choice such that the original program is terminating the transformed program is . We show that every program has an effectively computable normal form, in which each probabilistic choice either continues or terminates execution immediately, each with probability . For normal form programs, we provide a sound and complete proof rule for . Our proof rule uses transfinite ordinals. We show that reasoning about requires transfinite ordinals up to ; thus, existing techniques for probabilistic termination based on ranking supermartingales that map program states to reals do not suffice to reason about .
Cite
@article{arxiv.2310.16145,
title = {Positive Almost-Sure Termination -- Complexity and Proof Rules},
author = {Rupak Majumdar and V. R. Sathiyanarayana},
journal= {arXiv preprint arXiv:2310.16145},
year = {2023}
}