Almost-Sure Termination by Guarded Refinement

被引:1
|
作者
Gregersen, Simon Oddershede [1 ]
Aguirre, Alejandro [2 ]
Haselwarter, Philipp G. [2 ]
Tassarotti, Joseph [1 ]
Birkedal, Lars [2 ]
机构
[1] NYU, New York, NY 10003 USA
[2] Aarhus Univ, Aarhus, Denmark
基金
美国国家科学基金会;
关键词
almost-sure termination; probabilistic coupling; Markov chains; SEPARATION LOGIC; CONCURRENT; COMPLEXITY;
D O I
10.1145/3674632
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Almost-sure termination is an important correctness property for probabilistic programs, and a number of program logics have been developed for establishing it. However, these logics have mostly been developed for first-order programs written in languages with specific syntactic patterns for looping. In this paper, we consider almost-sure termination for higher-order probabilistic programs with general references. This combination of features allows for recursion and looping to be encoded through a variety of patterns. Therefore, rather than developing proof rules for reasoning about particular recursion patterns, we instead propose an approach based on proving refinement between a higher-order program and a simpler probabilistic model, in such a way that the refinement preserves termination behavior. By proving a refinement, almost-sure termination behavior of the program can then be established by analyzing the simpler model. We present this approach in the form of Caliper, a higher-order separation logic for proving terminationpreserving refinements. Caliper uses probabilistic couplings to carry out relational reasoning between a program and a model. To handle the range of recursion patterns found in higher-order programs, Caliper uses guarded recursion, in particular the principle of L & ouml;b induction. A technical novelty is that Caliper does not require the use of transfinite step indexing or other technical restrictions found in prior work on guarded recursion for termination-preservation refinement. We demonstrate the flexibility of this approach by proving almost-sure termination of several examples, including first-order loop constructs, a random list generator, treaps, and a sampler for Galton-Watson trees that uses higher-order store. All the results have been mechanized in the Coq proof assistant.
引用
收藏
页码:203 / 233
页数:31
相关论文
共 50 条
  • [1] 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
  • [2] Proving positive almost-sure termination
    Bournez, O
    Garnier, F
    TERM REWRITING AND APPLICATIONS, PROCEEDINGS, 2005, 3467 : 323 - 337
  • [3] 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,
  • [4] 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
  • [5] 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
  • [6] 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
  • [7] 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):
  • [8] Positive Almost-Sure Termination: Complexity and Proof Rules
    Majumdar, Rupak
    Sathiyanarayana, V. R.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (POPL):
  • [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