Abstract

Randomized higher-order computation can be seen as being captured by a λ-calculus endowed with a single algebraic operation, namely a construct for binary probabilistic choice. What matters about such computations is the probability of obtaining any given result, rather than the possibility or the necessity of obtaining it, like in (non)deterministic computation. Termination, arguably the simplest kind of reachability problem, can be spelled out in at least two ways, depending on whether it talks about the probability of convergence or about the expected evaluation time, the second one providing a stronger guarantee. In this paper, we show that intersection types are capable of precisely characterizing both notions of termination inside a single system of types: the probability of convergence of any λ-term can be underapproximated by its type , while the underlying derivation’s weight gives a lower bound to the term’s expected number of steps to normal form. Noticeably, both approximations are tight—not only soundness but also completeness holds. The crucial ingredient is non-idempotency, without which it would be impossible to reason on the expected number of reduction steps which are necessary to completely evaluate any term. Besides, the kind of approximation we obtain is proved to be optimal recursion theoretically: no recursively enumerable formal system can do better than that.

Highlights

  • The study and analysis of randomised computation is almost as old as theoretical computer science itself [De Leeuw et al 1956; Rabin 1963; Santos 1969]

  • We show here that intersection types capture both forms of probabilistic termination in untyped probabilistic λ-calculi

  • One may wonder whether one can do better than Theorem 21 when characterising probabilistic termination. Is it that one can get away from approximations, and devise a type system in which one type derivation is by itself a certificate? we prove that under mild assumptions one cannot, i.e. that our characterisation is the best possible, at least recursion-theoretically

Read more

Summary

INTRODUCTION

The study and analysis of randomised computation is almost as old as theoretical computer science itself [De Leeuw et al 1956; Rabin 1963; Santos 1969]. Traditionally conceived as lightweight methodologies ensuring safety ( the slogan łwell-typed programs cannot go wrongž), can be employed to check reachability and termination [Hughes et al 1996; Sùrensen and Urzyczyn 1989] This idea has been brought to its extreme consequences by the line of work on intersection types [Coppo and Dezani-Ciancaglini 1978; Coppo et al 1981], which guarantee termination, and characterise it, this way providing a compositional presentation of all and only the terminating programs. Given the rich theory that the programming language community has been able to build for the deterministic λ-calculus, a number of questions naturally arise Is it possible to faithfully and precisely reflect the expected time to termination by a system of types?. This section is meant to introduce the non-specialist to intersection types seen as a characterisation of terminating deterministic programs, and to the challenges one faces when trying to generalise intersection types to calculi featuring binary probabilistic choice

Intersection Types and Termination
Typing Termination in a Probabilistic Setting
A PROBABILISTIC CALL-BY-VALUE λ-CALCULUS
Mathematical Preliminaries
The Operational Semantics
NON-IDEMPOTENT MONADIC INTERSECTION TYPES
Some Comments on the Typing Rules
PRECISELY REFLECTING THE RUNTIME
Not Too Much
Not Too Little
CHARACTERISING PROBABILISTIC TERMINATION
Soundness
Completeness
The Various Flavours of a Correspondence
ON RECURSION-THEORETIC OPTIMALITY
Probabilistic Turing Machines
Preliminaries from Recursion Theory
VARIATIONS ON THE THEME
On Call-by-Name Evaluation
RELATED WORK
10 CONCLUSION
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call