skip to main content
Semantics of types for mutable state
Publisher:
  • Princeton University
  • Computer Science Dept. Engineering Quadrangle Princeton, NJ
  • United States
Order Number:AAI3136691
Pages:
246
Bibliometrics
Skip Abstract Section
Abstract

Proof-carrying code (PCC) is a framework for mechanically verifying the safety of machine language programs. A program that is successfully verified by a PCC system is guaranteed to be safe to execute, but this safety guarantee is contingent upon the correctness of various trusted components. For instance, in traditional PCC systems the trusted computing base includes a large set of low-level typing rules. Foundational PCC systems seek to minimize the size of the trusted computing base. In particular, they eliminate the need to trust complex, low-level type systems by providing machine-checkable proofs of type soundness for real machine languages.

In this thesis, I demonstrate the use of logical relations for proving the soundness of type systems for mutable state. Specifically, I focus on type systems that ensure the safe allocation, update, and reuse of memory. For each type in the language, I define logical relations that explain the meaning of the type in terms of the operational semantics of the language. Using this model of types, I prove each typing rule as a lemma.

The major contribution is a model of System F with general references—that is, mutable cells that can hold values of any closed type including other references, functions, recursive types, and impredicative quantified types. The model is based on ideas from both possible worlds and the indexed model of Appel and McAllester.

I show how the model of mutable references is encoded in higher-order logic. I also show how to construct an indexed possible-worlds model for a von Neumann machine. The latter is used in the Princeton Foundational PCC system to prove type safety for a full-fledged low-level typed assembly language. Finally, I present a semantic model for a region calculus that supports type-invariant references as well as memory reuse.

