ebook img

Alphard: Form and Content PDF

318 Pages·1981·19.498 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Alphard: Form and Content

ALPHARD: Form and Content ALPHARD: ' Form and Content Edited by Mary Shaw Springer-Verlag New York Heidelberg Berlin Mary Shaw (editor) Computer Science Department Carnegie-Mellon University Schenley Park Pittsburgh, Pa. 15213 U.S.A. Library of Congress Cataloging in Publication Data Main entry under title: Alphard : form and content. (Computer science monographs) 1. Alphard (Computer program language) I. Shaw, Mary, 1943- . II. Series. QA76.73.A254A37 001.64'24 81·18449 AACR2 © 1981 by Springer-Verlag New York Inc. All rights reserved. No part of this book may be translated or reproduced in any form without written permission from Springer-Verlag, 175 Fifth Avenue, New York, New York 10010, U.S.A. The use of general descriptive names, trade names, trademarks, etc., in this publication, even if the former are not especially identified, is not to be taken as a sign that such names, as understood by the Trade Marks and Merchandise Marks Act, may accordingly be used freely by anyone. 9 8 7 6 5 4 3 2 1 ISBN-13: 978-0-387-90663-8 e-ISBN-13: 978-1-4612-5979-4 001: 10.1007/978-1-4612-5979-4 Preface Alphard is a design for a programming system that supports the abstraction and verification techniques required by modern program'ming methodology. During the language design process, we were concerned simultaneously with problems of methodology, correctness, and efficiency. Methodological concerns are addressed through facilities for defining new, task·specific abstractions that capture complex notions in terms of their intended properties, without explicating them in terms of specific low· level implementations. Techniques for verifying certain properties of these programs address the correctness concerns. Finally, the language has been designed to permit compilation to efficient object code. Although a compiler was not implemented, the research shed light on specification issues and on programming methodology. Alphard language constructs allow a programmer to isolate an abstraction, specifying its behavior publicly while localizing knowledge about its implementation. The verification of such an abstraction consists of showing that its implementation behaves in accordance with the public specification. Given such a verification, the abstraction may be used with confidence to construct higher·level, more abstract, programs. The most common kind of abstraction in Alphard corresponds to what is now called an abstract data type. An abstract data type comprises a set of values for elements of the type and a set of operations on those values. A new language construct, the form, provides a way to encapsulate the definitions of data structures and operations in such a way that only public information could be accessed by the rest of the program. This volume is a collection of the research reports and articles written during the Alphard development The papers appear in their original form. When a version appeared as a technical report that is longer or more detailed than the corresponding journal article, I have chosen the more extensive version. Since the papers were written over a period of several years, the style and specific details of the language design differ from paper to paper. In order to help the reader make the transitions over evolutionary changes in the language, retrospective passages have been added between papers to explain the changes. These Interludes also present the historical context and the research focus of each of the papers. Acknowledgements I would like to express my deepest appreciation to the colleagues with whom this work was performed. Bill Wulf and Ralph London were as seriously involved as I was; my name appears as editor of this collection simply because I volunteered to organize it Paul Hilfinger was a rich source of ideas and criticism, and Jon Bentley led me to explore the usefulness of these ideas for theoreticians as well as software folk. Numerous students and visitors also contributed heavily: significant contributions were made by Gary Feldman, Bob Fitzgerald, Izumi Kimura, and Jonathan vi Preface Rosenberg, and ideas also emerged from discussions with Mario Barbacci, ROil Brender, Lee Cooprider, Neil Goldman, Don Good, John Guttag, Dorothea Haken, Jim Horning, Mike Horowitz, David Jefferson, Anita Jones, David Lamb, Barbara Liskov, David Musser, Karla Martin Perdue, K.V.S. Prasad, V.R. Prasad, Kamesh Ramakrishna, Jim Saxe, and Dave Wile. The language and, more significantly, the philosophy that underlies it emerged from interactions among these people and from discussions with other friends and critics, particularly those in the Computer Science Department at Carnegie· Mellon University, the USC Information Sciences Institute, and the DARPA Quality Software Working Group. Research Support This research was sponsored by the National Science Foundation (Grants DCR74-04187 and MCS77-03883), by the Defense Advanced Research Projects Agency (DOD) (Contract F44620-73- C-0074 monitored by the Air Force Office of Scientific Research, Contract DAHC-15-72-C-0308, and ARPA Order No. 3597 monitored by the Air Force Avionics Laboratory under Contract F33615-78-C-1551), and by the Office of Naval Research (Contract N00014-76-C-0370). Mary Shaw July 1981 Table of Contents Publication History 1 Introduction .. History and Overview 5 Prelude .. The Alphard form and Verification Issues 11 Part I .. Abstraction and Verification in Alphard: 15 Introduction to Language and Methodology Wm. A. Wulf, Ralph L. London, Mary Shaw (1976) Part II .. Remarks on the Impact of Program Verification 61 on Language Design Ralph L. London (1976) First Interlude .. Inadequacy of Simple Encapsulation 71 Part III .. Abstraction and Verification in Alphard: 73 Iteration and Generators Mary Shaw, Wm. A. Wulf, Ralph L. London (1976) Part IV·· Achieving Quality Software: 117 Reflections on the Aims and Objectives of Alphard Wm. A. Wulf, Mary Shaw, Ralph L. London (1976) Second Interlude .. Larger Examples 135 Part V .. Abstraction and Verification in Alphard: 139 Design and Verification of a Tree Handler Mary Shaw (1976) viii Table of Contents Part VI .. Abstraction and Verification in Alphard: 161 A Symbol Table Example Ralph L. London, Mary Shaw, Wm. A. Wulf (1976) Third Interlude .. Language Evolution 191 Part VII .. An Informal Definition of Alphard 195 Paul Hilfinger, Gary Feldman, Robert Fitzgerald, Izumi Kimura, Ralph L. London, K. V.S. Prasad, V.R. Prasad, Jonathan Rosenberg, Mary Shaw, Wm. A. Wulf (1978) Fourth Interlude .. Generality and Generic Definitions 253 Part VIII .. An Alphard Specification of a Correct and Efficient 255 Transformation on Data Structures Jon Louis Bentley and Mary Shaw (1978) Fifth Interlude .. Validating and Extending the Concepts 283 Part IX .. Validating the Utility of Abstraction Techniques 285 Mary Shaw, Gary Feldman, Robert Fitzgerald, Paul Hilfinger, Izumi Kimura, Ralph L. London, Jonathan Rosenberg, Wm. A. Wulf (1978) Part X .. Toward Relaxing Assumptions in Languages 295 and Their Implementations Mary Shaw and Wm. A. Wulf (1980) Postlude .. Reflections and Open Problems 315 Pu blication History The Alphard research on abstraction techniques has been presented in a number of articles and reports. These appeared over a period of several years, and the language was evolving as the papers were written. A discussion of the chronology of these papers may help to clarify the relations among them. The first paper in the Alphard sequence appeared before there was a language, let alone a name. We first discussed the issues of locality and scope in an essay called "Global Variable Considered Harmful" [1]. Although this essay is not included here, it marked the beginning of our attempts to encapsulate implementation detail. The first appearance of Alphard by that name was in 1974, in a technical report [2] called "Alphard: Toward a Language to Support Structured Programs." This report, also not included in this collection, presented many of the basic ideas of the language, including encapsulation, instantiation, and the notion of form, but the importance of formal specifications had not yet become evident. Preliminary drafts of a lengthy report, "Abstraction and Verification in Alphard," were circulated in Spring 1976. One version appeared in a collection of reports on current language design work [3]. This paper was quite broad, and it was soon obsolete. When it became apparent that this paper covered too much ground, it was divided into three smaller ones [4,5,12], and the title "Abstraction and Verification in Alphard" was adopted as a series title. The first of the subdivided reports [4], which appears as Part One of this voillme, covers the basic organization of the language and the verification methodology. A short version of this report was presented at the Second International Conference on Software Engineering in October 1976 and appeared in the IEEE Transactions on Software Engineering in December 1976 [8]. It was clear that the requirements of verification affected the language design as profoundly as concerns for methodology. This impact was discussed at a workshop on alternatives in the design of a common programming language for embedded computer applications in October 1976. The remarks prepared for that workshop were published in a volume of the Lecture Notes in Computer Science in 1977 [7], and the paper appears here as Part Two. The second segment of the original report [3] addressed part of the problem of defining control abstractions. The technical report which emerged [5] appears as Part Three of this volume. It presents techniques for adapting loop control to programmer-defined abstractions. The resulting language construct was a special kind of form called a generator, and the associated techniques include rules for verifying the definitions and for obtaining proof rules for the resulting loops. The report contains form definitions for sets and extended operations on sets. A short version was presented at the Conference on Language Design for Reliable Software in March 1977. This abbreviated version appeared in the Communications of the ACM in August 1977 and was reprinted in an IEEE tutorial volume in 1980 [10). 2 ALPHARD: FORM AND CONTENT The loop management techniques described in Part Three served as the major example in some reflections about the way joint concerns for verification, methodology, and efficiency interacted in the language design. This discussion of language design philosophy appeared in Carnegie· Mellon's Computer Science Research Review [9] and is included here as Part Four. It was also reprinted in an IEEE Tutorial volume in 1980. Two examples of nontrivial size provided an opportunity to explore the methodology. One example, binary trees, was presented at the Fifth Texas Conference on Computing Systems [6] and was reprinted in Seminaires IRIA: Langages et Traducteurs -- 7977; it appears here as Part Five. The last segment of the early paper [3] was another example, defining a symbol table that supports block structure. This example has been completed and verified. It appeared as a technical report and was subsequently presented at the IFIP Conference on Constructing Quality Software in Summer 1978 [12]; it is included here as Part Six. Our experience with these examples led to considerable revision in the language. The complete definition as of early 1978 was distributed as a technical report [11] and appears as Part Seven. The examples of Parts One to Six do not agree in detail with the 1978 language. However, they are mutually consistent, and the significant differences are explained in the Third Interlude (before Part Seven). Alphard has been used to support the verification of a transformation that is of interest in the field of analysis of algorithms. The Alphard development is of interest here because it illustrates the definition and analysis of a very general generic definition. The correctness of this definition depends on several very specific properties of the form that is provided as an actual parameter. This paper was presented at the IEEE Conference on Specifications of Reliable Software in April 1979, and it appeared in the IEEE Transactions on Software Engineering in November 1980 [13]; it appears here as Part Eight. Although the ideas developed in Alphard and other projects are promising, they are not yet validated in practice. We examined the problem of validating abstract data type techniques in a panel discussion at the 1978 ACM National Conference [13]; the paper appears here as Part Nine. During the development of Alphard, we learned some lessons about the importance of separating the specification of essential properties from the description of incidental effects of a particular implementation decision. We realized that these principles are often violated in language design, and we identified some instances, both in Alphard and in other languages, where successful separations had been made. We discussed this issue in a report that appeared in SIGPLAN Notices in March 1980 [15] and is included here as Part Ten. Various of the Alphard reports contained complete form definitions, including both specifications and representations. Most of these are accompanied by proofs. Since these definitions of abstract data types are interesting in themselves, a list with pointers to their locations in this volume may be helpful: 3 Publication History Abstract type Implementation strategy Location stack vector and pointer Part One queue vector and pointer Part One finite set vector and pointer Parts Three and Seven binary tree vector Part Five symbol table hash table of lists Part Six member set generic definition using Part Eight simpler sets Chronological Bibliography [1] William Wulf and Mary Shaw. "Global Variable Considered Harmful." ACM S/GPLAN Notices, 8, 2 (February, 1973), pp. 28-34. [2] William A. Wulf. "Alphard: Toward a Language to Support Structured Programs." Carnegie Mellon University Technical Report, April 1974. [3] Wm. A .. Wulf, Ralph L. London, and Mary Shaw. "Abstraction and Verification in Alphard." New Directions in Algorithmic Languages -- 1975, prepared for IFIP Working Group 2.1 by Stephen A. Schuman (ed.), Institut de Recherche d'Informatique et d'Automatique, 1976, pp. 217-295. This was a draft version; it was subsequently subdivided into [4,5,11]. [4] Wm. A. Wulf, Ralph L. London, and Mary Shaw. "Abstraction and Verification in Alphard: Introduction to Language and Methodology." Carnegie-Mellon University and USC Infonnation Sciences Institute Technical Reports, June 1976. An abbreviated version appeared in IEEE Transactions of Software Engineering, December 1976 [8]. [5] Mary Shaw, Wm. A. Wulf, and Ralph L. London. "Abstraction and Verification in Alphard: Iteration and Generators." Carnegie-Mellon University and USC Infonnation Sciences Institute Technical Reports, August 1976. An abbreviated version appeared in Communications of the ACM, August 1977 [9]. [6] Mary Shaw. "Abstraction and Verification in Alphard: Design and Verification of a Tree Handler." Carnegie-Mellon University Technical Report, June 1976. Proc. Fifth Texas Conference on Computing Systems, University of Texas at Austin, October 1976, pp. 86-94. Reprinted in Seminaires IRIA: Langages et Traducteurs -- 1977, Institut de Recherche d'Informatique et d'Automatique, 1978, pp. 135-155. [7] Ralph L. London. "Remarks on the Impact of Program Verification on Language Design." In Design and Implementation of Programming Languages: Proceedings of a DoD Sponsored Workshop, Ithaca, October 1976, 1. H. Williams and D. A. Fisher (eds.), Springer-Verlag Lecture Notes in Computer Science 54, 1977, pp. 313-320. [8] Wm. A. Wulf, Ralph L. London, and Mary Shaw. "An Introduction to the Construction and Verification of Alphard Programs." IEEE Transactions' on Software Engineering, SE-2, 4 (December 1976), pp. 253-265. Presented at Second International Conference on Software Engineering, October 1976. [9] William A. Wulf, Mary Shaw, and Ralph L. London. "Achieving Quality Software: Reflections on the Aims and Objectives of Alphard." Computer Science Research Review, Carnegie Mellon University, (December 1976), pp. 7-15. Reprinted in Tutorial: Programming LanJ!uage Design, text for IEEE Tutorial by Anthony 1. Wasserman, 1980, pp. 29-37.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.