Slicing Probabilistic Programs

被引:0
|
作者
Hur, Chung-Kil [1 ]
Nori, Aditya V. [1 ]
Rajamani, Sriram K. [1 ]
Samuel, Selva [1 ]
机构
[1] Seoul Natl Univ, Seoul 151, South Korea
关键词
Probabilistic Programming; Program Slicing; Bayesian Reasoning;
D O I
10.1145/2666356.2594303
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Probabilistic programs use familiar notation of programming languages to specify probabilistic models. Suppose we are interested in estimating the distribution of the return expression r of a probabilistic program P. We are interested in slicing the probabilistic program P and obtaining a simpler program SLI (P) which retains only those parts of P that are relevant to estimating r, and elides those parts of P that are not relevant to estimating r. We desire that the SLI transformation be both correct and efficient. By correct, we mean that P and SLI (P) have identical estimates on r. By efficient, we mean that estimation over SLI (P) be as fast as possible. We show that the usual notion of program slicing, which traverses control and data dependencies backward from the return expression r, is unsatisfactory for probabilistic programs, since it produces incorrect slices on some programs and sub-optimal ones on others. Our key insight is that in addition to the usual notions of control dependence and data dependence that are used to slice non-probabilistic programs, a new kind of dependence called observe dependence arises naturally due to observe statements in probabilistic programs. We propose a new definition of SLI (P) which is both correct and efficient for probabilistic programs, by including observe dependence in addition to control and data dependences for computing slices. We prove correctness mathematically, and we demonstrate efficiency empirically. We show that by applying the SLI transformation as a pre-pass, we can improve the efficiency of probabilistic inference, not only in our own inference tool R2, but also in other systems for performing inference such as Church and Infer. NET.
引用
收藏
页码:133 / 144
页数:12
相关论文
共 50 条
  • [1] Slicing of probabilistic programs based on specifications
    Navarro, Marcelo
    Olmedo, Federico
    SCIENCE OF COMPUTER PROGRAMMING, 2022, 220
  • [2] A Theory of Slicing for Imperative Probabilistic Programs
    Amtoft, Torben
    Banerjee, Anindya
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2020, 42 (02):
  • [3] Precise slicing of concurrent programs An Evaluation of static slicing algorithms for concurrent programs
    Giffhorn, Dennis
    Hammer, Christian
    AUTOMATED SOFTWARE ENGINEERING, 2009, 16 (02) : 197 - 234
  • [4] ON SLICING PROGRAMS WITH JUMP STATEMENTS
    AGRAWAL, H
    SIGPLAN NOTICES, 1994, 29 (06): : 302 - 312
  • [5] Dynamic slicing of concurrent programs
    Goswami, D
    Mall, R
    HIGH PERFORMANCE COMPUTING - HIPC 2000, PROCEEDINGS, 2001, 1970 : 15 - 26
  • [6] Static slicing of reactive programs
    Kulkarni, AR
    Ramesh, S
    THIRD IEEE INTERNATIONAL WORKSHOP ON SOURCE CODE ANALYSIS AND MANIPULATION - PROCEEDINGS, 2003, : 98 - 107
  • [7] Static slicing for pervasive programs
    Lu, Heng
    Chan, W. K.
    Tse, T. H.
    QSIC 2006: SIXTH INTERNATIONAL CONFERENCE ON QUALITY SOFTWARE, PROCEEDINGS, 2006, : 185 - +
  • [8] Slicing Concurrent Constraint Programs
    Falaschi, Moreno
    Gabbrielli, Maurizio
    Olarte, Carlos
    Palamidessi, Catuscia
    LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, LOPSTR 2016, 2017, 10184 : 76 - 93
  • [9] The debug slicing of logic programs
    Szilágyi, Gyöngyi
    Harmath, László
    Gyimóthy, Tibor
    Acta Cybernetica, 2001, 15 (02): : 257 - 278
  • [10] The Debug slicing of logic programs
    Szilágyi, G. (szilagyi@inf.u-szeged.hu), 2001, University of Szeged (15):