Skip to main content Accessibility help
×
Hostname: page-component-7bb8b95d7b-fmk2r Total loading time: 0 Render date: 2024-10-02T10:27:01.035Z Has data issue: false hasContentIssue false

28 - From Z to code

Published online by Cambridge University Press:  06 July 2010

Jonathan Jacky
Affiliation:
University of Washington
Get access

Summary

This chapter teaches a practical method for writing code from Z specifications that supplements intuition and experience with formal derivation.

The preceding Chapters 26 and 27 on refinement and program derivation show how to get from Z to code by purely formal methods, where each development step is a formula manipulation. As you must have realized, it is rarely necessary to develop an entire system in this completely formal way. The programming problems that arise within a single project usually present a range of difficulty. Large parts of the project may be so routine that there is no need for any formal description other than the code itself. Only a portion requires specification in Z. In this portion, you might refine only a fraction to a detailed design in Z. And in this fraction you might derive and verify only a page or two of code. The rest is so obvious that it can be translated to code by intuition and then verified by inspection.

Nevertheless, you can choose a strategy for implementing Z that you could justify formally by the methods of Chapters 26 and 27 if you were challenged to do so. This chapter presents such a strategy. When you have a formal specification, you can check designs and code rigorously if doubts remain after informal inspection.

The examples in this chapter are in C. They could easily be adapted to other programming languages.

Type
Chapter
Information
The Way of Z
Practical Programming with Formal Methods
, pp. 265 - 296
Publisher: Cambridge University Press
Print publication year: 1996

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • From Z to code
  • Jonathan Jacky, University of Washington
  • Book: The Way of Z
  • Online publication: 06 July 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574924.033
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • From Z to code
  • Jonathan Jacky, University of Washington
  • Book: The Way of Z
  • Online publication: 06 July 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574924.033
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • From Z to code
  • Jonathan Jacky, University of Washington
  • Book: The Way of Z
  • Online publication: 06 July 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511574924.033
Available formats
×