ebook img

Software Abstractions: Logic, Language, and Analysis PDF

373 Pages·2012·2.06 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 Software Abstractions: Logic, Language, and Analysis

Software Abstractions: Logic, Language, and Analysis Software Abstractions Logic, Language, and Analysis revised edition Daniel Jackson The MIT Press Cambridge, Massachusetts London, England © 2012 Daniel Jackson All rights reserved. No part of this book may be reproduced in any form by any electronic or mechanical means (including photocopying, recording, or information storage and retrieval) without permission in writing from the publisher. MIT Press books may be purchased at special quantity discounts for busi- ness or sales promotion use. For information, please email special_sales@ mitpress.mit.edu or write to Special Sales Department, The MIT Press, 55 Hayward Street, Cambridge, MA 02142. This book was set in Adobe Warnock and ITC Officina Sans, by the author, using Adobe Indesign and his own software, on Apple computers. Diagrams were drawn with OmniGraffle Pro. Printed and bound in the United States of America. Library of Congress Cataloging-in-Publication Data Jackson, Daniel, 1963– Software abstractions : logic, language, and analysis / Daniel Jackson.—Rev. ed. p. cm. Includes bibliographical references and index. ISBN 978-0-262-01715-2 (hardcover : alk. paper) 1. Computer software— Development. I. Title. QA76.76.D47J29 2012 005.1—dc23 2011024317 10 9 8 7 6 5 4 3 2 1 to Claudia Contents Preface xi Acknowledgments xv Acknowledgments (revised edition) xvii 1: Introduction 1 2: A Whirlwind Tour 5 2.1 Statics: Exploring States .........................................................................6 2.2 Dynamics: Adding Operations .............................................................9 2.3 Classification Hierarchy ......................................................................17 2.4 Execution Traces...................................................................................22 2.5 Summary ................................................................................................28 3: Logic 33 3.1 Three Logics in One .............................................................................33 3.2 Atoms and Relations ............................................................................35 3.3 Snapshots ...............................................................................................48 3.4 Operators ...............................................................................................50 3.5 Constraints .............................................................................................68 3.6 Declarations and Multiplicity Constraints ......................................75 3.7 Cardinality and Integers .....................................................................80 4: Language 85 4.1 An Example: Self-Grandpas ...............................................................85 4.2 Signatures and Fields ...........................................................................93 4.3 Model Diagrams .................................................................................103 4.4 Types and Type Checking .................................................................109 4.5 Facts, Predicates, Functions, and Assertions ................................119 4.6 Commands and Scope .......................................................................130 4.7 Modules and Polymorphism ............................................................133 4.8 Integers and Arithmetic ....................................................................136 viii contents 5: Analysis 141 5.1 Scope-Complete Analysis .................................................................141 5.2 Instances, Examples, and Counterexamples .................................146 5.3 Unbounded Universal Quantifiers ..................................................157 5.4 Scope Selection and Monotonicity .................................................165 6: Examples 171 6.1 Leader Election in a Ring ..................................................................171 6.2 Hotel Room Locking ..........................................................................187 6.3 Media Asset Management ................................................................205 6.4 Memory Abstractions ........................................................................219 Appendix A: Exercises 233 A.1 Logic Exercises ....................................................................................234 A.2 Extending Simple Models .................................................................244 A.3 Classic Puzzles ....................................................................................247 A.4 Metamodels .........................................................................................250 A.5 Small Case Studies ..............................................................................251 A.6 Open-Ended Case Studies ................................................................256 Appendix B: Alloy Language Reference 259 B.1 Lexical Issues .......................................................................................259 B.2 Namespaces .........................................................................................260 B.3 Grammar ..............................................................................................261 B.4 Precedence and Associativity ...........................................................263 B.5 Semantic Basis .....................................................................................264 B.6 Types and Overloading......................................................................266 B.7 Language Features ..............................................................................270 B.8 Relational Expressions .......................................................................285 B.9 Integer Expressions ............................................................................288 B.10 Boolean Expressions ..........................................................................289 Appendix C: Kernel Semantics 295 C.1 Semantics of the Alloy Kernel ..........................................................295 Appendix D: Diagrammatic Notation 299 contents ix Appendix E: Alternative Approaches 301 E.1 An Example ..........................................................................................303 E.2 B .............................................................................................................310 E.3 OCL .......................................................................................................316 E.4 VDM ......................................................................................................322 E.5 Z .............................................................................................................328 References 337 Index 345

Description:
In Software Abstractions Daniel Jackson introduces an approach to software design that draws on traditional formal methods but exploits automated tools to find flaws as early as possible. This approach--which Jackson calls "lightweight formal methods" or "agile modeling"--takes from formal specifica
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.