skip to main content
article

A lambda-calculus foundation for universal probabilistic programming

Published:04 September 2016Publication History
Skip Abstract Section

Abstract

We develop the operational semantics of an untyped probabilistic λ-calculus with continuous distributions, and both hard and soft constraints,as a foundation for universal probabilistic programming languages such as Church, Anglican, and Venture. Our first contribution is to adapt the classic operational semantics of λ-calculus to a continuous setting via creating a measure space on terms and defining step-indexed approximations. We prove equivalence of big-step and small-step formulations of this distribution-based semantics. To move closer to inference techniques, we also define the sampling-based semantics of a term as a function from a trace of random samples to a value. We show that the distribution induced by integration over the space of traces equals the distribution-based semantics. Our second contribution is to formalize the implementation technique of trace Markov chain Monte Carlo (MCMC) for our calculus and to show its correctness. A key step is defining sufficient conditions for the distribution induced by trace MCMC to converge to the distribution-based semantics. To the best of our knowledge, this is the first rigorous correctness proof for trace MCMC for a higher-order functional language, or for a language with soft constraints.

References

  1. S. Bhat, J. Borgström, A. D. Gordon, and C. V. Russo. Deriving probability density functions from probabilistic functional programs. In N. Piterman and S. A. Smolka, editors, Proceedings of TACAS 2013, volume 7795 of LNCS, pages 508–522. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P. Billingsley. Probability and Measure. Wiley-Interscience, third edition, 1995.Google ScholarGoogle Scholar
  3. A. Bizjak and L. Birkedal. Step-indexed logical relations for probability. In A. M. Pitts, editor, Proceedings of FoSSaCS 2015, volume 9034 of LNCS, pages 279–294. Springer, 2015.Google ScholarGoogle Scholar
  4. J. Borgström, U. Dal Lago, A. D. Gordon, and M. Szymczak. A lambdacalculus foundation for universal probabilistic programming (long version). CoRR, abs/1512.08990, 2015.Google ScholarGoogle Scholar
  5. P. Cousot and M. Monerau. Probabilistic abstract interpretation. In Proceedings of ESOP 2012, volume 7211 of LNCS, pages 166–190. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. V. Danos and T. Ehrhard. Probabilistic coherence spaces as a model of higher-order probabilistic computation. Information and Computation, 209(6):966–991, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. V. Danos and R. Harmer. Probabilistic game semantics. ACM Transactions on Computational Logic, 3(3):359–382, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Ehrhard, C. Tasson, and M. Pagani. Probabilistic coherence spaces are fully abstract for probabilistic PCF. In Proceedings of POPL 2014, pages 309–320. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. S. Goldwasser and S. Micali. Probabilistic encryption. Journal of Computer and System Sciences, 28(2):270–299, 1984.Google ScholarGoogle ScholarCross RefCross Ref
  10. N. D. Goodman. The principles and practice of probabilistic programming. In Proceedings of POPL 2013, pages 399–402. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. N. D. Goodman and A. Stuhlmüller. The design and implementation of probabilistic programming languages. http://dippl.org, 2014.Google ScholarGoogle Scholar
  12. N. D. Goodman and J. B. Tenenbaum. Probabilistic models of cognition. http://probmods.org, 2014.Google ScholarGoogle Scholar
  13. N. D. Goodman, V. K. Mansinghka, D. M. Roy, K. Bonawitz, and J. B. Tenenbaum. Church: a language for generative models. In D. A. McAllester and P. Myllymäki, editors, Proceedings of UAI 2008, pages 220–229. AUAI Press, 2008.Google ScholarGoogle Scholar
  14. A. D. Gordon, T. A. Henzinger, A. V. Nori, and S. K. Rajamani. Probabilistic programming. In M. B. Dwyer and J. Herbsleb, editors, Proceedings of FOSE 2014, pages 167–181. ACM, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. W. K. Hastings. Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 57:97–109, 1970.Google ScholarGoogle ScholarCross RefCross Ref
  16. M. D. Homan and A. Gelman. The no-u-turn sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15:1593–1623, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Hur, A. V. Nori, S. K. Rajamani, and S. Samuel. A provably correct sampler for probabilistic programs. In P. Harsha and G. Ramalingam, editors, Proceedings of FSTTCS 2015, volume 45 of LIPIcs, pages 475– 488. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2015.Google ScholarGoogle Scholar
  18. C. Jones. Probabilistic Non-determinism. PhD thesis, University of Edinburgh, 1990. Available as Technical Report CST-6390. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Jones and G. D. Plotkin. A probabilistic powerdomain of evaluations. In Proceedings of LICS 1989, pages 186–195. ACM, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. O. Kiselyov. Problems of the lightweight implementation of probabilistic programming, 2016. Poster at PPS’2016 workshop. D. Kozen. Semantics of probabilistic programs. In Proceedings of FOCS 1979, pages 101–114. IEEE Computer Society, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. C. D. Manning and H. Schütze. Foundations of statistical natural language processing. MIT Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. V. K. Mansinghka, D. Selsam, and Y. N. Perov. Venture: a higherorder probabilistic programming platform with programmable inference. CoRR, abs/1404.0099, 2014.Google ScholarGoogle Scholar
  23. N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller, and E. Teller. Equations of state calculations by fast computing machines. Journal of Chemical Physics, 21(6):1087–1092, 1953.Google ScholarGoogle ScholarCross RefCross Ref
  24. A. V. Nori, C. Hur, S. K. Rajamani, and S. Samuel. R2: an efficient MCMC sampler for probabilistic programs. In C. E. Brodley and P. Stone, editors, Proceedings of AAAI 2014, pages 2476–2482. AAAI Press, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. Panangaden. The category of Markov kernels. Electronic Notes in Theoretical Computer Science, 22:171–187, 1999. In proceedings of PROBMIV 1998.Google ScholarGoogle ScholarCross RefCross Ref
  26. P. Panangaden. Labelled Markov Processes. Imperial College Press, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. Park, F. Pfenning, and S. Thrun. A probabilistic language based upon sampling functions. ACM Transactions on Programming Languages and Systems, 31:1, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Pearl. Probabilistic reasoning in intelligent systems: networks of plausible inference. Morgan Kaufmann, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. N. Ramsey and A. Pfeffer. Stochastic lambda calculus and monads of probability distributions. In Proceedings of POPL 2002, pages 154–165, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. S. J. Russell. Unifying logic and probability. Communications of the ACM, 58(7):88–97, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Scibior, Z. Ghahramani, and A. D. Gordon. Practical probabilistic programming with monads. In B. Lippmeier, editor, Proceedings of Haskell 2015, pages 165–176. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. S. Staton, H. Yang, C. Heunen, O. Kammar, and F. Wood. Semantics for probabilistic programming: higher-order functions, continuous distributions, and soft constraints. CoRR, abs/1601.04943, 2016.Google ScholarGoogle Scholar
  33. S. Thrun. Robotic mapping: A survey. In G. Lakemeyer and B. Nebel, editors, Exploring artificial intelligence in the new millennium, pages 1–35. Morgan Kaufmann, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. L. Tierney. Markov chains for exploring posterior distributions. The Annals of Statistics, 22(4):1701–1728, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  35. D. Tolpin, J. van de Meent, and F. Wood. Probabilistic programming in Anglican. In A. Bifet, M. May, B. Zadrozny, R. Gavaldà, D. Pedreschi, F. Bonchi, J. S. Cardoso, and M. Spiliopoulou, editors, Proceedings of ECML PKDD 2015, Part III, volume 9286 of LNCS, pages 308–311. Springer, 2015.Google ScholarGoogle Scholar
  36. N. Toronto, J. McCarthy, and D. V. Horn. Running probabilistic programs backwards. In J. Vitek, editor, Proceedings of ESOP 2015, volume 9032 of LNCS, pages 53–79. Springer, 2015.Google ScholarGoogle Scholar
  37. D. Wingate, A. Stuhlmüller, and N. D. Goodman. Lightweight implementations of probabilistic programming languages via transformational compilation. In G. J. Gordon and D. Dunson, editors, Proceedings of AISTATS 2011, volume 15 of JMLR: Workshop and Conference Proceedings, pages 770–778. JMLR, 2011.Google ScholarGoogle Scholar

Index Terms

  1. A lambda-calculus foundation for universal probabilistic programming

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!