Cited By

  1. ACM
    Jacobs J, Hinrichsen J and Krebbers R (2024). Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message Passing, Proceedings of the ACM on Programming Languages, 8:POPL, (1385-1417), Online publication date: 5-Jan-2024.
  2. ACM
    Devriese D, Patrignani M and Piessens F (2022). Two Parametricities Versus Three Universal Types, ACM Transactions on Programming Languages and Systems, 44:4, (1-43), Online publication date: 31-Dec-2022.
  3. ACM
    van der Rest C, Poulsen C, Rouvoet A, Visser E and Mosses P (2022). Intrinsically-typed definitional interpreters à la carte, Proceedings of the ACM on Programming Languages, 6:OOPSLA2, (1903-1932), Online publication date: 31-Oct-2022.
  4. ACM
    Patterson D, Mushtak N, Wagner A and Ahmed A Semantic soundness for language interoperability Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation, (609-624)
  5. ACM
    Georges A, Trieu A and Birkedal L (2022). Le temps des cerises: efficient temporal stack safety on capability machines using directed capabilities, Proceedings of the ACM on Programming Languages, 6:OOPSLA1, (1-30), Online publication date: 29-Apr-2022.
  6. ACM
    Labrada E, Toro M, Tanter É and Devriese D (2022). Plausible sealing for gradual parametricity, Proceedings of the ACM on Programming Languages, 6:OOPSLA1, (1-28), Online publication date: 29-Apr-2022.
  7. ACM
    Spies S, Gäher L, Gratzer D, Tassarotti J, Krebbers R, Dreyer D and Birkedal L Transfinite Iris: resolving an existential dilemma of step-indexed separation logic Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation, (80-95)
  8. ACM
    Jung R, Jourdan J, Krebbers R and Dreyer D (2021). Safe systems programming in Rust, Communications of the ACM, 64:4, (144-152), Online publication date: 1-Apr-2021.
  9. ACM
    Sullivan Z, Downen P and Ariola Z Strictly capturing non-strict closures Proceedings of the 2021 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, (74-89)
  10. ACM
    Hinrichsen J, Louwrink D, Krebbers R and Bengtson J Machine-checked semantic session typing Proceedings of the 10th ACM SIGPLAN International Conference on Certified Programs and Proofs, (178-198)
  11. ACM
    Rajani V, Gaboardi M, Garg D and Hoffmann J (2021). A unifying type-theory for higher-order (amortized) cost analysis, Proceedings of the ACM on Programming Languages, 5:POPL, (1-28), Online publication date: 4-Jan-2021.
  12. ACM
    Spies S, Krishnaswami N and Dreyer D (2021). Transfinite step-indexing for termination, Proceedings of the ACM on Programming Languages, 5:POPL, (1-29), Online publication date: 4-Jan-2021.
  13. ACM
    Gregersen S, Bay J, Timany A and Birkedal L (2021). Mechanized logical relations for termination-insensitive noninterference, Proceedings of the ACM on Programming Languages, 5:POPL, (1-29), Online publication date: 4-Jan-2021.
  14. ACM
    Georges A, Guéneau A, Van Strydonck T, Timany A, Trieu A, Huyghebaert S, Devriese D and Birkedal L (2021). Efficient and provable local capability revocation using uninitialized capabilities, Proceedings of the ACM on Programming Languages, 5:POPL, (1-30), Online publication date: 4-Jan-2021.
  15. ACM
    Charguéraud A (2020). Separation logic for sequential programs (functional pearl), Proceedings of the ACM on Programming Languages, 4:ICFP, (1-34), Online publication date: 2-Aug-2020.
  16. ACM
    Giarrusso P, Stefanesco L, Timany A, Birkedal L and Krebbers R (2020). Scala step-by-step: soundness for DOT with step-indexed logical relations in Iris, Proceedings of the ACM on Programming Languages, 4:ICFP, (1-29), Online publication date: 2-Aug-2020.
  17. ACM
    Skorstengaard L, Devriese D and Birkedal L (2019). Reasoning about a Machine with Local Capabilities, ACM Transactions on Programming Languages and Systems, 42:1, (1-53), Online publication date: 31-Mar-2020.
  18. ACM
    Xia L, Zakowski Y, He P, Hur C, Malecha G, Pierce B and Zdancewic S (2019). Interaction trees: representing recursive and impure programs in Coq, Proceedings of the ACM on Programming Languages, 4:POPL, (1-32), Online publication date: 1-Jan-2020.
  19. ACM
    Timany A and Birkedal L (2019). Mechanized relational verification of concurrent programs with continuations, Proceedings of the ACM on Programming Languages, 3:ICFP, (1-28), Online publication date: 26-Jul-2019.
  20. ACM
    Qu W, Gaboardi M and Garg D (2019). Relational cost analysis for functional-imperative programs, Proceedings of the ACM on Programming Languages, 3:ICFP, (1-29), Online publication date: 26-Jul-2019.
  21. ACM
    Toro M, Garcia R and Tanter É (2018). Type-Driven Gradual Security with References, ACM Transactions on Programming Languages and Systems, 40:4, (1-55), Online publication date: 31-Dec-2019.
  22. ACM
    Frumin D, Krebbers R and Birkedal L ReLoC Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, (442-451)
  23. ACM
    Jung R, Jourdan J, Krebbers R and Dreyer D (2017). RustBelt: securing the foundations of the Rust programming language, Proceedings of the ACM on Programming Languages, 2:POPL, (1-34), Online publication date: 1-Jan-2018.
  24. ACM
    Timany A, Stefanesco L, Krogh-Jespersen M and Birkedal L (2017). A logical relation for monadic encapsulation of state: proving contextual equivalences in the presence of runST, Proceedings of the ACM on Programming Languages, 2:POPL, (1-28), Online publication date: 1-Jan-2018.
  25. ACM
    Patterson D, Perconti J, Dimoulas C and Ahmed A (2017). FunTAL: reasonably mixing a functional language with assembly, ACM SIGPLAN Notices, 52:6, (495-509), Online publication date: 14-Sep-2017.
  26. Kammar O, Levy P, Moss S and Staton S A monad for full ground reference cells Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, (1-12)
  27. ACM
    Patterson D, Perconti J, Dimoulas C and Ahmed A FunTAL: reasonably mixing a functional language with assembly Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, (495-509)
  28. ACM
    Amin N and Rompf T (2017). Type soundness proofs with definitional interpreters, ACM SIGPLAN Notices, 52:1, (666-679), Online publication date: 11-May-2017.
  29. ACM
    Krebbers R, Timany A and Birkedal L (2017). Interactive proofs in higher-order concurrent separation logic, ACM SIGPLAN Notices, 52:1, (205-217), Online publication date: 11-May-2017.
  30. ACM
    Amin N and Rompf T Type soundness proofs with definitional interpreters Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, (666-679)
  31. ACM
    Krebbers R, Timany A and Birkedal L Interactive proofs in higher-order concurrent separation logic Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, (205-217)
  32. ACM
    Jaber G and Tzevelekos N Trace semantics for polymorphic references Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, (585-594)
  33. ACM
    Jacob-Rao R, Cave A and Pientka B Mechanizing Proofs about Mendler-style Recursion Proceedings of the Eleventh Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, (1-9)
  34. Svendsen K, Sieczkowski F and Birkedal L Transfinite Step-Indexing Proceedings of the 25th European Symposium on Programming Languages and Systems - Volume 9632, (727-751)
  35. ACM
    Bach Poulsen C, Mosses P and Torrini P Imperative Polymorphism by Store-Based Types as Abstract Interpretations Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation, (3-8)
  36. ACM
    Krishnaswami N, Turon A, Dreyer D and Garg D (2012). Superficially substructural types, ACM SIGPLAN Notices, 47:9, (41-54), Online publication date: 15-Oct-2012.
  37. ACM
    Krishnaswami N, Turon A, Dreyer D and Garg D Superficially substructural types Proceedings of the 17th ACM SIGPLAN international conference on Functional programming, (41-54)
  38. Dockins R and Hobor A (2012). Time Bounds for General Function Pointers, Electronic Notes in Theoretical Computer Science (ENTCS), 286, (139-155), Online publication date: 1-Sep-2012.
  39. ACM
    Hur C, Dreyer D, Neis G and Vafeiadis V The marriage of bisimulations and Kripke logical relations Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (59-72)
  40. ACM
    Hur C, Dreyer D, Neis G and Vafeiadis V (2012). The marriage of bisimulations and Kripke logical relations, ACM SIGPLAN Notices, 47:1, (59-72), Online publication date: 18-Jan-2012.
  41. ACM
    Thamsborg J and Birkedal L A kripke logical relation for effect-based program transformations Proceedings of the 16th ACM SIGPLAN international conference on Functional programming, (445-456)
  42. ACM
    Thamsborg J and Birkedal L (2011). A kripke logical relation for effect-based program transformations, ACM SIGPLAN Notices, 46:9, (445-456), Online publication date: 18-Sep-2011.
  43. Appel A Verified software toolchain Proceedings of the 20th European conference on Programming languages and systems: part of the joint European conferences on theory and practice of software, (1-17)
  44. ACM
    Stewart G and Appel A Local actions for a curry-style operational semantics Proceedings of the 5th ACM workshop on Programming languages meets program verification, (31-42)
  45. ACM
    Pottier F A typed store-passing translation for general references Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (147-158)
  46. ACM
    Birkedal L, Reus B, Schwinghammer J, Støvring K, Thamsborg J and Yang H Step-indexed kripke models over recursive worlds Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (119-132)
  47. ACM
    Pottier F (2011). A typed store-passing translation for general references, ACM SIGPLAN Notices, 46:1, (147-158), Online publication date: 26-Jan-2011.
  48. ACM
    Birkedal L, Reus B, Schwinghammer J, Støvring K, Thamsborg J and Yang H (2011). Step-indexed kripke models over recursive worlds, ACM SIGPLAN Notices, 46:1, (119-132), Online publication date: 26-Jan-2011.
  49. Hobor A, Dockins R and Appel A A logical mix of approximation and separation Proceedings of the 8th Asian conference on Programming languages and systems, (439-454)
  50. ACM
    Dreyer D, Neis G and Birkedal L (2010). The impact of higher-order state and control effects on local relational reasoning, ACM SIGPLAN Notices, 45:9, (143-156), Online publication date: 27-Sep-2010.
  51. ACM
    Dreyer D, Neis G and Birkedal L The impact of higher-order state and control effects on local relational reasoning Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, (143-156)
  52. ACM
    Ahmed A, Appel A, Richards C, Swadi K, Tan G and Wang D (2010). Semantic foundations for typed assembly languages, ACM Transactions on Programming Languages and Systems, 32:3, (1-67), Online publication date: 1-Mar-2010.
  53. ACM
    Hobor A, Dockins R and Appel A A theory of indirection via approximation Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (171-184)
  54. ACM
    Hobor A, Dockins R and Appel A (2010). A theory of indirection via approximation, ACM SIGPLAN Notices, 45:1, (171-184), Online publication date: 2-Jan-2010.
  55. ACM
    Neis G, Dreyer D and Rossberg A (2009). Non-parametric parametricity, ACM SIGPLAN Notices, 44:9, (135-148), Online publication date: 31-Aug-2009.
  56. ACM
    Neis G, Dreyer D and Rossberg A Non-parametric parametricity Proceedings of the 14th ACM SIGPLAN international conference on Functional programming, (135-148)
  57. Birkedal L, StØvring K and Thamsborg J Realizability Semantics of Parametric Polymorphism, General References, and Recursive Types Proceedings of the 12th International Conference on Foundations of Software Science and Computational Structures - Volume 5504, (456-470)
  58. ACM
    Benton N and Tabareau N Compiling functional types to relational specifications for low level imperative code Proceedings of the 4th international workshop on Types in language design and implementation, (3-14)
  59. ACM
    Benton N and Zarfaty U Formalizing and verifying semantic type soundness of a simple compiler Proceedings of the 9th ACM SIGPLAN international conference on Principles and practice of declarative programming, (1-12)
  60. ACM
    Appel A, Melliès P, Richards C and Vouillon J A very modal model of a modern, major, general type system Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (109-122)
  61. ACM
    Appel A, Melliès P, Richards C and Vouillon J (2007). A very modal model of a modern, major, general type system, ACM SIGPLAN Notices, 42:1, (109-122), Online publication date: 17-Jan-2007.
  62. ACM
    Feng X, Ni Z, Shao Z and Guo Y An open framework for foundational proof-carrying code Proceedings of the 2007 ACM SIGPLAN international workshop on Types in languages design and implementation, (67-78)
  63. Ahmed A Step-Indexed syntactic logical relations for recursive and quantified types Proceedings of the 15th European conference on Programming Languages and Systems, (69-83)
  64. ACM
    Ni Z and Shao Z (2006). Certified assembly programming with embedded code pointers, ACM SIGPLAN Notices, 41:1, (320-333), Online publication date: 12-Jan-2006.
  65. ACM
    Ni Z and Shao Z Certified assembly programming with embedded code pointers Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, (320-333)
  66. Benton N A typed, compositional logic for a stack-based abstract machine Proceedings of the Third Asian conference on Programming Languages and Systems, (364-380)
  67. ACM
    Ahmed A, Fluet M and Morrisett G A step-indexed model of substructural state Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, (78-91)
  68. ACM
    Ahmed A, Fluet M and Morrisett G (2005). A step-indexed model of substructural state, ACM SIGPLAN Notices, 40:9, (78-91), Online publication date: 12-Sep-2005.
Contributors
  • Northeastern University

Recommendations