Powerloom Manual
Total Page:16
File Type:pdf, Size:1020Kb
PowerLoom R Manual Powerful knowledge representation and reasoning with delivery in Common-Lisp, Java, and C++ Version: 1.48 16 October 2010 This manual describes PowerLoom 3.2 or later. The PowerLoom development team Hans Chalupsky Robert M. MacGregor Thomas Russ {hans,tar}@isi.edu Copyright c 2010 University of Southern California, Information Sciences Institute, 4676 Admiralty Way, Marina Del Rey, CA 90292, USA Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. PowerLoom is a registered trademark of the University of Southern California. i Table of Contents 1 Introduction::::::::::::::::::::::::::::::::::::: 1 1.1 Powerloom Features :::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Powerloom History ::::::::::::::::::::::::::::::::::::::::::::: 4 1.3 Running PowerLoom ::::::::::::::::::::::::::::::::::::::::::: 4 1.3.1 Command-Line Options ::::::::::::::::::::::::::::::::::: 5 2 Conceptual Framework ::::::::::::::::::::::::: 6 2.1 Terms and Propositions :::::::::::::::::::::::::::::::::::::::: 6 2.2 Definitions ::::::::::::::::::::::::::::::::::::::::::::::::::::: 7 2.3 Truth Values ::::::::::::::::::::::::::::::::::::::::::::::::::: 8 2.4 Modules ::::::::::::::::::::::::::::::::::::::::::::::::::::::: 9 3 Annotated Example ::::::::::::::::::::::::::: 11 3.1 Using Modules :::::::::::::::::::::::::::::::::::::::::::::::: 11 3.2 Concepts:::::::::::::::::::::::::::::::::::::::::::::::::::::: 11 3.3 Relations ::::::::::::::::::::::::::::::::::::::::::::::::::::: 12 3.4 Relation Hierarchies::::::::::::::::::::::::::::::::::::::::::: 13 3.5 Functions ::::::::::::::::::::::::::::::::::::::::::::::::::::: 13 3.6 Defined Concepts ::::::::::::::::::::::::::::::::::::::::::::: 14 3.7 Negation and Open and Closed World Semantics :::::::::::::: 15 3.8 Retraction :::::::::::::::::::::::::::::::::::::::::::::::::::: 17 3.9 Clipping of Values :::::::::::::::::::::::::::::::::::::::::::: 18 3.10 Rule-based Inference ::::::::::::::::::::::::::::::::::::::::: 19 3.11 Explanation ::::::::::::::::::::::::::::::::::::::::::::::::: 20 3.12 Contexts and Modules ::::::::::::::::::::::::::::::::::::::: 22 3.13 Equality Reasoning :::::::::::::::::::::::::::::::::::::::::: 23 3.14 Classification, Subsumption :::::::::::::::::::::::::::::::::: 23 3.15 Truth Maintenance :::::::::::::::::::::::::::::::::::::::::: 24 3.16 Inference Control :::::::::::::::::::::::::::::::::::::::::::: 24 3.17 Keyword Axioms::::::::::::::::::::::::::::::::::::::::::::: 24 3.18 Cardinality/Type Reasoning with Frame Predicates :::::::::: 24 3.19 Loom-to-PowerLoom ::::::::::::::::::::::::::::::::::::::::: 24 3.20 Deviations from KIF ::::::::::::::::::::::::::::::::::::::::: 24 3.21 Differences from Loom ::::::::::::::::::::::::::::::::::::::: 24 3.22 Defaults ::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 3.23 Sets, Lists, SETOFALL, KAPPA ::::::::::::::::::::::::::::: 24 4 Communicating with PowerLoom :::::::::::: 25 4.1 Command Interpreter ::::::::::::::::::::::::::::::::::::::::: 25 4.2 Persistent Knowledge Bases ::::::::::::::::::::::::::::::::::: 26 5 Commands ::::::::::::::::::::::::::::::::::::: 27 ii 6 PowerLoom API ::::::::::::::::::::::::::::::: 40 6.1 API Functions :::::::::::::::::::::::::::::::::::::::::::::::: 40 6.2 Language Specific Interface:::::::::::::::::::::::::::::::::::: 58 6.2.1 Lisp API ::::::::::::::::::::::::::::::::::::::::::::::::: 59 6.2.1.1 Common Lisp Initialization :::::::::::::::::::::::::: 59 6.2.1.2 Type Declarations ::::::::::::::::::::::::::::::::::: 59 6.2.1.3 NULL values :::::::::::::::::::::::::::::::::::::::: 59 6.2.1.4 Wrapped Literal Values:::::::::::::::::::::::::::::: 59 6.2.1.5 Special Variables :::::::::::::::::::::::::::::::::::: 60 6.2.1.6 CLOS Objects versus Structs :::::::::::::::::::::::: 60 6.2.2 C++ API :::::::::::::::::::::::::::::::::::::::::::::::: 60 6.2.3 Java API::::::::::::::::::::::::::::::::::::::::::::::::: 60 6.2.3.1 Initializing PowerLoom :::::::::::::::::::::::::::::: 60 6.2.3.2 PowerLoom Java Conventions ::::::::::::::::::::::: 60 6.2.3.3 Using the PLI Class ::::::::::::::::::::::::::::::::: 62 6.2.3.4 Using Stella Objects ::::::::::::::::::::::::::::::::: 63 6.2.3.5 PowerLoom and Threads :::::::::::::::::::::::::::: 63 6.2.3.6 Setting and Restoring Global Variable Values :::::::: 63 6.2.3.7 Java Character Mapping::::::::::::::::::::::::::::: 65 6.2.3.8 Stella Exceptions in Java :::::::::::::::::::::::::::: 66 6.2.3.9 Iteration in Java::::::::::::::::::::::::::::::::::::: 66 6.2.3.10 Utility Classes for Java ::::::::::::::::::::::::::::: 67 7 Built-In Relations ::::::::::::::::::::::::::::: 68 8 PowerLoom GUI :::::::::::::::::::::::::::::: 84 8.1 Invoking the GUI ::::::::::::::::::::::::::::::::::::::::::::: 84 8.1.1 Starting a PowerLoom Server::::::::::::::::::::::::::::: 85 8.2 GUI Design Goals::::::::::::::::::::::::::::::::::::::::::::: 86 8.3 GUI Overview :::::::::::::::::::::::::::::::::::::::::::::::: 88 8.4 GUI Features ::::::::::::::::::::::::::::::::::::::::::::::::: 90 8.4.1 Connect to Server :::::::::::::::::::::::::::::::::::::::: 90 8.4.2 Edit Preferences:::::::::::::::::::::::::::::::::::::::::: 90 8.4.3 KB Load/Save ::::::::::::::::::::::::::::::::::::::::::: 90 8.4.4 Browsing::::::::::::::::::::::::::::::::::::::::::::::::: 90 8.4.5 Editing :::::::::::::::::::::::::::::::::::::::::::::::::: 93 8.4.6 Choosers ::::::::::::::::::::::::::::::::::::::::::::::::: 95 8.4.7 Extension Editor ::::::::::::::::::::::::::::::::::::::::: 96 8.4.8 Ask and Retrieve Queries::::::::::::::::::::::::::::::::: 97 8.4.9 Search ::::::::::::::::::::::::::::::::::::::::::::::::::: 98 8.4.10 Console ::::::::::::::::::::::::::::::::::::::::::::::::: 99 8.4.11 Cut/Copy/Paste/Delete:::::::::::::::::::::::::::::::: 100 8.5 Future Work ::::::::::::::::::::::::::::::::::::::::::::::::: 100 8.5.1 Large KBs :::::::::::::::::::::::::::::::::::::::::::::: 101 8.5.2 Undo ::::::::::::::::::::::::::::::::::::::::::::::::::: 101 8.5.3 Drag and Drop:::::::::::::::::::::::::::::::::::::::::: 101 8.5.4 Scrapbook :::::::::::::::::::::::::::::::::::::::::::::: 101 iii 8.5.5 Instance Cloning :::::::::::::::::::::::::::::::::::::::: 101 8.5.6 Security::::::::::::::::::::::::::::::::::::::::::::::::: 101 8.5.7 Multiple Users :::::::::::::::::::::::::::::::::::::::::: 101 9 Ontosaurus ::::::::::::::::::::::::::::::::::: 103 10 Installation :::::::::::::::::::::::::::::::::: 104 10.1 System Requirements ::::::::::::::::::::::::::::::::::::::: 104 10.2 Unpacking the Sources :::::::::::::::::::::::::::::::::::::: 105 10.3 Lisp Installation :::::::::::::::::::::::::::::::::::::::::::: 105 10.4 C++ Installation ::::::::::::::::::::::::::::::::::::::::::: 106 10.5 Java Installation :::::::::::::::::::::::::::::::::::::::::::: 107 10.6 Removing Unneeded Files ::::::::::::::::::::::::::::::::::: 107 10.7 Installing PowerLoom Patches :::::::::::::::::::::::::::::: 108 11 Miscellaneous ::::::::::::::::::::::::::::::: 109 12 Glossary ::::::::::::::::::::::::::::::::::::: 134 13 PowerLoom Grammar :::::::::::::::::::::: 137 13.1 Alphabet ::::::::::::::::::::::::::::::::::::::::::::::::::: 137 13.2 Grammar ::::::::::::::::::::::::::::::::::::::::::::::::::: 137 13.2.1 Constants and Typed Variables :::::::::::::::::::::::: 137 13.2.2 Terms ::::::::::::::::::::::::::::::::::::::::::::::::: 138 13.2.3 Sentences :::::::::::::::::::::::::::::::::::::::::::::: 138 13.2.4 Definitions ::::::::::::::::::::::::::::::::::::::::::::: 139 Function Index ::::::::::::::::::::::::::::::::::: 141 Variable Index:::::::::::::::::::::::::::::::::::: 142 Concept Index:::::::::::::::::::::::::::::::::::: 143 Chapter 1: Introduction 1 1 Introduction This document describes the PowerLoom knowledge representation and reasoning system. PowerLoom is the successor to the Loom knowledge representation system. It provides a language and environment for constructing intelligent, knowledge-based applications. Pow- erLoom uses a fully expressive, logic-based representation language (a variant of KIF). It uses a natural deduction inference engine that combines forward and backward chaining to derive what logically follows from the facts and rules asserted in the knowledge base. While PowerLoom is not a description logic, it does have a description classifier which uses technology derived from the Loom classifier to classify descriptions expressed in full first order predicate calculus. PowerLoom uses modules as a structuring device for knowledge bases, and ultra-lightweight worlds to support hypothetical reasoning. To implement PowerLoom we developed a new programming language called STELLA, which is a Strongly Typed, Lisp-like LAnguage that can be translated into Lisp, Java, and C++. STELLA tries to preserve those features of Lisp that facilitate symbolic programming and rapid prototyping, while still allowing translation into readable as well as efficient Java and C++ code. Because PowerLoom in written STELLA, we are able to deliver it in all three languages. 1.1 Powerloom Features PowerLoom is a full-function, logic-based knowledge representation and reasoning system, that supports all aspects of knowledge-based applications. It allows the representation of complex knowledge in a declarative, logic-based language, supports a variety of reasoning mechanisms to make implicit knowledge explicit, has a powerful query engine to retrieve what has been asserted and logically follows from the KB, provides file-based and RDBMS- based storage of knowledge bases, has