Hostname: page-component-cd9895bd7-jkksz Total loading time: 0 Render date: 2024-12-27T10:31:47.845Z Has data issue: false hasContentIssue false

Implementing a Library for Probabilistic Programming Using Non-strict Non-determinism

Published online by Cambridge University Press:  02 July 2019

SANDRA DYLUS*
Affiliation:
University of Kiel, Kiel, Germany (e-mail: sad@informatik.uni-kiel.de)
JAN CHRISTIANSEN
Affiliation:
Flensburg University of Applied Sciences, Flensburg, Germany (e-mail: jan.christiansen@hs-flensburg.de)
FINN TEEGEN
Affiliation:
University of Kiel, Kiel, Germany (e-mail: fte@informatik.uni-kiel.de)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

This paper presents PFLP, a library for probabilistic programming in the functional logic programming language Curry. It demonstrates how the concepts of a functional logic programming language support the implementation of a library for probabilistic programming. In fact, the paradigms of functional logic and probabilistic programming are closely connected. That is, language characteristics from one area exist in the other and vice versa. For example, the concepts of non-deterministic choice and call-time choice as known from functional logic programming are related to and coincide with stochastic memoization and probabilistic choice in probabilistic programming, respectively. We will further see that an implementation based on the concepts of functional logic programming can have benefits with respect to performance compared to a standard list-based implementation and can even compete with full-blown probabilistic programming languages, which we illustrate by several benchmarks.

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
© The Author(s), 2019. Published by Cambridge University Press

Footnotes

*

This is an extended version of a paper presented at the International Symposium on Practical Aspects of Declarative Languages (PADL 2018), invited as a rapid communication in TPLP. The authors acknowledge the assistance of the conference program chairs Nicola Leone and Kevin Hamlen. We are thankful for fruitful discussions with Michael Hanus as well as suggestions of Jan Bracker and Falco Nogatz. Finally, we are thankful for the comments of the anonymous reviewers to improve the readability of this paper.

References

