Positive Almost-Sure Termination: Complexity and Proof Rules

IF 2.2 Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Rupak Majumdar, V. R. Sathiyanarayana
{"title":"Positive Almost-Sure Termination: Complexity and Proof Rules","authors":"Rupak Majumdar, V. R. Sathiyanarayana","doi":"10.1145/3632879","DOIUrl":null,"url":null,"abstract":"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 (Π11-complete). This is in contrast to the related notions of Almost-Sure Termination (AST) and Bounded Termination (BAST), both of which are arithmetical (Π20- and Σ20-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 ω1CK; thus, existing techniques for probabilistic termination based on ranking supermartingales that map program states to reals do not suffice to reason about PAST.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"55 47","pages":"1089 - 1117"},"PeriodicalIF":2.2000,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the ACM on Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3632879","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

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 (Π11-complete). This is in contrast to the related notions of Almost-Sure Termination (AST) and Bounded Termination (BAST), both of which are arithmetical (Π20- and Σ20-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 ω1CK; thus, existing techniques for probabilistic termination based on ranking supermartingales that map program states to reals do not suffice to reason about PAST.
正几乎确定终止:复杂性与证明规则
我们研究了具有理性变量、有界非确定性选择和离散概率选择的命令式编程语言中 "几乎肯定终止"(PAST)的递归理论复杂性。如果对每个调度程序来说,程序都能几乎肯定地终止,并且终止的预期运行时间是有限的,那么程序就能几乎肯定地终止。我们证明,我们语言的 PAST 对于(光面)共分析集是完整的(Π11-complete)。这与相关的 "几乎确定终止"(AST)和 "有界终止"(BAST)概念截然不同,这两个概念都是算术性的(分别为 Π20- 和 Σ20-完备)。我们的上界意味着一种有效的程序,可以在有界非确定性模型中将概率终止推理简化为非概率公平终止,在无界非确定性模型中将概率终止推理简化为简单程序终止。而我们的下界却恰恰相反:对于每一个具有无界非确定性选择的程序,都存在一个具有有界选择的可有效计算的概率程序,当且仅当转换后的程序是 PAST 时,原始程序是终止的。我们证明,每个程序都有一个可有效计算的正常形式,其中每个概率选择要么继续执行,要么立即终止执行,每个概率为 1/2。对于正常形式程序,我们提供了一个完善的 PAST 证明规则。我们的证明规则使用无穷序。我们证明,推理 PAST 需要ω1CK以内的无穷序数;因此,基于将程序状态映射为实数的排序超马列的现有概率终止技术不足以推理 PAST。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages Engineering-Safety, Risk, Reliability and Quality
CiteScore
5.20
自引率
22.20%
发文量
192
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信