Reference. A Higher-Order Language for Markov Kernels and Linear Operators

Much work has been done to give semantics to probabilistic programming languages. In recent years, most of the semantics used to reason about probabilistic programs fall in two categories: semantics based on Markov kernels and semantics based on linear operators.

Both styles of semantics have found numerous applications in reasoning about probabilistic programs, but they each have their strengths and weaknesses. Though it is believed that there is a connection between them there are no languages that can handle both styles of programming.

In this work we address these questions by defining a two-level calculus and its categorical semantics which makes it possible to program with both kinds of semantics. From the logical side of things we see this language as an alternative resource interpretation of linear logic, where the resource being kept track of is sampling instead of variable use.

Cite

Cite as @amorim_2023_fossacs (helia, typst) · \cite{amorim_2023_fossacs} (LaTeX)
BibTeX
bibtex · 9 lines
@inproceedings{amorim_2023_fossacs,
 title = {A Higher-Order Language for Markov Kernels and Linear Operators},
 author = {Amorim, Pedro H. Azevedo de},
 year = {2023},
 doi = {10.1007/978-3-031-30829-1_5},
 url = {https://link.springer.com/chapter/10.1007/978-3-031-30829-1_5},
 booktitle = {Foundations of Software Science and Computation Structures (FoSSaCS 2023)},
 publisher = {Springer}
}
hayagriva YAML (typst)
yaml · 12 lines
amorim_2023_fossacs:
  type: article
  title: A Higher-Order Language for Markov Kernels and Linear Operators
  author: Amorim, Pedro H. Azevedo de
  date: 2023
  url: https://link.springer.com/chapter/10.1007/978-3-031-30829-1_5
  serial-number:
    doi: 10.1007/978-3-031-30829-1_5
  parent:
    type: proceedings
    title: Foundations of Software Science and Computation Structures (FoSSaCS 2023)
    publisher: Springer
Cited by (2)

Separated and Shared Effects in Higher-Order Languages amorim_hsu_independent

Effectful programs interact in ways that go beyond simple input-output, making compositional reasoning challenging. Existing work has shown that when such programs are “separate”, i.e., when programs do not interfere with each other, it can be easier to reason about them. While reasoning about separated resources has been well-studied, there has been little work on reasoning about separated effects, especially for functional, higher-order programming languages. We propose two higher-order languages that can reason about sharing and separation in effectful programs. Our first language 𝜆INI has a linear type system and probabilistic semantics, where the two product types capture independent and possibly-dependent pairs. Our second language 𝜆INI2 is two-level, stratified language, inspired by Benton’s linear-non-linear (LNL) calculus. We motivate this language with a probabilistic model, but we also provide a general categorical semantics and exhibit a range of concrete models beyond probabilistic programming. We prove soundness theorems for all of our languages; our general soundness theorem for our categorical models of 𝜆INI2 uses a categorical gluing construction.
Web

Classical Linear Logic in Perfect Banach Lattices amorim_witzman_kozen_2025

In recent years, researchers have proposed various models of linear logic with strong connections to measure theory, with probabilistic coherence spaces (PCoh) being one of the most prominent. One of the main limitations of the PCoh model is that it cannot interpret continuous measures. To overcome this obstacle, Ehrhard has extended PCoh to a category of positive cones and linear Scott-continuous functions and shown that it is a model of intuitionistic linear logic. In this work we show that the category PBanLat₁ of perfect Banach lattices and positive linear functions of norm at most 1 can serve the same purpose, with some added benefits. We show that PBanLat₁ is a model of classical linear logic (without exponential) and that PCoh embeds fully and faithfully in PBanLat₁ while preserving the monoidal and *-autonomous structures. Finally, we show how PBanLat₁ can be used to give semantics to a higher-order probabilistic programming language.
DOI
Cites 24 works (3 here)
With notes (3)

Denotational validation of higher-order Bayesian inference scibior-2017-denotational

We present a modular semantic account of Bayesian inference algorithms for probabilistic programming languages, as used in data science and machine learning. Sophisticated inference algorithms are often explained in terms of composition of smaller parts. However, neither their theoretical justification nor their implementation reflects this modularity. We show how to conceptualise and analyse such inference algorithms as manipulating intermediate representations of probabilistic programs using higher-order functions and inductive types, and their denotational semantics. Semantic accounts of continuous distributions use measurable spaces. However, our use of higher-order functions presents a substantial technical difficulty: it is impossible to define a measurable space structure over the collection of measurable functions between arbitrary measurable spaces that is compatible with standard operations on those functions, such as function application. We overcome this difficulty using quasi-Borel spaces, a recently proposed mathematical structure that supports both function spaces and continuous distributions. We define a class of semantic structures for representing probabilistic programs, and semantic validity criteria for transformations of these representations in terms of distribution preservation. We develop a collection of building blocks for composing representations. We use these building blocks to validate common inference algorithms such as Sequential Monte Carlo and Markov Chain Monte Carlo. To emphasize the connection between the semantic manipulation and its traditional measure theoretic origins, we use Kock’s synthetic measure theory. We demonstrate its usefulness by proving a quasi-Borel counterpart to the Metropolis-Hastings-Green theorem.
PDF · DOI · arXiv · pldb

A convenient category for higher-order probability theory heunen-2017-a

DOI · arXiv

Applicative programming with effects mcbride-2008-applicative

In this article, we introduce Applicative functors – an abstract characterisation of an applicative style of effectful programming, weaker than Monads and hence more widespread. Indeed, it is the ubiquity of this programming pattern that drew us to the abstraction. We retrace our steps in this article, introducing the applicative pattern by diverse examples, then abstracting it to define the Applicative type class and introducing a bracket notation that interprets the normal application syntax in the idiom of an Applicative functor. Furthermore, we develop the properties of applicative functors and the generic operations they support. We close by identifying the categorical structure of applicative functors and examining their relationship both with Monads and with Arrow.
PDF · DOI · pldb
amorim_2023_fossacs reference entries/refs/amorim_2023_fossacs/amorim_2023_fossacs.hel