Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.5555/2032497.2032529acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
Article

Gradual typestate

Published: 25 July 2011 Publication History

Abstract

Typestate reflects how the legal operations on imperative objects can change at runtime as their internal state changes. A typestate checker can statically ensure, for instance, that an object method is only called when the object is in a state for which the operation is welldefined. Prior work has shown how modular typestate checking can be achieved thanks to access permissions and state guarantees. However, static typestate checking is still too rigid for some applications.
This paper formalizes a nominal object-oriented language with mutable state that integrates typestate change and typestate checking as primitive concepts. In addition to augmenting the types of object references with access permissions and state guarantees, the language extends the notion of gradual typing to account for typestate: gradual typestate checking seamlessly combines static and dynamic checking by automatically inserting runtime checks into programs. A novel flow-sensitive permission-based type system allows programmers to write safe code even when the static type checker can only partly verify it.

References

[1]
Ahmed, A., Fluet, M., Morrisett, G.: L3: A linear language with locations. Fundamenta Informaticae 77(4), 397-449 (2007)
[2]
Aldrich, J., Sunshine, J., Saini, D., Sparks, Z.: Typestate-oriented programming. In: Proc. Onward! 2009, pp. 1015-1022. ACM, New York (2009)
[3]
Baker, H.G.: Minimizing reference count updating with deferred and anchored pointers for functional data structures. SIGPLAN Not. 29, 38-43 (1994)
[4]
Bierhoff, K., Aldrich, J.: Modular typestate checking of aliased objects. In: Proc. Conference on Object-oriented Programming Systems and Applications, pp. 301-320. ACM, New York (2007)
[5]
Bierhoff, K., Beckman, N.E., Aldrich, J.: Practical API protocol checking with access permissions. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 195-219. Springer, Heidelberg (2009)
[6]
Bierman, G., Meijer, E., Torgersen, M.: Adding dynamic types to c%. In: D'Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 76-100. Springer, Heidelberg (2010)
[7]
Bodden, E.: Efficient hybrid typestate analysis by determining continuationequivalent states. In: Proc. International Conference on Software Engineering, pp. 5-14. ACM, New York (2010)
[8]
Boyland, J.: Checking interference with fractional permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55-72. Springer, Heidelberg (2003)
[9]
Boyland, J., Retert, W.: Connecting effects and uniqueness with adoption. In: Symposium on Principles of Programming Languages, pp. 283-295. ACM, New York (2005)
[10]
DeLine, R., Fähndrich, M.: Typestates for objects. In: Vetta, A. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 465-490. Springer, Heidelberg (2004)
[11]
Drossopoulou, S., Damiani, F., Dezani-Ciancaglini, M., Giannini, P.: Fickle: Dynamic object re-classification. In: Lee, S.H. (ed.) ECOOP 2001. LNCS, vol. 2072, Springer, Heidelberg (2001)
[12]
Fink, S.J., Yahav, E., Dor, N., Ramalingam, G., Geay, E.: Effective typestate verification in the presence of aliasing. ACM Trans. Softw. Eng. Methodol. 17(2), 1-34 (2008)
[13]
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Professional Computing Series. Addison-Wesley, Reading (1994)
[14]
Garcia, R., Wolff, R., Tanter, é., Aldrich, J.: FeatherweightTypestate. Technical Report CMU-ISR-10-115, Carnegie Mellon University (July 2010)
[15]
Gay, S., Vasconcelos, V., Ravara, A., Gesbert, N., Caldeira, A.: Modular session types for distributed object-oriented programming. In: Symposium on Principles of programming languages, pp. 299-312. ACM, New York (2010)
[16]
Girard, J.-Y.: Linear logic. Theor. Comput. Sci. 50(1), 1-102 (1987)
[17]
Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23(3), 396-450 (2001)
[18]
Knowles, K., Flanagan, C.: Hybrid type checking. ACM Trans. Program. Lang. Syst. 32(2), 6:1-6:34 (2010)
[19]
Levanoni, Y., Petrank, E.: An on-the-fly reference-counting garbage collector for Java. ACM Trans. Program. Lang. Syst. 28, 1-69 (2006)
[20]
Naeem, N.A., Lhoták, O.: Typestate-like analysis of multiple interacting objects. In: Proc. Conference on Object-oriented programming systems languages and applications, pp. 347-366. ACM, New York (2008)
[21]
Pierce, B.C., Turner, D.N.: Local type inference. ACM Trans. Program. Lang. Syst. 22(1), 1-44 (2000)
[22]
Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. Lisp Symb. Comput. 6(3-4), 289-360 (1993)
[23]
Saini, D., Sunshine, J., Aldrich, J.: A theory of typestate-oriented programming. In: Formal Techniques for Java-like Programs (2010)
[24]
Siek, J.G., Taha, W.: Gradual typing for objects. In: Bateni, M. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 2-27. Springer, Heidelberg (2007)
[25]
Siek, J., Taha, W.: Gradual typing for functional languages. In: Proc. Scheme and Functional Programming Workshop (September 2006)
[26]
Strom, R.E., Yemini, S.: Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Softw. Eng. 12(1), 157-171 (1986)
[27]
Walker, D.: Substructural type systems. In: Pierce, B. (ed.) Advanced Topics in Types and Programming Languages, ch. 1, pp. 3-43. MIT Press, Cambridge (2005)
[28]
Wolff, R., Garcia, R., Tanter, é., Aldrich, J.: Gradual Featherweight Typestate. Technical Report CMU-ISR-10-116R, CarnegieMellon University (July 2010)

