Skip to main content

Alice in Wineland: A Fairy Tale with Contracts

  • Chapter
  • First Online:
The Logic of Software. A Tasting Menu of Formal Methods

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13360))

  • 681 Accesses

Abstract

In this tale Alice ends up in Wineland, where she tries to attend the birthday party of one of its most beloved inhabitants. In order to do so, she must learn about contracts and how important they are. She gets exposed to several contract languages, with their syntax and semantics, such as pre- and post-conditions, state machines, context-free grammars, and interval logic. She learns for what type of properties they are appropriate to use, and how to formally verify that programs meet their contracts.

We wish to thank Lewis Carroll, whose books inspired us to write this paper. Also, many thanks to Hurt Sandra Hedström for the wonderful state machine illustration.

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 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.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.

    Or a so-called ghost variable, if your specification system supports them: these are variables that are not part of the program, but are used for specification purposes.

References

  1. Aktug, I., Naliuka, K.: ConSpec - a formal language for policy specification. Sci. Comput. Program. 74(1–2), 2–12 (2008). https://doi.org/10.1016/j.scico.2008.09.004

    Article  MathSciNet  MATH  Google Scholar 

  2. Alur, R., Madhusudan, P.: Visibly pushdown languages. In: Proceedings of ACM Symposium on Theory of Computing (STOC 2004), pp. 202–211. Association for Computing Machinery (2004). https://doi.org/10.1145/1007352.1007390

  3. Beckert, B., Hähnle, R., Schmitt, P.H. (eds.): Verification of Object-Oriented Software. The KeY Approach. LNCS (LNAI), vol. 4334. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-69061-0

    Book  Google Scholar 

  4. Cimatti, A., Clarke, E., Giunchiglia, F., Roveri, M.: NuSMV: a new symbolic model verifier. In: Halbwachs, N., Peled, D. (eds.) CAV 1999. LNCS, vol. 1633, pp. 495–499. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48683-6_44

    Chapter  Google Scholar 

  5. Clarke, E.M., Henzinger, T.A., Veith, H., Bloem, R. (eds.) Handbook of Model Checking. Springer, Heidelberg (2018). https://doi.org/10.1007/978-3-319-10575-8

  6. Della Monica, D., Goranko, V., Montanari, A., Sciavicco, G.: Interval temporal logics: a journey. Bull. Eur. Assoc. Theor. Comput. Sci. EATCS 3(105), 81–107 (2011)

    Google Scholar 

  7. Harel, D.: Statecharts: a visual formalism for complex systems. Sci. Comput. Program. 8(3), 231–274 (1987). https://doi.org/10.1016/0167-6423(87)90035-9

    Article  MathSciNet  MATH  Google Scholar 

  8. Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969). https://doi.org/10.1145/363235.363259

    Article  MATH  Google Scholar 

  9. Hopcroft, J.E., Motwani, R., Ullman, J.D.: Introduction to Automata Theory, Languages, and Computation, 3rd edn. Pearson international edition, Addison-Wesley, Boston (2007)

    MATH  Google Scholar 

  10. Lamport, L.: The temporal logic of actions. ACM Trans. Program. Lang. Syst. 16(3), 872–923 (1994). https://doi.org/10.1145/177492.177726

    Article  Google Scholar 

  11. Leavens, G.T., et al.: JML reference manual (2008)

    Google Scholar 

  12. Meyer, B.: Applying “Design by Contract’’. IEEE Comput. 25(10), 40–51 (1992). https://doi.org/10.1109/2.161279

    Article  Google Scholar 

  13. Nakata, K., Uustalu, T.: A hoare logic for the coinductive trace-based big-step semantics of while. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 488–506. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-11957-6_26

    Chapter  Google Scholar 

  14. Oortwijn, W., Gurov, D., Huisman, M.: Practical abstractions for automated verification of shared-memory concurrency. In: Beyer, D., Zufferey, D. (eds.) VMCAI 2020. LNCS, vol. 11990, pp. 401–425. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-39322-9_19

    Chapter  MATH  Google Scholar 

  15. Reynolds, J.C.: Separation logic: a logic for shared mutable data structures. In: Proceedings of Logic in Computer Science (LICS 2002), pp. 55–74. IEEE Computer Society (2002). https://doi.org/10.1109/LICS.2002.1029817

  16. Rot, J., Bonsangue, M., Rutten, J.: Proving language inclusion and equivalence by coinduction. Inf. Comput. 246, 62–76 (2016). https://doi.org/10.1016/j.ic.2015.11.009

    Article  MathSciNet  MATH  Google Scholar 

  17. Wing, J.M.: A Two-Tiered Approach to Specifying Programs. Ph.D. thesis, Technical Report TR-299 (1983)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christian Lidström .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Gurov, D., Lidström, C., Rümmer, P. (2022). Alice in Wineland: A Fairy Tale with Contracts. In: Ahrendt, W., Beckert, B., Bubel, R., Johnsen, E.B. (eds) The Logic of Software. A Tasting Menu of Formal Methods. Lecture Notes in Computer Science, vol 13360. Springer, Cham. https://doi.org/10.1007/978-3-031-08166-8_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-08166-8_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-08165-1

  • Online ISBN: 978-3-031-08166-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics