Abstract
Formal specification of multi-threaded programs is notoriously hard, because thread execution may be preempted at any point. In contrast, abstract concurrency models such as actors seriously restrict concurrency to obtain race-free programs. Languages with cooperative scheduling occupy a middle ground between these extremes by explicit scheduling points. We introduce cooperative contracts, a contract-based specification approach designed for cooperative scheduling. It permits to specify complex concurrent behavior succinctly. Cooperative contracts are formalized as behavioral contracts in a compositional behavioral program logic in which they can be formally verified.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The restriction to a subset is purely for presentation purposes. A forthcoming implementation will support full ABS.
- 2.
The specifications of and are shown in the next subsection in connection with specification of suspension points.
- 3.
The execution pattern is inverse to method execution: on suspension execution stops and is later reactivated. Therefore, it is intuitive to specify before . Observe that the clause of the top-level method contract specifies the final state upon method termination, i.e. the postcondition of the final atomic segment.
- 4.
Due to their nature as contracts and behavioral types, not due to a relation to behavioral contracts as a subset of behavioral types as in [38].
References
Abadi, M., Lamport, L.: Conjoining specifications. ACM Trans. Program. Lang. Syst. 17(3), 507–534 (1995)
ABS development team: The ABS language specification, January 2018. http://docs.abs-models.org/
Agha, G., Hewitt, C.: Actors: a conceptual foundation for concurrent object-oriented programming. In: Shriver, B. (ed.) Research Directions in Object-Oriented Programming, pp. 49–74. MIT Press, Cambridge (1987)
Ahrendt, W., Beckert, B., Bubel, R., Hähnle, R., Schmitt, P.H., Ulbrich, M. (eds.): LNCS. From Theory to Practice, vol. 10001. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49812-6
Ahrendt, W., Dylla, M.: A system for compositional verification of asynchronous objects. Sci. Comput. Program. 77(12), 1289–1309 (2012)
de Boer, F.S., Hähnle, R., Johnsen, E.B., Schlatte, R., Wong, P.Y.H.: Formal modeling of resource management for cloud architectures: an industrial case study. In: De Paoli, F., Pimentel, E., Zavattaro, G. (eds.) ESOCC 2012. LNCS, vol. 7592, pp. 91–106. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-33427-6_7
Albert, E., Flores-Montoya, A., Genaim, S., Martin-Martin, E.: May-happen-in-parallel analysis for actor-based concurrency. ACM Trans. Comput. Log. 17(2), 11:1–11:39 (2016)
Armstrong, J.: Programming Erlang: Software for a Concurrent World. Pragmatic Bookshelf Series, Pragmatic Bookshelf (2007)
Arslan, V., Eugster, P., Nienaltowski, P., Vaucouleur, S.: SCOOP – concurrency made easy. In: Kohlas, J., Meyer, B., Schiper, A. (eds.) Dependable Systems: Software, Computing, Networks. LNCS, vol. 4028, pp. 82–102. Springer, Heidelberg (2006). https://doi.org/10.1007/11808107_4
Baker, H.G., Hewitt, C.E.: The incremental garbage collection of processes. In: Proceeding of the Symposium on Artificial Intelligence Programming Languages, number 12 in SIGPLAN Notices, p. 11, August 1977
Baudin, P., et al.: ACSL: ANSI/ISO C Specification Language. CEA LIST and INRIA, 1.4 edition (2010)
Baumann, C., Beckert, B., Blasum, H., Bormer, T.: Lessons learned from microkernel verification - specification is the new bottleneck. In: Cassez, F., Huuck, R., Klein, G., Schlich, B., (eds.) Proceedings 7th Conference on Systems Software Verification, EPTCS, vol. 102, pp. 18–32 (2012)
Beckert, B.: A dynamic logic for the formal verification of java card programs. In: Attali, I., Jensen, T. (eds.) JavaCard 2000. LNCS, vol. 2041, pp. 6–24. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-45165-X_2
Beckert, B., Klebanov, V., Weiß, B.: Dynamic logic for java. Deductive Software Verification – The KeY Book. LNCS, vol. 10001, pp. 49–106. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49812-6_3
Blom, S., Huisman, M., Mihelcic, M.: Specification and verification of GPGPU programs. Sci. Comput. Program. 95, 376–388 (2014)
Bocchi, L., Lange, J., Tuosto, E.: Three algorithms and a methodology for amending contracts for choreographies. Sci. Ann. Comp. Sci. 22(1), 61–104 (2012)
Brookes, S., O’Hearn, P.W.: Concurrent separation logic. ACM SIGLOG News 3(3), 47–65 (2016)
Caromel, D., Henrio, L., Serpette, B.P.: Asynchronous and deterministic objects. In: Proceedings of the 31st ACM Symposium on Principles of Programming Languages (POPL 2004), pp. 123–134. ACM Press (2004)
da Rocha Pinto, P., Dinsdale-Young, T., Gardner, P.: TaDA: a logic for time and data abstraction. In: Jones, R. (ed.) ECOOP 2014. LNCS, vol. 8586, pp. 207–231. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44202-9_9
Dahl, O.-J.: Monitors revisited. In: Roscoe, A.W., (ed.) A classical Mind: Essays in Honour of C.A.R. Hoare, pp. 93–103. Prentice Hall, Upper Saddle River (1994)
de Boer, F., et al.: A survey of active object languages. ACM Comput. Surv. 50(5), 76:1–76:39 (2017)
de Boer, F.S., Clarke, D., Johnsen, E.B.: A complete guide to the future. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 316–330. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71316-6_22
Din, C.C., Bubel, R., Hähnle, R.: KeY-ABS: a deductive verification tool for the concurrent modelling language ABS. In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 517–526. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_35
Din, C.C., Dovland, J., Johnsen, E.B., Owe, O.: Observable behavior of distributed systems: component reasoning for concurrent objects. J. Logic Algebraic Program. 81(3), 227–256 (2012)
Din, C.C., Hähnle, R., Johnsen, E.B., Pun, K.I., Tapia Tarifa, S.L.: Locally abstract, globally concrete semantics of concurrent programming languages. In: Schmidt, R.A., Nalon, C. (eds.) TABLEAUX 2017. LNCS (LNAI), vol. 10501, pp. 22–43. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66902-1_2
Din, C.C., Owe, O.: Compositional reasoning about active objects with shared futures. Formal Aspects Comput. 27(3), 551–572 (2015). https://doi.org/10.1007/s00165-014-0322-y
Din, C.C., Tapia Tarifa, S.L., Hähnle, R., Johnsen, E.B.: History-based specification and verification of scalable concurrent and distributed systems. In: Butler, M., Conchon, S., Zaïdi, F. (eds.) ICFEM 2015. LNCS, vol. 9407, pp. 217–233. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-25423-4_14
Dinsdale-Young, T., da Rocha Pinto, P., Gardner, P.: A perspective on specifying and verifying concurrent modules. J. Logic. Algebraic Methods Program. 98, 1–25 (2018)
Flanagan, C., Felleisen, M.: The semantics of future and an application. J. Funct. Program. 9(1), 1–31 (1999)
Flores-Montoya, A.E., Albert, E., Genaim, S.: May-happen-in-parallel based deadlock analysis for concurrent objects. In: Beyer, D., Boreale, M. (eds.) FMOODS/FORTE -2013. LNCS, vol. 7892, pp. 273–288. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-38592-6_19
Gavran, I., Niksic, F., Kanade, A., Majumdar, R., Vafeiadis, V.: Rely/guarantee reasoning for asynchronous programs. In: Aceto, L., de Frutos Escrig, D., (eds.) 26th International Conference on Concurrency Theory (CONCUR 2015), volume 42 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 483–496. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2015)
Hähnle, R., Huisman, M.: Deductive software verification: from pen-and-paper proofs to industrial tools. In: Steffen, B., Woeginger, G. (eds.) Computing and Software Science. LNCS, vol. 10000, pp. 345–373. Springer, Cham (2019). https://doi.org/10.1007/978-3-319-91908-9_18
Halstead Jr., R.H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)
Hansen, P.B.: Structured multiprogramming. Commun. ACM 15(7), 574–578 (1972)
Hansen, P.B.: Operating System Principles. Prentice-Hall Inc, Upper Saddle River (1973)
Hoare, C.A.R.: Towards a theory of parallel programming. In: Hansen, P.B. (ed.) Operating System Techniques, pp. 61–71. Springer, New York (1972). https://doi.org/10.1007/978-1-4757-3472-0_6
Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: Proceedings of the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008, pp. 273–284 (2008)
Hüttel, H., et al.: Foundations of session types and behavioural contracts. ACM Comput. Surv. 49(1), 3:1–3:36 (2016)
Jacobs, B., Piessens, F.: The VeriFast program verifier. Technical Report CW-520, Department of Computer Science, Katholieke Universiteit Leuven, August 2008
Johnsen, E.B., Hähnle, R., Schäfer, J., Schlatte, R., Steffen, M.: ABS: a core language for abstract behavioral specification. In: Aichernig, B.K., de Boer, F.S., Bonsangue, M.M. (eds.) FMCO 2010. LNCS, vol. 6957, pp. 142–164. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-25271-6_8
Jones, C.B.: Tentative steps toward a development method for interfering programs. ACM Trans. Program. Lang. Syst. 5(4), 596–619 (1983)
Kamburjan, E.: Behavioral program logic. In: Cerrito, S., Popescu, A. (eds.) TABLEAUX 2019. LNCS (LNAI), vol. 11714, pp. 391–408. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-29026-9_22
Kamburjan, E.: Behavioral program logic and LAGC semantics without continuations (technical report). CoRR, abs/1904.13338 (2019)
Kamburjan, E.: Modular verification of a modular specification: behavioral types as program logics. Ph.D. thesis, Technische Universität Darmstadt (2020)
Kamburjan, E., Chen, T.-C.: Stateful behavioral types for active objects. In: Furia, C.A., Winter, K. (eds.) IFM 2018. LNCS, vol. 11023, pp. 214–235. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-98938-9_13
Kamburjan, E., Din, C.C., Chen, T.-C.: Session-based compositional analysis for actor-based languages using futures. In: Ogata, K., Lawford, M., Liu, S. (eds.) ICFEM 2016. LNCS, vol. 10009, pp. 296–312. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-47846-3_19
Kamburjan, E., Din, C.C., Hähnle, R., Johnsen, E.B.: Asynchronous cooperative contracts for cooperative scheduling. In: Ölveczky, P.C., Salaün, G. (eds.) SEFM 2019. LNCS, vol. 11724, pp. 48–66. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-30446-1_3
Kamburjan, E., Din, C.C., Hähnle, R., Johnsen, E.B.: Asynchronous cooperative contracts for cooperative scheduling. Technical report, TU Darmstadt (2019). http://formbar.raillab.de/en/techreportcontract/
Kirchner, F., Kosmatov, N., Prevosto, V., Signoles, J., Yakobowski, B.: Frama-C: a software analysis perspective. Formal Aspects Comput. 27(3), 573–609 (2015). https://doi.org/10.1007/s00165-014-0326-7
Leavens, G.T., et al.: JML reference manual. Draft revision 2344, May 2013
Leino, K.R.M., Wüstholz, V.: The Dafny integrated development environment. In: Dubois, C., Giannakopoulou, D., Méry, D. (eds.) Proceedings 1st Workshop on Formal Integrated Development Environment, F-IDE, EPTCS, Grenoble, France, vol. 149, pp. 3–15 (2014)
Lin, J.-C., Yu, I.C., Johnsen, E.B., Lee, M.-C.: ABS-YARN: a formal framework for modeling Hadoop YARN clusters. In: Stevens, P., Wąsowski, A. (eds.) FASE 2016. LNCS, vol. 9633, pp. 49–65. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49665-7_4
Liskov, B.H., Shrira, L.: Promises: linguistic support for efficient asynchronous procedure calls in distributed systems. In: Wise, D.S. (ed.) Proceedings of the SIGPLAN Conference on Programming Language Design and Implementation (PLDI 1988), pp. 260–267. ACM Press, June 1988
Nakata, K., Uustalu, T.: A Hoare logic for the coinductive trace-based big-step semantics of while. Logical Methods Comput. Sci. 11(1), 1–32 (2015)
O’Hearn, P., Reynolds, J., Yang, H.: Local reasoning about programs that alter data structures. In: Fribourg, L. (ed.) CSL 2001. LNCS, vol. 2142, pp. 1–19. Springer, Heidelberg (2001). https://doi.org/10.1007/3-540-44802-0_1
Oortwijn, W., Blom, S., Huisman, M.: Future-based static analysis of message passing programs. In: Orchard, D.A., Yoshida, N., (eds.) Proceedings of the Ninth workshop on Programming Language Approaches to Concurrency- and Communication-cEntric Software, PLACES 2016, EPTCS, Eindhoven, The Netherlands, 8th April 2016, vol. 211, pp. 65–72 (2016)
Summers, A.J., Müller, P.: Actor services - modular verification of message passing programs. In: Thiemann, P. (ed.) ESOP 2016), vol. 9632, pp. 699–726. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49498-1_27
Weiß, B.: Deductive verification of object-oriented software: dynamic frames, dynamic logic and predicate abstraction. Ph.D. thesis, Karlsruhe Institute of Technology (2011)
Wong, P.Y.H., Diakov, N., Schaefer, I.: Modelling adaptable distributed object oriented systems using the HATS approach: a fredhopper case study. In: Beckert, B., Damiani, F., Gurov, D. (eds.) FoVeOOS 2011. LNCS, vol. 7421, pp. 49–66. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-31762-0_5
Yonezawa, A., Briot, J.P., Shibayama, E.: Object-oriented concurrent programming in ABCL/1. In: Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 1986), vol. 21, no. 11, pp. 258–268, November 1986. SIGPLAN Notices
Zaharieva-Stojanovski, M., Huisman, M.: Verifying class invariants in concurrent programs. In: Gnesi, S., Rensink, A. (eds.) FASE 2014. LNCS, vol. 8411, pp. 230–245. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-642-54804-8_16
Acknowledgment
This work is supported by the SIRIUS Centre for Scalable Data Access and the FormbaR project, part of AG Signalling/DB RailLab in the Innovation Alliance of Deutsche Bahn AG and TU Darmstadt. The authors thank Wolfgang Ahrendt, Frank de Boer, and Henk Mulder for their careful reading and valuable feedback.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Kamburjan, E., Din, C.C., Hähnle, R., Johnsen, E.B. (2020). Behavioral Contracts for Cooperative Scheduling. In: Ahrendt, W., Beckert, B., Bubel, R., Hähnle, R., Ulbrich, M. (eds) Deductive Software Verification: Future Perspectives. Lecture Notes in Computer Science(), vol 12345. Springer, Cham. https://doi.org/10.1007/978-3-030-64354-6_4
Download citation
DOI: https://doi.org/10.1007/978-3-030-64354-6_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-64353-9
Online ISBN: 978-3-030-64354-6
eBook Packages: Computer ScienceComputer Science (R0)