Advertisement

Invariants, Well-Founded Statements and Real-Time Program Algebra

  • Ian J. Hayes
  • Larissa Meinicke
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8442)

Abstract

Program algebras based on Kleene algebra abstract the essential properties of programming languages in the form of algebraic laws. The proof of a refinement law may be expressed in terms of the algebraic properties of programs required for the law to hold, rather than directly in terms of the semantics of a language. This has the advantage that the law is then valid for any programming language that satisfies the axioms of the algebra.

In this paper we explore the notion of well-founded statements and their relationship to well-founded relations and iterations. The laws about well-founded statements and relations are combined with invariants to derive a simpler proof of a while-loop introduction law. The algebra is then applied to a real-time programming language. The main difference is that tests within conditions and loops take time to evaluate and during that time the values of program inputs may change. This requires new definitions for conditionals and while loops but the proofs of the introduction laws for these constructs can still make use of the more basic algebraic properties of iterations.

Keywords

Iteration Operator Operational Semantic Algebraic Property Sequential Composition Idle Statement 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abadi, M., Lamport, L.: An old-fashioned recipe for real time. ACM Trans. on Prog. Lang. and Sys. 16(5), 1543–1571 (1994)CrossRefGoogle Scholar
  2. 2.
    Abrial, J.-R.: The B-Book: Assigning programs to meanings. Cambridge University Press (1996)Google Scholar
  3. 3.
    Asarin, E., Caspi, P., Maler, O.: Timed regular expressions. J. ACM 49(2), 172–206 (2002)CrossRefMathSciNetGoogle Scholar
  4. 4.
    Back, R.-J.R., von Wright, J.: Refinement Calculus: A Systematic Introduction. Springer, New York (1998)CrossRefzbMATHGoogle Scholar
  5. 5.
    Back, R.-J.R., von Wright, J.: Reasoning algebraically about loops. Acta Informatica 36, 295–334 (1999)CrossRefzbMATHMathSciNetGoogle Scholar
  6. 6.
    Blikle, A.: Specified programming. In: Blum, E.K., Paul, M., Takasu, S. (eds.) Mathematical Studies of Information Processing. LNCS, vol. 75, pp. 228–251. Springer, Heidelberg (1979)CrossRefGoogle Scholar
  7. 7.
    Cohen, E.: Separation and reduction. In: Backhouse, R., Oliveira, J.N. (eds.) MPC 2000. LNCS, vol. 1837, pp. 45–59. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  8. 8.
    Coleman, J.W.: Expression decomposition in a rely/guarantee context. In: Shankar, N., Woodcock, J. (eds.) VSTTE 2008. LNCS, vol. 5295, pp. 146–160. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  9. 9.
    Colvin, R.J., Hayes, I.J.: Structural operational semantics through context-dependent behaviour. Journal of Logic and Algebraic Programming 80(7), 392–426 (2011)CrossRefzbMATHMathSciNetGoogle Scholar
  10. 10.
    Conway, J.H.: Regular Algebra and Finite Machines. Chapman Hall (1971)Google Scholar
  11. 11.
    Hayes, I.J. (ed.): Specification Case Studies, 2nd edn. Prentice Hall (1993)Google Scholar
  12. 12.
    Hayes, I.J.: Reasoning about real-time programs using idle-invariant assertions. In: Dong, J.S., He, J., Purvis, M. (eds.) Proceedings of 7th Asia-Pacific Software Engineering Conference (APSEC 2000), pp. 16–23. IEEE Computer Society (2000)Google Scholar
  13. 13.
    Hayes, I.J.: Reasoning about real-time repetitions: Terminating and nonterminating. Science of Computer Programming 43(2-3), 161–192 (2002)CrossRefzbMATHMathSciNetGoogle Scholar
  14. 14.
    Hayes, I.J.: A predicative semantics for real-time refinement. In: McIver, A., Morgan, C.C. (eds.) Programming Methodology, pp. 109–133. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  15. 15.
    Hayes, I.J.: Towards platform-independent real-time systems. In: Strooper, P.A. (ed.) ASWEC, pp. 192–200. IEEE Computer Society (2004)Google Scholar
  16. 16.
    Hayes, I.J.: Termination of real-time programs: Definitely, definitely not, or maybe. In: Dunne, S., Stoddart, W. (eds.) UTP 2006. LNCS, vol. 4010, pp. 141–154. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  17. 17.
    Hayes, I.J.: Invariants and well-foundedness in program algebra. In: Cavalcanti, A., Deharbe, D., Gaudel, M.-C., Woodcock, J. (eds.) ICTAC 2010. LNCS, vol. 6255, pp. 1–14. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  18. 18.
    Hayes, I.J., Burns, A., Dongol, B., Jones, C.B.: Comparing degrees of non-deterministic in expression evaluation. The Computer Journal 56(6), 741–755 (2013)CrossRefGoogle Scholar
  19. 19.
    Hayes, I.J., Dunne, S.E., Meinicke, L.: Unifying theories of programming that distinguish nontermination and abort. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 178–194. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  20. 20.
    Hayes, I.J., Utting, M.: A sequential real-time refinement calculus. Acta Informatica 37(6), 385–448 (2001)CrossRefzbMATHMathSciNetGoogle Scholar
  21. 21.
    Hayes, I.J., Colvin, R.J.: Integrated operational semantics: Small-step, big-step and multi-step. In: Derrick, J., Fitzgerald, J., Gnesi, S., Khurshid, S., Leuschel, M., Reeves, S., Riccobene, E. (eds.) ABZ 2012. LNCS, vol. 7316, pp. 21–35. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  22. 22.
    Hayes, I.J., Jones, C.B., Colvin, R.J.: Reasoning about concurrent programs: Refining rely-guarantee thinking. Technical Report CS-TR-1395, School of Computing Science, Newcastle University, 66 pages (September 2013)Google Scholar
  23. 23.
    Hehner, E.C.R.: Termination is timing. In: van de Snepscheut, J.L.A. (ed.) MPC 1989. LNCS, vol. 375, pp. 36–47. Springer, Heidelberg (1989)CrossRefGoogle Scholar
  24. 24.
    Hehner, E.C.R.: Abstractions of time. In: Roscoe, A.W. (ed.) A Classical Mind, ch. 12, pp. 191–210. Prentice Hall (1994)Google Scholar
  25. 25.
    Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice Hall (1998)Google Scholar
  26. 26.
    Hooman, J.: Extending Hoare logic to real-time. Formal Aspects of Computing 6(6A), 801–825 (1994)CrossRefzbMATHGoogle Scholar
  27. 27.
    Jones, C.B.: Systematic Software Development Using VDM, 2nd edn. Prentice-Hall (1990)Google Scholar
  28. 28.
    Kozen, D.: Kleene algebra with tests. ACM Trans. Prog. Lang. and Sys. 19, 427–443 (1999)CrossRefGoogle Scholar
  29. 29.
    Morgan, C.C.: The specification statement. ACM Trans. Prog. Lang. and Sys. 10(3), 403–419 (1988)CrossRefzbMATHGoogle Scholar
  30. 30.
    Morgan, C.C.: Programming from Specifications, 2nd edn. Prentice Hall (1994)Google Scholar
  31. 31.
    Morgan, C.C., Robinson, K.A.: Specification statements and refinement. IBM Jnl. Res. Dev. 31(5), 546–555 (1987)CrossRefzbMATHMathSciNetGoogle Scholar
  32. 32.
    Morris, J.M.: A theoretical basis for stepwise refinement and the programming calculus. Science of Computer Programming 9(3), 287–306 (1987)CrossRefzbMATHMathSciNetGoogle Scholar
  33. 33.
    Søndergaard, H., Sestoft, P.: Referential transparency, definiteness and unfoldability. Acta Informatica 27, 505–517 (1990)CrossRefMathSciNetGoogle Scholar
  34. 34.
    Spivey, J.M.: The Z Notation: A Reference Manual, 2nd edn. Prentice Hall International (1992)Google Scholar
  35. 35.
    Utting, M., Fidge, C.J.: A real-time refinement calculus that changes only time. In: Jifeng, H. (ed.) Proc. 7th BCS/FACS Refinement Workshop, Electronic Workshops in Computing. Springer (July 1996)Google Scholar
  36. 36.
    von Wright, J.: From Kleene algebra to refinement algebra. In: Boiten, E.A., Möller, B. (eds.) MPC 2002. LNCS, vol. 2386, pp. 233–262. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  37. 37.
    von Wright, J.: Towards a refinement algebra. Sci. of Comp. Prog. 51, 23–45 (2004)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Ian J. Hayes
    • 1
  • Larissa Meinicke
    • 1
  1. 1.School of Information Technology and Electrical EngineeringThe University of QueenslandBrisbaneAustralia

Personalised recommendations