Positive Almost-Sure Termination: Complexity and Proof Rules

被引:1
|
作者
Majumdar, Rupak [1 ]
Sathiyanarayana, V. R. [1 ]
机构
[1] Max Planck Inst Software Syst MPI SWS, Paul Ehrlich Str,Bldg G26, D-67663 Kaiserslautern, Germany
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / POPL期
关键词
probabilistic programs; demonic non-determinism; positive almost-sure termination; computational complexity; program reasoning;
D O I
10.1145/3632879
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We study the recursion-theoretic complexity of Positive Almost-Sure Termination (PAST) 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 PAST for our language is complete for the (lightface) co-analytic sets (Pi(1)(1)-complete). This is in contrast to the related notions of Almost-Sure Termination (AST) and Bounded Termination (BAST), both of which are arithmetical (Pi(0)(2) - and Sigma(0)(2)-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 if, and only if, the transformed program is PAST. 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 1/2. For normal form programs, we provide a sound and complete proof rule for PAST. Our proof rule uses transfinite ordinals. We show that reasoning about PAST requires transfinite ordinals up to omega(CK)(1); thus, existing techniques for probabilistic termination based on ranking supermartingales that map program states to reals do not suffice to reason about PAST.
引用
收藏
页数:29
相关论文
共 50 条
  • [1] Proving positive almost-sure termination
    Bournez, O
    Garnier, F
    TERM REWRITING AND APPLICATIONS, PROCEEDINGS, 2005, 3467 : 323 - 337
  • [2] A New Proof Rule for Almost-Sure Termination
    McIver, Annabelle
    Morgan, Carroll
    Kaminski, Benjamin Lucien
    Katoen, Joost-Pieter
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [3] Intersection Types and (Positive) Almost-Sure Termination
    Dal Lago, Ugo
    Faggian, Claudia
    Della Rocca, Simona Ronchi
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5
  • [4] On the Hardness of Almost-Sure Termination
    Kaminski, Benjamin Lucien
    Katoen, Joost-Pieter
    MATHEMATICAL FOUNDATIONS OF COMPUTER SCIENCE 2015, PT I, 2015, 9234 : 307 - 318
  • [5] Almost-Sure Termination by Guarded Refinement
    Gregersen, Simon Oddershede
    Aguirre, Alejandro
    Haselwarter, Philipp G.
    Tassarotti, Joseph
    Birkedal, Lars
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (ICFP): : 203 - 233
  • [6] On the Almost-Sure Termination of Binary Sessions
    Dal Lago, Ugo
    Padovani, Luca
    26TH INTERNATIONAL SYMPOSIUM ON PRINCIPLES AND PRACTICE OF DECLARATIVE PROGRAMMING, PPDP 2024, 2024,
  • [7] New Approaches for Almost-Sure Termination of Probabilistic Programs
    Huang, Mingzhang
    Fu, Hongfei
    Chatterjee, Krishnendu
    PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2018, 2018, 11275 : 181 - 201
  • [8] Modular Verification for Almost-Sure Termination of Probabilistic Programs
    Huang, Mingzhang
    Fu, Hongfei
    Chatterjee, Krishnendu
    Goharshady, Amir Kafshdar
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (OOPSLA):
  • [9] Proving Almost-Sure Termination by Omega-Regular Decomposition
    Chen, Jianhui
    He, Fei
    PROCEEDINGS OF THE 41ST ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '20), 2020, : 869 - 882
  • [10] From Innermost to Full Almost-Sure Termination of Probabilistic Term Rewriting
    Kassing, Jan-Christoph
    Frohn, Florian
    Giesl, Jurgen
    FOUNDATIONS OF SOFTWARE SCIENCE AND COMPUTATION STRUCTURES, PT II, FOSSACS 2024, 2024, 14575 : 206 - 228