ebook img

Nondeterminism in algebraic specifications and algebraic programs. PDF

263 Pages·2012·15.2 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 Nondeterminism in algebraic specifications and algebraic programs.

Progress in Theoretical Computer Science Editor Ronald V. Book, University of California Editorial Board Erwin Engeler, ΕΤΗ Zentrum, Zurich, Switzerland G6rard Huet, INRIA, Le Chesnay, France Jean-Pierre Jouannaud, Universit6 de Paris-Sud, Orsay, France Robin Milner, University of Edinburgh, Edinburgh, Scotland Maurice Nivat, Universite de Paris VII, Paris, France Martin Wirsing, Universität Passau, Passau, Germany Heinrich Hussmann Nondeterminism in Algebraic Specifications and Algebraic Programs Birkhäuser Boston · Basel · Berlin Heinrich Hussmann Technische Universität München Institut für Informatik D-8000 München 2 Germany Library of Congress Cataloging-in-Publication Data Hussmann, Heinrich, 1959- Nondeterminism in algebraic specification and algebraic programs / Heinrich Hussmann. p. cm. -- (Progress in theoretical computer science) Includes bibliographical references, ISBN 0-8176-3700-1 (alk. paper) 1. Computer science—Mathematics. I. Title. II. Series. QA76.9.M35H87 1993 93-9340 005.13'l~dc20 CIP Printed on acid-free paper. © Birkhäuser Boston 1993. Copyright is not claimed for works of U.S. Government employees. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photo copying, recording, or otherwise, without prior permission of the copyright owner. Permission to photocopy for internal or personal use of specific clients is granted by Birkhäuser Boston for libraries and other users registered with the Copyright Clearance Center (CCC), provided that the base fee of $6.00 per copy, plus $0.20 per page is paid directly to CCC, 21 Congress Street, Salem, MA 01970, U.S.A. Special requests should be addressed directly to Birkhäuser Boston, 675 Massachusetts Avenue, Cambridge, MA 02139, U.S.A. ISBN 0-8176-3700-1 ISBN 3-7643-3700-1 Typset copy prepared by the Author. Printed and bound by Quinn-Woodbine, Woodbine, NJ. Printed in the U.S.A. 9 8 7 6 5 4 3 21 Table of Contents Chapter 0: Introduction 1 0.1 Preview 3 0.2 Historical Background 9 0.3 Basic Notions 10 Chapter 1: Nondeterministic Algebraic Specifications 17 1.1 Nondeterministic Algebras 17 1.1.1 A Discussion of Alternative Approaches 18 1.1.2 The Principle of Extensionality 22 1.1.3 The Notion of an Algebra 24 1.2 Inclusion Rules as a Specification Language 28 1.2.1 Axioms and their Semantics 28 1.2.2 The Calculus of Term Rewriting 31 1.2.3 Soundness: A Negative Result 34 1.2.4 Right-Linearity: A Special Case 38 Chapter 2: Specifications with a Deterministic Basis 43 2.1 Deterministic Basis 44 2.1.1 Soundness and Deterministic Basis 45 2.1.2 Determinacy Predicate 46 2.1.3 Completeness: A Negative Result 49 2.2 Additive Specifications 53 2.2.1 DET-Completeness and DET-Additi vity 54 2.2.2 Term Models and Completeness 57 2.3 Junk-Free Models 60 2.3.1 "Junk" in Nondeterministic Models 60 2.3.2 Breadth Induction 63 2.3.4 DET-Generated Models 66 2.3.5 Term-Generated Models 67 2.4 Hierarchical Specifications 71 Chapter 3: Structure of the Model Classes 75 3.1 Homomorphisms and Extremal Algebras 76 3.2 Initial Models 80 3.3 Initial Models with Deterministic Basis 83 Chapter 4: Nondeterministic Specifications as a General Framework 89 4.1 Equational Logic 89 4.2 Term Rewriting 91 vi CONTENTS 4.3 Conditional Axioms 93 4.4 Algebraic Programming 99 4.4.1 Constructor-Based Specifications 99 4.4.2. Narrowing without Confluence 107 4.5 Logic Programming 113 4.5.1. Narrowing Simulates Logic Programming 114 4.5.2. Logic Programming Simulates Narrowing 119 Chapter 5: Implementation and Examples 125 5.1 Term Rewriting 125 5.1.1 Innermost Rewriting 126 5.1.2 Search Strategies 131 5.1.3 Optimizations 132 5.2 Graph Rewriting 136 5.2.1 Representation of Terms by Graphs 137 5.2.2 Rewriting of Term Graphs 139 5.2.3 Soundness and Completeness 142 5.3 Examples 147 5.3.1 Nondeterministic Finite State Automata 147 5.3.2 Petri Nets 150 5.3.3 The Eight Queens Problem 152 5.3.4 The Monkey-Banana Problem 154 5.3.5 Printer Scheduling 156 Chapter 6: Partial Nondeterministic Specifications 161 6.1 Partial Operations 161 6.1.1 Undefined "Values" 161 6.1.2 Partial Multi-Algebras 164 6.2 Partiality and Term Rewriting 167 6.2.1 A Calculus for Partial Specifications 168 6.2.2 Partial DET-Completeness and DET-Additivity 170 6.3 Partial Specifications with Constructor Basis 172 6.4 Structure of the Model Classes 176 6.4.1 Homomorphisms 176 6.4.2 Initial Algebras 178 6.4.3 Terminal Algebras 183 CONTENTS vii Chapter 7: Communicating Processes: An Example 187 7.1. Communicating Processes (CP) 187 7.2. Semantics of CP 189 7.2.1. Transition Semantics 190 7.2.2. Trace Semantics 195 7.2.3. Refusal Semantics 197 7.3. Improvements and Applications 200 Chapter 8: Concluding Remarks 201 8.1. Summary and Evaluation 201 8.2. Future Work 202 References 205 Appendix A: Proofs 215 Appendix B: Experiments with RAP 243 Preface Algebraic specification, nondeterminism and term rewriting are three active research areas aiming at concepts for the abstract description of software systems: Algebraic specifications are well-suited for describing data structures and sequential software systems in an abstract way. Term rewriting methods are used in many prototyping systems and form the basis for executing specifi cations. Nondeterminism plays a major role in formal language theory; in programming it serves for delaying design decisions in program development and occurs in a "natural" way in formalisations of distributed processes. Heinrich Hussmann presents an elegant extension of equational specification and term rewriting to include nondeterminism. Based on a clean modeltheoretic semantics he considers term rewriting systems without confluence restrictions as a specification language and shows that fundamental properties such as the existence of initial models or the soundness and completeness of narrowing, the basic mechanism for executing equational specifications, can be extended to nondeterministic computations. The work of Heinrich Hussmann is an excellent contribution to Algebraic Programming; it gives a framework that admits a direct approach to program verification, is suitable for describing concurrent and distributed processes, and it can be executed as fast as Prolog. Munich, January 1993 Martin Wirsing Preface by the Author This monograph is based on a Ph. D. thesis with the title „Nichtdetermini stische Algebraische Spezifikationen" (in German), which was accepted by the University of Passau in the winter term 1988/1989. The text has been thoroughly revised and substantially extended in the meantime. The original thesis was primarily aimed at the "core" theme of generalizing algebraic specifications to nondeterminism. The monograph version now contains a comparison with the established field of logic programming, a new chapter on narrowing for nondeterministic specifications and a more detailed treatment of graph rewriting techniques. I hope that the revision will extend the readership of this book from specialists in algebraic specification to everybody who is interested in the relationship between logic programming, term rewriting and formal specification. I would like to thank Prof. Broy for finding the topic of the thesis and for his manyfold support, in particular for many fruitful discussions and for reading a preliminary version. Many thanks also to Prof. Wirsing, for reading a draft, for valuable remarks and for proposing the publication within this series of books. The anonymous referee has given very helpful suggestions for the revision of the manuscript, many thanks also to him or her. Many collegues have contributed to this work by discussions and remarks; for their particular interest I would like to thank Thomas Beizner, Alfons Geser, Jürgen Knopp, Bernhard Möller, Peter Mosses, Tobias Nipkow, Gert Smolka and Michal Walicki. Gabi Kohlmaier, now Gabi Hussmann, is entitled to special warm thanks for moral support. Finally, I would like to thank the staff of Birkhäuser for their excellent support in the technical production of the book. Munich, December 22, 1992 Heinrich Hussmann Chapter Ο Introduction This monograph presents a generalization of the theory of equational algebraic specifications, where the equational axioms are replaced by directed rewrite rules. A model-theoretic semantics for such specifications is given, which provides a rather general framework for studying • the integration of nondeterminism into algebraic specifications, and • model-oriented semantics for general (non-confluent) term rewriting. The study of this central topic leads to interesting side results in the fields of • relationships between algebraic and logic programming, and • relationships between term rewriting and graph rewriting. The starting point for this work is the observation that the available formal specification languages for software are very much influenced by the concepts of traditional mathematical logic. In particular, the notion of equality (which is a symmetric operation) plays a central role in algebraic specifications. This emphasis on symmetry does not correspond well to the fact that software belongs to a computational paradigm, which is always directed. Every execution of an algorithm consists in a directed evaluation of its formal descripton (therefore leading to such problems as the question of termination). This kind of directed evaluation transforms syntactical objects into semantically equal ones. Classical (deterministic) evaluation gives a close connection between a non- symmetric relation between objects (the operational evaluation) and a symmetric one (the semantical denotation). The theory of term rewriting is an ideal framework for studying such connections.

Description:
chapter (chapter zero) gives an overview of the historical background of this work, a third section introduces some basic notions. The subsequent first chapter already contains the elementary framework for nondeterministic algebraic specifications (the notion of a model and the calculus of term rew
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.