Cited By

View all
  • (2019)Graduality and parametricity: together again for the first timeProceedings of the ACM on Programming Languages10.1145/33711144:POPL(1-32)Online publication date: 20-Dec-2019
  • (2019)Gradual parametricity, revisitedProceedings of the ACM on Programming Languages10.1145/32903303:POPL(1-30)Online publication date: 2-Jan-2019
  • (2018)Graduality from embedding-projection pairsProceedings of the ACM on Programming Languages10.1145/32367682:ICFP(1-30)Online publication date: 30-Jul-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
ECOOP'11: Proceedings of the 25th European conference on Object-oriented programming
July 2011
657 pages
ISBN:9783642226540
  • Editor:
  • Mira Mezini

Sponsors

  • Google Inc.
  • SAP
  • IBMR: IBM Research
  • AOSD-Europe: European Network of Excellence on Aspect-Oriented Software Development
  • Microsoft Research: Microsoft Research

In-Cooperation

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 25 July 2011

Check for updates

Qualifiers

  • Article

Conference

ECOOP '11
Sponsor:
  • IBMR
  • Microsoft Research

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Graduality and parametricity: together again for the first timeProceedings of the ACM on Programming Languages10.1145/33711144:POPL(1-32)Online publication date: 20-Dec-2019
  • (2019)Gradual parametricity, revisitedProceedings of the ACM on Programming Languages10.1145/32903303:POPL(1-30)Online publication date: 2-Jan-2019
  • (2018)Graduality from embedding-projection pairsProceedings of the ACM on Programming Languages10.1145/32367682:ICFP(1-30)Online publication date: 30-Jul-2018
  • (2018)Type-Driven Gradual Security with ReferencesACM Transactions on Programming Languages and Systems10.1145/322906140:4(1-55)Online publication date: 13-Dec-2018
  • (2016)Typechecking protocols with Mungo and StMungoProceedings of the 18th International Symposium on Principles and Practice of Declarative Programming10.1145/2967973.2968595(146-159)Online publication date: 5-Sep-2016
  • (2016)The gradualizer: a methodology and algorithm for generating gradual type systemsACM SIGPLAN Notices10.1145/2914770.283763251:1(443-455)Online publication date: 11-Jan-2016
  • (2016)The gradualizer: a methodology and algorithm for generating gradual type systemsProceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2837614.2837632(443-455)Online publication date: 11-Jan-2016
  • (2015)Gradual certified programming in coqACM SIGPLAN Notices10.1145/2936313.281671051:2(26-40)Online publication date: 21-Oct-2015
  • (2015)Gradual certified programming in coqProceedings of the 11th Symposium on Dynamic Languages10.1145/2816707.2816710(26-40)Online publication date: 21-Oct-2015
  • (2015)Principal Type Schemes for Gradual ProgramsACM SIGPLAN Notices10.1145/2775051.267699250:1(303-315)Online publication date: 14-Jan-2015
  • Show More Cited By

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media