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 .
To save content items to your Kindle, first ensure no-reply@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.
Data abstraction is based formally on the use of logical types to model data. To make effective use of data abstraction, it is generally necessary to define special-purpose types for both design models and specifications of required behaviour. The formal properties these types are required to have will depend on the kind of behaviour being specified, on the level of abstraction at which the devices are described, and on how accurate the specifications are intended to be.
This means that no fixed collection of logical types can be an adequate basis for specifying all devices. The types bool and num→bool, for example, are sufficient for specifying hardware behaviour at the level of abstraction where the devices used are flip-flops and combinational logic gates. But at the level of abstraction where the primitive components are transistors, an accurate model of behaviour has to account for more kinds of values than can be represented by the two truth-values T and F. It may be necessary to represent electrical signals of several different strengths, or to represent ‘undefined’ or ‘floating’ values. The types bool and num→bool are also insufficient for specifications at the register-transfer level of abstraction, where it is often necessary to specify behaviour not in terms of the values on single wires but in terms of vectors of bits and arithmetical operations on fixed-width binary words. At the architecture level, concise specifications may require comparatively complex abstract data types, such as stacks and queues.
This chapter provides an overview of the formulation of higher order logic used in this book for reasoning about hardware. A brief account is also given of the mechanization of this logic in the HOL theorem proving system.
The version of higher order logic described in this chapter was developed by Mike Gordon at the University of Cambridge [41]. Gordon's version of higher order logic is based on Church's formulation of simple type theory [24], which combines features of the λ-calculus with a simplification of the original type theory of Whitehead and Russell [115]. Gordon's machine-oriented formulation extends Church's theory in two significant ways: the syntax of types includes the polymorphic type discipline developed by Milner for the LCF logic PPλ [48], and the primitive basis of the logic includes rules of definition for extending the logic with new constants and types.
The description of higher order logic given in this chapter is not complete, though it does cover all the aspects of the logic important to an understanding of later chapters. This book is concerned more with specifications than with proofs, and verification of theorems will be left mainly to the reader's logical and mathematical intuition. This chapter therefore deals mostly with notation. See Gordon's paper [41] or the HOL system manual [47] for a full account of higher order logic, including a list of the primitive rules of inference and a set-theoretic semantics.
Continued advances in microelectronics have allowed hardware designers to build devices of remarkable size and complexity. With increasing size and complexity, however, it becomes increasingly difficult to ensure that these devices are free of design errors. Exhaustive simulation of even moderately-sized circuits is impossible, and partial simulation offers only partial assurance of correctness.
This is an especially serious problem in safety-critical applications, where failure due to design errors may cause loss of life or extensive damage. In these applications, functional errors in circuit designs cannot be tolerated. But even where safety is not the primary consideration, there may be important economic reasons for doing everything possible to eliminate design errors, and to eliminate them early in the design process. A flawed design may mean costly and time-consuming refabrication, and mass-produced devices may have to be recalled and replaced.
A solution to these problems is one of the goals of formal methods for verification of the correctness of hardware designs—sometimes just called hardware verification. With this approach, the behaviour of hardware devices is described mathematically, and formal proof is used to verify that they meet rigorous specifications of intended behaviour. The proofs can be very large and complex, so mechanized theorem-proving tools are often used to construct them.
Considerable progress has been made in this area in the past few years.
The notion of abstraction plays a central role in making formal proof an effective method for dealing with the problem of hardware correctness. This chapter explains how two important types of abstraction—which will be referred to as abstraction within a model of hardware behaviour and abstraction between models of hardware behaviour—can be expressed in higher order logic.
Abstraction within a model has to do with the way in which the correctness of individual designs is formulated. With the approach to hardware verification introduced in the previous chapter, correctness is stated by a proposition which asserts that some relationship of ‘satisfaction’ holds between the model of a circuit design and a specification of its intended behaviour. This relationship must, in general, be one of abstraction—it must relate a detailed model of an actual design to a more abstract specification of required behaviour. Sections 4.1–4.6 show how this notion of correctness as an abstraction relationship can be formalized in logic and incorporated into the method of hardware verification already introduced.
The second type of abstraction, called abstraction between models, is discussed in section 4.7. Here the concern is not with the correctness of individual designs, but with the relationship between two different collections of specifications for the primitive components used in all designs. One such collection can be an abstraction of another in the sense that it presents a more abstract view of the same primitive components.
This chapter describes the basic techniques for using higher order logic to specify hardware behaviour and to prove the correctness of hardware designs.
The advantages of higher order logic as a formalism for hardware verification are discussed by Gordon in [45] and by Hanna and Daeche in [57, 58]. Higher order logic makes available the results of general mathematics, and this allows one to construct any mathematical tools needed for the verification task in hand. Its expressive power permits hardware behaviour to be described directly in logic; a specialized hardware description language is not needed. In the formulation used here, new constants and types can be introduced by purely definitional means. This allows special-purpose notation for hardware verification to be introduced without the danger associated with postulating ad hoc axioms. In addition, the inference rules of the logic provide a secure basis for proofs of correctness; a specialized deductive calculus for reasoning about hardware behaviour is not required.
Although higher order logic has all these pragmatic advantages, to say that it is the only feasible formalism for hardware verification would be an exaggeration. Some other approaches axe briefly discussed at the end of this chapter. Furthermore, higher order logic does not make traditional hardware description languages (HDLs) obsolete. A major problem with these languages is that they usually lack a formal semantics, which precludes using them to reason about hardware behaviour.
This case study is a formal description of a protocol for a local area network, using the specification language PSF.
One approach to local networking is the ring network. Although various types of rings have been proposed and built, we will study one of the more popular organizations, the token ring network. In such a network, a token circulates around the ring, which can be captured by one of the components. The component guarding the token is allowed to transmit a message.
The protocol specified in this paper is based on the token ring described in [IEEE85b] as an IEEE standard. This description is given partly in informal, natural language and drawings, and partly by means of state transition systems. The intention of this chapter is to apply a Formal Description Technique in order to give a formal specification of the protocol. In contrast to the protocols in the previous chapters, we try to provide a specification, that resembles an existing standard as much as possible.
TOKEN RING NETWORK, AN INTRODUCTION
A ring consists of a collection of ring interfaces connected by point-to-point links that form a circle, as shown in Figure 7.1. Point-to-point links involve a well-understood and field-proven technology. Due to the sequential ordering of the stations attached to a ring, a ring-based protocol is in general fair in the sense that each station eventually will get control of the ring. In a token ring, each station has a known upper bound on channel access. The ring network standardized in [IEEE85b] is called a token ring and in this section we will take a closer look on what this is.
The Amoeba Distributed Operating System uses a Transaction Protocol for the communication between different processes running under the supervision of the Operating System. A transaction is a basic form of information exchange between two processes, consisting of a request followed by a reply. Contrary to a Connection Oriented Protocol a Transaction Protocol does not establish a permanent (logical) connection between two communicating processes. For each transaction a connection is built up. As soon as the transaction is finished the connection is broken. The choice of a Transaction Protocol in favour of a Connection Oriented Protocol is based on the observation that in a distributed operating system most communications within a network do not imply massive data transport during a long time. As a result the overhead costs of building up and maintaining a permanent connection between two processes will be (too) high.
In the Amoeba Operating System transactions take place between a Client process and a Server process. A Client process sends a request to the network. This request can be answered by a Server process with a reply. In order to increase the performance and the fault tolerance of the operating system several Server processes may provide the same service. When a specific Server crashes or is temporarily busy another one can take over its task.
As in all communication protocols, acknowledgements are needed for reliable communications. In the Amoeba Transaction Protocol, abbreviated to ATP in the sequel, an acknowledgement message from Client to Server is used to report the reception of a reply. The reply itself serves as an acknowledgement of the reception of a request.
An important reason why formal description techniques are not appreciated as widely as wished by the developers of such techniques, is that people who actually design and implement software have relatively little knowledge of formal methods. The acceptance of formal techniques not only depends on the existence of techniques that are easy to understand and easy to use, but also on the training of potential users. This implies that there is a need for text books and case-studies. We think that a collection of formal specifications in a restricted area of application may help to get a better understanding of the use of formal techniques. Although the method we use is well suited for formal verification, we concentrate on the act of specification. A first requirement for a formal correctness proof is a formal specification.
We restrict ourselves in this book to a collection of specifications concerning one application area, the field of communication protocols. Although this seems to be an area with a relatively high acceptance of formal techniques, most of the protocols that are actually in use are specified in natural language, if ever specified otherwise than by the actual implementation. Even well-known and accepted standards, such as the token ring protocol, do not have a rigorous formal definition. Informal specifications in this area may lead to misinterpretations and, thus, to different implementations that will not be able to work together. Formal techniques are especially needed for communication protocol design, since these protocols describe distributed systems which have a high degree of non-determinism.
Sliding Window Protocols are used to provide reliable data communication between two computers in a network environment. A Sliding Window Protocol is connection oriented: a logical connection between the computers is established before data are transferred. Establishing a connection is not part of a Sliding Window Protocol. The connection is supposed to be a point-to-point connection without an intermediate network station. Sliding Window Protocols are situated in the Data Link Layer of the ISO OSI layer model.
In Tanenbaum ([Tan89]) three Sliding Window Protocols are presented. In this chapter a formal specification of these protocols is given. In the remainder of this section we give a general and informal description of a Sliding Window Protocol. In sections 4.2 to 4.4 the different Sliding Window Protocols are introduced and specified in PSF. The communication between Host processes and a Sliding Window Protocol is specified in section 4.5.
GENERAL DESCRIPTION OF A SLIDING WINDOW PROTOCOL
A Sliding Window Protocol (SWP) manages the communication on a point-to-point connection between two computers in a network at the Data Link Layer level in the OSI terminology. A SWP is a full-duplex protocol. This means that data can be transmitted simultaneously from station <I>A to station <I>B and vice versa. On both sides a SWP process is active, taking care of correct transmission. A SWP process contains a sending and a receiving part, managing outgoing and incoming data respectively. As we shall see in the sequel, these parts are not fully separated.
The specifications in this book are the result of a number of case studies performed by researchers from the Programming Research Group at the University of Amsterdam. The primary goal was to study the use of the techniques developed by the Programming Research Group for the specification of real-life protocols. From the pool of available case studies we made a selection that focuses on communication protocols, which we present in an order well suited for use in education. We hope that this book provides a first step towards a methodology for the design of communication protocols using PSF.
The following people have contributed to this book: Jacob Brunekreef, Henrik Jacobsson, Sjouke Mauw, Gert Veltink and Jos van Wamel.
Other people have helped in initiating and creating this book. The editors would like to express their gratitude for their help in various ways to Jan Bergstra, Jacob Brunekreef, Bob Diertens, Casper Dik, Hans Kamps, Hans Mulder and Jos van Wamel.