Automated Verification of Higher-Order Probabilistic Programs via a Dependent Refinement Type System

被引:0
|
作者
Kura, Satoshi [1 ]
Unno, Hiroshi [2 ]
机构
[1] Waseda Univ, Waseda, Japan
[2] Tohoku Univ, Tohoku, Japan
关键词
dependent refinement type system; higher-order program;
D O I
10.1145/3674662
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Verification of higher-order probabilistic programs is a challenging problem. We present a verification method that supports several quantitative properties of higher-order probabilistic programs. Usually, extending verification methods to handle the quantitative aspects of probabilistic programs often entails extensive modifications to existing tools, reducing compatibility with advanced techniques developed for qualitative verification. In contrast, our approach necessitates only small amounts of modification, facilitating the reuse of existing techniques and implementations. On the theoretical side, we propose a dependent refinement type system for a generalised higher-order fixed point logic (HFL). Combined with continuation-passing style encodings of properties into HFL, our dependent refinement type system enables reasoning about several quantitative properties, including weakest pre-expectations, expected costs, moments of cost, and conditional weakest pre-expectations for higher-order probabilistic programs with continuous distributions and conditioning. The soundness of our approach is proved in a general setting using a framework of categorical semantics so that we don't have to repeat similar proofs for each individual problem. On the empirical side, we implement a type checker for our dependent refinement type system that reduces the problem of type checking to constraint solving. We introduce admissible predicate variables and integrable predicate variables to constrained Horn clauses (CHC) so that we can soundly reason about the least fixed points and samplings from probability distributions. Our implementation demonstrates that existing CHC solvers developed for non-probabilistic programs can be extended to a solver for the extended CHC with only small efforts. We also demonstrate the ability of our type checker to verify various concrete examples.
引用
收藏
页数:30
相关论文
共 50 条
  • [1] Formal Verification of Higher-Order Probabilistic Programs
    Sato, Tetsuya
    Aguirre, Alejandro
    Barthe, Gilles
    Gaboardi, Marco
    Garg, Deepak
    Hsu, Justin
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL):
  • [2] Automated Verification of Higher-Order Functional Programs
    Terauchi, Tachio
    [J]. FUNCTIONAL AND LOGIC PROGRAMMING (FLOPS 2012), 2012, 7294 : 2 - 2
  • [3] Relatively Complete Refinement Type System for Verification of Higher-Order Non-deterministic Programs
    Unno, Hiroshi
    Satake, Yuki
    Terauchi, Tachio
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [4] Refinement of higher-order logic programs
    Colvin, R
    Hayes, I
    Hemer, D
    Strooper, P
    [J]. LOGIC BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 2003, 2664 : 126 - 143
  • [5] VERIFICATION OF PROGRAMS WITH HIGHER-ORDER ARRAYS
    KOWALCZYK, W
    URZYCZYN, P
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1987, 278 : 251 - 258
  • [6] Types and Higher-Order Recursion Schemes for Verification of Higher-Order Programs
    Kobayashi, Naoki
    [J]. ACM SIGPLAN NOTICES, 2009, 44 (01) : 416 - 428
  • [7] A Modal Type Theory of Expected Cost in Higher-Order Probabilistic Programs
    Rajani, Vineet
    Barthe, Gilles
    Garg, Deepak
    [J]. Proceedings of the ACM on Programming Languages, 2024, 8 (OOPSLA2)
  • [8] Semantics of Higher-Order Probabilistic Programs with Conditioning
    Dahlqvist, Fredrik
    Kozen, Dexter
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (04):
  • [9] Modular Verification of Higher-Order Functional Programs
    Sato, Ryosuke
    Kobayashi, Naoki
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS (ESOP 2017): 26TH EUROPEAN SYMPOSIUM ON PROGRAMMING, 2017, 10201 : 831 - 854
  • [10] Temporal Verification of Higher-Order Functional Programs
    Murase, Akihiro
    Terauchi, Tachio
    Kobayashi, Naoki
    Sato, Ryosuke
    Unno, Hiroshi
    [J]. ACM SIGPLAN NOTICES, 2016, 51 (01) : 57 - 68