Skip to main content Accessibility help
×
Home

Syntactic soundness proof of a type-and-capability system with hidden state

  • FRANÇOIS POTTIER (a1)

Abstract

This paper presents a formal definition and machine-checked soundness proof for a very expressive type-and-capability system, that is, a low-level type system that keeps precise track of ownership and side effects. The programming language has first-class functions and references. The type system's features include the following: universal, existential, and recursive types; subtyping; a distinction between affine and unrestricted data; support for strong updates; support for naming values and heap fragments via singleton and group regions; a distinction between ordinary values (which exist at runtime) and capabilities (which do not); support for dynamic reorganizations of the ownership hierarchy by disassembling and reassembling capabilities; and support for temporarily or permanently hiding a capability via frame and anti-frame rules. One contribution of the paper is the definition of the type-and-capability system itself. We present the system as modularly as possible. In particular, at the core of the system, the treatment of affinity, in the style of dual intuitionistic linear logic, is formulated in terms of an arbitrary monotonic separation algebra, a novel axiomatization of resources, ownership, and the manner in which they evolve with time. Only the peripheral layers of the system are aware that we are dealing with a specific monotonic separation algebra, whose resources are references and regions. This semi-abstract organization should facilitate further extensions of the system with new forms of resources. The other main contribution is a machine-checked proof of type soundness. The proof is carried out in the Wright and Felleisen's syntactic style. This offers an evidence that this relatively simple-minded proof technique can scale up to systems of this complexity, and constitutes a viable alternative to more sophisticated semantic proof techniques. We do not claim that the syntactic technique is superior: We simply illustrate how it is used and highlight its strengths and shortcomings.

Copyright

References

Hide All
Abadi, M., Pierce, B. & Plotkin, G. (1991) Faithful ideal models for recursive polymorphic types. Int. J. Found. Comput. Sci 2 1, 121.
Ahmed, A. J. (2004) Semantics of Types for Mutable State. Ph.D. thesis, Princeton University, Princeton, NJ.
Ahmed, A., Appel, A. W., Richards, C. D., Swadi, K. N., Tan, G. & Wang, D. C. (2010) Semantic foundations for typed assembly languages. ACM Trans. Program. Lang. Syst. 32 3, 7:167.
Ahmed, Amal J., Fluet, M. & Morrisett, G. (2005) A step-indexed model of substructural state. In ACM International Conference on Functional Programming (ICFP), pp. 78–91.
Ahmed, A., Fluet, M. & Morrisett, G. (2007) L 3: A linear language with locations. Fundam. Inform. 77 4, 397449.
Almeida, P. S. (1997) Balloon types: Controlling sharing of state in data types. In European Conference on Object-Oriented Programming, Lecture Notes in Computer Science, vol. 1241. New York: Springer, pp. 3259.
Amadio, R. M. & Cardelli, L. (1993) Subtyping recursive types. ACM Trans. Program. Lang. Syst. 15 4, 575631.
Atkey, R. (2010) Amortised resource analysis with separation logic. In European Symposium on Programming (ESOP), Lecture Notes in Computer Science, vol. 6012. New York: Springer, pp. 85103.
Aydemir, B. E., Bohannon, A., Fairbairn, M., Foster, J. N., Pierce, Benjamin C., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S. & Zdancewic, S. (2005) Mechanized metatheory for the masses: The PoplMark challenge. In International Conference on Theorem Proving in Higher Order Logics (TPHOLs), Lecture Notes in Computer Science, vol. 3603. New York: Springer, pp. 5065.
Barber, A. (1996) Dual Intuitionistic Linear Logic. Tech. Rep. ECS-LFCS-96-347. Laboratory for Foundations of Computer Science, School of Informatics at the University of Edinburgh, Edinburgh, UK.
Bell, C. J., Dockins, R., Hobor, A., Appel, A. W. & Walker, D. (2008) Comparing semantic and syntactic methods in mechanized proof frameworks.Proceedings of the International Workshop on Proof-Carrying Code (PCC), Carnegie Mellon University, Pittsburgh, PA.
Bierhoff, K. & Aldrich, J. (2007) Modular typestate checking of aliased objects. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 301–320.
Birkedal, L., Reus, B., Schwinghammer, J., Støvring, K., Thamsborg, J. & Yang, H. (2011) Step-indexed Kripke models over recursive worlds. In ACM Symposium on Principles of Programming Languages (POPL), pp. 119–132.
Birkedal, L., Støvring, K. & Thamsborg, J. (2009) Realizability semantics of parametric polymorphism, general references, and recursive types. In International Conference on Foundations of Software Science and Computation Structures (FOSSACS), Lecture Notes in Computer Science, vol. 5504. New York: Springer, pp. 456470.
Birkedal, L., Støvring, K. & Thamsborg, J. (2010) Realisability semantics of parametric polymorphism, general references, and recursive types. Math. Struct. Comput. Sci. 20 4, 655703.
Birkedal, L., Torp-Smith, N. & Yang, H. (2006) Semantics of separation-logic typing and higher-order frame rules for Algol-like languages. Logical Methods Comput. Sci. 2 5.
Blanqui, F. & Koprowski, A. (2011) CoLoR: A coq library on well-founded rewrite relations and its application to the automated verification of termination certificates. Math. Struct. Comput. Sci. 21 4, 827859.
Boyapati, C., Lee, R. & Rinard, M. (2002) Ownership types for safe programming: Preventing data races and deadlocks. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 211–230.
Boyland, J. T. (2010) Semantics of fractional permissions with nesting. ACM Trans. Program. Lang. Syst. 32 6, 22:133.
Boyland, J. T. & Retert, W. (2005) Connecting effects and uniqueness with adoption. In ACM Symposium on Principles of Programming Languages (POPL), pp. 283–295.
Brandt, M. & Henglein, F. (1998) Coinductive axiomatization of recursive type equality and subtyping. Fundam. Inform. 33, 309338.
Buisse, A., Birkedal, L. & Støvring, K. (2011) A step-indexed Kripke model of separation logic for storable locks. Electron. Notes Theor. Comput. Sci. 276, 121143.
Calcagno, C., O'Hearn, P. W. & Yang, H. (2007) Local action and abstract separation logic. In IEEE Symposium on Logic in Computer Science (LICS), pp. 366–378.
Charguéraud, A. (2012) The locally nameless representation. J. Autom. Reasoning 49 3, 363408.
Charguéraud, A. & Pottier, F. (2008) Functional translation of a calculus of capabilities. In ACM International Conference on Functional Programming (ICFP), pp. 213–224.
Clarke, D. G., Potter, J. M. & Noble, J. (1998) Ownership types for flexible alias protection. In ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 48–64.
Crary, K., Walker, D. & Morrisett, G. (1999) Typed memory management in a calculus of capabilities. In ACM Symposium on Principles of Programming Languages (POPL), pp. 262–275.
Danielsson, N. A. & Altenkirch, T. (2010) Subtyping, declaratively. In International Conference on Mathematics of Program Construction (MPC), Lecture Notes in Computer Science, vol. 6120. New York: Springer, pp. 100118.
de Bruijn, N. G. (1972) Lambda-calculus notation with nameless dummies: A tool for automatic formula manipulation with application to the Church-Rosser theorem. Indag. Math. 34 5, 381392.
DeLine, R. & Fähndrich, M. (2001) Enforcing high-level protocols in low-level software. In ACM Conference on Programming Language Design and Implementation (PLDI), pp. 59–69.
Detlefs, D. L., Leino, K., Rustan, M. & Nelson, G. (1998) Wrestling with Rep Exposure. Res. Rep. 156, SRC, Palo Alto, CA.
Dietl, W. & Peter, M. (2005) Universes: Lightweight ownership for JML. J. Object Technol. 4 8, 532.
Dinsdale-Young, T., Birkedal, L., Gardner, P., Parkinson, M. J. & Yang, H. (submitted) Views: Compositional Reasoning for Concurrent Programs.
Dinsdale-Young, T., Dodds, M., Gardner, P., Parkinson, M. & Vafeiadis, V. (2010) Concurrent Abstract Predicates. Tech. Rep., Computer Laboratory, University of Cambridge, Cambridge, UK.
Dockins, R., Hobor, A. & Appel, A. W. (2009) A fresh look at separation algebras and share accounting. In Asian Symposium on Programming Languages and Systems (APLAS), Lecture Notes in Computer Science, vol. 5904. New York: Springer, pp. 161177.
Fähndrich, M., Aiken, M., Hawblitzel, C., Hodson, O., Hunt, G., Larus, J. R. & Levi, S. (2006) Language support for fast and reliable message-based communication in Singularity OS. In Proceedings of the EuroSys, pp. 177–190.
Fähndrich, M. & DeLine, R. (2002) Adoption and focus: Practical linear types for imperative programming. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI), pp. 13–24.
Gapeyev, V., Levin, M. & Pierce, B. (2002) Recursive subtyping revealed. J. Funct. Program. 12 6, 511548.
Gauthier, N. & Pottier, F. (2004) Numbering matters: First-order canonical forms for second-order recursive types. In Proceedings of the ACM International Conference on Functional Programming (ICFP), pp. 150–161.
Gifford, D. K., Jouvelot, P., Sheldon, M. A. & O'Toole, J. W. (1992) Report on the FX-91 Programming Language. Tech. Rep. MIT/LCS/TR-531, Massachusetts Institute of Technology, Cambridge, MA.
Girard, J.-Y. (1972) Interprétation Fonctionnelle et Élimination des Coupures de L'arithmétique D'ordre Supérieur. Thèse d'état, Université Paris 7.
Glew, N. (2002) A theory of second-order trees. In European Symposium on Programming (ESOP), Lecture Notes in Computer Science, vol. 2305. New York: Springer, pp. 147161.
Gotsman, A., Berdine, J., Cook, B., Rinetzky, N. & Sagiv, M. (2007) Local Reasoning for Storable Locks and Threads. Tech. Rep. MSR-TR-2007-39. Microsoft Research.
Harper, R. (1994) A simplified account of polymorphic references. Inf. Process. Lett. 51 4, 201206.
Hoare, C. A. R. (1972) Proof of correctness of data representations. Acta Inform. 4, 271281.
Hobor, A., Appel, A. W. & ZappaNardelli, F. Nardelli, F. (2008) Oracle semantics for concurrent separation logic. In European Symposium on Programming (ESOP), Lecture Notes in Computer Science, vol. 4960. New York: Springer, pp. 353367.
Hofmann, M. (2000) A type system for bounded space and functional in-place update. Nord. J. Comput. 7 4, 258289.
Hogg, J. (1991) Islands: Aliasing protection in object-oriented languages. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 271–285.
Ishtiaq, Samin S. & O'Hearn, Peter W. (2001) BI as an assertion language for mutable data structures. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL), pp. 14–26.
Launchbury, J. & Jones, S. P. (1995) State in Haskell. LISP Symb. Comput. 8 4, 293341.
Levy, P. B. (2002) Possible world semantics for general storage in call-by-value. Computer Science Logic, Lecture Notes in Computer Science, vol. 2471. New York: Springer.
MacQueen, D. B., Plotkin, G. D. & Sethi, R. (1986) An ideal model for recursive polymorphic types. Inf. Control 71 (1–2), 95130.
Mazurak, K., Zhao, J. & Zdancewic, S. (2010) Lightweight linear types in system F°. In Workshop on Types in Language Design and Implementation (TLDI), pp. 77–88.
Mitchell, John C. (1988) Polymorphic-type inference and containment. Inf. Comput. 76 (2–3), 211249.
Monnier, S. (2008) Statically Tracking State with Typed Regions. Draft.
Müller, P. & Poetzsch-Heffter, A. (2001) Universes: A Type System for Alias and Dependency Control. Tech. Rep. 279, Fernuniversität Hagen, Germany.
Nanevski, A., Morrisett, G. & Birkedal, L. (2008) -type theory, polymorphism and separation. J. Funct. Program. 18 (5–6), 865911.
Nanevski, A., Vafeiadis, V. & Berdine, J. (2010) Structuring the verification of heap-manipulating programs. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL), pp. 261–274.
O'Hearn, Peter W. (2007) Resources, concurrency and local reasoning. Theor. Comput. Sci. 375 (1–3), 271307.
O'Hearn, P. W., Yang, H. & Reynolds, J. C. (2004) Separation and information hiding. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL), pp. 268–280.
PeytonJones, S. Jones, S. & Wadler, P. (1993) Imperative functional programming. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL), pp. 71–84.
Pilkiewicz, A. & Pottier, F. (2011) The essence of monotonic state. Workshop on Types in Language Design and Implementation (TLDI), Philadelphia, PA.
Pollack, R., Sato, M. & Ricciotti, W. (2012) A canonical locally named representation of binding. J. Autom. Reasoning 49 2, 185207.
Pottier, F. (2008) Hiding local state in direct style: A higher-order anti-frame rule. In IEEE Symposium on Logic in Computer Science (LICS), pp. 331–340.
Pottier, F. (2009a) Generalizing the higher-order frame and anti-frame rules. Unpublished manuscript.
Pottier, F. (2009b). Three comments on the anti-frame rule. Unpublished manuscript.
Pottier, F. (2012a) Accompanying Coq scripts; for browsing [online]. Available at: http://gallium.inria.fr/~fpottier/ssphs/. Accessed 21 September 2012.
Pottier, F. (2012b) Accompanying Coq scripts; for downloading [online]. Available at: http://gallium.inria.fr/~fpottier/ssphs/ssphs.tar.gz and also as an online supplement at http://www.cambridge.org/. . . . Accessed 21 September 2012.
Pottier, F. & Protzenko, J. (2012) Programming with permissions: An introduction to Mezzo. Unpublished manuscript.
Reus, B. & Schwinghammer, J. (2006) Separation logic for higher-order store. In Computer Science Logic, Lecture Notes in Computer Science, vol. 4207. New York: Springer, pp. 575590.
Reynolds, John C. (1974) Towards a theory of type structure. In Colloque sur la Programmation, Lecture Notes in Computer Science, vol. 19. New York: Springer, pp. 408425.
Reynolds, John C. (2002) Separation logic: A logic for shared mutable data structures. In IEEE Symposium on Logic in Computer Science (LICS), pp. 55–74.
Schwinghammer, J., Birkedal, L., Pottier, F., Reus, B., Støvring, K. & Yang, H. (2012) A step-indexed Kripke model of hidden state. Math. Struct. Comput. Sci. Available at: http://dx.doi.org/10.1017/S0960129512000035.
Schwinghammer, J., Birkedal, L., Reus, B. & Yang, H. (2009) Nested Hoare triples and frame rules for higher-order store. In Computer Science Logic, Lecture Notes in Computer Science, vol. 5771. New York: Springer, pp. 440454.
Schwinghammer, J., Birkedal, L. & Støvring, K. (2011) A step-indexed Kripke model of hidden state via recursive properties on recursively defined metric spaces. In International Conference on Foundations of Software Science and Computation Structures (FOSSACS), Lecture Notes in Computer Science, no. 6604. New York: Springer, pp. 305319.
Schwinghammer, J., Yang, H., Birkedal, L., Pottier, F. & Reus, B. (2010) A semantic foundation for hidden state. In International Conference on Foundations of Software Science and Computation Structures (FOSSACS), Lecture Notes in Computer Science, vol. 6014. New York: Springer, pp. 217.
Smith, F., Walker, D. & Morrisett, G. (2000) Alias types. In European Symposium on Programming (ESOP), Lecture Notes in Computer Science, vol. 1782. New York: Springer, pp. 366381.
Swamy, N., Hicks, M., Morrisett, G., Grossman, D. & Jim, T. (2006) Safe manual memory management in Cyclone. Sci. Comput. Program. 62 2, 122144.
Talpin, J.-P. & Jouvelot, P. (1994) The type and effect discipline. Inf. Comput. 11 2, 245296.
Tan, G., Shao, Z., Feng, X. & Cai, H. (2009) Weak updates and separation logic. In Asian Symposium on Programming Languages and Systems (APLAS), Lecture Notes in Computer Science, vol. 5904. New York: Springer, pp. 178193.
Tofte, M. & Talpin, J.-P. (1997) Region-based memory management. Inf. Comput. 132 2, 109176.
Tov, J. A. & Pucella, R. (2010) Stateful contracts for affine types. In European Symposium on Programming (ESOP), Lecture Notes in Computer Science, vol. 6012. New York: Springer, pp. 550569.
Tov, J. A. & Pucella, R. (2011) Practical affine types. In ACM Symposium on Principles of Programming Languages (POPL), pp. 447–458.
Urban, C. (2008) Nominal techniques in Isabelle/HOL. J. Autom. Reason. 40 4, 327356.
Vouillon, J. & Melliès, P.-A. (2004) Semantic types: A fresh look at the ideal model for types. In ACM Symposium on Principles of Programming Languages (POPL), pp. 52–63.
Walker, D. (2005) Substructural type systems. In Advanced Topics in Types and Programming Languages, Pierce, B. C. (ed). Cambridge, MA: MIT Press, Chap. 1, pp. 343.
Walker, D. & Morrisett, G. (2000) Alias types for recursive data structures. In Workshop on Types in Compilation (TIC), Lecture Notes in Computer Science, vol. 2071. New York: Springer, pp. 177206.
Wright, A. K. (1995) Simple imperative polymorphism. LISP Symb. Comput. 8 4, 343356.
Wright, A. K. & Felleisen, M. (1994) A syntactic approach to type soundness. Inf. Comput. 115 1, 3894.
Type Description Title
UNKNOWN
Supplementary materials

POTTIER Supplementary Material
Appendix

 Unknown (539 KB)
539 KB

Syntactic soundness proof of a type-and-capability system with hidden state

  • FRANÇOIS POTTIER (a1)

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed.

Syntactic soundness proof of a type-and-capability system with hidden state

  • FRANÇOIS POTTIER (a1)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *