Litcius/Paper detail

Intersection types and (positive) almost-sure termination

Ugo Dal Lago, Claudia Faggian, Simona Ronchi Della Rocca

2021Proceedings of the ACM on Programming Languages21 citationsDOIOpen Access PDF

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.

Topics & Concepts

MathematicsReachabilityIntersection (aeronautics)Completeness (order theory)SoundnessProbabilistic logicRecursively enumerable languageDiscrete mathematicsRecursion (computer science)Algebraic numberMathematical proofComputationConvergence (economics)Theory of computationReduction (mathematics)Upper and lower boundsBinary numberBinary relationAlgorithmConstruct (python library)Generator (circuit theory)Representation (politics)Extension (predicate logic)Theoretical computer scienceProbability measureConsistency (knowledge bases)CombinatoricsLogic, programming, and type systemsFormal Methods in VerificationPolynomial and algebraic computation