Abstract
Type-and-effect systems are a widely used approach to program verification, verifying the result of a computation using types, and its behavior using effects. This paper extends an effect system for verifying temporal, value-dependent properties on event sequences yielded by programs, to the delimited control operators shift0/reset0. While these delimited control operators enable useful and powerful programming techniques, they hinder reasoning about the behavior of programs because of their ability to suspend, resume, discard, and duplicate delimited continuations. This problem is more serious in effect systems for temporal properties because these systems must be capable of identifying what event sequences are yielded by captured continuations. Our key observation for achieving effective reasoning in the presence of the delimited control operators is that their use modifies answer effects, which are temporal effects of the continuations. Based on this observation, we extend an effect system for temporal verification to accommodate answer-effect modification. Allowing answer-effect modification enables easily reasoning about traces that captured continuations yield. Another novel feature of our effect system is the support for dependently typed continuations, which allows us to reason about programs more precisely. We prove soundness of the effect system for finite event sequences via type safety and that for infinite event sequences using a logical relation.
Supplemental Material
Available for Download
This material provides the full definitions, a more detailed explanation of an example, auxiliary lemmas, and proofs that are omitted in the paper titled "Temporal Verification with Answer-Effect Modification" at POPL 2023.
- Danel Ahman. 2018. Handling fibred algebraic effects. Proc. ACM Program. Lang., 2, POPL (2018), 7:1–7:29. https://doi.org/10.1145/3158095
Google Scholar
Digital Library
- Jonathan Aldrich, Joshua Sunshine, Darpan Saini, and Zachary Sparks. 2009. Typestate-oriented programming. In Companion to the 24th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2009, Shail Arora and Gary T. Leavens (Eds.). ACM, 1015–1022. https://doi.org/10.1145/1639950.1640073
Google Scholar
Digital Library
- Jesper Bengtson, Karthikeyan Bhargavan, Cédric Fournet, Andrew D. Gordon, and Sergio Maffeis. 2011. Refinement types for secure implementations. ACM Trans. Program. Lang. Syst., 33, 2 (2011), 8:1–8:45. https://doi.org/10.1145/1890028.1890031
Google Scholar
Digital Library
- Gérard Boudol. 2010. Typing termination in a higher-order concurrent imperative language. Inf. Comput., 208, 6 (2010), 716–736. https://doi.org/10.1016/j.ic.2009.06.007
Google Scholar
Digital Library
- Edmund M. Clarke, E. Allen Emerson, and A. Prasad Sistla. 1983. Automatic Verification of Finite State Concurrent Systems Using Temporal Logic Specifications: A Practical Approach. In Conference Record of the Tenth Annual ACM Symposium on Principles of Programming Languages, Austin, Texas, USA, January 1983, John R. Wright, Larry Landweber, Alan J. Demers, and Tim Teitelbaum (Eds.). ACM Press, 117–126. https://doi.org/10.1145/567067.567080
Google Scholar
Digital Library
- William D. Clinger, Daniel P. Friedman, and Mitchell Wand. 1985. A Scheme for a Higher-Level Semantic Algebra. Cambridge University Press, 237–250.
Google Scholar
- Youyou Cong and Kenichi Asai. 2018. Handling delimited continuations with dependent types. PACMPL, 2, ICFP (2018), 69:1–69:31. https://doi.org/10.1145/3236764
Google Scholar
Digital Library
- Byron Cook, Heidy Khlaaf, and Nir Piterman. 2017. Verifying Increasingly Expressive Temporal Logics for Infinite-State Systems. J. ACM, 64, 2 (2017), 15:1–15:39. https://doi.org/10.1145/3060257
Google Scholar
Digital Library
- Olivier Danvy and Andrzej Filinski. 1989. A functional abstraction of typed contexts.
Google Scholar
- Olivier Danvy and Andrzej Filinski. 1990. Abstracting Control. In LISP and Functional Programming. 151–160. https://doi.org/10.1145/91556.91622
Google Scholar
Digital Library
- Daniel Dietsch, Matthias Heizmann, Vincent Langenfeld, and Andreas Podelski. 2015. Fairness Modulo Theory: A New Approach to LTL Software Model Checking. In Computer Aided Verification - 27th International Conference, CAV 2015, San Francisco, CA, USA, July 18-24, 2015, Proceedings, Part I, Daniel Kroening and Corina S. Pasareanu (Eds.) (Lecture Notes in Computer Science, Vol. 9206). Springer, 49–66. https://doi.org/10.1007/978-3-319-21690-4_4
Google Scholar
Cross Ref
- Matthias Felleisen and Robert Hieb. 1992. The Revised Report on the Syntactic Theories of Sequential Control and State. Theorical Computer Science, 103, 2 (1992), 235–271. https://doi.org/10.1016/0304-3975(92)90014-7
Google Scholar
Digital Library
- Andrzej Filinski. 1994. Representing Monads. In Proceedings of the 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 446–457. https://doi.org/10.1145/174675.178047
Google Scholar
Digital Library
- Yannick Forster, Ohad Kammar, Sam Lindley, and Matija Pretnar. 2017. On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control. PACMPL, 1, ICFP (2017), 13:1–13:29. https://doi.org/10.1145/3110257
Google Scholar
Digital Library
- Colin S. Gordon. 2017. A Generic Approach to Flow-Sensitive Polymorphic Effects. In 31st European Conference on Object-Oriented Programming, ECOOP 2017, Peter Müller (Ed.) (LIPIcs, Vol. 74). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 13:1–13:31. https://doi.org/10.4230/LIPIcs.ECOOP.2017.13
Google Scholar
Cross Ref
- Colin S. Gordon. 2020. Lifting Sequential Effects to Control Operators. In 34th European Conference on Object-Oriented Programming, ECOOP 2020, Robert Hirschfeld and Tobias Pape (Eds.) (LIPIcs, Vol. 166). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 23:1–23:30. https://doi.org/10.4230/LIPIcs.ECOOP.2020.23
Google Scholar
Cross Ref
- Colin S. Gordon. 2021. Polymorphic Iterable Sequential Effect Systems. ACM Trans. Program. Lang. Syst., 43, 1 (2021), 4:1–4:79. https://doi.org/10.1145/3450272
Google Scholar
Digital Library
- Carl A. Gunter, Didier Rémy, and Jon G. Riecke. 1995. A Generalization of Exceptions and Control in ML-like Languages. In Proceedings of the seventh international conference on Functional programming languages and computer architecture, FPCA 1995. 12–23. https://doi.org/10.1145/224164.224173
Google Scholar
Digital Library
- Hugo Herbelin. 2005. On the Degeneracy of Sigma-Types in Presence of Computational Classical Logic. In Typed Lambda Calculi and Applications, 7th International Conference, TLCA 2005, Pawel Urzyczyn (Ed.) (Lecture Notes in Computer Science, Vol. 3461). Springer, 209–220. https://doi.org/10.1007/11417170_16
Google Scholar
Digital Library
- Hugo Herbelin. 2012. A Constructive Proof of Dependent Choice, Compatible with Classical Logic. In Proceedings of the 27th Annual IEEE Symposium on Logic in Computer Science, LICS 2012. IEEE Computer Society, 365–374. https://doi.org/10.1109/LICS.2012.47
Google Scholar
Digital Library
- Martin Hofmann and Wei Chen. 2014. Abstract interpretation from Büchi automata. In Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), CSL-LICS ’14, Thomas A. Henzinger and Dale Miller (Eds.). ACM, 51:1–51:10. https://doi.org/10.1145/2603088.2603127
Google Scholar
Digital Library
- Atsushi Igarashi and Naoki Kobayashi. 2002. Resource usage analysis. In The 29th SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2002, John Launchbury and John C. Mitchell (Eds.). ACM, 331–342. https://doi.org/10.1145/503272.503303
Google Scholar
Digital Library
- Futoshi Iwama, Atsushi Igarashi, and Naoki Kobayashi. 2006. Resource usage analysis for a functional language with exceptions. In Proceedings of the 2006 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation, PEPM 2006, John Hatcliff and Frank Tip (Eds.). ACM, 38–47. https://doi.org/10.1145/1111542.1111550
Google Scholar
Digital Library
- Yukiyoshi Kameyama and Takuo Yonezawa. 2008. Typed Dynamic Control Operators for Delimited Continuations. In Functional and Logic Programming, 9th International Symposium, FLOPS 2008. 239–254. https://doi.org/10.1007/978-3-540-78969-7_18
Google Scholar
Cross Ref
- Naoki Kobayashi, Takeshi Nishikawa, Atsushi Igarashi, and Hiroshi Unno. 2019. Temporal Verification of Programs via First-Order Fixpoint Logic. In Static Analysis - 26th International Symposium, SAS 2019, Porto, Portugal, October 8-11, 2019, Proceedings, Bor-Yuh Evan Chang (Ed.) (Lecture Notes in Computer Science, Vol. 11822). Springer, 413–436. https://doi.org/10.1007/978-3-030-32304-2_20
Google Scholar
Digital Library
- Naoki Kobayashi and C.-H. Luke Ong. 2009. A Type System Equivalent to the Modal Mu-Calculus Model Checking of Higher-Order Recursion Schemes. In Proceedings of the 24th Annual IEEE Symposium on Logic in Computer Science, LICS 2009. IEEE Computer Society, 179–188. https://doi.org/10.1109/LICS.2009.29
Google Scholar
Digital Library
- Eric Koskinen and Tachio Terauchi. 2014. Local Temporal Reasoning. In Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (CSL-LICS ’14), Thomas A. Henzinger and Dale Miller (Eds.). ACM, 59:1–59:10. https://doi.org/10.1145/2603088.2603138
Google Scholar
Digital Library
- Orna Kupferman, Moshe Y. Vardi, and Pierre Wolper. 2000. An automata-theoretic approach to branching-time model checking. J. ACM, 47, 2 (2000), 312–360. https://doi.org/10.1145/333979.333987
Google Scholar
Digital Library
- Rodolphe Lepigre. 2016. A Classical Realizability Model for a Semantical Value Restriction. In Programming Languages and Systems - 25th European Symposium on Programming, ESOP 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Peter Thiemann (Ed.) (Lecture Notes in Computer Science, Vol. 9632). Springer, 476–502. https://doi.org/10.1007/978-3-662-49498-1_19
Google Scholar
Digital Library
- Daniel Marino and Todd D. Millstein. 2009. A generic type-and-effect system. In Proceedings of the 4th ACM SIGPLAN International Workshop on Types in Languages Design and Implementation, TLDI 2009, Andrew Kennedy and Amal Ahmed (Eds.). ACM, 39–50. https://doi.org/10.1145/1481861.1481868
Google Scholar
Digital Library
- Ian A. Mason, Scott F. Smith, and Carolyn L. Talcott. 1996. From Operational Semantics to Domain Theory. Inf. Comput., 128, 1 (1996), 26–47. https://doi.org/10.1006/inco.1996.0061
Google Scholar
Digital Library
- Marek Materzok and Dariusz Biernacki. 2011. Subtyping Delimited Continuations. In Proceeding of the 16th ACM SIGPLAN international conference on Functional Programming, ICFP 2011, Manuel M. T. Chakravarty, Zhenjiang Hu, and Olivier Danvy (Eds.). ACM, 81–93. https://doi.org/10.1145/2034773.2034786
Google Scholar
Digital Library
- Robin Milner. 1978. A Theory of Type Polymorphism in Programming. J. Comput. Syst. Sci., 17, 3 (1978), 348–375. https://doi.org/10.1016/0022-0000(78)90014-4
Google Scholar
Cross Ref
- Étienne Miquey. 2017. A Classical Sequent Calculus with Dependent Types. In Programming Languages and Systems - 26th European Symposium on Programming, ESOP 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Hongseok Yang (Ed.) (Lecture Notes in Computer Science, Vol. 10201). Springer, 777–803. https://doi.org/10.1007/978-3-662-54434-1_29
Google Scholar
Digital Library
- Akihiro Murase, Tachio Terauchi, Naoki Kobayashi, Ryosuke Sato, and Hiroshi Unno. 2016. Temporal verification of higher-order functional programs. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, Rastislav Bodík and Rupak Majumdar (Eds.). ACM, 57–68. https://doi.org/10.1145/2837614.2837667
Google Scholar
Digital Library
- Aleksandar Nanevski, Greg Morrisett, and Lars Birkedal. 2006. Polymorphism and separation in hoare type theory. In Proceedings of the 11th ACM SIGPLAN International Conference on Functional Programming, ICFP 2006, John H. Reppy and Julia Lawall (Eds.). ACM, 62–73. https://doi.org/10.1145/1159803.1159812
Google Scholar
Digital Library
- Yoji Nanjo, Hiroshi Unno, Eric Koskinen, and Tachio Terauchi. 2018. A Fixpoint Logic and Dependent Effects for Temporal Property Verification. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’18), Anuj Dawar and Erich Grädel (Eds.). ACM, 759–768. https://doi.org/10.1145/3209108.3209204
Google Scholar
Digital Library
- Yoji Nanjo, Hiroshi Unno, Eric Koskinen, and Tachio Terauchi. 2018. A Fixpoint Logic and Dependent Effects for Temporal Property Verification. https://www.cs.tsukuba.ac.jp/~uhiro/papers/lics2018full.pdf Technical report extending t Nanjo/Unno/Koskinen/Terauchi_2018_LICS with proofs
Google Scholar
- Luca Padovani and Luca Novara. 2015. Types for Deadlock-Free Higher-Order Programs. In Formal Techniques for Distributed Objects, Components, and Systems - 35th IFIP WG 6.1 International Conference, FORTE 2015, Held as Part of the 10th International Federated Conference on Distributed Computing Techniques, DisCoTec 2015, Susanne Graf and Mahesh Viswanathan (Eds.) (Lecture Notes in Computer Science, Vol. 9039). Springer, 3–18. https://doi.org/10.1007/978-3-319-19195-9_1
Google Scholar
Cross Ref
- Andrew Pitts and Ian Stark. 1998. Operational Reasoning for Functions with Local State. In Higher Order Operational Techniques in Semantics, Andrew Gordon and Andrew Pitts (Eds.). Publications of the Newton Institute, Cambridge University Press, 227–273. http://www.inf.ed.ac.uk/~stark/operfl.html
Google Scholar
Digital Library
- Andrew M. Pitts. 1997. Parametric Polymorphism and Operational Equivalence. Electron. Notes Theor. Comput. Sci., 10 (1997), 2–27. https://doi.org/10.1016/S1571-0661(05)80685-1
Google Scholar
Digital Library
- Gordon D. Plotkin and Matija Pretnar. 2009. Handlers of Algebraic Effects. In Programming Languages and Systems, 18th European Symposium on Programming, ESOP 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, Proceedings. 80–94. https://doi.org/10.1007/978-3-642-00590-9_7
Google Scholar
Digital Library
- Gordon D. Plotkin and Matija Pretnar. 2013. Handling Algebraic Effects. Logical Methods in Computer Science, 9, 4 (2013), https://doi.org/10.2168/LMCS-9(4:23)2013
Google Scholar
Cross Ref
- Patrick Maxim Rondon, Ming Kawaguchi, and Ranjit Jhala. 2008. Liquid types. In Proceedings of the ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation, PLDI 2008,, Rajiv Gupta and Saman P. Amarasinghe (Eds.). ACM, 159–169. https://doi.org/10.1145/1375581.1375602
Google Scholar
Digital Library
- Chung-chieh Shan. 2004. Shift to Control. In Proceedings of the 5th workshop on Scheme and Functional Programming, Olin Shivers and Oscar Waddell (Eds.). 99–107.
Google Scholar
- Christian Skalka and Scott F. Smith. 2004. History Effects and Verification. In Programming Languages and Systems: Second Asian Symposium, APLAS 2004, Wei-Ngan Chin (Ed.) (Lecture Notes in Computer Science, Vol. 3302). Springer, 107–128. https://doi.org/10.1007/978-3-540-30477-7_8
Google Scholar
Cross Ref
- Nikhil Swamy, Catalin Hritcu, Chantal Keller, Aseem Rastogi, Antoine Delignat-Lavaud, Simon Forest, Karthikeyan Bhargavan, Cédric Fournet, Pierre-Yves Strub, Markulf Kohlweiss, Jean Karim Zinzindohoue, and Santiago Zanella Béguelin. 2016. Dependent types and multi-monadic effects in F. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016. 256–270. https://doi.org/10.1145/2837614.2837655
Google Scholar
Digital Library
- Mads Tofte and Jean-Pierre Talpin. 1997. Region-based Memory Management. Inf. Comput., 132, 2 (1997), 109–176. https://doi.org/10.1006/inco.1996.2613
Google Scholar
Digital Library
- Hiroshi Unno and Naoki Kobayashi. 2009. Dependent type inference with interpolants. In Proceedings of the 11th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, PPDP 2009, António Porto and Francisco Javier López-Fraguas (Eds.). ACM, 277–288. https://doi.org/10.1145/1599410.1599445
Google Scholar
Digital Library
- Hiroshi Unno, Yuki Satake, Tachio Terauchi, and Eric Koskinen. 2020. Program Verification via Predicate Constraint Satisfiability Modulo Theories. CoRR, abs/2007.03656 (2020), arXiv:2007.03656. arxiv:2007.03656
Google Scholar
- Caterina Urban, Samuel Ueltschi, and Peter Müller. 2018. Abstract Interpretation of CTL Properties. In Static Analysis - 25th International Symposium, SAS 2018, Freiburg, Germany, August 29-31, 2018, Proceedings, Andreas Podelski (Ed.) (Lecture Notes in Computer Science, Vol. 11002). Springer, 402–422. https://doi.org/10.1007/978-3-319-99725-4_24
Google Scholar
Cross Ref
Index Terms
Temporal Verification with Answer-Effect Modification: Dependent Temporal Type-and-Effect System with Delimited Continuations
Recommendations
On typing delimited continuations: three new solutions to the printf problem
In "Functional Unparsing" (J. Funct. Program. 8(6):621---625, 1998), Danvy presented a type-safe printf function using continuations and an accumulator to achieve the effect of dependent types. The key technique employed in Danvy's solution is the non-...
Handling delimited continuations with dependent types
Dependent types are a powerful tool for maintaining program invariants. To take advantage of this aspect in real-world programming, efforts have been put into enriching dependently typed languages with missing constructs, most notably, effects. This ...
Polymorphic delimited continuations
APLAS'07: Proceedings of the 5th Asian conference on Programming languages and systemsThis paper presents a polymorphic type system for a language with delimited control operators, shift and reset. Based on the monomorphic type system by Danvy and Filinski, the proposed type system allows pure expressions to be polymorphic. Thanks to the ...






Comments