Abstract
Automatically establishing that a probabilistic program satisfies some property ϕ is a challenging problem. While a sampling-based approach—which involves running the program repeatedly—can suggest that ϕ holds, to establish that the program satisfies ϕ, analysis techniques must be used. Despite recent successes, probabilistic static analyses are still more difficult to design and implement than their deterministic counterparts. This paper presents a framework, called PMAF, for designing, implementing, and proving the correctness of static analyses of probabilistic programs with challenging features such as recursion, unstructured control-flow, divergence, nondeterminism, and continuous distributions. PMAF introduces pre-Markov algebras to factor out common parts of different analyses. To perform interprocedural analysis and to create procedure summaries, PMAF extends ideas from non-probabilistic interprocedural dataflow analysis to the probabilistic setting. One novelty is that PMAF is based on a semantics formulated in terms of a control-flow hyper-graph for each procedure, rather than a standard control-flow graph. To evaluate its effectiveness, PMAF has been used to reformulate and implement existing intraprocedural analyses for Bayesian-inference and the Markov decision problem, by creating corresponding interprocedural analyses. Additionally, PMAF has been used to implement a new interprocedural linear expectation-invariant analysis. Experiments with benchmark programs for the three analyses demonstrate that the approach is practical.
Supplemental Material
- S. Abramsky and A. Jung. 1994. Domain Theory. In Handbook of Logic in Computer Science. Oxford University Press Oxford, UK. Google Scholar
Digital Library
- R. I. Bahar, E. A. Frohm, C. M. Gaona, G. D. Hachtel, E. Macii, A. Pardo, and F. Somenzi. 1997. Algebraic Decision Diagrams and their Applications. Formal Methods in System Design 10 (April 1997). Issue 2. Google Scholar
Digital Library
- T. Ball, A. Podelski, and S. K. Rajamani. 2001. Boolean and Cartesian Abstraction for Model Checking C Programs. In Tools and Algs. for the Construct. and Anal. of Syst. (TACAS'01). Google Scholar
Digital Library
- G. Barthe, T. Espitau, L. M. Ferrer Fioriti, and J. Hsu. 2016. Synthesizing Probabilistic Invariants via Doob's Decomposition. In Computer Aided Verif. (CAV'16).Google Scholar
- G. Barthe, T. Espitau, M. Gaboardi, B. Gregoire, J. Hsu, and P.-Y. Strub. 2016. A Program Logic for Probabilistic Programs. Available at justinh.su/files/papers/ellora.pdf.Google Scholar
- G. Barthe, B. Gregoire, and S. Zanella Beguelin. 2009. Formal Certification of Code-based Cryptographic Proofs. In Princ. of Prog. Lang. (POPL'09). Google Scholar
Digital Library
- P. Billingsley. 2012. Probability and Measure. John Wiley & Sons, Inc.Google Scholar
- J. Borgstrom, U. D. Lago, A. D. Gordon, and M. Szymczak. 2016. A Lambda-Calculus Foundation for Universal Probabilistic Programming. In Int. Conf. on Functional Programming (ICFP'16). Google Scholar
Digital Library
- F. Bourdoncle. 1993. Efficient Chaotic Iteration Strategies With Widenings. In Formal Methods in Prog. and Their Applications.Google Scholar
- T. Brazdil, S. Kiefer, and A. Kucera. 2014. Efficient Analysis of Probabilistic Programs with an Unbounded Counter. J. ACM 61 (November 2014). Issue 6. Google Scholar
Digital Library
- T. Brazdil, S. Kiefer, A. Kucera, and I. H. Varekova. 2015. Runtime Analysis of Probabilistic Programs with Unbounded Recursion. J. Comput. Syst. Sci. 81 (February 2015). Issue 1. Google Scholar
Digital Library
- B. Carpenter, A. Gelman, M. D. Hoffman, D. Lee, B. Goodrich, M. Betancourt, M. Brubaker, J. Guo, P. Li, and A. Riddell. 2017. Stan: A Probabilistic Programming Language. J. Statistical Softw. 76 (2017). Issue 1.Google Scholar
- A. Chakarov and S. Sankaranarayanan. 2013. Probabilistic Program Analysis with Martingales. In Computer Aided Verif. (CAV'13). Google Scholar
Digital Library
- A. Chakarov and S. Sankaranarayanan. 2014. Expectation Invariants for Probabilistic Program Loops as Fixed Points. In Static Analysis Symp. (SAS'14).Google Scholar
- K. Chatterjee, H. Fu, and A. K. Goharshady. 2016. Termination Analysis of Probabilistic Programs Through Positivstellensatz's. In Computer Aided Verif. (CAV'16).Google Scholar
- K. Chatterjee, H. Fu, P. Novotny, and R. Hasheminezhad. 2016. Algorithmic Analysis of Qualitative and Quantitative Termination Problems for Affine Probabilistic Programs. In Princ. of Prog. Lang. (POPL'16). Google Scholar
Digital Library
- K. Chatterjee, P. Novotny, and D. ?ikelic. 2017. Stochastic Invariants for Probabilistic Termination. In Princ. of Prog. Lang. (POPL'17). Google Scholar
Digital Library
- G. Claret, S. K. Rajamani, A. V. Nori, A. D. Gordon, and J. Borgstrom. 2013. Bayesian Inference using Data Flow Analysis. In Found. of Softw. Eng. (FSE'13). Google Scholar
Digital Library
- S. Conchon, J.-C. Filliatre, and J. Signoles. 2007. Designing a Generic Graph Library Using ML Functors. In Trends in Functional Programming.Google Scholar
- P. Cousot. 1981. Semantic Foundations of Program Analysis. In Program Flow Analysis: Theory and Applications. Prentice-Hall.Google Scholar
- P. Cousot and R. Cousot. 1977. Abstract Interpretation: A Unified Latice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Princ. of Prog. Lang. (POPL'77). Google Scholar
Digital Library
- P. Cousot and R. Cousot. 1978. Static Determination of Dynamic Properties of Recursive Procedures. In Formal Descriptions of Programming Concepts, (IFIP WG 2.2, St. Andrews, Canada, August 1977). North-Holland.Google Scholar
- P. Cousot and R. Cousot. 1979. Systematic Design of Program Analysis Frameworks. In Princ. of Prog. Lang. (POPL'79). Google Scholar
Digital Library
- P. Cousot and N. Halbwachs. 1978. Automatic Discovery of Linear Constraints Among Variables of a Program. In Princ. of Prog. Lang. (POPL'78). Google Scholar
Digital Library
- P. Cousot and M. Monerau. 2012. Probabilistic Abstract Interpretation. In European Symp. on Programming (ESOP'12). Google Scholar
Digital Library
- E. Darulova and V. Kuncak. 2014. Sound Compilation of Reals. In Princ. of Prog. Lang. (POPL'14). Google Scholar
Digital Library
- J. I. den Hartog and E. P. de Vink. 1999. Mixing Up Nondeterminism and Probability: a preliminary report. Electr. Notes Theor. Comp. Sci. 22 (1999).Google Scholar
- E. W. Dijkstra. 1997. A Discipline of Programming. Prentice Hall PTR Upper Saddle River. Google Scholar
Digital Library
- K. Etessami, D.Wojtczak, and M. Yannakakis. 2008. Recursive Stochastic Games with Positive Rewards. In Int. Colloq. on Automata, Langs., and Programming (ICALP'08). Google Scholar
Digital Library
- K. Etessami and M. Yannakakis. 2005. Recursive Markov Chains, Stochastic Grammars, and Monotone Systems of Nonlinear Equations. In Symp. on Theor. Aspects of Comp. Sci. (STACS'05). Google Scholar
Digital Library
- K. Etessami and M. Yannakakis. 2015. Recursive Markov Decision Processes and Recursive Stochastic Games. J. ACM 62 (May 2015). Issue 2. Google Scholar
Digital Library
- A. Farzan and Z. Kincaid. 2015. Compositional Recurrence Analysis. In Formal Methods in Compiter-Aided Design (FMCAD'15). Google Scholar
Digital Library
- L. M. Ferrer Fioriti and H. Hermanns. 2015. Probabilistic Termination: Soundness, Completeness, and Compositionality. In Princ. of Prog. Lang. (POPL'15). Google Scholar
Digital Library
- R. W. Floyd. 1967. Assigning Meanings to Programs. In Proc. AMS Symposium in Appl. Math.Google Scholar
Cross Ref
- G. Gallo, G. Longo, S. Pallottino, and S. Nguyen. 1993. Directed Hypergraphs and Applications. Disc. Appl. Math. 42 (April 1993). Issue 2. Google Scholar
Digital Library
- T. Gehr, S. Misailovic, and M. Vechev. 2016. PSI: Exact Symbolic Inference for Probabilistic Programs. In Computer Aided Verif. (CAV'16).Google Scholar
- Z. Ghahramani. 2015. Probabilistic machine learning and artificial intelligence. Nature (2015).Google Scholar
- N. D. Goodman, V. K. Mansinghka, D. M. Roy, and J. B. Tenenbaum. 2008. Church: a language for generative models. In Uncertainty in Artif. Intelligence. Google Scholar
Digital Library
- A. D. Gordon, T. A. Henzinger, A. V. Nori, and S. K. Rajamani. 2014. Probabilistic Programming. In Future of Softw. Eng. (FOSE'14). Google Scholar
Digital Library
- S. Graf and H. Saidi. 1997. Construction of Abstract State Graphs with PVS. In Computer Aided Verif. (CAV'97). Google Scholar
Digital Library
- C. A. Gunter, P. D. Mosses, and D. S. Scott. 1989. Semantic Domains and Denotational Semantics. Technical Report. University of Pennsylvania Department of Computer and Information Science.Google Scholar
- N. Halbwachs. 1979. Determination automatique de relations lineaires verifiees par les variables d'un programme. Ph.D. Dissertation. Univ. of Grenoble.Google Scholar
- C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Commun. ACM 12 (October 1969). Issue 10. Google Scholar
Digital Library
- S. Horwitz, T. Reps, and M. Sagiv. 1995. Demand Interprocedural Dataflow Analysis. In Found. of Softw. Eng. (FSE'95). Google Scholar
Digital Library
- B. Jeannet and A. Mine. 2009. Apron: A Library of Numerical Abstract Domains for Static Analysis. In Computer Aided Verif. (CAV'09). Google Scholar
Digital Library
- C. Jones. 1989. Probabilistic Non-determinism. Ph.D. Dissertation. University of Edinburgh Edinburgh. Google Scholar
Digital Library
- C. Jones and G. Plotkin. 1989. A Probabilistic Powerdomain of Evaluations. In Logic in Computer Science (LICS'89). Google Scholar
Digital Library
- B. L. Kaminski, J.-P. Katoen, C. Matheja, and F. Olmedo. 2016. Weakest Precondition Reasoning for Expected Run--Times of Probabilistic Programs. In European Symp. on Programming (ESOP'16). Google Scholar
Digital Library
- J.-P. Katoen, A. K. McIver, L. A. Meinicke, and C. C. Morgan. 2010. Linear-Invariant Generation for Probabilistic Programs: Automated Support for Proof-Based Methods. In Static Analysis Symp. (SAS'10). Google Scholar
Digital Library
- M. Kattenbelt, M. Kwiatkowska, G. Norman, and D. Parker. 2009. Abstraction Refinement for Probabilistic Software. In Verif., Model Checking, and Abs. Interp. (VMCAI'09). Google Scholar
Digital Library
- G. A. Kildall. 1973. A Unified Approach to Global Program Optimization. In Princ. of Prog. Lang. (POPL'73). Google Scholar
Digital Library
- J. Knoop and B. Steffen. 1992. The Interprocedural Coincidence Theorem. In Comp. Construct. (CC'92). Google Scholar
Digital Library
- D. E. Knuth. 1977. A Generalization of Dijkstra's Algorithm. Inf. Proc. Let. 6 (February 1977). Issue 1.Google Scholar
Cross Ref
- S. Kok, M. Sumner, M. Richardson, P. Singla, H. Poon, D. Lowd, J. Wang, and P. Domingos. 2007. The Alchemy System for Statistical Relational AI. Technical Report. University of Washington.Google Scholar
- D. Kozen. 1981. Semantics of Probabilistic Programs. J. Comput. Syst. Sci. 22 (June 1981). Issue 3.Google Scholar
- D. Kozen. 1985. A Probabilistic PDL. J. Comput. Syst. Sci. 30 (April 1985). Issue 2.Google Scholar
- A. Lal, T. Reps, and G. Balakrishnan. 2005. Extended Weighted Pushdown Systems. In Computer Aided Verif. (CAV'05). Google Scholar
Digital Library
- Z. Li and J. Eisner. 2009. First- and Second-Order Expectation Semirings with Applications to Minimum-Risk Training on Translation Forests. In Conference on Empirical Methods in Natural Language Processing (EMNLP'09). Google Scholar
Digital Library
- A. K. McIver and C. C. Morgan. 2001. Partial correctness for probabilistic demonic programs. Theor. Comp. Sci. 266 (September 2001). Issue 1. Google Scholar
Digital Library
- A. K. McIver and C. C. Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer Science+Business Media, Inc. Google Scholar
Digital Library
- B. Milch, B. Marthi, S. Russell, D. Sontag, D. L. Ong, and A. Kolobov. 2005. BLOG: Probabilistic Models with Unknown Objects. In Int. Joint Conf. on Artif. Intelligence (IJCAI'05). Google Scholar
Digital Library
- A. Mine. 2006. Symbolic Methods to Enhance the Precision of Numerical Abstract Domains. In Verif., Model Checking, and Abs. Interp. (VMCAI'06). Google Scholar
Digital Library
- T. Minka, J. M. Winn, J. P. Guiver, S. Webster, Y. Zaykov, B. Yangel, A. Spengler, and J. Bronskill. 2014. Infer.NET 2.6. Microsoft Research Cambridge. research.microsoft.com/infernet.Google Scholar
- M. Mislove. 2000. Nondeterminism and Probabilistic Choice: Obeying the Laws. In Concurrency Theory. Google Scholar
Digital Library
- M. Mislove, J. Ouaknine, and J. Worrell. 2004. Axioms for Probability and Nondeterminism. Electr. Notes Theor. Comp. Sci. 96 (June 2004).Google Scholar
- U. Moncke and R. Wilhelm. 1991. Grammar Flow Analysis. In Attribute Grammars, Applications and Systems, (Int. Summer School SAGA). Google Scholar
Digital Library
- D. Monniaux. 2000. Abstract Interpretation of Probabilistic Semantics. In Static Analysis Symp. (SAS'00). Google Scholar
Digital Library
- D. Monniaux. 2001. Backwards Abstract Interpretation of Probabilistic Programs. In European Symp. on Programming (ESOP'01). Google Scholar
Digital Library
- D. Monniaux. 2003. Abstract Interpretation of Programs as Markov Decision Processes. In Static Analysis Symp. (SAS'03). Google Scholar
Digital Library
- M. Mottl. 2017. Lacaml - Linear Algebra for OCaml. Available at github.com/mmottl/lacaml.Google Scholar
- M. Muller-Olm and H. Seidl. 2004. Precise Interprocedural Analysis through Linear Algebra. In Princ. of Prog. Lang. (POPL'04). Google Scholar
Digital Library
- F. Olmedo, B. L. Kaminski, J.-P. Katoen, and C. Matheja. 2016. Reasoning about Recursive Probabilistic Programs. In Logic in Computer Science (LICS'16). Google Scholar
Digital Library
- P. Panangaden. 1999. The Category of Markov Kernels. Electr. Notes Theor. Comp. Sci. 22 (1999).Google Scholar
- A. Pfeffer. 2005. The Design and Implementation of IBAL: A General-Purpose Probabilistic Language. Technical Report. Harvard Computer Science Group.Google Scholar
- M. L. Puterman. 1994. Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons, Inc. Google Scholar
Digital Library
- G. Ramalingam. 1996. Bounded Incremental Computation. Springer-Verlag. Google Scholar
Digital Library
- T. Reps, S. Horwitz, and M. Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Princ. of Prog. Lang. (POPL'95). Google Scholar
Digital Library
- M. Sagiv, T. Reps, and S. Horwitz. 1996. Precise Interprocedural Dataflow Analysis with Applications to Constant Propagation. Theor. Comp. Sci. 167 (1996). Issue 1. Google Scholar
Digital Library
- S. Sankaranarayanan, A. Chakarov, and S. Gulwani. 2013. Static Analysis for Probabilistic Programs: Inferring Whole Program Properties from Finitely Many Paths. In Prog. Lang. Design and Impl. (PLDI'13). Google Scholar
Digital Library
- M. Sharir and A. Pnueli. 1981. Two Approaches to Interprocedural Data Flow Analysis. In Program Flow Analysis: Theory and Applications. Prentice-Hall.Google Scholar
- R. E. Tarjan. 1981. A Unified Approach to Path Problems. J. ACM 28 (July 1981). Issue 3. Google Scholar
Digital Library
- R. Tix, K. Keimel, and G. Plotkin. 2009. Semantic Domains for Combining Probability and Non-Determinism. Electr. Notes Theor. Comp. Sci. 222 (February 2009). Google Scholar
Digital Library
- D. Wang, J. Hoffmann, and T. Reps. 2018. A Denotational Semantics for Nondeterminism in Probabilistic Programs. Available at www.cs.cmu.edu/~diw3/papers/WangHR18.pdf.Google Scholar
- D. Wojtczak and K. Etessami. 2017. PReMo s Probabilistic Recursive Models analyzer. Available at groups.inf.ed.ac.uk/premo/.Google Scholar
Index Terms
PMAF: an algebraic framework for static analysis of probabilistic programs
Recommendations
PMAF: an algebraic framework for static analysis of probabilistic programs
PLDI 2018: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and ImplementationAutomatically establishing that a probabilistic program satisfies some property ϕ is a challenging problem. While a sampling-based approach—which involves running the program repeatedly—can suggest that ϕ holds, to establish that the program satisfies ϕ,...
Interprocedural pointer alias analysis
We present practical approximation methods for computing and representing interprocedural aliases for a program written in a language that includes pointers, reference parameters, and recursion. We present the following contributions: (1) a framework ...
Tracking pointers with path and context sensitivity for bug detection in C programs
This paper proposes a pointer alias analysis for automatic error detection. State-of-the-art pointer alias analyses are either too slow or too imprecise for finding errors in real-life programs. We propose a hybrid pointer analysis that tracks actively ...







Comments