Abstract
This work presents PλωNK, a functional probabilistic network programming language that extends Probabilistic NetKAT (PNK). Like PNK, it enables probabilistic modelling of network behaviour, by providing probabilistic choice and infinite iteration (to simulate looping network packets). Yet, unlike PNK, it also offers abstraction and higher-order functions to make programming much more convenient.
The formalisation of PλωNK is challenging for two reasons: Firstly, network programming induces multiple side effects (in particular, parallelism and probabilistic choice) which need to be carefully controlled in a functional setting. Our system uses an explicit syntax for thunks and sequencing which makes the interplay of these effects explicit. Secondly, measure theory, the standard domain for formalisations of (continuous) probablistic languages, does not admit higher-order functions. We address this by leveraging ω-Quasi Borel Spaces (ωQBSes), a recent advancement in the domain theory of probabilistic programming languages.
We believe that our work is not only useful for bringing abstraction to PNK, but that—as part of our contribution—we have developed the meta-theory for a probabilistic language that combines advanced features like higher-order functions, iteration and parallelism, which may inform similar meta-theoretic efforts.
Supplemental Material
- Bram Aerts, Toon Goedemé, and Joost Vennekens. 2016. A Probabilistic Logic Programming Approach to Automatic Video Montage. In Proceedings of the Twenty-second European Conference on Artificial Intelligence (ECAI’16). IOS Press, Amsterdam, The Netherlands, The Netherlands, 234–242. Google Scholar
- Carolyn Jane Anderson, Nate Foster, Arjun Guha, Jean-Baptiste Jeannin, Dexter Kozen, Cole Schlesinger, and David Walker. 2014. NetkAT: semantic foundations for networks. In POPL. ACM, 113–126.Google Scholar
- Robert J Aumann et al. 1961. Borel structures for function spaces. Illinois Journal of Mathematics 5, 4 (1961), 614–630.Google Scholar
- Giorgio Bacci, Robert Furber, Dexter Kozen, Radu Mardare, Prakash Panangaden, and Dana Scott. 2018. Boolean-Valued Semantics for the Stochastic 𝜆-Calculus. In LICS. ACM, 669–678.Google Scholar
- Ingo Battenfeld, Matthias Schröder, and Alex Simpson. 2007. A Convenient Category of Domains. Electr. Notes Theor. Comput. Sci. 172 (2007), 69–99.Google Scholar
- Bob Carpenter, Andrew Gelman, Matthew D Hoffman, Daniel Lee, Ben Goodrich, Michael Betancourt, Marcus Brubaker, Jiqiang Guo, Peter Li, and Allen Riddell. 2017. Stan: A probabilistic programming language. Journal of statistical software 76, 1 (2017).Google Scholar
- Marco F. Cusumano-Towner, Feras A. Saad, Alexander K. Lew, and Vikash K. Mansinghka. 2019. Gen: a general-purpose probabilistic programming system with programmable inference. In PLDI. ACM, 221–236.Google Scholar
- Vincent Danos and Thomas Ehrhard. 2011. Probabilistic coherence spaces as a model of higher-order probabilistic computation. Inf. Comput. 209, 6 (2011), 966–991.Google Scholar
- Olivier Danvy and Lasse R. Nielsen. 2001. Defunctionalization at Work. In PPDP. ACM, 162–174.Google Scholar
- Dries De Maeyer, Joris Renkens, Lore Cloots, Luc De Raedt, and Kathleen Marchal. 2013. PheNetic: network-based interpretation of unstructured gene lists in E. coli. Molecular BioSystems 9, 7 (2013), 1594–1603.Google Scholar
- Thomas Ehrhard and Christine Tasson. 2019. Probabilistic call by push value. Logical Methods in Computer Science 15, 1 (2019).Google Scholar
- Daan Fierens, Guy Van den Broeck, Joris Renkens, Dimitar Sht. Shterionov, Bernd Gutmann, Ingo Thon, Gerda Janssens, and Luc De Raedt. 2015. Inference and learning in probabilistic logic programs using weighted Boolean formulas. TPLP 15, 3 (2015), 358–401.Google Scholar
- Nate Foster, Arjun Guha, Mark Reitblatt, Alec Story, Michael J Freedman, Naga Praveen Katta, Christopher Monsanto, Joshua Reich, Jennifer Rexford, Cole Schlesinger, et al. 2013. Languages for software-defined networks. IEEE Communications Magazine 51, 2 (2013), 128–134.Google Scholar
- Nate Foster, Dexter Kozen, Konstantinos Mamouras, Mark Reitblatt, and Alexandra Silva. 2016. Probabilistic NetKAT. In Programming Languages and Systems - 25th European Symposium on Programming, ESOP 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings (Lecture Notes in Computer Science), Peter Thiemann (Ed.), Vol. 9632. Springer, 282–309. Google Scholar
- Andrew Gacek. 2008. The Abella Interactive Theorem Prover (System Description). In IJCAR (Lecture Notes in Computer Science), Vol. 5195. Springer, 154–161.Google Scholar
- Hong Ge, Kai Xu, and Zoubin Ghahramani. 2018. Turing: A language for flexible probabilistic inference. In International Conference on Artificial Intelligence and Statistics. 1682–1690.Google Scholar
- Noah D. Goodman. 2013. The principles and practice of probabilistic programming. In POPL. ACM, 399–402.Google Scholar
- Noah D. Goodman, Vikash K. Mansinghka, Daniel M. Roy, Keith Bonawitz, and Joshua B. Tenenbaum. 2012. Church: a language for generative models. CoRR abs/1206.3255 (2012).Google Scholar
- Jean Goubault-Larrecq. 2019. A Probabilistic and Non-Deterministic Call-by-Push-Value Language. In Thirty-Fourth Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2019, Vancouver, Canada, June 2427, 2019, Proceedings. To appear. https://arxiv.org/pdf/1812.11573.pdfGoogle Scholar
- Jean Goubault-Larrecq and Daniele Varacca. 2011. Continuous Random Variables. In LICS. IEEE Computer Society, 97–106.Google Scholar
- Chris Heunen, Ohad Kammar, Sam Staton, and Hongseok Yang. 2017. A convenient category for higher-order probability theory. In LICS. IEEE Computer Society, 1–12.Google Scholar
- Claire Jones and Gordon D Plotkin. 1989. A probabilistic powerdomain of evaluations. In Proceedings. Fourth Annual Symposium on Logic in Computer Science. IEEE, 186–195.Google Scholar
- Achim Jung and Regina Tix. 1998. The troublesome probabilistic powerdomain. Electr. Notes Theor. Comput. Sci. 13 (1998), 70–91.Google Scholar
- Doga Kisa, Guy Van den Broeck, Arthur Choi, and Adnan Darwiche. 2014. Probabilistic Sentential Decision Diagrams. In KR. AAAI Press.Google Scholar
- Dexter Kozen. 1981. Semantics of Probabilistic Programs. J. Comput. Syst. Sci. 22, 3 (1981), 328–350.Google Scholar
- Paul Blain Levy. 2001. Call-by-push-value. Ph.D. Dissertation. Queen Mary University of London, UK.Google Scholar
- Anthony Lu. 2016. Venture: An extensible platform for probabilistic meta-programming. Master’s thesis. Massachusetts Institute of Technology.Google Scholar
- Eugenio Moggi. 1991. Notions of Computation and Monads. Inf. Comput. 93, 1 (1991), 55–92.Google Scholar
- Benjamin C. Pierce. 2002. Types and programming languages. MIT Press.Google Scholar
- Joshua Reich, Christopher Monsanto, Nate Foster, Jennifer Rexford, and David Walker. 2013. Modular SDN programming with Pyretic. Technical Report of USENIX (2013).Google Scholar
- John C. Reynolds. 1998. Definitional Interpreters for Higher-Order Programming Languages. Higher-Order and Symbolic Computation 11, 4 (1998), 363–397.Google Scholar
- Nasser Saheb-Djahromi. 1980. CPO’s of measures for nondeterminism. Theoretical Computer Science 12, 1 (1980), 19–37.Google Scholar
- Adam Scibior, Ohad Kammar, and Zoubin Ghahramani. 2018. Functional programming for modular Bayesian inference. PACMPL 2, ICFP (2018), 83:1–83:29.Google Scholar
- Steffen Smolka, Spiridon Aristides Eliopoulos, Nate Foster, and Arjun Guha. 2015. A fast compiler for NetKAT. In ICFP. ACM, 328–341.Google Scholar
- Steffen Smolka, David M. Kahn, Praveen Kumar, Nate Foster, Dexter Kozen, and Alexandra Silva. 2017a. Deciding Probabilistic Program Equivalence in NetKAT. CoRR abs/1707.02772 (2017). arXiv: 1707.02772 http://arxiv.org/abs/1707.02772Google Scholar
- Steffen Smolka, Praveen Kumar, Nate Foster, Dexter Kozen, and Alexandra Silva. 2017b. Cantor meets Scott: semantic foundations for probabilistic networks. In POPL. ACM, 557–571.Google Scholar
- Steffen Smolka, Praveen Kumar, David M. Kahn, Nate Foster, Justin Hsu, Dexter Kozen, and Alexandra Silva. 2019. Scalable verification of probabilistic networks. In PLDI. ACM, 190–203.Google Scholar
- Sam Staton. 2017. Commutative Semantics for Probabilistic Programming. In ESOP (Lecture Notes in Computer Science), Vol. 10201. Springer, 855–879.Google Scholar
- William W. Tait. 1967. Intensional Interpretations of Functionals of Finite Type I. J. Symb. Log. 32, 2 (1967), 198–212.Google Scholar
- Matthijs Vákár, Ohad Kammar, and Sam Staton. 2019. A domain theory for statistical probabilistic programming. PACMPL 3, POPL (2019), 36:1–36:29. https://dl.acm.org/citation.cfm?id=3290349Google Scholar
- Frank D. Wood, Jan-Willem van de Meent, and Vikash Mansinghka. 2014. A New Approach to Probabilistic Programming Inference. In AISTATS (JMLR Workshop and Conference Proceedings), Vol. 33. JMLR.org, 1024–1032.Google Scholar
Index Terms
PλωNK: functional probabilistic NetKAT
Recommendations
NetKAT: semantic foundations for networks
POPL '14: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesRecent years have seen growing interest in high-level languages for programming networks. But the design of these languages has been largely ad hoc, driven more by the needs of applications and the capabilities of network hardware than by foundational ...
Temporal NetKAT
PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and ImplementationOver the past 5-10 years, the rise of software-defined networking (SDN) has inspired a wide range of new systems, libraries, hypervisors and languages for programming, monitoring, and debugging network behavior. Oftentimes, these systems are disjoint—...
Temporal NetKAT
PLDI '16Over the past 5-10 years, the rise of software-defined networking (SDN) has inspired a wide range of new systems, libraries, hypervisors and languages for programming, monitoring, and debugging network behavior. Oftentimes, these systems are disjoint—...






Comments