skip to main content

Stable relations and abstract interpretation of higher-order programs

Published:03 August 2020Publication History
Skip Abstract Section

Abstract

We present a novel denotational semantics for the untyped call-by-value λ-calculus, where terms are interpreted as stable relations, i.e. as binary relations between substitutions and values, enjoying a monotonicity property. The denotation captures the input-output behaviour of higher-order programs, and is proved sound and complete with respect to the operational semantics. The definition also admits a presentation as a program logic. Following the principles of abstract interpretation, we use our denotational semantics as a collecting semantics to derive a modular relational analysis for higher-order programs. The analysis infers equalities between the arguments of a program and its result—a form of frame condition for functional programs.

Skip Supplemental Material Section

Supplemental Material

Presentation at ICFP '20

References

  1. Samson Abramsky. 1991. Domain Theory in Logical Form. Annals of Pure and Applied Logic 51, 1-2 ( March 1991 ), 1-77. https://doi.org/10.1016/ 0168-0072 ( 91 ) 90065-t Google ScholarGoogle ScholarCross RefCross Ref
  2. Oana F. Andreescu, Thomas Jensen, Stéphane Lescuyer, and Benoît Montagu. 2019. Inferring Frame Conditions with Static Correlation Analysis. Proc. ACM Program. Lang. 3, POPL, Article 47 ( Jan. 2019 ), 29 pages. https://doi.org/10.1145/3290360 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Brian Aydemir, Arthur Charguéraud, Benjamin C. Pierce, Randy Pollack, and Stephanie Weirich. 2008. Engineering Formal Metatheory. In Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages-POPL '08. ACM Press. https://doi.org/10.1145/1328438.1328443 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Anindya Banerjee and Thomas Jensen. 2003. Modular Control-Flow Analysis with Rank 2 Intersection Types. Mathematical Structures in Computer Science 13, 1 (Feb. 2003 ), 87-124. https://doi.org/10.1017/s0960129502003845 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Mike Barnett, Bor-Yuh Evan Chang, Robert DeLine, Bart Jacobs, and K. Rustan M. Leino. 2006. Boogie: A Modular Reusable Verifier for Object-Oriented Programs. In Formal Methods for Components and Objects (LNCS, Vol. 4111 ), Frank S. de Boer, Marcello M. Bonsangue, Susanne Graf, and Willem-Paul de Roever (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 364-387. https://doi.org/10.1007/11804192_17 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Mike Barnett, K. Rustan M. Leino, and Wolfram Schulte. 2005. The Spec# Programming System: An Overview. In Construction and Analysis of Safe, Secure, and Interoperable Smart Devices (LNCS, Vol. 3362 ), Gilles Barthe, Lilian Burdy, Marieke Huisman, Jean-Louis Lanet, and Traian Muntean (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 49-69. https: //doi.org/10.1007/978-3-540-30569-9_3 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Richard Bird and Oege de Moor. 1996. The Algebra of Programming. https://doi.org/10.1007/978-3-642-61455-2_12 Google ScholarGoogle ScholarCross RefCross Ref
  8. David Cachera and David Pichardie. 2010. A Certified Denotational Abstract Interpreter. In Interactive Theorem Proving, Matt Kaufmann and Lawrence C. Paulson (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 9-24. https://doi.org/ 10.1007/978-3-642-14052-5_3 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Arthur Charguéraud. 2010. Program Verification through Characteristic Formulae. In Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming (ICFP '10). Association for Computing Machinery, New York, NY, USA, 321-332. https://doi.org/10.1145/1863543.1863590 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Arthur Charguéraud. 2011. The Locally Nameless Representation. Journal of Automated Reasoning 49, 3 (May 2011 ), 363-408. https://doi.org/10.1007/s10817-011-9225-2 Google ScholarGoogle ScholarCross RefCross Ref
  11. Stephen A. Cook. 1978. Soundness and Completeness of an Axiom System for Program Verification. SIAM J. Comput. 7, 1 (Feb. 1978 ), 70-90. https://doi.org/10.1137/0207005 Google ScholarGoogle ScholarCross RefCross Ref
  12. Patrick Cousot. 1997. Types as Abstract Interpretations. In Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages-POPL '97. ACM Press. https://doi.org/10.1145/263699.263744 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Patrick Cousot and Radhia Cousot. 1977. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL '77). Association for Computing Machinery, New York, NY, USA, 238-252. https: //doi.org/10.1145/512950.512973 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Patrick Cousot and Radhia Cousot. 1994. Higher-Order Abstract Interpretation (and Application to Comportment Analysis Generalizing Strictness, Termination, Projection and PER Analysis of Functional Languages). In Proceedings of 1994 IEEE International Conference on Computer Languages (ICCL94). IEEE Comput. Soc. Press. https://doi.org/10.1109/iccl. 1994. 288389 Google ScholarGoogle ScholarCross RefCross Ref
  15. Patrick Cousot and Radhia Cousot. 2002. Modular Static Program Analysis. In Compiler Construction (LNCS, Vol. 2304 ), R. Nigel Horspool (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 159-179. https://doi.org/10.1007/3-540-45937-5_13 Google ScholarGoogle ScholarCross RefCross Ref
  16. Manuvir Das. 2000. Unification-Based Pointer Analysis with Directional Assignments. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (PLDI '00). ACM, New York, NY, USA, 35-46. https://doi.org/10.1145/349299.349309 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Derek Dreyer, Karl Crary, and Robert Harper. 2003. A Type System for Higher-Order Modules. In Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '03). Association for Computing Machinery, New York, NY, USA, 236-249. https://doi.org/10.1145/604131.604151 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Christopher Earl, Matthew Might, and David Van Horn. 2010. Pushdown Control-Flow Analysis of Higher-Order Programs. Workshop on Scheme and Functional Programming abs/1007.4268 ( 2010 ). arXiv: 1007.4268 http://arxiv.org/abs/1007.4268Google ScholarGoogle Scholar
  19. Azadeh Farzan and Zachary Kincaid. 2015. Compositional Recurrence Analysis. In Proceedings of the 15th Conference on Formal Methods in Computer-Aided Design (FMCAD '15). FMCAD Inc, Austin, TX, 57-64. http://dl.acm.org/citation.cfm? id= 2893529. 2893544Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Jean-Christophe Filliâtre and Andrei Paskevich. 2013. Why3-Where Programs Meet Provers. In Programming Languages and Systems (LNCS, Vol. 7792 ), Matthias Felleisen and Philippa Gardner (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 125-128. https://doi.org/10.1007/978-3-642-37036-6_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Robert W. Floyd. 1993. Assigning Meanings to Programs. In Program Verification. Springer Netherlands, 65-81. https: //doi.org/10.1007/ 978-94-011-1793-7_4 Google ScholarGoogle Scholar
  22. Murdoch Gabbay and Andrew M. Pitts. 1999. A New Approach to Abstract Syntax Involving Binders. In Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158). IEEE Comput. Soc, 214-224. https://doi.org/10.1109/lics. 1999.782617 Google ScholarGoogle ScholarCross RefCross Ref
  23. Liang Gu, Alexander Vaynberg, Bryan Ford, Zhong Shao, and David Costanzo. 2011. CertiKOS: A Certified Kernel for Secure Cloud Computing. In Proceedings of the Second Asia-Pacific Workshop on Systems-APSys '11. ACM Press. https://doi.org/10.1145/2103799.2103803 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Nevin Heintze. 1994. Set-Based Analysis of ML Programs. ACM SIGPLAN Lisp Pointers VII, 3 ( July 1994 ), 306-317. https://doi.org/10.1145/182590.182495 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Commun. ACM 12, 10 (Oct. 1969 ), 576-580. https://doi.org/10.1145/363235.363259 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Kohei Honda, Martin Berger, and Nobuko Yoshida. 2006. Descriptive and Relative Completeness of Logics for Higher-Order Functions. In Automata, Languages and Programming, Michele Bugliesi, Bart Preneel, Vladimiro Sassone, and Ingo Wegener (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 360-371. https://doi.org/10.1007/11787006_31 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. David Van Horn and Matthew Might. 2010. Abstracting Abstract Machines. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming-ICFP '10. ACM Press. https://doi.org/10.1145/1863543.1863553 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Paul Hudak and Jonathan Young. 1991. Collecting Interpretations of Expressions. ACM Transactions on Programming Languages and Systems (TOPLAS) 13, 2 (April 1991 ), 269-290. https://doi.org/10.1145/103135.103139 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Hugo Illous, Matthieu Lemerre, and Xavier Rival. 2017. A Relational Shape Abstract Domain. In NASA Formal Methods (LNCS, Vol. 10227 ), Clark Barrett, Misty Davies, and Temesghen Kahsai (Eds.). Springer International Publishing, 212-229. https://doi.org/10.1007/978-3-319-57288-8_15 Google ScholarGoogle ScholarCross RefCross Ref
  30. Bertrand Jeannet, Alexey Loginov, Thomas Reps, and Mooly Sagiv. 2004. A Relational Approach to Interprocedural Shape Analysis. In Static Analysis (LNCS, Vol. 3148 ), Roberto Giacobazzi (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 246-264. https://doi.org/10.1007/978-3-540-27864-1_19 Google ScholarGoogle ScholarCross RefCross Ref
  31. Neil D. Jones and Steven S. Muchnick. 1980. Complexity of Flow Analysis, Inductive Assertion Synthesis and a Language Due to Dijkstra. In 21st Annual Symposium on Foundations of Computer Science (sfcs 1980 ). IEEE. https://doi.org/10.1109/ sfcs. 1980.16 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Neil D. Jones and Alan Mycroft. 1986. Data Flow Analysis of Applicative Programs Using Minimal Function Graphs. In Proceedings of the 13th ACM SIGACT-SIGPLAN symposium on Principles of programming languages-POPL '86. ACM Press. https://doi.org/10.1145/512644.512672 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. G. Kahn. 1987. Natural Semantics. In STACS 87. Springer-Verlag, 22-39. https://doi.org/10.1007/bfb0039592 Google ScholarGoogle ScholarCross RefCross Ref
  34. Gowtham Kaki and Suresh Jagannathan. 2014. A Relational Framework for Higher-Order Shape Analysis. In Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming (ICFP '14). ACM, New York, NY, USA, 311-324. https://doi.org/10.1145/2628136.2628159 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Zachary Kincaid, Jason Breck, Ashkan Forouhi Boroujeni, and Thomas Reps. 2017. Compositional Recurrence Analysis Revisited. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017 ). ACM, New York, NY, USA, 248-262. https://doi.org/10.1145/3062341.3062373 Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Gerwin Klein, Michael Norrish, Thomas Sewell, Harvey Tuch, Simon Winwood, Kevin Elphinstone, Gernot Heiser, June Andronick, David Cock, Philip Derrin, Dhammika Elkaduwe, Kai Engelhardt, and Rafal Kolanski. 2009. seL4: Formal Verification of an OS Kernel. In Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles-SOSP '09. ACM Press. https://doi.org/10.1145/1629575.1629596 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Saul A. Kripke. 1965. Semantical Analysis of Intuitionistic Logic I. In Formal Systems and Recursive Functions. Elsevier, 92-130. https://doi.org/10.1016/s0049-237x( 08 ) 71685-9 Google ScholarGoogle ScholarCross RefCross Ref
  38. Ramana Kumar, Magnus O. Myreen, Michael Norrish, and Scott Owens. 2014. CakeML: A Verified Implementation of ML. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '14). Association for Computing Machinery, New York, NY, USA, 179-191. https://doi.org/10.1145/2535838.2535841 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Xavier Leroy. 2000. A Modular Module System. Journal of Functional Programming 10, 3 ( 2000 ), 269-303. https://doi.org/10. 1017/S0956796800003683 Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Xavier Leroy. 2006. Formal Certification of a Compiler Back-End or: Programming a Compiler with a Proof Assistant. In Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages-POPL'06. ACM Press. https://doi.org/10.1145/1111037.1111042 Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Claude Marché and Christine Paulin-Mohring. 2005. Reasoning About Java Programs with Aliasing and Frame Conditions. In Theorem Proving in Higher Order Logics (LNCS, Vol. 3603 ), Joe Hurd and Tom Melham (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 179-194. https://doi.org/10.1007/11541868_12 Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Bertrand Meyer. 2015. Framing the Frame Problem. In Dependable Software Systems Engineering. 193-203. https: //doi.org/10.3233/978-1-61499-495-4-193 Google ScholarGoogle ScholarCross RefCross Ref
  43. Jan Midtgaard. 2012. Control-Flow Analysis of Functional Programs. Comput. Surveys 44, 3 ( June 2012 ), 1-33. https: //doi.org/10.1145/2187671.2187672 Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Jan Midtgaard and Thomas Jensen. 2008. A Calculational Approach to Control-Flow Analysis by Abstract Interpretation. In Static Analysis. Springer Berlin Heidelberg, 347-362. https://doi.org/10.1007/978-3-540-69166-2_23 Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Jan Midtgaard and Thomas P. Jensen. 2009. Control-Flow Analysis of Function Calls and Returns by Abstract Interpretation. In Proceedings of the 14th ACM SIGPLAN international conference on Functional programming-ICFP '09. ACM Press. https://doi.org/10.1145/1596550.1596592 Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Flemming Nielson, Hanne Riis Nielson, and Chris Hankin. 1999. Principles of Program Analysis. Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-662-03811-6 Google ScholarGoogle ScholarCross RefCross Ref
  47. Andrew Pitts. 2016. Nominal Techniques. ACM SIGLOG News 3, 1 (Feb. 2016 ), 57-72. https://doi.org/10.1145/2893582.2893594 Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. J. C. Reynolds. 2002. Separation Logic: A Logic for Shared Mutable Data Structures. In Proceedings 17th Annual IEEE Symposium on Logic in Computer Science. IEEE Comput. Soc. https://doi.org/10.1109/lics. 2002.1029817 Google ScholarGoogle ScholarCross RefCross Ref
  49. Patrick M. Rondon, Ming Kawaguci, and Ranjit Jhala. 2008. Liquid Types. In Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '08). ACM, New York, NY, USA, 159-169. https://doi.org/10.1145/1375581.1375602 Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Olin Shivers. 1991. The Semantics of Scheme Control-Flow Analysis. In Proceedings of the 1991 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM '91). Association for Computing Machinery, New York, NY, USA, 190-198. https://doi.org/10.1145/115865.115884 Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Christopher A. Stone and Robert Harper. 2006. Extensional Equivalence and Singleton Types. ACM Transactions on Computational Logic 7, 4 (Oct. 2006 ), 676-722. https://doi.org/10.1145/1183278.1183281 Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Christian Urban and Cezary Kaliszyk. 2012. General Bindings and Alpha-Equivalence in Nominal Isabelle. Logical Methods in Computer Science Volume 8, Issue 2 ( June 2012 ). https://doi.org/10.2168/LMCS-8( 2 :14) 2012 Google ScholarGoogle ScholarCross RefCross Ref
  53. Johan van Benthem. 2008. The Information in Intuitionistic Logic. Synthese 167, 2 (Oct. 2008 ), 251-270. https://doi.org/10. 1007/s11229-008-9408-5 Google ScholarGoogle ScholarCross RefCross Ref
  54. Niki Vazou, Eric L. Seidel, Ranjit Jhala, Dimitrios Vytiniotis, and Simon Peyton-Jones. 2014. Refinement Types for Haskell. In Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming-ICFP '14. ACM Press. https://doi.org/10.1145/2628136.2628161 Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Niki Vazou, Anish Tondwalkar, Vikraman Choudhury, Ryan G. Scott, Ryan R. Newton, Philip Wadler, and Ranjit Jhala. 2017. Refinement Reflection: Complete Verification with SMT. Proceedings of the ACM on Programming Languages 2, POPL, Article 53 ( Dec. 2017 ), 31 pages. https://doi.org/10.1145/3158141 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Stable relations and abstract interpretation of higher-order programs

          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
          About Cookies On This Site

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

          Learn more

          Got it!