Skip to main content

Analyzing a Real-Time Program with Z

  • Conference paper

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

Abstract

Real-time behavior of a multi-tasking program running on a pre-emptive priority-based operating system is analyzed. The operating system and a collection of application tasks are modelled in Z. Real-time is represented by an ordinary Z state variable. The model is adapted to a particular application by defining a state machine for each task and associating execution times with each state. The model is analyzed by exhaustive simulation with the SMV model checker. The state transitions described by Z operation schemas are implemented in the SMV programming language. Invariants, preconditions, and postconditions from the Z are translated to formulas in CTL, the SMV specification language. The SMV program is verified by checking these formulas. This detects coding errors in the SMV program and also reveals inconsistencies in the original Z where operation schemas are inconsistent with state invariants. The errors were corrected. Additional CTL formulas describe temporal properties that cannot be expressed directly in Z. The Z model is validated by checking an example SMV program with CTL formulas that confirm scheduling results from rate-monotonic analysis (RMA). Another application that does not satisfy the assumptions of RMA is analyzed, establishing that high-priority tasks cannot indefinitely delay low-priority tasks and real-time deadlines can be met.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Atlee, J.M., Gannon, J.: State-based model checking of event-driven system requirements. IEEE Transactions on Software Engineering 19(1), 24–40 (1993)

    Article  Google Scholar 

  2. Chaochen, Z., Hoare, C.A.R., Ravn, A.P.: A calculus of durations. Information Processing Letters 40, 269–276 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  3. Clarke, E., Grumberg, O., Long, D.: Verification tools for finite-state concurrent systems. In: de Bakker, J.W., de Roever, W.-P., Rozenberg, G. (eds.) REX 1993. LNCS, vol. 803, pp. 124–175. Springer, Heidelberg (1994)

    Google Scholar 

  4. Evans, A.S.: Specifying and verifying concurrent systems using Z. In: Naftalin, M., Bertrán, M., Denvir, T. (eds.) FME 1994. LNCS, vol. 873, pp. 366–380. Springer, Heidelberg (1994)

    Google Scholar 

  5. Evans, A.S.: Visualizing concurrent Z specifications. In: Bowen, J.P., Hall, J.A. (eds.) Z User Workshop, Cambridge. Workshops in Computing, pp. 269–281. Springer, Heidelberg (1994)

    Google Scholar 

  6. Evans, A.S.: An improved recipe for specifying reactive systems in Z. In: Till, D., Bowen, J.P., Hinchey, M.G. (eds.) ZUM 1997. LNCS, vol. 1212, pp. 275–294. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  7. Fidge, C.J.: Real-time schedulability tests for preemptive multitasking. Real-Time Systems 14(1), 61–93 (1998)

    Article  Google Scholar 

  8. Jacky, J.: The Way of Z: Practical Programming with Formal Methods. Cambridge University Press, Cambridge (1997)

    Google Scholar 

  9. Jacky, J.: Analyzing a real-time program with Z and SMV. Technical Report 98-06-01, Department of Radiation Oncology, University of Washington, Box 356043, Seattle, Washington 98195-6043, USA (June 1998)

    Google Scholar 

  10. Jacky, J., Patrick, M.: Modelling, checking, and implementing a control program for a radiation therapy machine. In: Cleaveland, R., Jackson, D. (eds.) AAS 1997: Proc. 1st ACM SIGPLAN Workshop on Automated Analysis of Software, pp. 25–32 (1997)

    Google Scholar 

  11. Jacky, J., Unger, J., Patrick, M., Reid, D., Risler, R.: Experience with Z developing a control program for a radiation therapy machine. In: Till, D., Bowen, J.P., Hinchey, M.G. (eds.) ZUM 1997. LNCS, vol. 1212, pp. 317–328. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  12. Liu, C.L., Layland, J.W.: Scheduling algorithms for multiprogramming in a hard-real-time environment. Journal of the Association for Computing Machinery 20(1), 46–61 (1973)

    MATH  MathSciNet  Google Scholar 

  13. McMillan, K.L.: The SMV system, Carnegie-Mellon University, USA, February 2 (1992) (Draft)

    Google Scholar 

  14. Spivey, J.M.: Specifying a real-time kernel. IEEE Software 7(5), 21–28 (1990)

    Article  Google Scholar 

  15. Spivey, J.M.: The fuzz Manual. Computing Science Consultancy, UK (January 1991) Second Printing

    Google Scholar 

  16. Spivey, J.M.: The Z Notation: A Reference Manual, 2nd edn. Prentice Hall International Series in Computer Science (1992)

    Google Scholar 

  17. Wind River Systems, Inc., Alameda, California, USA. VxWorks Programmer’s Guide 5.3.1 (1997)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Jacky, J. (1998). Analyzing a Real-Time Program with Z. In: Bowen, J.P., Fett, A., Hinchey, M.G. (eds) ZUM ’98: The Z Formal Specification Notation. ZUM 1998. Lecture Notes in Computer Science, vol 1493. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-49676-2_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-49676-2_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65070-6

  • Online ISBN: 978-3-540-49676-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics