Skip to main content
Log in

Weak Updates and Separation Logic

  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Separation logic provides a simple but powerful technique for reasoning about low-level imperative programs that use shared data structures. Unfortunately, separation logic supports only “strong updates,” in which mutation to a heap location is safe only if a unique reference is owned. This limits the applicability of separation logic when reasoning about the interaction between many high-level languages (e.g., ML, Java, C#) and low-level ones since the high-level languages do not support strong updates. Instead, they adopt the discipline of “weak updates,” in which there is a global “heap type” to enforce the invariant of type-preserving heap updates. We present SL w, a logic that extends separation logic with reference types and elegantly reasons about the interaction between strong and weak updates. We describe a semantic framework for reference types, which is used to prove the soundness of SL w. Finally, we show how to extend SL w with concurrency.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Ahmed, A. J., “Semantics of Types for Mutable State,” Ph. D. thesis, Princeton University, 2004.

  2. Appel, A. W. and McAllester, D., “An indexed model of recursive types for foundational proof-carrying code,” ACM Trans. on Prog. Lang. and Sys., 23, 5, pp. 657-683, 2001.

    Article  Google Scholar 

  3. Appel, A. W., Mellies, P.-A., Richards, C. D. and Vouillon, J., “A very modal model of a modern, major, general type system,” in Proc. of 34th ACM Symp. on Principles of Prog. Lang., ACM Press, pp. 109-122, Jan. 2007.

  4. Birkedal, L., Støvring, K. and Thamsborg, J., “Realizability semantics of parametric polymorphism, references, and recursive types,” in FoSSaCS, Springer-Verlag, pp. 456-470, April 2009.

  5. Bornat, R., Calcagno, C., O’Hearn, P. and Parkinson, M., “Permission accounting in separation logic,” in Proc. 32nd ACM Symp. on Principles of Prog. Lang., pp. 259-270, 2005.

  6. Furr, M. and Foster, J. S., “Checking type safety of foreign function calls,” ACM Trans. Program. Lang. Syst., 30, 4, pp. 1-63, 2008.

    Article  Google Scholar 

  7. Harper, R., “A simplified account of polymorphic references,” Information Processing Letters, 57, 1, pp. 15-16, 1996.

    Article  MATH  MathSciNet  Google Scholar 

  8. Hoare, C. A. R., “An axiomatic basis for computer programming,” Commun. ACM, 12, 10, pp. 578-580, October 1969.

  9. Honda, K., Yoshida, N. and Berger, M., “An observationally complete program logic for imperative higher-order frame rules,” in Proc. 20th IEEE Symposium on Logic in Computer Science, pp. 270-279, June 2005.

  10. Krishnaswami, N., Birkedal, L., Aldrich, J. and Reynolds, J., “Idealized ML and its separation logic,” Unpublished manuscript, July 2007.

  11. Matthews, J. and Findler, R. B., “Operational semantics for multi-language programs,” in Proc. 34th ACM Symp. on Principles of Prog. Lang., pp. 3-10, 2007.

  12. O’Hearn, P. W., Reynolds, J. C. and Yang, H., “Local reasoning about programs that alter data structures,” in Computer Science Logic, pp. 1-19, 2001.

  13. O’Hearn, P. W., Yang, H. and Reynolds, J. C., “Separation and information hiding,” in Proc. 31th ACM Symp. on Principles of Prog. Lang., pp. 268-280, Venice, Italy, Jan. 2004.

  14. Parkinson, M., “Local reasoning for Java,” Ph.D. thesis, Tech Report UCAM-CL-TR-654, University of Cambridge Computer Laboratory, Oxford, Nov. 2005.

  15. Pottier, F., “Hiding local state in direct style: a higher-order anti-frame rule,” in Proc. 23rd IEEE Symposium on Logic in Computer Science, pp. 331-340, June 2008.

  16. Reus, B. and Schwinghammer, J., “Separation logic for higher-order store,” in 20th International Workshop on Computer Science Logic (CSL), pp. 575-590, 2006.

  17. Reynolds, J. C., “Separation logic: A logic for shared mutable data structures,” in Proc. 17th IEEE Symposium on Logic in Computer Science, pp. 55-74, July 2002.

  18. Tan, G. and Croft, J., “An empirical security study of the native code in the JDK,” in 17th Usenix Security Symposium, pp. 365-377, 2008.

  19. Tan, G., Shao, Z., Feng, X. and Cai, H., “Weak updates and separation logic,” in Proc. of the 7th Asian Symposium on Programming Languages and Systems (APLAS ’09), pp. 178-193, 2009.

  20. Tofte, M., “Type inference for polymorphic references,” Inf. and Comp., 89, 1, pp. 1-34, 1990.

    Article  MATH  MathSciNet  Google Scholar 

  21. Tofte, M. and Talpin, J.-P., “Region-based memory management,” Information and Computation, 132, 2, pp. 109-176, 1997.

    Article  MATH  MathSciNet  Google Scholar 

  22. Trifonov, V. and Shao, Z., “Safe and principled language interoperation,” in 8th European Symposium on Programming (ESOP), pp. 128-146, 1999.

  23. Vafeiadis, V. and Parkinson, M. J., “A marriage of rely/guarantee and separation logic,” in CONCUR, pp. 256-271, 2007.

  24. Wright, A. K. and Felleisen, M., “A syntactic approach to type soundness,” Information and Computation, 115, 1, pp. 38-94, 1994.

    Article  MATH  MathSciNet  Google Scholar 

  25. Yoshida, N., Honda, K. and Berge, M., “Logical reasoning for higher-order functions with local state,” in FoSSaCS (Seidl, H. ed.), pp. 361-377, March 2007.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gang Tan.

About this article

Cite this article

Tan, G., Shao, Z., Feng, X. et al. Weak Updates and Separation Logic. New Gener. Comput. 29, 3–29 (2011). https://doi.org/10.1007/s00354-010-0097-5

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00354-010-0097-5

Keywords:

Navigation