Raising Expectations: Automating Expected Cost Analysis with Types

06/24/2020
by   Di Wang, et al.
0

This article presents a type-based analysis for deriving upper bounds on the expected execution cost of probabilistic programs. The analysis is naturally compositional, parametric in the cost model, and supports higher order functions and inductive data types. The derived bounds are multivariate polynomials that are functions of data structures. Bound inference is enabled by local type rules that reduce type inference to linear constraint solving. The type system is based on the potential method of amortized analysis and extends automatic amortized resource analysis (AARA) for deterministic programs. A main innovation is that bounds can contain symbolic probabilities, which may appear in data structures and function arguments. Another contribution is a novel soundness proof that establishes the correctness of the derived bounds with respect to a distribution-based operational cost semantics that also includes nontrivial diverging behavior. For cost models like time, derived bounds imply termination with probability one. To highlight the novel ideas, the presentation focuses on linear potential and a core language. However, the analysis is implemented as an extension of Resource Aware ML and supports polynomial bounds and user defined data structures. The effectiveness of the technique is evaluated by analyzing the sample complexity of discrete distributions and with a novel average-case estimation for deterministic programs that combines expected cost analysis with statistical methods.

READ FULL TEXT
research
04/26/2023

Automatic Amortized Resource Analysis with Regular Recursive Types

The goal of automatic resource bound analysis is to statically infer sym...
research
11/24/2017

Bounded Expectations: Resource Analysis for Probabilistic Programs

This paper presents a new static analysis for deriving upper bounds on t...
research
11/25/2017

A Language for Probabilistically Oblivious Computation

An oblivious computation is one that is free of direct and indirect info...
research
06/07/2022

Automated Expected Amortised Cost Analysis of Probabilistic Data Structures

In this paper, we present the first fully-automated expected amortised c...
research
07/22/2018

Analysis of Logarithmic Amortised Complexity

We introduce a novel amortised resource analysis based on a potential-ba...
research
02/21/2020

Exponential Automatic Amortized Resource Analysis

Automatic amortized resource analysis (AARA) is a type-based technique f...
research
02/21/2020

Exponential Amortized Resource Analysis

Automatic amortized resource analysis (AARA) is a type-based technique f...

Please sign up or login with your details

Forgot password? Click here to reset