Intersection Types and (Positive) Almost-Sure Termination - Archive ouverte HAL
Article Dans Une Revue Proceedings of the ACM on Programming Languages Année : 2021

Intersection Types and (Positive) Almost-Sure Termination

Résumé

Randomised 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.
Fichier principal
Vignette du fichier
main_PAST.pdf (1.13 Mo) Télécharger le fichier
Origine Fichiers éditeurs autorisés sur une archive ouverte

Dates et versions

hal-03044416 , version 1 (07-12-2020)

Identifiants

Citer

Ugo Dal Lago, Claudia Faggian, Simona Ronchi Della Rocca. Intersection Types and (Positive) Almost-Sure Termination. Proceedings of the ACM on Programming Languages, 2021, ⟨10.1145/3434313⟩. ⟨hal-03044416⟩
72 Consultations
91 Téléchargements

Altmetric

Partager

More