Formally Verified Samplers From Probabilistic Programs With Loops and Conditioning

11/12/2022
by   Alexander Bagnall, et al.
0

We present Zar: a formally verified compiler pipeline from discrete probabilistic programs with unbounded loops in the conditional probabilistic guarded command language (cpGCL) to proved-correct executable samplers in the random bit model. We exploit the key idea that all discrete probability distributions can be reduced to unbiased coin-flipping schemes. The compiler pipeline first translates a cpGCL program into choice-fix trees, an intermediate representation suitable for reduction of biased probabilistic choices. Choice-fix trees are then translated to coinductive interaction trees for execution within the random bit model. The correctness of the composed translations establishes the sampling equidistribution theorem: compiled samplers are correct wrt. the conditional weakest pre-expectation semantics of cpGCL source programs. Zar is implemented and fully verified in the Coq proof assistant. We extract verified samplers to OCaml and Python and empirically validate them on a number of illustrative examples.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/21/2017

A Verified Compiler for Probability Density Functions

Bhat et al. developed an inductive compiler that computes density functi...
research
12/04/2019

A Verified Optimizer for Quantum Circuits

We present VOQC, the first fully verified compiler for quantum circuits,...
research
05/18/2020

Scaling Exact Inference for Discrete Probabilistic Programs

Probabilistic programming languages (PPLs) are an expressive means of re...
research
11/07/2017

A Semantics for Probabilistic Control-Flow Graphs

This article develops a novel operational semantics for probabilistic co...
research
05/11/2021

Formally Verified Simulations of State-Rich Processes using Interaction Trees in Isabelle/HOL

Simulation and formal verification are important complementary technique...
research
11/07/2017

A Theory of Slicing for Probabilistic Control-Flow Graphs

We present a theory for slicing probabilistic imperative programs -- con...
research
12/18/2020

An Infrastructure for Faithful Execution of Remote Attestation Protocols

Remote attestation is an emerging technology for establishing trust in a...

Please sign up or login with your details

Forgot password? Click here to reset