Skip to main content

Behavioral Contracts for Cooperative Scheduling

  • Chapter
  • First Online:
Deductive Software Verification: Future Perspectives

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.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and 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

Notes

  1. 1.

    The restriction to a subset is purely for presentation purposes. A forthcoming implementation will support full ABS.

  2. 2.

    The specifications of and are shown in the next subsection in connection with specification of suspension points.

  3. 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. 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

  1. Abadi, M., Lamport, L.: Conjoining specifications. ACM Trans. Program. Lang. Syst. 17(3), 507–534 (1995)

    Article  Google Scholar 

  2. ABS development team: The ABS language specification, January 2018. http://docs.abs-models.org/

  3. 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)

    Google Scholar 

  4. 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

    Book  Google Scholar 

  5. Ahrendt, W., Dylla, M.: A system for compositional verification of asynchronous objects. Sci. Comput. Program. 77(12), 1289–1309 (2012)

    Article  Google Scholar 

  6. 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

    Chapter  Google Scholar 

  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)

    Article  MathSciNet  Google Scholar 

  8. Armstrong, J.: Programming Erlang: Software for a Concurrent World. Pragmatic Bookshelf Series, Pragmatic Bookshelf (2007)

    Google Scholar 

  9. 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

    Chapter  Google Scholar 

  10. 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

    Google Scholar 

  11. Baudin, P., et al.: ACSL: ANSI/ISO C Specification Language. CEA LIST and INRIA, 1.4 edition (2010)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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

    Chapter  Google Scholar 

  14. 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

    Chapter  Google Scholar 

  15. Blom, S., Huisman, M., Mihelcic, M.: Specification and verification of GPGPU programs. Sci. Comput. Program. 95, 376–388 (2014)

    Article  Google Scholar 

  16. 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)

    MathSciNet  Google Scholar 

  17. Brookes, S., O’Hearn, P.W.: Concurrent separation logic. ACM SIGLOG News 3(3), 47–65 (2016)

    Article  Google Scholar 

  18. 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)

    Google Scholar 

  19. 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

    Chapter  Google Scholar 

  20. 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)

    Google Scholar 

  21. de Boer, F., et al.: A survey of active object languages. ACM Comput. Surv. 50(5), 76:1–76:39 (2017)

    Article  Google Scholar 

  22. 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

    Chapter  Google Scholar 

  23. 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

    Chapter  Google Scholar 

  24. 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)

    Article  MathSciNet  Google Scholar 

  25. 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

    Chapter  Google Scholar 

  26. 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

    Article  MathSciNet  MATH  Google Scholar 

  27. 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

    Chapter  Google Scholar 

  28. 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)

    Article  MathSciNet  Google Scholar 

  29. Flanagan, C., Felleisen, M.: The semantics of future and an application. J. Funct. Program. 9(1), 1–31 (1999)

    Article  MathSciNet  Google Scholar 

  30. 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

    Chapter  Google Scholar 

  31. 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)

    Google Scholar 

  32. 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

    Chapter  Google Scholar 

  33. Halstead Jr., R.H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)

    Article  Google Scholar 

  34. Hansen, P.B.: Structured multiprogramming. Commun. ACM 15(7), 574–578 (1972)

    Article  Google Scholar 

  35. Hansen, P.B.: Operating System Principles. Prentice-Hall Inc, Upper Saddle River (1973)

    MATH  Google Scholar 

  36. 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

    Chapter  Google Scholar 

  37. 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)

    Google Scholar 

  38. Hüttel, H., et al.: Foundations of session types and behavioural contracts. ACM Comput. Surv. 49(1), 3:1–3:36 (2016)

    Article  Google Scholar 

  39. Jacobs, B., Piessens, F.: The VeriFast program verifier. Technical Report CW-520, Department of Computer Science, Katholieke Universiteit Leuven, August 2008

    Google Scholar 

  40. 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

    Chapter  Google Scholar 

  41. Jones, C.B.: Tentative steps toward a development method for interfering programs. ACM Trans. Program. Lang. Syst. 5(4), 596–619 (1983)

    Article  Google Scholar 

  42. 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

    Chapter  Google Scholar 

  43. Kamburjan, E.: Behavioral program logic and LAGC semantics without continuations (technical report). CoRR, abs/1904.13338 (2019)

    Google Scholar 

  44. Kamburjan, E.: Modular verification of a modular specification: behavioral types as program logics. Ph.D. thesis, Technische Universität Darmstadt (2020)

    Google Scholar 

  45. 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

    Chapter  Google Scholar 

  46. 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

    Chapter  Google Scholar 

  47. 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

    Chapter  Google Scholar 

  48. 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/

  49. 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

    Article  MathSciNet  Google Scholar 

  50. Leavens, G.T., et al.: JML reference manual. Draft revision 2344, May 2013

    Google Scholar 

  51. 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)

    Google Scholar 

  52. 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

    Chapter  Google Scholar 

  53. 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

    Google Scholar 

  54. 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)

    Article  MathSciNet  Google Scholar 

  55. 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

    Chapter  Google Scholar 

  56. 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)

    Google Scholar 

  57. 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

    Chapter  Google Scholar 

  58. Weiß, B.: Deductive verification of object-oriented software: dynamic frames, dynamic logic and predicate abstraction. Ph.D. thesis, Karlsruhe Institute of Technology (2011)

    Google Scholar 

  59. 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

    Chapter  Google Scholar 

  60. 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

    Google Scholar 

  61. 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

    Chapter  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Eduard Kamburjan .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics