Abstract
We introduce a system of monadic affine sized types, which substantially generalizes usual sized types and allows in this way to capture probabilistic higher-order programs that terminate almost surely. Going beyond plain, strong normalization without losing soundness turns out to be a hard task, which cannot be accomplished without a richer, quantitative notion of types, but also without imposing some affinity constraints. The proposed type system is powerful enough to type classic examples of probabilistically terminating programs such as random walks. The way typable programs are proved to be almost surely terminating is based on reducibility but requires a substantial adaptation of the technique.
- Andreas Abel. 2004. Termination checking with types. ITA 38, 4 (2004), 277--319.Google Scholar
- Roberto M. Amadio and Solange Coupet-Grimal. 1998. Analysis of a guard condition in type theory. In FoSSaCS’98 (LNCS), Maurice Nivat (Ed.), Vol. 1378. Springer, 48--62. Google Scholar
Digital Library
- Gilles Barthe, Maria João Frade, Eduardo Giménez, Luis Pinto, and Tarmo Uustalu. 2004. Type-based termination of recursive definitions. MSCS 14, 1 (2004), 97--141. Google Scholar
Digital Library
- Gilles Barthe, Benjamin Grégoire, and Santiago Zanella Béguelin. 2009. Formal certification of code-based cryptographic proofs. In POPL’09, Zhong Shao and Benjamin C. Pierce (Eds.). ACM, 90--101. Google Scholar
Digital Library
- Gilles Barthe, Benjamin Grégoire, Sylvain Heraud, and Santiago Zanella Béguelin. 2011. Computer-aided security proofs for the working cryptographer. In CRYPTO 2011 (LNCS), Phillip Rogaway (Ed.), Vol. 6841. Springer, 71--90. Google Scholar
Digital Library
- Gilles Barthe, Benjamin Grégoire, and Colin Riba. 2008. A tutorial on type-based termination. In ALFA Summer School 2008 (LNCS), Ana Bove, Luís Soares Barbosa, Alberto Pardo, and Jorge Sousa Pinto (Eds.), Vol. 5520. Springer, 100--152.Google Scholar
- Gilles Barthe, Benjamin Grégoire, and Colin Riba. 2008. Type-based termination with sized products. In CSL’08 (LNCS), Michael Kaminski and Simone Martini (Eds.), Vol. 5213. Springer, 493--507. Google Scholar
Digital Library
- Olivier Bournez and Florent Garnier. 2005. Proving positive almost-sure termination. In RTA’05 (LNCS), Jürgen Giesl (Ed.), Vol. 3467. Springer, 323--337. Google Scholar
Digital Library
- Olivier Bournez and Claude Kirchner. 2002. Probabilistic rewrite strategies. Applications to ELAN. In RTA’02 (LNCS), Sophie Tison (Ed.), Vol. 2378. Springer, 252--266. Retrieved from Google Scholar
Digital Library
- T. Brázdil, V. Brožek, K. Etessami, A. Kučera, and D. Wojtczak. 2010. One-counter Markov decision processes. In 21st ACM-SIAM Symposium on Discrete Algorithms.Google Scholar
- Alberto Cappai and Ugo Dal Lago. 2015. On equivalences, metrics, and polynomial time. In FCT’15 (LNCS), Adrian Kosowski and Igor Walukiewicz (Eds.), Vol. 9210. Springer, 311--323.Google Scholar
- Aleksandar Chakarov and Sriram Sankaranarayanan. 2013. Probabilistic program analysis with martingales. In CAV’13 (LNCS), Natasha Sharygina and Helmut Veith (Eds.), Vol. 8044. Springer, 511--526.Google Scholar
- Krishnendu Chatterjee, Hongfei Fu, and Amir Kafshdar Goharshady. 2016. Termination analysis of probabilistic programs through Positivstellensatz’s. In CAV’16 (LNCS), Swarat Chaudhuri and Azadeh Farzan (Eds.), Vol. 9779. Springer, 3--22.Google Scholar
- Krishnendu Chatterjee, Hongfei Fu, Petr Novotný, and Rouzbeh Hasheminezhad. 2016. Algorithmic analysis of qualitative and quantitative termination problems for affine probabilistic programs. In POPL’16, Rastislav Bodík and Rupak Majumdar (Eds.). ACM, 327--342. Google Scholar
Digital Library
- Ugo Dal Lago. 2005. The geometry of linear higher-order recursion. In LICS’05. IEEE Computer Society, 366--375. Google Scholar
Digital Library
- Ugo Dal Lago. 2011. A short introduction to implicit computational complexity. In ESSLLI’10. 89--109. Google Scholar
Digital Library
- Ugo Dal Lago and Marco Gaboardi. 2011. Linear dependent types and relative completeness. In LICS’11. IEEE Computer Society, 133--142. Google Scholar
Digital Library
- Ugo Dal Lago and Martin Hofmann. 2011. Realizability models and implicit complexity. Theor. Comput. Sci. 412, 20 (2011), 2029--2047. Google Scholar
Digital Library
- Ugo Dal Lago and Paolo Parisen Toldin. 2015. A higher-order characterization of probabilistic polynomial time. Inf. Comput. 241 (2015), 114--141. Google Scholar
Digital Library
- Ugo Dal Lago and Margherita Zorzi. 2012. Probabilistic operational semantics for the lambda calculus. RAIRO - Theor. Inf. Appl. 46, 3 (2012), 413--450.Google Scholar
Cross Ref
- Karel de Leeuw, Edward Forrest Moore, Claude Elwood Shannon, and Norman Shapiro. 1956. Computability by probabilistic machines. Automata Stud. 34 (1956), 183--212.Google Scholar
- Javier Esparza, Andreas Gaiser, and Stefan Kiefer. 2012. Proving termination of probabilistic programs using patterns. In CAV’12 (LNCS), P. Madhusudan and Sanjit A. Seshia (Eds.), Vol. 7358. Springer, 123--138. Google Scholar
Digital Library
- Luis María Ferrer Fioriti and Holger Hermanns. 2015. Probabilistic termination: Soundness, completeness, and compositionality. In POPL’15, Sriram K. Rajamani and David Walker (Eds.). ACM, 489--501. Google Scholar
Digital Library
- Jean-Yves Girard, Paul Taylor, and Yves Lafont. 1989. Proofs and Types. Cambridge University Press, New York. Google Scholar
Digital Library
- Noah D. Goodman, Vikash K. Mansinghka, Daniel M. Roy, Keith Bonawitz, and Joshua B. Tenenbaum. 2008. Church: A language for generative models. In UAI’08, David A. McAllester and Petri Myllymäki (Eds.). AUAI Press, 220--229. Google Scholar
Digital Library
- Martin Hofmann. 1997. A mixed modal/linear lambda calculus with applications to Bellantoni-Cook safe recursion. In CSL’97 (LNCS), Mogens Nielsen and Wolfgang Thomas (Eds.), Vol. 1414. Springer, 275--294. Google Scholar
Digital Library
- John Hughes, Lars Pareto, and Amr Sabry. 1996. Proving the correctness of reactive systems using sized types. In POPL’96, Hans-Juergen Boehm and Guy L. Steele Jr. (Eds.). ACM Press, 410--423. Google Scholar
Digital Library
- Benjamin Lucien Kaminski and Joost-Pieter Katoen. 2015. On the hardness of almost-sure termination. In MFCS (1) (Lecture Notes in Computer Science), Vol. 9234. Springer, 307--318.Google Scholar
- Benjamin Lucien Kaminski, Joost-Pieter Katoen, Christoph Matheja, and Federico Olmedo. 2018. Weakest precondition reasoning for expected runtimes of randomized algorithms. J. ACM 65, 5 (2018), 30:1--30:68. Google Scholar
Digital Library
- Ugo Dal Lago and Charles Grellois. 2017. Probabilistic termination by monadic affine sized typing. In ESOP’17 (LNCS), Hongseok Yang (Ed.), Vol. 10201. Springer, 393--419.Google Scholar
- Ugo Dal Lago, Sara Zuppiroli, and Maurizio Gabbrielli. 2014. Probabilistic recursion theory and implicit computational complexity. Sci. Ann. Comp. Sci. 24, 2 (2014), 177--216.Google Scholar
- Christopher Manning and Hinrich Schütze. 2001. Foundations of Statistical Natural Language Processing. MIT Press. Google Scholar
Digital Library
- Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer.Google Scholar
- Annabelle McIver, Carroll Morgan, Benjamin Lucien Kaminski, and Joost-Pieter Katoen. 2018. A new proof rule for almost-sure termination. PACMPL 2, (POPL’18), 33:1--33:28. Google Scholar
Digital Library
- Rajeev Motwani and Prabhakar Raghavan. 1995. Randomized Algorithms. Cambridge University Press. Google Scholar
Digital Library
- Judea Pearl. 1989. Probabilistic Reasoning in Intelligent Systems - Networks of Plausible Inference. Morgan Kaufmann. Google Scholar
Digital Library
- Amr Sabry and Matthias Felleisen. 1993. Reasoning about programs in continuation-passing style. Lisp Symbol. Comput. 6, 3--4 (1993), 289--360. Google Scholar
Digital Library
- Alexander Schrijver. 1986. Theory of Linear and Integer Programming. John Wiley 8 Sons, New York, NY. Google Scholar
Digital Library
- Kazushige Terui. 2007. Light affine lambda calculus and polynomial time strong normalization. Arch. Math. Log. 46, 3--4 (2007), 253--280.Google Scholar
Cross Ref
- Sebastian Thrun. 2002. Robotic mapping: A survey. In Exploring Artificial Intelligence in the New Millenium. Morgan Kaufmann. Google Scholar
Digital Library
- Hongwei Xi. 2002. Dependent types for program termination verification. Higher-Order Symbol. Comput. 15, 1 (2002), 91--131. Google Scholar
Digital Library
Index Terms
Probabilistic Termination by Monadic Affine Sized Typing
Recommendations
Probabilistic Termination by Monadic Affine Sized Typing
Programming Languages and SystemsAbstractWe introduce a system of monadic affine sized types, which substantially generalise usual sized types, and allows this way to capture probabilistic higher-order programs which terminate almost surely. Going beyond plain, strong normalisation ...
Parametric quantifiers for dependent type theory
Polymorphic type systems such as System F enjoy the parametricity property: polymorphic functions cannot inspect their type argument and will therefore apply the same algorithm to any type they are instantiated on. This idea is formalized mathematically ...
Normalization by evaluation for sized dependent types
Sized types have been developed to make termination checking more perspicuous, more powerful, and more modular by integrating termination into type checking. In dependently-typed proof assistants where proofs by induction are just recursive functional ...






Comments