skip to main content
research-article
Free Access

Probabilistic Termination by Monadic Affine Sized Typing

Published:15 March 2019Publication History
Skip Abstract Section

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.

References

  1. Andreas Abel. 2004. Termination checking with types. ITA 38, 4 (2004), 277--319.Google ScholarGoogle Scholar
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. Ugo Dal Lago. 2005. The geometry of linear higher-order recursion. In LICS’05. IEEE Computer Society, 366--375. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Ugo Dal Lago. 2011. A short introduction to implicit computational complexity. In ESSLLI’10. 89--109. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Ugo Dal Lago and Marco Gaboardi. 2011. Linear dependent types and relative completeness. In LICS’11. IEEE Computer Society, 133--142. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Ugo Dal Lago and Martin Hofmann. 2011. Realizability models and implicit complexity. Theor. Comput. Sci. 412, 20 (2011), 2029--2047. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Ugo Dal Lago and Paolo Parisen Toldin. 2015. A higher-order characterization of probabilistic polynomial time. Inf. Comput. 241 (2015), 114--141. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Ugo Dal Lago and Margherita Zorzi. 2012. Probabilistic operational semantics for the lambda calculus. RAIRO - Theor. Inf. Appl. 46, 3 (2012), 413--450.Google ScholarGoogle ScholarCross RefCross Ref
  21. Karel de Leeuw, Edward Forrest Moore, Claude Elwood Shannon, and Norman Shapiro. 1956. Computability by probabilistic machines. Automata Stud. 34 (1956), 183--212.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. Jean-Yves Girard, Paul Taylor, and Yves Lafont. 1989. Proofs and Types. Cambridge University Press, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle Scholar
  31. 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 ScholarGoogle Scholar
  32. Christopher Manning and Hinrich Schütze. 2001. Foundations of Statistical Natural Language Processing. MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Annabelle McIver and Carroll Morgan. 2005. Abstraction, Refinement and Proof for Probabilistic Systems. Springer.Google ScholarGoogle Scholar
  34. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  35. Rajeev Motwani and Prabhakar Raghavan. 1995. Randomized Algorithms. Cambridge University Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Judea Pearl. 1989. Probabilistic Reasoning in Intelligent Systems - Networks of Plausible Inference. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Amr Sabry and Matthias Felleisen. 1993. Reasoning about programs in continuation-passing style. Lisp Symbol. Comput. 6, 3--4 (1993), 289--360. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Alexander Schrijver. 1986. Theory of Linear and Integer Programming. John Wiley 8 Sons, New York, NY. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Kazushige Terui. 2007. Light affine lambda calculus and polynomial time strong normalization. Arch. Math. Log. 46, 3--4 (2007), 253--280.Google ScholarGoogle ScholarCross RefCross Ref
  40. Sebastian Thrun. 2002. Robotic mapping: A survey. In Exploring Artificial Intelligence in the New Millenium. Morgan Kaufmann. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Hongwei Xi. 2002. Dependent types for program termination verification. Higher-Order Symbol. Comput. 15, 1 (2002), 91--131. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Probabilistic Termination by Monadic Affine Sized Typing

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      HTML Format

      View this article in HTML Format .

      View HTML Format
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!