Skip to main content

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7850))

Abstract

One of the main reasons aliasing has to be controlled, as highlighted in another chapter [1] of this book [2], is the possibility that a variable can unexpectedly change its value without the referrer’s knowledge. This book will not be complete without a discussion of the impact of immutability on reference-abundant imperative object-oriented languages. In this chapter we briefly survey possible definitions of immutability and present recent work by the authors on adding immutability to object-oriented languages and how it impacts aliasing.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Hogg, J., Lea, D., Wills, A., de Champeaux, D., Holt, R.: The Geneva Convention on the Treatment of Object Aliasing. In: Clarke, D., Noble, J., Wrigstad, T. (eds.) Aliasing in Object-Oriented Programming. LNCS, vol. 7850, pp. 7–14. Springer, Heidelberg (2013)

    Google Scholar 

  2. Clarke, D., Noble, J., Wrigstad, T. (eds.): Aliasing in Object-Oriented Programming. LNCS, vol. 7850. Springer, Heidelberg (2013)

    Google Scholar 

  3. Birka, A., Ernst, M.D.: A practical type system and language for reference immutability. In: OOPSLA, pp. 35–49. ACM Press, New York (2004)

    Google Scholar 

  4. Skoglund, M., Wrigstad, T.: A mode system for read-only references in Java. In: FTfJP. Springer, Heidelberg (2001)

    Google Scholar 

  5. Pechtchanski, I., Sarkar, V.: Immutability specification and its applications. In: Java Grande, pp. 202–211. ACM Press, Seattle (2002)

    Google Scholar 

  6. Tschantz, M.S., Ernst, M.D.: Javari: Adding reference immutability to Java. In: OOPSLA, pp. 211–230. ACM Press, New York (2005)

    Google Scholar 

  7. Kniesel, G., Theisen, D.: JAC — access right based encapsulation for Java. Software: Practice and Experience 31(6), 555–576 (2001)

    Article  MATH  Google Scholar 

  8. Boyland, J., Noble, J., Retert, W.: Capabilities for Sharing: A Generalisation of Uniqueness and Read-Only. In: Lindskov Knudsen, J. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 2–27. Springer, Heidelberg (2001)

    Google Scholar 

  9. Dietl, W., Müller, P.: Universes: Lightweight ownership for JML. Journal of Object Technology (JOT) 4(8), 5–32 (2005)

    Article  Google Scholar 

  10. Zibin, Y., Potanin, A., Artzi, S., Kiezun, A., Ernst, M.D.: Object and reference immutability using Java generics. In: Foundations of Software Engineering (2007)

    Google Scholar 

  11. Zibin, Y., Potanin, A., Li, P., Ali, M., Ernst, M.D.: Ownership and immutability in generic java. In: OOPSLA, pp. 598–617. ACM Press (2010)

    Google Scholar 

  12. Östlund, J., Wrigstad, T., Clarke, D., Åkerblom, B.: Ownership, Uniqueness and Immutability. In: Paige, R.F., Meyer, B. (eds.) TOOLS EUROPE 2008. LNBIP, vol. 11, pp. 178–197. Springer, Heidelberg (2008)

    Google Scholar 

  13. Burdy, L., Cheon, Y., Cok, D., Ernst, M.D., Kiniry, J., Leavens, G.T., Leino, K.R.M., Poll, E.: An overview of JML tools and applications. STTT 7(3), 212–232 (2005)

    Article  Google Scholar 

  14. Tkachuk, O., Dwyer, M.B.: Adapting side effects analysis for modular program model checking. In: ESEC/FSE, pp. 188–197. ACM Press, New York (2003)

    Chapter  Google Scholar 

  15. Clausen, L.R.: A Java bytecode optimizer using side-effect analysis. Concurrency: Practice and Experience 9(11), 1031–1045 (1997)

    Article  Google Scholar 

  16. Sălcianu, A.: Pointer analysis for Java programs: Novel techniques and applications. PhD thesis, MIT Dept. of EECS (September 2006)

    Google Scholar 

  17. Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley, New York (2000)

    Google Scholar 

  18. Artzi, S., Ernst, M.D., Kieżun, A., Pacheco, C., Perkins, J.H.: Finding the needles in the haystack: Generating legal test inputs for object-oriented programs. In: M-TOOS. ACM Press, Portland (2006)

    Google Scholar 

  19. Mariani, L., Pezzè, M.: Behavior capture and test: Automated analysis of component integration. In: ICECCS, pp. 292–301. IEEE, Tokyo (2005)

    Google Scholar 

  20. Xie, T.: Augmenting Automatically Generated Unit-Test Suites with Regression Oracle Checking. In: Thomas, D. (ed.) ECOOP 2006. LNCS, vol. 4067, pp. 380–403. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  21. Ernst, M.D., Cockrell, J., Griswold, W.G., Notkin, D.: Dynamically discovering likely program invariants to support program evolution. IEEE TSE 27(2), 99–123 (2001)

    Google Scholar 

  22. Dallmeier, V., Lindig, C., Wasylkowski, A., Zeller, A.: Mining object behavior with ADABU. In: WODA, pp. 17–24. ACM Press, New York (2006)

    Chapter  Google Scholar 

  23. Dolado, J.J., Harman, M., Otero, M.C., Hu, L.: An empirical investigation of the influence of a type of side effects on program comprehension. IEEE TSE 29(7), 665–670 (2003)

    Google Scholar 

  24. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. AW (2005)

    Google Scholar 

  25. Boyapati, C.: SafeJava: A Unified Type System for Safe Programming. PhD thesis, MIT Dept. of EECS (February 2004)

    Google Scholar 

  26. Sălcianu, A., Rinard, M.: Purity and Side Effect Analysis for Java Programs. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 199–215. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  27. Rountev, A.: Precise identification of side-effect-free methods in Java. In: Proceedings of ICSM, pp. 82–91. IEEE Computer Society (2004)

    Google Scholar 

  28. Landi, W., Ryder, B.G., Zhang, S.: Interprocedural side effect analysis with pointer aliasing. In: Proceedings of PLDI, pp. 56–67 (1993)

    Google Scholar 

  29. Pearce, D.J.: JPure: A Modular Purity System for Java. In: Knoop, J. (ed.) CC 2011. LNCS, vol. 6601, pp. 104–123. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  30. Noble, J., Vitek, J., Potter, J.: Flexible Alias Protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  31. Kernighan, B.W., Ritchie, D.M.: The C Programming Language, 2nd edn. Software Series. Prentice Hall, Englewood Cliffs (1988)

    Google Scholar 

  32. Stroustrup, B.: The C++ Programming Language. Addison-Wesley, Boston (2000)

    Google Scholar 

  33. Meyers, S.: Effective C++, 2nd edn. Addison-Wesley (1997)

    Google Scholar 

  34. Morris, J.H.: Sniggering type checker experiment. Experiment at Xerox PARC (1978); Personal communication (May 2004)

    Google Scholar 

  35. Gannon, J.D.: An experimental evaluation of data type conventions. Communications of the ACM 20(8), 584–595 (1977)

    Article  MATH  Google Scholar 

  36. Prechelt, L., Tichy, W.F.: A controlled experiment to assess the benefits of procedure argument type checking. IEEE TSE 24(4), 302–312 (1998)

    Google Scholar 

  37. Foster, J.S., Fähndrich, M., Aiken, A.: A theory of type qualifiers. In: PLDI, pp. 192–203 (June 1999)

    Google Scholar 

  38. Milner, R., Tofte, M., Harper, R.: The Definition of Standard ML. MIT Press (1990)

    Google Scholar 

  39. Leroy, X.: The Objective Caml system, release 3.07 (September 29, 2003) with Doligez, D., Garrigue, J., Rémy, D., Vouillon, J.

    Google Scholar 

  40. Clarke, D., Potter, J., Noble, J.: Ownership Types for Flexible Alias Protection. In: OOPSLA, pp. 48–64. ACM Press, Vancouver (1998)

    Google Scholar 

  41. Bloch, J.: Effective Java Programming Language Guide. Addison Wesley, Boston (2001)

    Google Scholar 

  42. Huang, S.S., Zook, D., Smaragdakis, Y.: cJ: Enhancing Java with safe type conditions. In: AOSD, pp. 185–198. ACM Press, New York (2007)

    Chapter  Google Scholar 

  43. Clarke, D., Östlund, J., Sergey, I., Wrigstad, T.: Ownership Types: A Survey. In: Clarke, D., Noble, J., Wrigstad, T. (eds.) Aliasing in Object-Oriented Programming. LNCS, vol. 7850, pp. 15–58. Springer, Heidelberg (2013)

    Google Scholar 

  44. Clarke, D., Drossopoulou, S.: Ownership, Encapsulation, and the Disjointness of Type and Effect. In: OOPSLA, pp. 292–310. ACM Press, Seattle (2002)

    Google Scholar 

  45. Boyland, J.: Why we should not add readonly to Java (yet). Journal of Object Technology (2006); Special issue: ECOOP 2005 Workshop FTfJP

    Google Scholar 

  46. Wrigstad, T.: Ownership-Based Alias Management. PhD thesis, Royal Institute of Technology, Sweden (May 2006)

    Google Scholar 

  47. Boyland, J.: Checking Interference with Fractional Permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55–72. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  48. Clarke, D.: Object Ownership and Containment. PhD thesis, School of Computer Science and Engineering, University of New South Wales, Sydney, Australia (2001)

    Google Scholar 

  49. Potanin, A., Noble, J., Clarke, D., Biddle, R.: Generic ownership for generic Java. In: OOPSLA, pp. 311–324. ACM Press, New York (2006)

    Google Scholar 

  50. Clarke, D., Drossopoulou, S.: Ownership, encapsulation and the disjointness of type and effect. In: OOPSLA, pp. 292–310. ACM Press, New York (2002)

    Google Scholar 

  51. Boyapati, C.: SafeJava: A Unified Type System for Safe Programming. PhD thesis, Electrical Engineering and Computer Science, MIT (February 2004)

    Google Scholar 

  52. Birka, A.: Compiler-enforced immutability for the Java language. Technical Report MIT-LCS-TR-908, MIT Lab for Computer Science (June 2003); Revision of Master’s thesis

    Google Scholar 

  53. Bracha, G., Odersky, M., Stoutamire, D., Wadler, P.: Making the future safe for the past: Adding genericity to the Java programming language. In: OOPSLA, pp. 183–200. ACM Press, New York (1998)

    Google Scholar 

  54. Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems (TOPLAS) 23(3), 396–450 (2001)

    Article  Google Scholar 

  55. Clarke, D., Wrigstad, T.: External Uniqueness is Unique Enough. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 176–241. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  56. Wrigstad, T.: Ownership-Based Alias Management. PhD thesis, Royal Institute of Technology, Kista, Stockholm (May 2006)

    Google Scholar 

  57. Müller, P., Poetzsch-Heffter, A.: Universes: A type system for controlling representation exposure. Technical report, Fernuniversität Hagen (1999)

    Google Scholar 

  58. Müller, P.: Modular Specification and Verification of Object-Oriented Programs. PhD thesis, FernUniversität Hagen (2001)

    Google Scholar 

  59. Haack, C., Poll, E.: Type-Based Object Immutability with Flexible Initialization. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 520–545. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  60. Ernst, M.D.: Type annotations specification (jsr 308), http://pag.csail.mit.edu/jsr308/ (September 12, 2008)

  61. Boyland, J.: Why we should not add readonly to Java (yet). In: FTfJP, Glasgow, Scotland. Springer (July 2005)

    Google Scholar 

  62. Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: POPL, pp. 47–57 (January 1988)

    Google Scholar 

  63. Talpin, J.P., Jouvelot, P.: The type and effect discipline. In: LICS, pp. 162–173 (June 1992)

    Google Scholar 

  64. Nielson, F., Riis Nielson, H.: Type and Effect Systems. In: Olderog, E.-R., Steffen, B. (eds.) Correct System Design. LNCS, vol. 1710, pp. 114–136. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  65. Müller, P., Poetzsch-Heffter, A.: Universes: A type system for alias and dependency control. Technical Report 279, Fernuniversität Hagen (2001)

    Google Scholar 

  66. Haack, C., Poll, E., Schäfer, J., Schubert, A.: Immutable Objects for a Java-Like Language. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 347–362. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  67. Porat, S., Biberstein, M., Koved, L., Mendelson, B.: Automatic detection of immutable fields in Java. In: CASCON (November 2000)

    Google Scholar 

  68. Fähndrich, M., Leino, K.R.M.: Declaring and checking non-null types in an object-oriented language. In: OOPSLA, pp. 302–312. ACM Press, New York (2003)

    Google Scholar 

  69. Fähndrich, M., Xia, S.: Establishing object invariants with delayed types. In: Gabriel, R.P., Bacon, D.F., Lopes, C.V., Steele Jr., G.L. (eds.) OOPSLA, pp. 337–350. ACM Press (2007)

    Google Scholar 

  70. Qi, X., Myers, A.C.: Masked types for sound object initialization. In: Shao, Z., Pierce, B.C. (eds.) POPL, pp. 53–65. ACM Press (2009)

    Google Scholar 

  71. Summers, A.J., Müller, P.: Freedom before commitment - a lightweight type system for object initialisation. In: OOPSLA. ACM Press (2011)

    Google Scholar 

  72. Leino, K.R.M., Müller, P., Wallenburg, A.: Flexible Immutability with Frozen Objects. In: Shankar, N., Woodcock, J. (eds.) VSTTE 2008. LNCS, vol. 5295, pp. 192–208. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  73. Dietl, W., Müller, P.: Universes: Lightweight Ownership for JML. Journal of Object Technology 4(8), 5–32 (2005)

    Article  Google Scholar 

  74. Dietl, W., Drossopoulou, S., Müller, P.: Generic Universe Types. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 28–53. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  75. Müller, P., Rudich, A.: Ownership transfer in Universe Types. In: OOPSLA (2007)

    Google Scholar 

  76. Haack, C., Poll, E., Schäfer, J., Schubert, A.: Immutable Objects for a Java-Like Language. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 347–362. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  77. Tschantz, M.S., Ernst, M.D.: Javari: Adding reference immutability to Java. In: OOPSLA (2005)

    Google Scholar 

  78. Zibin, Y., Potanin, A., Artzi, S., Kieżun, A., Ernst, M.D.: Object and reference immutability using Java generics. Technical Report MIT-CSAIL-TR-2007-018, MITCSAIL (2007)

    Google Scholar 

  79. Kniesel, G., Theisen, D.: JAC—access right based encapsulation for Java. Software — Practice and Experience (2001)

    Google Scholar 

  80. Skoglund, M., Wrigstad, T.: Alias control with read-only references. In: Sixth Conference on Computer Science and Informatics (March 2002)

    Google Scholar 

  81. Lu, Y., Potter, J.: Protecting representation with effect encapsulation. In: POPL (2006)

    Google Scholar 

  82. Noble, J., Vitek, J., Potter, J.: Flexible Alias Protection. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  83. Igarashi, A., Viroli, M.: Variant parametric types: A flexible subtyping scheme for generics. ACM Transactions on Programming Languages and Systems (TOPLAS) 28(5), 795–847 (2006)

    Article  Google Scholar 

  84. DeLine, R., Fähndrich, M.: Typestates for Objects. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 465–490. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Potanin, A., Östlund, J., Zibin, Y., Ernst, M.D. (2013). Immutability. In: Clarke, D., Noble, J., Wrigstad, T. (eds) Aliasing in Object-Oriented Programming. Types, Analysis and Verification. Lecture Notes in Computer Science, vol 7850. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-36946-9_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-36946-9_9

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-36945-2

  • Online ISBN: 978-3-642-36946-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics