Abstract
Object ownership is an important technique in dealing with object sharing and aliasing to support verification of OO programs. Dynamic Ownership proposes a very flexible encapsulation discipline and has been adopted in Spec#. However, to use this technique, programmers have to keep all the ownership information in mind to decide the validation for modifying one variable. This makes the approach difficult to master and use. In this paper, we apply data-flow analysis to generate most annotations of dynamic ownership automatically, thus can potentially reduce the workload of program verification. Moreover, our technique can reveal ownership topology errors and encapsulation errors. In addition, the entire analysis of our approach is static, thus is efficient.
The work is supported by NSFC under grant No. 61272160 and No. 61202069.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Some ownership systems support ownership transfer. For simplicity, we ignore ownership transfer in this paper.
- 2.
Leino and Müller [6] allows invariants to mention more objects than our work. Our work will still generate more proper annotations if we extend similar rules.
References
Clarke, D.G., Potter, J.M., Noble, J.: Ownership types for flexible alias protection. In: OOPSLA 1998, pp. 48–64. ACM (1998)
Noble, J., Vitek, J., Potter, J.: Flexible alias protection. In: Jul, E. (ed.) ECOOP 1998–Object-Oriented Programming. LNCS, vol. 1445, pp. 158–185. Springer, Heidelberg (1998)
Dietl, W., Müller, P.: Object ownership in program verification. In: Clarke, D., Noble, J., Wrigstad, T. (eds.) Aliasing in Object-Oriented Programming. LNCS, vol. 7850, pp. 289–318. Springer, Heidelberg (2013)
Cunningham, D., Dietl, W., Drossopoulou, S., Francalanza, A., Müller, P., Summers, A.J.: Universe types for topology and encapsulation. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2007. LNCS, vol. 5382, pp. 72–112. Springer, Heidelberg (2008)
Barnett, M., DeLine, R., Fähndrich, M., Leino, K.R.M., Schulte, W.: Verification of object-oriented programs with invariants. J. Object Technol. 3, 27 (2004)
Leino, K.R.M., Müller, P.: Object invariants in dynamic contexts. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 491–515. Springer, Heidelberg (2004)
Müller, P., Poetzsch-Heffter, A., Leavens, G.T.: Modular invariants for layered object structures. Sci. Comput. Program. 62(3), 253–286 (2006)
Leino, K.R.M., Müller, P.: Using the Spec# language, methodology, and tools to write bug-free programs. In: Müller, P. (ed.) LASER Summer School 2007/2008. LNCS, vol. 6029, pp. 91–139. Springer, Heidelberg (2010)
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools. Addison-Wesley Longman Publishing Co. Inc., Redwood City (1986)
Einarsson, A., Nielsen, J.D.: A survivor’s guide to java program analysis with soot, BRICS, Department of Computer Science, University of Aarhus, Denmark (2008)
Vallée-Rai, R., Co, P., Gagnon, E., Hendren, L., Lam, P., Sundaresan, V.: Soot - a java bytecode optimization framework. In: Proceedings of the 1999 Conference of the Centre for Advanced Studies on Collaborative Research, p. 13. IBM Press (1999)
Huang, W., Dietl, W., Milanova, A., Ernst, M.D.: Inference and checking of object ownership. In: Noble, J. (ed.) ECOOP 2012. LNCS, vol. 7313, pp. 181–206. Springer, Heidelberg (2012)
Müller, P., Poetzsch-Heffter, A.: Universes: a type system for controlling representation exposure. In: Programming Languages and Fundamentals of Programming, vol. 263, Fernuniversität Hagen (1999)
Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: a behavioral interface specification language for java. SIGSOFT Softw. Eng. Notes 31(3), 1–38 (2006)
Leavens, G.T., Poll, E., Clifton, C., Cheon, Y., Ruby, C., Cok, D., Müller, P., Kiniry, J., Chalin, P., Zimmerman, D.M., et al.: JML Reference Manual (2008)
Barnett, M., M. Leino, K.R., Schulte, W.: The Spec# programming system: an overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Hu, T., Liu, H., Zhang, K., Qiu, Z. (2016). Automatic Annotating and Checking of Dynamic Ownership. In: Castor, F., Liu, Y. (eds) Programming Languages. SBLP 2016. Lecture Notes in Computer Science(), vol 9889. Springer, Cham. https://doi.org/10.1007/978-3-319-45279-1_6
Download citation
DOI: https://doi.org/10.1007/978-3-319-45279-1_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-45278-4
Online ISBN: 978-3-319-45279-1
eBook Packages: Computer ScienceComputer Science (R0)