Knowledge Representation, Reasoning, and the Design of Intelligent Agents

Knowledge Representation, Reasoning, and the Design of Intelligent Agents

P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 KNOWLEDGE REPRESENTATION, REASONING, AND THE DESIGN OF INTELLIGENT AGENTS Knowledge representation and reasoning is the foundation of artificial intel- ligence, declarative programming, and the design of knowledge-intensive software systems capable of performing intelligent tasks. Using logical and probabilistic formalisms based on answer-set programming (ASP) and ac- tion languages, this book shows how such systems can be given knowledge about the world and how this knowledge can be used to solve nontrivial com- putational problems. The authors maintain a balance between mathematical analysis and practical design of intelligent agents. All the concepts, such as answering queries, planning, diagnostics, and probabilistic reasoning, are illustrated by programming examples. The text can be used for AI-related undergraduate and graduate classes and by researchers who would like to learn more about ASP and knowledge representation. Dr. Michael Gelfond is a Professor of Computer Science at Texas Tech University. He received his PhD from the Institute of Mathematics of the Academy of Sciences, St. Petersburg, Russia. He is a AAAI fellow and serves as an Area Editor for the International Journal of Theory and Prac- tice of Logic Programming and as an Executive Editor of the Journal of Logic and Computation. In 2004 and 2012 he was the recipient of the award for most influential paper in twenty years by the International Association of Logic Programming. Yulia Kahl is a member of the Texas Action Group and the Knowledge Representation Lab at Texas Tech. She received her Master’s in Computer Science, focusing on the use of ASP for planning. She has also worked as a programmer at IBM. i P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 ii P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 KNOWLEDGE REPRESENTATION, REASONING, AND THE DESIGN OF INTELLIGENT AGENTS The Answer-Set Programming Approach MICHAEL GELFOND Texas Tech University YULIA KAHL University of Texas at El Paso iii P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 32 Avenue of the Americas, New York, NY 10013-2473, USA Cambridge University Press is part of the University of Cambridge. It furthers the University’s mission by disseminating knowledge in the pursuit of education, learning and research at the highest international levels of excellence. www.cambridge.org Information on this title: www.cambridge.org/9781107029569 C Michael Gelfond and Yulia Kahl 2014 This publication is in copyright. Subject to statutory exception and to the provisions of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. First published 2014 Printed in the United States of America A catalog record for this publication is available from the British Library. Library of Congress Cataloging in Publication Data Gelfond, Michael. Knowledge representation, reasoning, and the design of intelligent agents : the answer-set programming approach / Michael Gelfond, Texas Tech University, Yulia Kahl, University of Texas at El Paso. pages cm Includes bibliographical references and index. ISBN 978-1-107-02956-9 (hardback : alk. paper) 1. Intelligent agents (Computer software) I. Kahl, Yulia, 1970– II. Title. QA76.76.I58G45 2014 006.3–dc23 2013029651 ISBN 978-1-107-02956-9 Hardback Cambridge University Press has no responsibility for the persistence or accuracy of URLs for external or third-party Internet Web sites referred to in this publication and does not guarantee that any content on such Web sites is, or will remain, accurate or appropriate. iv P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 To Lara and Patrick, with love v P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 vi P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 Contents Preface page xiii 1 Logic-Based Approach to Agent Design 1 1.1 Modeling an Intelligent Agent 1 1.2 Simple Family Knowledge Base – an Example 4 1.3 A Historical Comment 6 1.3.1 The Axiomatic Method 6 1.3.2 Logic and Design of Intelligent Agents 7 Summary 8 References and Further Reading 9 Exercises 10 2 Answer Set Prolog (ASP) 11 2.1 Syntax 11 2.2 Semantics 16 2.2.1 Informal Semantics 16 2.2.2 Formal Semantics 21 2.3 A Note on Translation from Natural Language 30 2.4 Properties of ASP Programs 31 Summary 35 References and Further Reading 35 Exercises 36 3 Roots of Answer Set Prolog 40 3.1 First-Order Logic (FOL) 40 3.2 Nonmonotonic Logics 43 3.2.1 Circumscription 44 3.2.2 Autoepistemic Logic 46 3.2.3 Reiter’s Default Theories 47 vii P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 viii Contents 3.3 ASP and Negation in Logic Programming 49 3.3.1 Clark’s Completion 49 3.3.2 Well-Founded Semantics 53 Summary 57 References and Further Reading 57 Exercises 58 4 Creating a Knowledge Base 61 4.1 Reasoning about Family 62 4.1.1 Basic Family Relationships 62 4.1.2 Defining Orphans 66 4.1.3 Defining Ancestors 68 4.2 Reasoning about Electrical Circuits 71 4.3 Hierarchical Information and Inheritance 75 Summary 81 References and Further Reading 82 Exercises 83 5 Representing Defaults 86 5.1 A General Strategy for Representing Defaults 86 5.1.1 Uncaring John 86 5.1.2 Cowardly Students 91 5.1.3 A Special Case 92 5.2 Knowledge Bases with Null Values 93 5.2.1 Course Catalog 93 5.3 Simple Priorities between Defaults 95 5.4 Inheritance Hierarchies with Defaults 99 5.4.1 Submarines Revisited 99 5.4.2 Membership Revisited 100 5.4.3 The Specificity Principle 100 5.5 (*) Indirect Exceptions to Defaults 103 Summary 108 References and Further Reading 108 Exercises 109 6 The Answer-Set Programming Paradigm 114 6.1 Computing Hamiltonian Cycles 115 6.2 Solving Puzzles 121 6.2.1 Sudoku Puzzle 121 6.2.2 Mystery Puzzle 125 P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 Contents ix Summary 127 References and Further Reading 128 Exercises 129 7 Algorithms for Computing Answer Sets 131 7.1 Finding Models of Propositional Formulas 131 7.2 Finding Answer Sets of Logic Programs 136 7.2.1 The First Solver 137 7.2.2 The Second Solver 143 7.2.3 Finding Answer Sets of Disjunctive Programs 147 7.2.4 Answering Queries 148 Summary 149 References and Further Reading 149 Exercises 150 8 Modeling Dynamic Domains 152 8.1 The Blocks World – A Historic Example 152 8.2 A General Solution 162 8.3 AL Syntax 166 8.4 AL Semantics – The Transition Relation 167 8.4.1 States 167 8.4.2 Transitions 171 8.5 Examples 175 8.5.1 The Briefcase Domain 175 8.5.2 The Blocks World Revisited 179 8.5.3 Blocks World with Concurrent Actions 182 8.6 Nondeterminism in AL 184 8.7 Temporal Projection 186 Summary 187 References and Further Reading 188 Exercises 189 9 Planning Agents 192 9.1 Classical Planning with a Given Horizon 192 9.2 Examples of Classical Planning 195 9.2.1 Planning in the Blocks World 195 9.2.2 Igniting the Burner 200 9.2.3 Missionaries and Cannibals 201 9.3 Heuristics 204 9.4 Concurrent Planning 208 9.5 (*) Finding Minimal Plans 209 P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 x Contents Summary 211 References and Further Reading 213 Exercises 214 10 Diagnostic Agents 216 10.1 Recording the History of a Domain 218 10.2 Defining Explanations 220 10.3 Computing Explanations 224 10.4 (*) Finding Minimal Explanations 228 10.5 Importance of New Predicates hpd and obs 229 Summary 231 References and Further Reading 232 Exercises 232 11 Probabilistic Reasoning 235 11.1 Classical Probabilistic Models 235 11.2 The Jungle Story in P-log 238 11.3 Syntax and Semantics of P-log 241 11.4 Representing Knowledge in P-log 251 11.4.1 The Monty Hall Problem 252 11.4.2 Death of a Rat? 255 11.4.3 The Spider Bite 257 11.4.4 The Bayesian Squirrel 260 11.5 (*) P-log + CR-Prolog and the Wandering Robot 263 Summary 266 References and Further Reading 267 Exercises 267 12 The Prolog Programming Language 271 12.1 The Prolog Interpreter 271 12.1.1 Unification 272 12.1.2 SLD Resolution 276 12.1.3 Searching for SLD Derivation – Prolog Control 280 12.1.4 SLDNF Resolution 282 12.2 Programming in Prolog 284 12.2.1 The Basics of Prolog Programming 284 12.2.2 Parts Inventory Program 291 12.2.3 (*) Finding Derivatives of Polynomials 295 Summary 304 References and Further Reading 305 Exercises 305 P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 Contents xi Appendix A: ASP Solver Quick-Start 307 Appendix B: Aspide 310 Appendix C: Introduction to SPARC 314 Appendix D: Code 317 D.1 ASP Encoding of the Igniting the Burner Example 317 D.2 ASP Encoding of the Missionaries and Cannibals Example 320 D.3 ASP Encoding of the Circuit Diagnostic Example 325 Bibliography 331 Index 343 P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 xii P1: WQS Trim: 6in × 9in Top: 0.581in Gutter: 0.75in CUUS2070-FM CUUS2070/Gelfond 978 1 107 02956 9 November 23, 2013 14:49 Preface This is a book about knowledge representation and reasoning (KRR) – a comparatively new branch of science that serves as the foundation of arti- ficial intelligence, declarative programming, and the design of intelligent agents – knowledge-intensive software systems capable of exhibiting in- telligent behavior.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    366 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us