Antoy, S. 2005. Evaluation strategies for functional logic programming. Journal of Symbolic Computation 40, 1 875903.CrossRefGoogle Scholar
Antoy, S. and Hanus, M. 2010. Functional logic programming. Communications of the ACM 53, 4, 7485.10.1145/1721654.1721675CrossRefGoogle Scholar
Braßel, B. 2009. A technique to build debugging tools for lazy functional logic languages. Electronic Notes in Theoretical Computer Science 246, 6376.Google Scholar
Braßel, B., Hanus, M. and Huch, F. 2004. Encapsulating non-determinism in functional logic computations. Journal of Functional and Logic Programming 2004, 6, Special Issue 1.Google Scholar
Braßel, B., Hanus, M., Peemöller, B. and Reck, F. 2011. KiCS2: A New Compiler from Curry to Haskell. In Proceedings of the 20th International Conference on Functional and Constraint Logic Programming, Kuchen, H., Ed. WFLP ’11. Springer-Verlag, Odense, Denmark, 118.Google Scholar
Christiansen, J. and Fischer, S. 2008. EasyCheck – Test Data for Free. In Proceedings of the International Symposium on Functional and Logic Programming. Springer, Berlin, Heidelberg, 322336.10.1007/978-3-540-78969-7_23CrossRefGoogle Scholar
Christiansen, J., Seidel, D. and Voigtl¨ander, J. 2010. Free Theorems For Functional Logic Programs. In Proceedings of the 4th ACM SIGPLAN Workshop on Programming Languages Meets Program Verification. ACM, New York, NY, USA, 3948.Google Scholar
Christiansen, J., Seidel, D. and Voigtl¨ander, J. 2011. An Adequate, Denotational, Functional-Style Semantics for Typed FlatCurry. In Proceedings of the 19th International Workshop on Functional and (Constraint) Logic Programming. LNCS. Springer-Verlag, Madrid, Spain.Google Scholar
De Raedt, L. and Kimmig, A. 2013. Probabilistic programming concepts. arXiv:1312.4328 (preprint).Google Scholar
Dylus, S., Christiansen, J. and Teegen, F. 2018. Probabilistic Functional Logic Programming. In Practical Aspects of Declarative Languages. PADL ’18. Springer International Publishing, Los Angeles, CA, USA, 319.CrossRefGoogle Scholar
Erwig, M. and Kollmansberger, S. 2006. Functional pearls: Probabilistic functional programming in Haskell. Journal of Functional Programming 16, 1, 2134.CrossRefGoogle Scholar
Fischer, S., Kiselyov, O. and Shan, C.-c. 2009. Purely Functional Lazy Non-deterministic Programming. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming. ACM, New York, NY, USA, 1122.Google Scholar
Goodman, N. D., Mansinghka, V. K., Roy, D. M., Bonawitz, K. and Tenenbaum, J. B. 2008. Church: A Language for Generative Models. CoRR, 220–229.Google Scholar
Goodman, N. D. and Stuhlmüller, A. 2014. The Design and Implementation of Probabilistic Programming Languages. http://dippl.org.Google Scholar
Gordon, A. D., Henzinger, T. A., Nori, A. V. and Rajamani, S. K. 2014. Probabilistic Programming. In Proceedings of the on Future of Software Engineering. FOSE ‘14. ACM, Hyderabad, India, 167181.Google Scholar
Hanus, M. 2017. PAKCS: The Portland Aachen Kiel Curry System. Published: Available at http://www.informatik.uni-kiel.de/~pakcs/.Google Scholar
Kimmig, A., Demoen, B., De Raedt, L., Costa, V. S. and Rocha, R. 2011. On the implementation of the probabilistic logic programming language ProbLog. Theory and Practice of Logic Programming 11, 235262.CrossRefGoogle Scholar
Kiselyov, O. and Shan, C.-c. 2009. Embedded probabilistic programming. In Domain-Specific Languages. Springer, Berlin, Heidelberg, 360384.CrossRefGoogle Scholar
McCallum, A., Schultz, K. and Singh, S. 2009. FACTORIE: Probabilistic Programming via Imperatively Defined Factor Graphs. In Proceedings of the International Conference on Neural Information Processing Systems. Vancouver, British Columbia, Canada.Google Scholar
Nampally, A. and Ramakrishnan, C. R. 2015. Constraint-Based Inference in Probabilistic Logic Programs. In Workshop on Probabilistic Programming, 46–56.Google Scholar
Nogatz, F., Frühwirth, T. and Seipel, D. 2018. CHR.js: A CHR implementation in JavaScript. In Rules and Reasoning. Springer, 131146.CrossRefGoogle Scholar
Paige, B. and Wood, F. 2014. A Compilation Target for Probabilistic Programming Languages. In Proceedings of the International Conference on Machine Learning. Beijing, China.Google Scholar
Runciman, C., Naylor, M. and Lindblad, F. 2008. SmallCheck and Lazy SmallCheck: Automatic Exhaustive Testing for Small Values. In Proceedings of the First ACM SIGPLAN Symposium on Haskell. Haskell ’08. ACM, Victoria, BC, Canada, 3748.10.1145/1411286.1411292CrossRefGoogle Scholar
Ścibior, A., Ghahramani, Z. and Gordon, A. D. 2015. Practical Probabilistic Programming with Monads. In Proceedings of the 2015 ACM SIGPLAN Symposium on Haskell. Haskell ’15. ACM, Vancouver, BC, Canada, 165176.CrossRefGoogle Scholar
Varacca, D. and Winskel, G. 2006. Distributing Probability over Non-determinism. Mathematical Structures in Computer Science 16, 87113.Google Scholar
Wadler, P. 1985. How to Replace Failure by a List of Successes. In Proceedings of the International Conference on Functional Programming Languages and Computer Architecture. ACM, New York, NY, USA, 113128.CrossRefGoogle Scholar
Wood, F., Meent, J. W. and Mansinghka, V. 2014. A new Approach to Probabilistic Programming Inference. In Proceedings of the Seventeenth International Conference on Artificial Intelligence and Statistics. Proceedings of Machine Learning Research. PMLR, Reykjavik, Iceland, 10241032.Google Scholar