Correctness by construction for probabilistic programs

07/30/2020
βˆ™
by   Annabelle McIver, et al.
βˆ™
0
βˆ™

The "correct by construction" paradigm is an important component of modern Formal Methods, and here we use the probabilistic Guarded-Command Language 𝑝𝐺𝐢𝐿 to illustrate its application to π‘π‘Ÿπ‘œπ‘π‘Žπ‘π‘–π‘™π‘–π‘ π‘‘π‘–π‘ programming. 𝑝𝐺𝐢𝐿 extends Dijkstra's guarded-command language 𝐺𝐢𝐿 with probabilistic choice, and is equipped with a correctness-preserving refinement relation (βŠ‘) that enables compact, abstract specifications of probabilistic properties to be transformed gradually to concrete, executable code by applying mathematical insights in a systematic and layered way. Characteristically for "correctness by construction", as far as possible the reasoning in each refinement-step layer does not depend on earlier layers, and does not affect later ones. We demonstrate the technique by deriving a fair-coin implementation of any given discrete probability distribution. In the special case of simulating a fair die, our correct-by-construction algorithm turns out to be "within spitting distance" of Knuth and Yao's optimal solution.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
βˆ™ 11/28/2022

Flexible Correct-by-Construction Programming

Correctness-by-Construction (CbC) is an incremental program construction...
research
βˆ™ 04/12/2022

Traits for Correct-by-Construction Programming

We demonstrate that traits are a natural way to support correctness-by-c...
research
βˆ™ 11/27/2017

Probabilistic solution of Yao's millionaires' problem

We offer a probabilistic solution of Yao's millionaires' problem that gi...
research
βˆ™ 10/23/2018

Programming Without Refining

To derive a program for a given specification R means to find an artifac...
research
βˆ™ 05/07/2022

Slicing of Probabilistic Programs based on Specifications

This paper presents the first slicing approach for probabilistic program...
research
βˆ™ 02/02/2023

A Typed Lambda-Calculus for Establishing Trust in Probabilistic Programs

The extensive deployment of probabilistic algorithms has radically chang...
research
βˆ™ 03/16/2018

Nesting Probabilistic Programs

We formalize the notion of nesting probabilistic programming queries and...

Please sign up or login with your details

Forgot password? Click here to reset