Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-m42fx Total loading time: 0 Render date: 2024-07-21T04:14:56.629Z Has data issue: false hasContentIssue false

18 - Module Specification

Published online by Cambridge University Press:  28 January 2010

John C. Reynolds
Affiliation:
Carnegie Mellon University, Pennsylvania
Get access

Summary

In constructing a large program, it is vital to be able to divide the program into parts, often called modules, and to specify these modules with sufficient precision that one can program each module knowing only the specification of the other modules.

One of the main benefits of modern type theory is the realization that the type of a module is in fact a formal specification of the module. Indeed (although we will not discuss them in this book) there are implemented type-based systems such as NuPrl and Coq which can handle specifications of functional programs that are as expressive and flexible as the specifications of imperative programs in Chapter 3. As with the specifications of Chapter 3, however, considerable human assistance is needed to insure that a program meets its specification.

In this chapter, we will examine more limited systems for which the check that a module meets its specification can be performed efficiently and without human intervention. What is surprising is the extent to which these less expressive systems can still detect programming errors.

We begin with a discussion of type definitions, especially abstract type definitions that make it possible to separate the definition of an abstract type, including both its representation and the relevant primitive operations, from the part of the program that uses the abstract type but is independent of its representation and the implementation of the primitives. We then examine a more general approach based on existentially quantified types and polymorphic functions.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 1998

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.

  • Module Specification
  • John C. Reynolds, Carnegie Mellon University, Pennsylvania
  • Book: Theories of Programming Languages
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626364.019
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.

  • Module Specification
  • John C. Reynolds, Carnegie Mellon University, Pennsylvania
  • Book: Theories of Programming Languages
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626364.019
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.

  • Module Specification
  • John C. Reynolds, Carnegie Mellon University, Pennsylvania
  • Book: Theories of Programming Languages
  • Online publication: 28 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626364.019
Available formats
×