Skip to main content

UTP by Example: Designs

  • Chapter
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10215))

Abstract

We present a tutorial introduction to the semantics of a basic nondeterministic imperative programming language in Unifying Theories of Programming (UTP). First, we give a simple relational semantics that accounts for a theory of partial correctness. Second, we give a semantics based on the theory of precondition-postcondition pairs, known in UTP as designs. This paper should be read in conjunction with the UTP book by Hoare & He. Our contribution lies in the large number of examples we introduce.

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

Buying options

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

Learn about institutional subscriptions

References

  1. Abrial, J.-R.: The B Book - Assigning Programs to Meanings. Cambridge University Press, Cambridge (1996)

    Book  MATH  Google Scholar 

  2. Anderson, H., Ciobanu, G., Freitas, L.: UTP and temporal logic model checking. In: [11], pp. 22–41 (2008)

    Google Scholar 

  3. Back, R.-J., Wright, J.: Refinement Calculus: A Systematic Introduction. Graduate Texts in Computer Science. Springer, Heidelberg (1998)

    Book  MATH  Google Scholar 

  4. Backhouse, R.: Galois connections and fixed point calculus. In: Backhouse, R., Crole, R., Gibbons, J. (eds.) Algebraic and Coalgebraic Methods in the Mathematics of Program Construction. LNCS, vol. 2297, pp. 89–150. Springer, Heidelberg (2002). doi:10.1007/3-540-47797-7_4

    Chapter  Google Scholar 

  5. Bandur, V., Woodcock, J.: Unifying theories of logic and specification. In: Iyoda, J., Moura, L. (eds.) SBMF 2013. LNCS, vol. 8195, pp. 18–33. Springer, Heidelberg (2013). doi:10.1007/978-3-642-41071-0_3

    Chapter  Google Scholar 

  6. Banks, M.J., Jacob, J.L.: On modelling user observations in the UTP. In: [62], pp. 101–119 (2010)

    Google Scholar 

  7. Banks, M.J., Jacob, J.L.: Unifying theories of confidentiality. In: [62], pp. 120–136 (2010)

    Google Scholar 

  8. Beg, A., Butterfield, A.: Linking a state-rich process algebra to a state-free algebra to verify software/hardware implementation. In: FIT, Proceedings of the 8th International Conference on Frontiers of Information Technology (2010)

    Google Scholar 

  9. Bresciani, R., Butterfield, A.: A probabilistic theory of designs based on distributions. In: [73], pp. 105–123 (2012)

    Google Scholar 

  10. Butterfield, A.: Saoithín: a theorem prover for UTP. In: [62], pp. 137–156 (2010)

    Google Scholar 

  11. Butterfield, A. (ed.): UTP 2008. LNCS, vol. 5713. Springer, Heidelberg (2010). doi:10.1007/978-3-642-14521-6

    MATH  Google Scholar 

  12. Butterfield, A.: The logic of U \(\cdot \) (TP)2. In: [73], pp. 124–143 (2012)

    Google Scholar 

  13. Butterfield, A., Freitas, L., Woodcock, J.: Mechanising a formal model of flash memory. Sci. Comput. Program. 74(4), 219–237 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  14. Butterfield, A., Sherif, A., Woodcock, J.: Slotted-circus. In: Davies, J., Gibbons, J. (eds.) IFM 2007. LNCS, vol. 4591, pp. 75–97. Springer, Heidelberg (2007). doi:10.1007/978-3-540-73210-5_5

    Chapter  Google Scholar 

  15. Butterfield, A., Woodcock, J., Formalising flash memory: first steps. In: 12th International Conference on Engineering of Complex Computer Systems (ICECCS 2007), 10–14 July 2007, Auckland, New Zealand, pp. 251–260. IEEE Computer Society (2007)

    Google Scholar 

  16. Cavalcanti, A., Woodcock, J.: A tutorial introduction to CSP in Unifying Theories of Programming. In: Cavalcanti, A., Sampaio, A., Woodcock, J. (eds.) PSSE 2004. LNCS, vol. 3167, pp. 220–268. Springer, Heidelberg (2006). doi:10.1007/11889229_6

    Chapter  Google Scholar 

  17. Cavalcanti, A., Gaudel, M.-C.: A note on traces refinement and the conf relation in the unifying theories of programming. In: [11], pp. 42–61 (2008)

    Google Scholar 

  18. Cavalcanti, A., Gaudel, M.-C.: Specification coverage for testing in Circus. In: [62], pp. 1–45 (2010)

    Google Scholar 

  19. Cavalcanti, A., Mota, A., Woodcock, J.: Simulink timed models for program verification. In: Liu, Z., Woodcock, J., Zhu, H. (eds.) Theories of Programming and Formal Methods. LNCS, vol. 8051, pp. 82–99. Springer, Heidelberg (2013). doi:10.1007/978-3-642-39698-4_6

    Chapter  Google Scholar 

  20. Cavalcanti, A., Sampaio, A., Woodcock, J.: Unifying classes and processes. Softw. Syst. Model. 4(3), 277–296 (2005)

    Article  Google Scholar 

  21. Cavalcanti, A., Wellings, A., Woodcock, J.: The safety-critical Java memory model: a formal account. In: Butler, M., Schulte, W. (eds.) FM 2011. LNCS, vol. 6664, pp. 246–261. Springer, Heidelberg (2011). doi:10.1007/978-3-642-21437-0_20

    Chapter  Google Scholar 

  22. Cavalcanti, A., Wellings, A.J., Woodcock, J.: The safety-critical Java memory model formalised. Formal Asp. Comput. 25(1), 37–57 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  23. Cavalcanti, A., Wellings, A.J., Woodcock, J., Wei, K., Zeyda, F.: Safety-critical Java in circus. In: Wellings, A.J., Ravn, A.P. (eds.) The 9th International Workshop on Java Technologies for Real-time and Embedded Systems, JTRES 2011, York, 26–28 September 2011, pp. 20–29. ACM (2011)

    Google Scholar 

  24. Cavalcanti, A., Woodcock, J.: Angelic nondeterminism and unifying theories of programming. Electr. Notes Theor. Comput. Sci. 137(2), 45–66 (2005)

    Article  MATH  Google Scholar 

  25. Cavalcanti, A., Woodcock, J., Dunne, S.: Angelic nondeterminism in the unifying theories of programming. Formal Asp. Comput. 18(3), 288–307 (2006)

    Article  MATH  Google Scholar 

  26. Cavalcanti, A., Zeyda, F., Wellings, A.J., Woodcock, J., Wei, K.: Safety-critical Java programs from circus models. Real-Time Syst. 49(5), 614–667 (2013)

    Article  MATH  Google Scholar 

  27. Chen, X., Ye, N., Ding, W.: A formal approach to analyzing interference problems in aspect-oriented designs. In: [62], pp. 157–171 (2010)

    Google Scholar 

  28. Chen, Y.: Programmable verifiers in imperative programming. In: [62], pp. 172–187 (2010)

    Google Scholar 

  29. Deutsch, M., Henson, M.C.: A relational investigation of UTP designs and prescriptions. In: [34], pp. 101–122 (2006)

    Google Scholar 

  30. Dijkstra, E.W.: Guarded commands, nondeterminacy and formal derivation of programs. Commun. ACM 18(8), 453–457 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  31. Dijkstra, E.W.: A Discipline of Programming. Prentice-Hall, Upper Saddle River (1976)

    MATH  Google Scholar 

  32. Dunne, S.: Conscriptions: a new relational model for sequential computations. In: [73], pp. 144–163 (2012)

    Google Scholar 

  33. Dunne, S.E., Hayes, I.J., Galloway, A.J.: Reasoning about loops in total and general correctness. In: [11], pp. 62–81 (2008)

    Google Scholar 

  34. Dunne, S., Stoddart, B. (eds.): UTP 2006. LNCS, vol. 4010. Springer, Heidelberg (2006)

    MATH  Google Scholar 

  35. Feliachi, A., Gaudel, M.-C., Wolff, B.: Unifying theories in Isabelle/HOL. In: [62], pp. 188–206 (2010)

    Google Scholar 

  36. Foster, S., Zeyda, F., Woodcock, J.: Isabelle/UTP: a mechanised theory engineering framework. In: Naumann, D. (ed.) UTP 2014. LNCS, vol. 8963, pp. 21–41. Springer, Heidelberg (2015). doi:10.1007/978-3-319-14806-9_2

    Google Scholar 

  37. Foster, S., Woodcock, J.: Unifying theories of programming in Isabelle. In: Liu, Z., Woodcock, J., Zhu, H. (eds.) Unifying Theories of Programming and Formal Engineering Methods. LNCS, vol. 8050, pp. 109–155. Springer, Heidelberg (2013). doi:10.1007/978-3-642-39721-9_3

    Chapter  Google Scholar 

  38. Foster, S., Zeyda, F., Woodcock, J.: Unifying heterogeneous state-spaces with lenses. In: Sampaio, A., Wang, F. (eds.) ICTAC 2016. LNCS, vol. 9965, pp. 295–314. Springer, Heidelberg (2016). doi:10.1007/978-3-319-46750-4_17

    Chapter  Google Scholar 

  39. Guttmann, W.: Lazy UTP. In: [11], pp. 82–101 (2008)

    Google Scholar 

  40. Guttmann, W.: Unifying recursion in partial, total and general correctness. In: [62], pp. 207–225 (2010)

    Google Scholar 

  41. Harwood, W., Cavalcanti, A., Woodcock, J.: A theory of pointers for the UTP. In: Fitzgerald, J.S., Haxthausen, A.E., Yenigun, H. (eds.) ICTAC 2008. LNCS, vol. 5160, pp. 141–155. Springer, Heidelberg (2008). doi:10.1007/978-3-540-85762-4_10

    Chapter  Google Scholar 

  42. Hayes, I.J.: Termination of real-time programs: definitely, definitely not, or maybe. In: [34], pp. 141–154 (2006)

    Google Scholar 

  43. Jifeng, H.: Transaction calculus. In: [11], pp. 2–21 (2008)

    Google Scholar 

  44. Jifeng, H.: A probabilistic BPEL-like language. In: [62], pp. 74–100 (2010)

    Google Scholar 

  45. He, J., Hoare, T.: Csp is a retract of CCS. In: [34], pp. 38–62 (2006)

    Google Scholar 

  46. He, J., Qin, S., Sherif, A.: Constructing property-oriented models for verification. In: [34], pp. 85–100 (2006)

    Google Scholar 

  47. He, J., Sanders, J.W.: Unifying probability. In: [34], pp. 173–199 (2006)

    Google Scholar 

  48. Hehner, E.: Retrospective and prospective for unifying theories of programming. In: [34], pp. 1–17 (2006)

    Google Scholar 

  49. Hoare, C.A.R., Hayes, I.J., Jifeng, H., Morgan, C., Roscoe, A.W., Sanders, J.W., Sørensen, I.H., Spivey, J.M., Sufrin, B.: Laws of programming. Commun. ACM 30(8), 672–686 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  50. Hoare, C.A.R., Jifeng, H.: Unifying Theories of Programming. Prentice Hall, Upper Saddle River (1998)

    MATH  Google Scholar 

  51. Jones, C.B.: Systematic Software Development Using VDM. Prentice-Hall International, Upper Saddle River (1986)

    MATH  Google Scholar 

  52. McEwan, A.A., Woodcock, J.: Unifying theories of interrupts. In: [11], pp. 122–141 (2008)

    Google Scholar 

  53. Morgan, C.: Programming from Specifications, 2nd edn. Prentice-Hall International, Upper Saddle River (1994)

    MATH  Google Scholar 

  54. Morris, J.M.: A theoretical basis for stepwise refinement and the programming calculus. Sci. Comput. Program. 9, 287–306 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  55. Nuka, G., Woodcock, J.: Mechanising a unifying theory. In: [34], pp. 217–235 (2006)

    Google Scholar 

  56. Oliveira, M., Cavalcanti, A., Woodcock, J.: Unifying theories in ProofPower-Z. In: [34], pp. 123–140 (2006)

    Google Scholar 

  57. Oliveira, M., Cavalcanti, A., Woodcock, J.: A denotational semantics for circus. Electr. Notes Theor. Comput. Sci. 187, 107–123 (2007)

    Article  Google Scholar 

  58. Oliveira, M., Cavalcanti, A., Woodcock, J.: A UTP semantics for circus. Formal Asp. Comput. 21(1–2), 3–32 (2009)

    Article  MATH  Google Scholar 

  59. Oliveira, M., Cavalcanti, A., Woodcock, J.: Unifying theories in ProofPower-Z. Formal Asp. Comput. 25(1), 133–158 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  60. Perna, J.I., Woodcock, J.: A denotational semantics for Handel-C hardware compilation. In: Butler, M., Hinchey, M.G., Larrondo-Petrie, M.M. (eds.) ICFEM 2007. LNCS, vol. 4789, pp. 266–285. Springer, Heidelberg (2007). doi:10.1007/978-3-540-76650-6_16

    Chapter  Google Scholar 

  61. Perna, J.I., Woodcock, J.: UTP semantics for Handel-C. In: [11], pp. 142–160 (2008)

    Google Scholar 

  62. Qin, S. (ed.): UTP 2010. LNCS, vol. 6445. Springer, Heidelberg (2010)

    Google Scholar 

  63. Ribeiro, P., Cavalcanti, A.: Designs with angelic nondeterminism. In: Seventh International Symposium on Theoretical Aspects of Software Engineering, TASE 2013, 1–3 July 2013, Birmingham, pp. 71–78. IEEE (2013)

    Google Scholar 

  64. Santos, T., Cavalcanti, A., Sampaio, A.: Object-orientation in the UTP. In: [34], pp. 18–37 (2006)

    Google Scholar 

  65. Sherif, A., Cavalcanti, A., He, J., Sampaio, A.: A process algebraic framework for specification and validation of real-time systems. Formal Asp. Comput. 22(2), 153–191 (2010)

    Article  MATH  Google Scholar 

  66. Sherif, A., Jifeng, H.: Towards a time model for Circus. In: George, C., Miao, H. (eds.) ICFEM 2002. LNCS, vol. 2495, pp. 613–624. Springer, Heidelberg (2002). doi:10.1007/3-540-36103-0_62

    Chapter  Google Scholar 

  67. Sherif, A., Jifeng, H., Cavalcanti, A., Sampaio, A.: A framework for specification and validation of real-time systems using circus actions. In: Liu, Z., Araki, K. (eds.) ICTAC 2004. LNCS, vol. 3407, pp. 478–493. Springer, Heidelberg (2005). doi:10.1007/978-3-540-31862-0_34

    Chapter  Google Scholar 

  68. Smith, M.A., Gibbons, J.: Unifying theories of locations. In: [11], pp. 161–180 (2008)

    Google Scholar 

  69. Stoddart, B., Bell, P.: Probabilistic choice, reversibility, loops, and miracles. In: [62], pp. 253–270 (2010)

    Google Scholar 

  70. Stoddart, B., Zeyda, F., Lynas, R.: A design-based model of reversible computation. In: [34], pp. 63–83 (2006)

    Google Scholar 

  71. Wei, K., Woodcock, J., Cavalcanti, A.: Circus time with reactive designs. In: [73], pp. 68–87 (2012)

    Google Scholar 

  72. Weiglhofer, M., Aichernig, B.K.: Unifying input output conformance. In: [11], pp. 181–201 (2008)

    Google Scholar 

  73. Wolff, B., Gaudel, M.-C., Feliachi, A. (eds.): UTP 2012. LNCS, vol. 7681. Springer, Heidelberg (2013)

    Google Scholar 

  74. Woodcock, J.: The miracle of reactive programming. In: [11], pp. 202–217 (2008)

    Google Scholar 

  75. Woodcock, J.: Engineering UToPiA. In: Jones, C., Pihlajasaari, P., Sun, J. (eds.) FM 2014. LNCS, vol. 8442, pp. 22–41. Springer, Heidelberg (2014). doi:10.1007/978-3-319-06410-9_3

    Chapter  Google Scholar 

  76. Woodcock, J., Bandur, V.: Unifying theories of undefinedness in UTP. In: [73], pp. 1–22 (2012)

    Google Scholar 

  77. Woodcock, J., Cavalcanti, A.: A tutorial introduction to designs in unifying theories of programming. In: Boiten, E.A., Derrick, J., Smith, G. (eds.) IFM 2004. LNCS, vol. 2999, pp. 40–66. Springer, Heidelberg (2004). doi:10.1007/978-3-540-24756-2_4

    Chapter  Google Scholar 

  78. Woodcock, J., Cavalcanti, A., Fitzgerald, J.S., Larsen, P.G., Miyazawa, A., Perry, S.: Features of CML: a formal modelling language for systems of systems. In: 7th International Conference on System of Systems Engineering, SoSE 2012, Genova, 16–19 July 2012, pp. 445–450. IEEE (2012)

    Google Scholar 

  79. Zeyda, F., Cavalcanti, A.: Encoding Circus programs in ProofPowerZ. In: [11], pp. 218–237 (2008)

    Google Scholar 

  80. Zeyda, F., Cavalcanti, A.: Higher-order UTP for a theory of methods. In: [73], pp. 204–223 (2012)

    Google Scholar 

  81. Zhan, N., Kang, E.Y., Liu, Z.: Component publications and compositions. In: [11], pp. 238–257 (2008)

    Google Scholar 

  82. Zhu, H., He, J., Peng, X., Jin, N.: Denotational approach to an event-driven system-level language. In: [11], pp. 258–278 (2008)

    Google Scholar 

  83. Zhu, H., Liu, P., He, J., Qin, S.: Mechanical approach to linking operational semantics and algebraic semantics for Verilog using Maude. In: [73], pp. 164–185 (2012)

    Google Scholar 

  84. Zhu, H., Sanders, J.W., He, J., Qin, S.: Denotational semantics for a probabilistic timed shared-variable language. In: [73], pp. 224–247 (2012)

    Google Scholar 

  85. Zhu, H., Yang, F., He, J.: Generating denotational semantics from algebraic semantics for event-driven system-level language. In: [62], pp. 286–308 (2010)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jim Woodcock .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing AG

About this chapter

Cite this chapter

Woodcock, J., Foster, S. (2017). UTP by Example: Designs. In: Bowen, J., Liu, Z., Zhang, Z. (eds) Engineering Trustworthy Software Systems. SETSS 2016. Lecture Notes in Computer Science(), vol 10215. Springer, Cham. https://doi.org/10.1007/978-3-319-56841-6_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-56841-6_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-56840-9

  • Online ISBN: 978-3-319-56841-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics