Powerloom Manual
Powerloom Manual
R
Manual
Powerful knowledge representation and reasoning with
delivery in Common-Lisp, Java, and C++
Version: 1.48
16 October 2010
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
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
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
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.
tractions with retrieval and inference without having to reload large knowledge bases
from scratch after every change. Truth maintenance of cached inference results that
might have been invalidated by updates is done via inference cache contexts. After a
knowledge base has been loaded and changed by some updates, the changed state can
be saved out to a file or an (experimental) persistent store built on top of a relational
database.
• Scalability: Despite its emphasis on expressive representation which usually has to
be paid for with intractable and expensive reasoning procedures, PowerLoom is very
scalable and comes with a variety of mechanisms to control search and handle large
ontologies and knowledge bases. For example, PowerLoom’s reasoning specialists han-
dle a wide variety of inferencing very effectively without having to go through any
rule chaining. Search control annotations can be used to help the inference engine use
rules more effectively. For example, depending on fan-out, certain rules are run more
effectively forwards than backwards (or vice versa), and a KB developer can tell the
system when that’s the case. PowerLoom has resource-bounded depth-first or iterative
deepening search which provides an any-time inference scheme for situations where
resources are limited. A "just-in-time" forward inference engine elaborates the asser-
tion neighborhood of objects touched upon by inference. This allows focused forward
inference relevant to current inference goals, without having to run forward inference
over a potentially very large KB to completion. PowerLoom has a static and dynamic
query optimizer, that, similar to optimizers used in database systems, orders conjunc-
tive goals based on relation extension sizes and rule fan-out to minimize intermediate
result sets and chaining. The dynamic optimizer does this for each conjunctive sub-
goal based on actual bindings. Given this mechanism it is possible to run PowerLoom
queries that return 100,000’s of solutions. PowerLoom also has a powerful relational
database interface that allows it to utilize the power of databases for handling large
assertion bases (soon to be released). One application of this PowerLoom/RDBMS
integration is used with ISI’s Omega ontology. It is also a crucial part of our KOJAK
Link Discovery System.
• Tools and APIs: PowerLoom has a host of associated tools and APIs (not all of which
have been released yet). It comes with an interactive command-line interface which
is useful for developing ontologies and knowledge bases, an extensive programmatic
interface called PLI with Lisp, C++ and Java bindings, and a Lisp-based Loom API to
load legacy Loom KBs. Starting with PowerLoom version 4.0 Ontosaurus and a Java-
based GUI have been released as part of PowerLoom. Ontosaurus is a Web-based KB
browser that dynamically generates HTML pages viewable in a standard Web browser.
The Java-based GUI provides a browse/edit/query environment for developing KBs.
The GUI uses a client/server architecture and can be used embedded or standalone
against a PowerLoom server that might be hosted - among other options - in a Web
server such as Tomcat. A soon-to-be-released Protege plug-in allows export of Protege
ontologies into PowerLoom format. OntoMorph is a translation system that supports
writing of KB translators and importers, e.g., to import ontologies written in other
languages (for example, Flogic).
• Initial Semantic Web support: Given PowerLoom’s emphasis on expressive representa-
tion, we have not yet focused much on Semantic Web languages such as OWL, which
restricts expressivity to gain decidability. OWL also has other limitations such as re-
Chapter 1: Introduction 4
striction to binary relations and lack of support for arithmetic and inequalities which
limits its usefulness for practical applications. Nevertheless, given that people are
starting to use these languages more and more, we’ve developed some initial import
translators for RDF/RDFS and OWL which once they mature we will release as part
of PowerLoom.
• Portability and integration: Since PowerLoom is implemented in STELLA, it is avail-
able in Lisp, C++ and Java implementations and highly portable. PowerLoom can be
run in each of these languages under Unix (such as Linux, SunOS or MacOS X) as
well as Windows 2000 and XP. Due to the availability in three main-stream languages,
it can easily be integrated programmatically with most application software without
having to use some complex integration framework. The C++ and Java libraries for
PowerLoom are also quite small and light-weight, for example, the necessary STELLA
and PowerLoom jar files of the Java implementation are less than 2.5 Meg in size.
PL-USER |=
Under Windows, you can do something similar by running a Command Prompt window
and executing the ‘powerloom.bat’ script. You can also simply double click on the script
which will run PowerLoom and bring up a Command Prompt window for you.
Chapter 1: Introduction 5
Once the |= prompt has come up you can type in PowerLoom commands and see their
results. The string preceding the prompt indicates the "current module" relative to which
commands are interpreted. For example, type the demo command to see a menu of available
demos. Step through one or more of them to get familiar with PowerLoom.
Starting with version 4.0 PowerLoom also ships with an experimental PowerLoom GUI
and the Ontosaurus browser which can additionally be used to edit and browse knowledge
bases.
2 Conceptual Framework
This chapter presents the fundamental conceptual building blocks that are used to construct
PowerLoom knowledge bases. The PowerLoom language is based on KIF, which provides a
syntax and a declarative semantics for first-order predicate calculus expressions. KIF is a
proposed ANSII standard language used by a variety of knowledge representation systems.
Practical knowledge representation systems necessarily add a procedural semantics that
defines the interpretation of knowledge structures when definitions and facts are retracted
or modified. This chapter assumes that the reader has some familiarity with the semantics
of the predicate calculus, and instead focuses on aspects of the semantics that go beyond
the traditional (KIF) semantics.
A PowerLoom knowledge base is constructed by first defining the terminology (concepts
and relations) for a domain, and then asserting additional rules and facts about that domain.
Facts can be asserted and later retracted, so the answers returned by queries may change
over time. The knowledge structures are organized into logical containers called “modules”.
The division into modules means that in general, facts are not asserted globally, but instead
hold only within a specific context. For example, a logical proposition may evaluate as true
within one module, and evaluate as false within a different one.
The discussion below uses some examples of actual PowerLoom syntax to illustrate
certain points. However, we gloss over the fine points of syntax, and instead focus on
semantic issues. The next chapter reverses that emphasis, and presents a series of examples
that illustrate the breadth of syntactic constructs implemented for the PowerLoom language.
2.2 Definitions
PowerLoom requires that relations are defined before they are used within assertions and
queries. The commands defconcept, defrelation, and deffunction are used to define
concepts, relations, and functions, respectively. The definitions
(defconcept person)
(defrelation married-to ((?p1 person) (?p2 person))
(deffunction + ((?n1 number) (?n2 number)) :-> (?sum number))
declare that person is a concept, that married-to is a binary relation that takes ar-
guments of type person, and that + is a function that takes arguments of type number1 .
The requirement that relations be defined before they are referenced can be inconvenient
at times. For example, suppose we wish to define parent as “a person who is the parent of
another person” and we also wish to state that the first argument to the parent-of relation
has type parent:
(defconcept parent (?p)
:<=> (and (person ?p) (exists ?c (parent-of ?p ?c))))
(defrelation parent-of ((?p parent) (?c person)))
In this example, the first reference to parent-of occurs before it is defined. PowerLoom
permits circular references such as these as long as they occur within definitions. It does so
by deferring evaluation of rules that occur within definitions. Here is a specification that is
logically equivalent, but is not legal because the parent-of relation appears in an assertion
before it is defined:
(defconcept parent (?p))
(assert (forall (?p) (<=> (parent ?p)
(and (person ?p) (exists ?c (parent-of ?p ?c))))))
(defrelation parent-of ((?p parent) (?c person)))
So when does the rule inside of the first parent definition get defined? All axioms (facts
and rules) that appear within the boundaries of a definition are evaluated just prior to
the next occurrence of a PowerLoom query. Hence, in the example above where the rule
occurred within the definition, there was no error because evaluation of that rule occured
sometime after the second definition (which defines the otherwise problematic reference to
parent-of).
One will sometimes see the command (process-definitions) appearing at intervals
within a file containing PowerLoom commands. Each such appearance forces the definitions
that preceed it to be fully-evaluated. This is done so that the interval between a definition
and its evaluation not be too great; it can get confusing if PowerLoom reports a semantic
violation long after the origin of the conflict.
PowerLoom definitions commands (those prefixed by “def”) have one other semantic
property that distinguishes them from ordinary assertions. Any axioms that appear within
a definition are tied to that definition. If a definition is modified and then reevaluated,
axioms that don’t survive the modification are retracted. For example, suppose we evaluate
the following two commands.
(defrelation parent-of ((?p1 person) (?p2 person))
:=> (relative-of ?p1 ?p2))
1
The function + and the concept number are predefined in PowerLoom.
Chapter 2: Conceptual Framework 8
If we now ask PowerLoom whether or not Mary is a person, the answer will be yes
(TRUE) because Mary is asserted to be an employee, and membership in employee implies
membership in person. In other words, although the direct assertion that Mary is a person
is not present in the knowledge base, a logical proof exists that the proposition “Mary is a
person” is true.
2.4 Modules
The knowledge loaded into an executing PowerLoom system is divided into logical partitions
called “modules”. The modules are arranged into a hierarchy; knowledge inherits down the
hierarchy from parents to children. A convenient way to organize knowledge is to put
definitional knowledge higher up in the module hierarchy, and factual knowledge lower
down. For example, suppose we want to build a knowledge base that defines a business
domain, and include a substantial number of facts about individual companies. We might
use one or a few modules to define terminology that relates to the business domain, and
then places the set of facts about each company in its own module. If we were querying
the knowledge base about one or a few companies, it would not be necessary to load the
modules for the remaining companies into the system.
Facts asserted within a module are not visible in sibling modules, or in ancestor modules.
Thus, if we enter into PowerLoom an assertion that“Georgia is a state”, we are not asserting
that Georgia is a state in all possible worlds, but that, from the vantage point of the current
module and those modules below, it is the case that Georgia is a state. If we want the fact
that Georgia is a state to be recognized as true in many or most other modules, then we
should make our assertion in a module that is relatively high up in the hierarchy, so that is
visible to (inherited by) the other modules.
The inheritance of facts is not monotonic—a child module can retract or override facts
inherited from its ancestors. For example, suppose we have two modules, called above
and below such that the below module is below (inherits from) the above module. Next,
suppose we make an assertion within the above module that “Joel is a duck”, and then
we shift to the below module and retract the proposition that “Joel is a duck”. From the
vantage point of the below module, if we now ask if Joel is a duck, we will get back the
value unknown. However, if we switch to the above module and ask the same question, we
get back the answer true This occurs because the effect of the retraction operation that
was applied to the below module is not “visible” to modules above it (or to any sibling
modules). Hence, when module hierarchies are involved, it is oversimplifying to state that
a retraction has the effect of erasing a prior assertion.
The PowerLoom execution process maintains a pointer to the current module, and all
asserions, queries, etc. are made relative to that module. Hence, when we talk about
Chapter 2: Conceptual Framework 10
“switching” from one module to another, we are speaking literally—a change-module com-
mand (or one of its equivalents) is invoked to switch from one module to another.2
PowerLoom comes with some modules already built-in. The module named PL-KERNEL
contains a set of general-purpose concept and relation definitions that collectively form
the foundation for constructing application-specific knowledge bases. PowerLoom attaches
specialized reasoners to many of the relations in PL-KERNEL. The command interpreter
starts up in a module named PL-USER. That module is initially empty, and is intended as
a convenient place to experiment with PowerLoom.
2
Many of the Powerloom API procedures take a module argument that causes a temporary switch to a
different module within the scope of that procedure.
Chapter 3: Annotated Example 11
3 Annotated Example
The section presents a small example of a PowerLoom knowledge base. It introduces the
fundamental PowerLoom modelling concepts and illustrates the syntax of basic PowerLoom
declarations, assertions, and commands. This section can be read stand-alone, but readers
who intend to use PowerLoom to create their own models are encouraged to load the demo
file ???, and run the examples “live”.
The conceptual terms introduced in this section include modules, concepts, relations,
functions, instances, propositions, assertions, queries, retraction, positive and negative facts,
clipping, rules, and contexts.
3.2 Concepts
Concepts are defined using the defconcept command. Here we define the concepts company
and corporation:
(defconcept company)
(defconcept corporation (?c company))
The first definition tells the system that company is a concept (in the business module).
The second definition defines a concept corporation. The type declaration (?c company)
indicates that corporation is a subconcept of company, i.e., all instances of corporation
are also instances of company. Let us now create a couple of companies:
1
PowerLoom modules are case-insensitive by default. This means, for example, that a logical constant
named "Foo" may be referenced by any of the symbols ’FOO’, ’foo’, ’foO’ etc. You may create case-
sensitive modules, but if you do so, when inside that module all PowerLoom commands and other symbols
such as AND, EXISTS, etc. will need to be referred to using uppercase names, since no automatic case-
conversion will take place.
Chapter 3: Annotated Example 12
3.3 Relations
So far, our two companies aren’t very interesting. In order to say more about them, we can
define some relations and functions using the declarations defrelation and deffunction:
(defrelation company-name ((?c company) (?name STRING)))
This declaration defines a binary relation company-name. The first value in a company-
name tuple must be an instance of type company, while the second value must be a string.
We can now give our companies names, using the command assert:
(assert (company-name ACME-cleaners "ACME Cleaners, LTD"))
(assert (company-name megasoft "MegaSoft, Inc."))
We can retrieve pairs of companies and their names with the following query (note that
we omitted the optional retrieval variables in which case they are determined by collecting
the free variables in the query expression):
(retrieve all (company-name ?x ?y))
⇒
There are 2 solutions:
#1: ?X=MEGASOFT, ?Y="MegaSoft, Inc."
#2: ?X=ACME-CLEANERS, ?Y="ACME Cleaners, LTD"
Using retrieval variables is useful if we want to order the result columns in a certain way,
for example:
(retrieve all (?y ?x) (company-name ?x ?y))
⇒
There are 2 solutions:
#1: ?Y="MegaSoft, Inc.", ?X=MEGASOFT
#2: ?Y="ACME Cleaners, LTD", ?X=ACME-CLEANERS
Chapter 3: Annotated Example 13
3.5 Functions
This illustrates another point: A PowerLoom relation is by default “multi-valued”, which in
the case of a binary relation means that a single first value can be mapped by the relation
to more than one second value. In the present case, our model permits a company entity to
have more than one company-name. If a (binary) relation always maps its first argument to
exactly one value (i.e., if it it “single-valued”) we can specify it as a function instead of a
relation. For example, we can use a function to indicate the number of employees for a
company:
(deffunction number-of-employees ((?c company)) :-> (?n INTEGER))
When defining a function, all arguments but the last appear just as they do for a relation.
The last argument (and its type) appears by itself following the keyword :->. Defining a
single-valued relation as a function allows us to refer to it using a functional syntax within
a logical sentence, as in the following:
(assert (= (number-of-employees ACME-cleaners) 8))
(assert (= (number-of-employees megasoft) 10000))
Chapter 3: Annotated Example 14
The functional syntax often results in shorter expressions than equivalents that use
relational syntax. For example to retrieve all companies with fewer than 50 employees, we
can simply write:
(retrieve all (and (company ?x) (< (number-of-employees ?x) 50)))
⇒
There is 1 solution:
#1: ?X=ACME-CLEANERS
Using the syntax for relations, the same query would require the introduction of an
existential quantifier, as in:
(retrieve all (and (company ?x)
(exists ?n
(and (number-of-employees ?x ?n)
(< ?n 50)))))
⇒
There is 1 solution:
#1: ?X=ACME-CLEANERS
To repeat ourselves slightly, Powerloom allows users the choice of using either relational
or functional syntax when using a function in predicate position. For example, if f is a
function, then the expressions (f ?x ?y) and (= (f ?x) ?y) are equivalent.
negated proposition by wrapping an explicit not arount it. The reason for this asymmetry
is that checking for truth and falsity really amounts to asking two separate and possibly
expensive queries, and the user or programmer should decide whether the effort should be
expended to ask both queries instead of just one.
PowerLoom can sometimes infer a negative fact without the necessity of a direct asser-
tion. For example:
(ask (= (number-of-employees ACME-cleaners) 8))
⇒
TRUE
(ask (= (number-of-employees ACME-cleaners) 10))
⇒
FALSE
(ask (not (= (number-of-employees ACME-cleaners) 10)))
⇒
TRUE
PowerLoom can infer the second and third answers because it knows that the function
number-of-employees can return only one value, and if that value is the number eight, it
cannot also be something else (in this case, ten).
Many systems, in particular, database systems and Prolog, make the assumptions that
if a proposition cannot be proved true, then it must be false. This is called the “closed
world assumption”. By default, PowerLoom makes an open-world assumption, but for
specific relations it can be instructed to assume a closed world if a user wants closed world
semantics. For example, suppose we introduce a relation works-for, and we assume that
all works-for facts have been entered in our knowledge base:
(defrelation works-for (?p (?c Company)))
(assert (works-for shirly ACME-cleaners))
(assert (works-for jerome zz-productions))
If we ask PowerLoom whether Jerome does NOT work for MegaSoft, it will return
unknown. But if we assert that the relation works-for is closed, then PowerLoom will
assume that Jerome only works for ZZ Productions:
(ask (not (works-for jerome megasoft)))
⇒
UNKNOWN
3.8 Retraction
Below, we introduce a few new terms for defining geographic information. We define a
relation called contains to assert that one geographic location (the second argument to
contains) is located within another:
(defconcept geographic-location)
(defconcept country (?l geographic-location))
(defconcept state (?l geographic-location))
(defconcept city (?l geographic-location))
(defrelation contains ((?l1 geographic-location)
(?l2 geographic-location)))
Now, we can assert some facts about U.S. geography (including one deliberate mistake):
(assert (and
(country united-states)
(geographic-location eastern-us)
(contains united-states eastern-us)
(state georgia) (contains eastern-us georgia)
(city atlanta) (contains georgia atlanta)
(geographic-location southern-us)
(contains united-states southern-us)
(state texas) (contains eastern-us texas)
(city dallas) (contains texas dallas)
(city austin) (contains texas austin)))
We would like to repair the incorrect assertion (contains eastern-us texas). The
PowerLoom command retract allows us to erase assertions that should not be true:
(ask (contains eastern-us texas))
⇒
TRUE
Retraction should not be confused with assertion of negative propositions. For example,
asserting that Texas is not a state would not retract the assertion that it is (a state). Instead,
an evident logical contradiction is detected as a “clash”, and the clashing proposition is
disallowed:
(assert (not (state texas)))
⇒
Derived both TRUE and FALSE for the proposition ‘|P|(STATE TEXAS)’.
Clash occurred in module ‘‘|MDL|/PL-KERNEL-KB/business’.
3.11 Explanation
PowerLoom provides a command called why that you can use to get an explanation of the
logic behind one of its answers. The why command explains the last query entered into the
system, i.e., it should invoked after one has submitted a retrieve or an ask command.
Before asking a why command, you must enable the justifications feature:
(set-feature justifications)
Queries execute a bit more slowly with jusifications enabled, which is why it is disabled
by default. Having enabled justifications, we must (re)run a query. Here is how we can ask
why Dallas is contained in the Southern US:
(ask (contains southern-us dallas))
⇒
TRUE
(why)
⇒
1 (CONTAINS SOUTHERN-US DALLAS)
follows by Modus Ponens
and substitution {?l3/DALLAS, ?l2/TEXAS, ?l1/SOUTHERN-US}
since 1.1 ! (forall (?l1 ?l3)
(<= (CONTAINS ?l1 ?l3)
(exists (?l2)
(and (CONTAINS ?l1 ?l2)
(CONTAINS ?l2 ?l3)))))
and 1.2 ! (CONTAINS SOUTHERN-US TEXAS)
and 1.3 ! (CONTAINS TEXAS DALLAS)
The above explanation tells us that a rule (our transitivity rule) was invoked during
the proof, and that two ground assertions (CONTAINS SOUTHERN-US TEXAS) and (CONTAINS
TEXAS DALLAS) were accessed to supply preconditions for the rule. These combined as-
sertions lead to the conclusion (CONTAINS SOUTHERN-US DALLAS). Within an explanation,
directly asserted propositions are indicated with the prefix ‘!’.
We can also ask why after a retrieve query. However, if the query has multiple solutions,
each one has a separate explanation. In order to ask why, we need to ask for one solution
at a time. This can be done by omitting the word all from the retrieve query, and
subsequently calling (retrieve) to obtain results one-at-a-time.5
(retrieve (contains southern-us ?x))
⇒
#1: ?X=DALLAS
5
The order of solutions will not necessarily be the same as shown here.
Chapter 3: Annotated Example 21
(retrieve)
⇒
There are 2 solutions so far:
#1: ?X=DALLAS
#2: ?X=TEXAS
(retrieve)
⇒
There are 3 solutions so far:
#1: ?X=DALLAS
#2: ?X=TEXAS
#3: ?X=AUSTIN
(why)
⇒
1 (CONTAINS SOUTHERN-US AUSTIN)
follows by Modus Ponens
with substitution {?l1/SOUTHERN-US, ?l3/AUSTIN, ?l2/TEXAS}
since 1.1 ! (FORALL (?l1 ?l3)
(<= (CONTAINS ?l1 ?l3)
(EXISTS (?l2)
(AND (CONTAINS ?l1 ?l2)
(CONTAINS ?l2 ?l3)))))
and 1.2 ! (CONTAINS SOUTHERN-US TEXAS)
and 1.3 ! (CONTAINS TEXAS AUSTIN)
The following query combines a variety of relations that have been entered into the
business modules. It retrieves names of companies whose headquarters are in the southern
US. Note that query variables that do not appear in the output (i.e., variables not listed
after the all
(retrieve ?name (exists (?city ?company)
(and (contains southern-us ?city)
(headquartered-in ?company ?city)
(company-name ?company ?name))))
⇒
There is 1 solution so far:
#1: ?NAME="MegaSoft, Inc."
(why)
⇒
1 (and (COMPANY-NAME MEGASOFT MegaSoft, Inc.)
(HEADQUARTERED-IN MEGASOFT DALLAS)
(CONTAINS SOUTHERN-US DALLAS))
follows by And-Introduction
since 1.1 ! (COMPANY-NAME MEGASOFT MegaSoft, Inc.)
and 1.2 ! (HEADQUARTERED-IN MEGASOFT DALLAS)
and 1.3 (CONTAINS SOUTHERN-US DALLAS)
⇒
There are 4 solutions:
#1: ?X=ACME-CLEANERS, ?Y="ACME Cleaners, LTD"
#2: ?X=MEGASOFT, ?Y="MegaZorch, Inc."
#3: ?X=WEB-PHANTOMS, ?Y="Web Phantoms, Inc."
#4: ?X=MEGASOFT, ?Y="MegaSoft"
We see that all facts pertaining to company names have inherited down from the Business
to the Alternate Business module, except for the name for MegaSoft that we explicitly
retracted. Also, the new facts asserted within the Alternate Business module appear mixed
in with the inherited facts.
3.19 Loom-to-PowerLoom
3.22 Defaults
language, and relatively awkward in Java and C++. Users of either of those languages
are more likely to want to call s-evaluate.
5 Commands
This chapter lists all available PowerLoom commands alphabetically. Each command is doc-
umented with its name, a (possibly empty) list of parameters specified as (<name> <type>)
pairs, its return type, and its category (Command). Almost all of the commands implic-
itly quote their arguments, meaning that when calling them, you don’t need to add any
quotation yourself. For example, the command all-facts-of is defined as follows:
The all-facts-of command has one parameter called instanceRef of type name, and
returns a STELLA list containing zero or more objects of type proposition as its result.
The type name subsumes the types symbol, surrogate, string, and keyword. Unless
you are in a case-sensitive module, the following four commands are equivalent:
(all-facts-of Merryweather)
(all-facts-of :MERRYWEATHER)
(all-facts-of "merryweather")
(all-facts-of @MerryWeather)
Commands can also have &rest parameters (similar to Lisp functions). These are either
used to allow a variable number of arguments, or to handle optional arguments, since
STELLA does not directly support optional arguments.
Here is a list of important parameter types used in the command specifications below:
• generalized-symbol: A generalized symbol is either a plain symbol (similar to a
Lisp symbol) such as Merryweather, a keyword (similar to a Lisp keyword) such as
:KIF, or a STELLA surrogate which is a symbol starting with an at-sign, e.g., @CONS.
STELLA surrogates are used as names for objects of arbitrary types.
• name: Names can be either a string, or a generalized-symbol (i.e., a symbol,
a keyword, or a surrogate). If a symbol is supplied, only its symbol-name is used.
Commands that take names as arguments usually coerce whatever argument is entered
into a string, but by allowing a name they make it a little bit more convenient to type
a name in an interactive invocation.1
• parse-tree: A parse tree is similar to a Lisp s-expression, i.e., it can either be an
atom such as a symbol, number, or a string, or a list of zero or more parse trees. For
example, the expression (happy Fred) is a parse tree, and so are its components happy
and Fred.
Here is the list of all available PowerLoom commands:
In this case the bindings of each solution will become arguments to the specified rela-
tion in the order of querys output variables (the arities have to match). The :pattern
option is a generalization of this mechanism that specifies an arbitrary proposition
pattern to be instantiated by the query’s solution. In this case <description-term>
has to be a SETOFALL or KAPPA expression whose IO-variables will be bound in
sequence to the bindings of a query solution to generate the resulting proposition. Fi-
nally, if a :module option is specified, the assertions will be generated in that module.
Note that for this to work the relations referenced in the query proposition or pattern
have to be visible in the module. Also, instances will not be copied to the target
module, therefore, the resulting propositions might reference external out-of-module
objects in case they are not visible there. If :record-justifications? is TRUE, justifi-
cations will be recorded for the query and the resulting justifications will be linked
to the asserted propositions. Here are some examples:
(assert-from-query (retrieve all (foo ?x ?y)))
(assert-from-query (retrieve all (?y ?x)
(exists ?z
(and (foo ?x ?z)
(foo ?z ?y))))
:relation bar :module other)
(assert-from-query
(retrieve all (and (relation ?x) (symmetric ?x)))
:pattern (kappa (?pred)
(forall (?x ?y)
(=> (holds ?pred ?x ?y)
(holds ?pred ?y ?x))))))
clear-caches () : [Command]
Clear all query and memoization caches.
copyright () : [Command]
Print detailed PowerLoom copyright information.
transitive, while uses-links are only followed one level deep. I.e., a module A that
uses B will see all objects of B (and any of B’s parents) but not see anything from
modules used by B. Another difference is that only objects declared as public can be
inherited via uses-links (this is not yet enforced). Note that - contrary to Lisp - there
are separate name spaces for classes, functions, and variables. For example, a module
could inherit the class CONS from the STELLA module, but shadow the function of the
same name.
The above discussion of :includes and :uses semantics keyed on the inheri-
tance/visibility of symbols. The PowerLoom system makes another very important
distinction: If a module A is inherited directly or indirectly via :includes
specification(s) by a submodule B, then all definitions and facts asserted in A are
visible in B. This is not the cases for :uses; the :uses options does not impact
inheritance of propositions at all.
The list of modules specified in the :includes option plus (if supplied) the parent in
the path used for name become the new module’s parents. If no :uses option was
supplied, the new module will use the STELLA module by default, otherwise, it will
use the set of specified modules.
If :case-sensitive? is supplied as TRUE, symbols in the module will be interned
case-sensitively, otherwise (the default), they will be converted to uppercase before
they get interned. That means that any reference from inside a case-sensitive module
to a non-case-sensitive module will have to use uppercase names for symbols in the
non-case-sensitive module. The standard system modules are all NOT case sensitive.
Modules can shadow definitions of functions and classes inherited from parents or
used modules. Shadowing is done automatically, but generates a warning unless
the shadowed type or function name is listed in the :shadow option of the module
definition .
Examples:
(defmodule "PL-KERNEL/PL-USER"
:uses ("LOGIC" "STELLA")
:package "PL-USER")
(defmodule PL-USER/GENEALOGY)
The remaining options are relevant only for modules that contain STELLA code.
Modules used only to contain knowledge base definitions and assertions have no use
for them:
The keywords :lisp-package, :java-package, and :cpp-package specify the name
of a native package or name space in which symbols of the module should be allocated
when they get translated into one of Lisp, Java, or C++. By default, Lisp symbols are
allocated in the STELLA package, and C++ names are translated without any prefixes.
The rules that the STELLA translator uses to attach translated Java objects to classes
and packages are somewhat complex. Use :java-package option to specify a list of
package names (separated by periods) that prefix the Java object in this module. Use
:java-catchall-class to specify the name of the Java class to contain all global & special
variables, parameter-less functions and functions defined on arguments that are not
classes in the current module. The default value will be the name of the module.
Chapter 5: Commands 33
When set to TRUE, the :api? option tells the PowerLoom User Manual generator
that all functions defined in this module should be included in the API section. Ad-
ditionally, the Java translator makes all API functions synchronized.
[<keyword-option>*])
Relation parameters can be typed or untyped. <keyword-option> represents a key-
word followed by a value that states an assertion about <relconst>. For example,
including the option :foo bar states that the proposition (foo <relconst> bar) is
true. :foo (bar fum) states that both (foo <relconst> bar) and (foo <relconst>
fum) are true. :foo true states that (foo <relconst>) is true, :foo false states
that (not (foo <relconst>)) is true.
print-features () : [Command]
Print the currently enabled and available PowerLoom environment features.
process-definitions () : [Command]
Finish processing all definitions and assertions that have been evaluated/loaded since
that last call to process-definitions. PowerLoom defers complete processing of
definitions to make it easier to support cyclic definitions. Following finalization of
definitions, this call performs semantic validation of any assertions evaluated since the
last call to process-definitions. PowerLoom calls this function internally before
each query; the primary reason to call it explicitly is to force the production of any
diagnostic information that results from the processing and validation.
Chapter 5: Commands 36
reset-powerloom () : [Command]
Reset PowerLoom to its initial state. CAUTION: This will destroy all loaded knowl-
edge bases and might break other loaded STELLA systems if they do reference Pow-
erLoom symbols in their code.
6 PowerLoom API
This chapter lists functions that collectively define the PowerLoom API. The first section
describes the API functions themselves. The signature is the basic Stella signature. In-
formation on how to translate the names of the functions and their arguments into the
programming languages Common Lisp, C++ or Java is given in the Language Specific In-
terface section.
Note that because names in modules that are not case-sensitive are canonicalized, the
name of the returned object may not match name exactly.
get-inferred-binary-proposition-values [Function]
((relation logic-object) (arg object) (module module)
(environment environment)) : pl-iterator
Return all values v such that (relation arg v) has been asserted or can be inferred.
initialize () : [Function]
Initialize the PowerLoom logic system. This function needs to be called by all appli-
cations before using PowerLoom. If it is called more than once, every call after the
first one is a no-op.
A module name of null or the empty string refers to the current module. If no
module can be found with the name module-name, then a Stella no-such-context-
exception is thrown.
Note that because names in modules that are not case-sensitive are canonicalized, the
name of the returned object may not match name exactly.
A module name of null or the empty string refers to the current module. If no
module can be found with the name module-name, then a Stella no-such-context-
exception is thrown.
s-get-domain ((relation-name string) (module-name string) [Function]
(environment environment)) : logic-object
Return the type (concept) for the first argument to the binary relation relation-name.
A module name of null or the empty string refers to the current module. If no
module can be found with the name module-name, then a Stella no-such-context-
exception is thrown.
s-get-inferred-binary-proposition-values [Function]
((relation-name string) (arg-name string) (module-name string)
(environment environment)) : pl-iterator
Return all values v such that (relation-name arg-name v) has been asserted or can
be inferred.
A module name of null or the empty string refers to the current module. If no
module can be found with the name module-name, then a Stella no-such-context-
exception is thrown.
s-get-nth-domain ((relation-name string) (n integer) [Function]
(module-name string) (environment environment)) : logic-object
Return the type (a concept) for the nth argument of the relation named relation-name.
Counting starts at zero.
A module name of null or the empty string refers to the current module. If no
module can be found with the name module-name, then a Stella no-such-context-
exception is thrown.
s-get-object ((name string) (module-name string) [Function]
(environment environment)) : object
Look for an object named name that is local to or visible from the module module-
name. A module name of null or the empty string refers to the current module. If no
module can be found with the name module-name, then a Stella no-such-context-
exception is thrown.
s-get-parent-modules ((name string) (environment environment)) : [Function]
(pl-iterator of module)
Return the modules that are immediate parents of module name. If no module named
name exists, a Stella no-such-context-exception is thrown.
s-get-parent-modules ((name string) (environment environment)) : [Function]
(pl-iterator of module)
Return the modules that are immediate parents of module name. If no module named
name exists, a Stella no-such-context-exception is thrown.
s-get-proposition ((relation-and-arguments string) [Function]
(module-name string) (environment environment)) : proposition
Return a proposition matching relation-and-arguments that has been asserted (or
inferred by forward chaining). relation-and-arguments is a string that begins with
Chapter 6: PowerLoom API 56
• Method and Function names begin with a lower case letter but each subsequent word
is capitalized. The hyphens from PowerLoom names are removed. Example:
wrapper-value => wrapperValue
• Storage slots are implemented as Java fields. The names begin with a lower case letter
but each subsequent word is capitalized. The hyphens from PowerLoom names are
removed. Example:
dynamic-slots => dynamicSlots
• Global and Special variable names are written in all uppercase. The hyphens from
PowerLoom are replaced by underscore ( ) characters. By convention, special variables
are written in PowerLoom with surrounding asterisk (*) characters. The asterisks are
replaced by dollar signs ($). Example:
*html-quoted-characters* => $HTML_QUOTED_CHARACTERS$
The most common non-alphanumeric characters are mapped as follows. A full set of
mappings is in section Section 6.2.3.7 [Java Character Mapping], page 65.
? => P (for Predicate)
! => X (eXclamation)
$ => B (Buck)
% => R (peRcent)
& => A (Ampersand)
* => $ Special variable marker.
The character mappings use uppercase characters if the basic identifier uses mixed or
lower case. The mappings use lowercase characters if the basic identifier uses upper case.
Stella modules are mapped to Java packages. The basic system distribution includes the
following package hierarchy:
edu
isi
stella
javalib
powerloom
logic
pl_kernel_kb
loom_api
Basic system functionality and data structures such as Cons and List objects are defined
in stella. PowerLoom’s logic (concepts, relations, rules, etc.) are defined in the logic package.
There is a set of interface functions in the PLI class in the powerloom package. They are
described in their own section below.
We recommend the following import statements in Java files that use PowerLoom:
import edu.isi.stella.*;
import edu.isi.stella.javalib.*;
import edu.isi.powerloom.PLI;
import edu.isi.powerloom.logic.*;
Functions (in Java terms, static Methods) are translated as static methods on the class
of their first argument (as long as that argument is not a primitive type and is in the
Chapter 6: PowerLoom API 62
same Stella module). Functions which take no arguments, those whose first argument is a
primitive type, and those whose first argument is a class not defined in the same module
are all placed into a class with the same name as the Stella module in which it appers. It
will be in the package corresponding to that Stella module. Java constructors should not
be called directly. Instead, there will be a static method new<ClassName> (with the class
name in mixed case!) that should be used instead.
Most of the functions of interest will be in the edu.isi.stella.Stella, edu.isi.powerloom.PLI
or edu.isi.powerloom.logic.Logic classes.
Methods typically refer to their first argument as "self".
Methods which return more than one return value will take a final argument which is
an array of Stella_Object, which will be used to return the additional arguments.
Primitive types in Stella have the following mapping in Java:
Stella Java
====== ====
INTEGER int
FLOAT double
NUMBER double
CHARACTER char
BOOLEAN boolean
STRING String
MUTABLE-STRING StringBuffer
NATIVE-OUTPUT-STREAM java.io.PrintStream
NATIVE-INPUT-STREAM java.io.PushbackInputStream (May change!!!)
Inside Stella/PowerLoom objects and collections, primitive types are wrapped using
Stella wrappers instead of Java’s primitive classes. So integers will be wrapped as
edu.isi.stella.IntegerWrapper rather than java.lang.Integer. Wrappers have a field called
wrapperValue which accesses the internal value. Example of use:
import edu.isi.stella.*;
import edu.isi.stella.javalib.*;
...
IntegerWrapper iWrap = IntegerWrapper.wrapInteger(42);
...
int answer = iWrap.wrapperValue;
...
equivalents using the conventions described in Section 6.2.3.2 [PowerLoom Java Conven-
tions], page 60. We also provide javadoc documentation for the edu.isi.powerloom.PLI
class. We recommend using this method for accessing PowerLoom functionality. We expect
to expand the range of PowerLoom interface functions that have an analog in the PLI class
over time.
made to the values will not affect any other running threads. This means that the changes
don’t need to be synchronized. Note that global (as opposed to special) variables don’t use
these objects.
Numbers and boolean values are stored in special variables using the corresponding Java
classes Integer, Double, Boolean, etc. The naming convention is to have all upper case
letters with a dollar sign ($) at the beginning and end of the name.
To temporarily change the value of one of these variables, users will need to be responsible
for saving and restoring the old values. Use of the "try ... finally ..." construct is very
useful for this, since it guarantees that the restore of values will be done. An example follows
of how to safely change modules. Contexts should be changed using the functions, although
other global variables can be changed by using the set method. Note that we use variables
of type Object to hold the values, since that avoids the need to cast when extracting the
current value, since the only operation we do with the current value is save it to restore it
later.
import edu.isi.stella.*;
// CONTEXT CHANGE.
Object savedModule = Stella.$MODULE$.get();
Module newModule
= Stella.getStellaModule(contextName, true);
if (newModule == null) { // Handle missing module
}
try {
Module.changeCurrentModule(newModule)
// Code that uses the newModule
} finally {
Module.changeCurrentModule(savedModule);
}
} finally {
Stella.$SAFETY$.set(savedValue);
}
} finally {
Stella.$PRINTREADABLY$.set(savedValue);
}
The need to change the module using this type of code can be largely avoided by using
the functions in the PLI interface package. They take a module argument and can handle
the binding and restoration of the module value themselves.
<space> => _
while (iter.nextP()) {
processValue(iter.value);
}
The PLI class also contains a number of functions for simplifying the interaction with
PlIterator objects that are returned by various API functions. These are the getNth...
functions. They work on sequences and sequence-like objects such as Proposition and and
the value slot of PlIterator objects. Note that they do not return sequential elements of
the iterator, but rather elements of the implicit sequence that is the value of iterators that
have more than one return variable. For convenience, they also work (with index = 0) on
the value of PlIterator objects that have only a single return variable. For example:
// Get values of (object name age) in the iterator and then
// print out a message with the name and age (position 1 & 2).
// This skips the PowerLoom object bound to ?X in position 0.
PlIterator iter =
PLI.sRetrieve("all (and (name ?x ?name) (age ?x ?age))",
null,
null);
Chapter 6: PowerLoom API 67
while (iter.nextP()) {
System.out.println(PLI.getNthString(iter, 1, null, null) + " is " +
PLI.getNthInteger(iter, 2, null, null ) + " years old.");
}
7 Built-In Relations
This chapter lists relations that come predefined in PowerLoom. They are defined in the
module PL-KERNEL; users can access them by including or using the PL-KERNEL module
within the declarations of their own modules.
member is derived multiple times, all occurrences are kept. This is useful, for example,
to collect and then sum up number-valued attributes of objects.
INSERT-ELEMENT ((?l list) (?n integer) (?e thing)) :-> (?r list) [Function]
Add ?e at position ?n (zero-based) to ?l to construct ?r (shifts the remaining elements
right). Count from end of the list and shift left if ?n is negative such that -1 inserts
at the end of the list, -2 second to last, etc.
8 PowerLoom GUI
The PowerLoom GUI (or knowledge editor) is a Java-based graphical client for PowerLoom.
The GUI is implemented as a Swing-based Java application which communicates with an
embedded or remote PowerLoom server using a SOAP communication layer over HTTP.
The architecture of the PowerLoom GUI most closely resembles the traditional two-tier
client/server model. Since the GUI does not contain a great deal of business logic (e.g., it
does not know how to do inferencing), it does not directly map onto the traditional notion
of a smart client. Similarly, since PowerLoom is much “smarter” than a typical DBMS, it
does not cleanly map onto a traditional backend server. However, since the GUI contains
the presentation logic, it is more similar to a 2-tier model than a 3-tier model where the
presentation logic resides in a middle tier.
Communication between the GUI and PowerLoom is done via the XML-based SOAP pro-
tocol. In order to effectively communication via SOAP, a Web service layer was built on top
of PowerLoom. This layer provides support for marshaling and unmarshaling of PowerLoom
objects to/from XML, and also provides a PowerLoom API that is accessible as a web ser-
vice. The Java client uses JAXM and the Castor framework (see http://www.castor.org)
to support SOAP communication.
PL-USER |=
Alternatively, PowerLoom can be started in its standard command loop mode and then
the GUI can be started with the start-powerloom-gui command. This is useful if the
Chapter 8: PowerLoom GUI 85
GUI becomes necessary at some point during development or if a different port should be
used. For example:
% powerloom
Initializing STELLA...
Initializing PowerLoom...
PL-USER |=
When the GUI is run against an embedded server as in the examples above, it is run
asynchronously and commands can be executed at the PowerLoom command loop at any
time. Moreover, when the GUI is exited, the command loop stays active until it is exited
explicitly as well.
The GUI can also be run standalone in which case the user needs to connect to a running
PowerLoom server. For example:
% powerloom --gui-only
Running standalone PowerLoom GUI...
Once the GUI is initialized, the user can connect to a server via the File -> Connect
to Server menu item. After the first connection, the host and port of the last used server
will be remembered for the next startup. If during the next startup that server is not active
anymore, an error will be signaled and the user can connect to a different server instead.
PL-USER |=
The command also accepts a :port option to make the server listen to a different port.
Alternatively, the PowerLoom Web Archive available in
powerloom-x.y.z/native/java/lib/ploom.war
can be deployed in an Apache Tomcat server by copying it into the server installation’s
‘webapps’ directory. The GUI can then connect to it at the server port used by Tomcat.
data from the server. Also, the GUI takes full advantage of Swing’s ability to control the
application via keyboard input. For example, to create a new instance named newName, a
user needs to simply type the key sequence Ctrl-I newName RET.
Context Sensitivity: For any given object that is displayed in a user interface, there is
a set of actions that can be performed on that object. Additionally, the actions that can
be performed on an object depend on where the object is displayed. Therefore, the GUI
pervasively supports context-sensitive popup menus. When users right-click on an object, a
list of appropriate actions will be presented in a menu. For example, when a user right-clicks
on a concept in the Knowledge Browser, the list of possible actions shown in Figure 8.1 is
presented.
application which would have its own application-specific menus and windows, but would
retain the general-purpose browsing, querying, and editing tools for direct manipulation of
the knowledge base.
• Query - menu items for querying the KB, searching the KB, and editing a relation’s
extension.
• View - this menu contains various items for updating the appearance of the application,
including a refresh item to bring the GUI up-to-date with the state of the KB on the
server, and menu items for showing/hiding the application’s toolbar and status bar.
This menu also contains items for changing the application’s font, for example, the
Demo Theme changes all fonts to a large bold font suitable for demo presentations.
• Navigate - contains menu items for navigating backward and forward in a browser’s
selection history.
• Window - contains a list of the currently open windows on the desktop. Selecting
a window brings the window to the top of the window stack, and if the window is
iconified, it is de-iconified.
• Help - contains an item to open an HTML help browser, and an item to open an About
box which contains information about the PowerLoom GUI.
Most menu items have accelerator keys that allow an item to be executed by a combina-
tion of keystrokes. The toolbar contains several buttons which provide shortcuts to menu
items. There are currently toolbar buttons for cutting, copying, pasting, deleting, editing
an object, and opening a query dialog. The toolbar may be undocked from its default
position by dragging it anywhere on the desktop. It may also be hidden and unhidden by
selecting the View -> Toolbar menu item.
The status bar at the bottom of the application contains information on the current
status of the application. The status bar is divided into two sections. The leftmost section
displays the last module that was selected by a user. The application keeps track of the
current module in order to provide continuity between operations. For example, if a user
opens a browser and browses the AIRCRAFT-KB, and then opens a query dialog, it makes
sense for the query dialog to use the AIRCRAFT-KB module instead of some other module.
The rightmost section of the status bar contains messages that pertain to the current
state of the application. For example, if a user selects a concept and then clicks the cut
toolbar button, a message will appear in the rightmost status bar prompting the user to
select another concept and perform a paste action. The status bar may be hidden and
unhidden by selecting the View -> Statusbar menu item.
Figure 8.2 shows a few internal frames that are open. The function of each frame is
identified in the frame’s title bar, and each type of frame has a unique icon in it’s upper
left-hand corner. In this example, the three open frames are used to browse the KB, query
the KB, and edit an instance.
A user typically follows a workflow cycle similar to the following sequence:
1. The user launches the GUI by executing the powerloom script, clicking on a desktop
icon or on a hyperlink in a browser.
2. The GUI is loaded on the user’s machine. If the GUI was launched via Java Web Start
(not yet fully supported), the entire application may need to be downloaded or updated
before execution begins.
3. The GUI reads a preferences file stored in a default location on the user’s local machine.
If this is the first time the application is being executed, a default preferences file is
Chapter 8: PowerLoom GUI 90
used. The preferences file includes among other things the PowerLoom server that was
last accessed.
4. If the preferences file contains the last-accessed server, the GUI attempts to connect
to the server and query the server for a description of the server’s capabilities. If
connection is successful, a browser window will open displaying the modules that are
currently loaded in the server instance.
5. The user selects any KB files (s)he wishes to load, and instructs the server to load the
files.
6. The user performs some browsing, querying, and editing of the loaded KB.
7. If any changes were made, the user saves the KB to a new or existing file.
8. The user repeats steps 5-7 as needed, and then exits the application.
8.4.3 KB Load/Save
In its standard configuration, PowerLoom stores knowledge bases via flat files. The user
can load one or more KB files from the local file system which will be transferred across the
network and loaded into the server instance via PowerLoom’s load command. Conversely,
a modified knowledge base can be saved to a local file on a per-module basis (using a version
of PowerLoom’s save-module command). Future versions of PowerLoom will support more
sophisticated persistence that will go directly to a database or other persistent store.
8.4.4 Browsing
The knowledge browser window, shown in Figure 8.3, can be opened by selecting the KB
-> Browse menu item or typing Ctrl-b. The browser provides a visual overview of all
knowledge in the KB, and is capable of launching specialized tools such as editors, search
dialogs, etc.
Chapter 8: PowerLoom GUI 91
The main method for filling the contents of a navigation pane is to select some object in a
navigation pane that is to the left or above it. This is discussed in more detail in the section
below. However, in some cases, it is possible to modify the contents of a navigation pane
without performing a selection. For example, in the instance navigation pane, it is possible
to show derived or inherited instances by right-clicking on the instance list and selecting an
appropriate menu item. Similarly, the relation navigation pane can toggle between direct or
inherited relations. Propositions and rules are by default displayed according to the module
that is currently selected. However, the contents of the proposition or rule navigation pane
can be updated by selecting a more specific module in the View From Module combobox
contained in the navigation pane’s title bar.
Selection: When the browser is initially opened, a tree of modules is displayed in the
module navigation pane, and all other navigation panes are empty. When a module is
selected, the remaining subpanes are populated with knowledge that is contained in that
module. Similarly, selecting a concept in the concept navigation pane populates the relation,
proposition, and instance panes with knowledge that is relevant to the selected concept. In
general, selecting an object in a given navigation pane may affect the contents of navigation
panes to the right and/or below it. More specifically, the rules for object selection are as
follows:
• Selecting a module populates the concept, relation, and instance subpanes with knowl-
edge contained in the module.
• Selecting a concept populates the relation subpane with relations that use the concept
as a domain type, and populates the instance subpane with the concept’s extension.
The proposition and rule subpanes are populated with propositions and rules associated
with the concept.
• Selecting a relation populates the proposition and rule subpanes with propositions and
rules associated with the relation.
• Selecting an instance with no selected relation populates the proposition subpane with
propositions that refer to the selected instance.
• Selecting an instance and a relation populates the proposition subpane with proposi-
tions that contain the relation as a predicate, and the instance as an argument.
• De-selecting an object will update the state of the browser appropriately. For example,
after selecting a module and a concept, deselecting the concept will refresh the concept,
relation, instance, proposition and rule subpanes to display the knowledge contained
in the selected module.
The title pane in each navigation pane displays a description of the source of the sub-
pane’s contents. For example, if both the relation WINGSPAN and the instance AGM-130 were
selected, the proposition subpane would contain the title “Propositions for WINGSPAN
and AGM-130”.
Each selection event is recorded in a selection history which can be rolled back and
forward. For example, assume the user selects the AIRCRAFT-KB module and then selects
the GUIDANCE-TYPE concept. If the user then selects the Navigate -> Back menu item, the
selection history will be rolled back so that only AIRCRAFT-KB is selected. If the user then
selects Navigate -> Forward, the selection history will be rolled forward to its original state
so that both AIRCRAFT-KB and GUIDANCE-TYPE are selected.
Chapter 8: PowerLoom GUI 93
8.4.5 Editing
Objects may be edited by right-clicking them and selecting the Edit... menu item in the
popup menu. Alternatively, an object may be selected, and then the Objects -> Edit
Object menu item or the the edit toolbar button can be pressed. Object editors do double-
duty as object viewers, since all relevant object information is present in each editor.
There are several common user actions that are available in edit dialogs. For example,
hitting RET while the cursor is positioned in the name field of the editor commits the concept.
Most editors have OK and Cancel buttons at the bottom to commit or abort edits. Lists of
items commonly have + and -- buttons at the top that allow one to add a new item or delete
the selected item. When the + button is pressed, either a chooser dialog (see Section 8.4.6
Chapter 8: PowerLoom GUI 94
[Choosers], page 95) or a specialized editor will be opened. Similar to the browser, list items
can be right-clicked to display a list of possible actions. For example, a superconcept can
be clicked in a concept editor to immediately edit the concept’s parent.
Each type of object has a specialized editor. For example, an instance editor is shown
in Figure 8.4. There are separate editors for modules, concepts, relations, instances, and
propositions/rules, which are described below.
Module Editor: The module editor contains a number of fields and components used to
enter information relevant for a new or existing module. Examples of values that can be
edited are a module’s name, its documentation and its includes (or supermodules) list.
Concept Editor: The concept editor allows editing of concept attributes such as a con-
cept’s supertypes, its name, its associated propositions, etc. In addition to the inherent
attributes of a concept, all relations which have the concept as a domain type are displayed
and may be edited. Clicking the + button above the relation list opens a new relation editor
with default values filled in. Similarly, clicking the + button above the proposition list opens
a proposition editor.
Chapter 8: PowerLoom GUI 95
Relation Editor: The relation editor allows the user to enter a list of variables and
types for the relation’s arguments, and allows the setting of various relation attributes, e.g.,
whether the relation is closed, functional, etc. Similar to the concept editor, propositions
and rules associated with a relation can be edited.
Instance Editor: The instance editor allows the user to input an instance’s name, doc-
umentation, and associated propositions. If a proposition uses the relation image-url, an
image will be retrieved from the server and presented in the editor window.
Proposition editor: The proposition editor, shown in Figure 8.5, consists of a text field for
entering the proposition, and a set of buttons for performing actions on the proposition. The
buttons allow a user to assert, deny, or retract the typed proposition. There are several text-
based facilities which support efficient editing of propositions. First, the editor supports
many Emacs-style keybindings which facilitate editing of Lisp-like expressions, including
selecting entire parenthesis-delimited subexpressions, jumping backward and forward over
subexpressions, and navigating up and down expression trees.
8.4.6 Choosers
In a number of situations, an object of a specific type must be selected. For example, when
selecting a superconcept in a concept editor, the user should be presented with a list of
Chapter 8: PowerLoom GUI 96
existing concepts. In these cases, a chooser dialog is presented to the user which displays a
filterable list of candidate objects. As the user types a name of the object in the name text
field, the list of objects is filtered so that only objects which begin with the typed prefix are
displayed. Choosers are available for modules, concept, instances, and relations. A variable
chooser allows the user to type a variable name and select a type from a concept from a
list.
by typing Ctrl-RET or by clicking on the Execute button at the bottom of the dialog.
After a query has executed, results will be displayed in the results table or a “No results
found” indicator will flash. The column headers for the results will display the correspond-
ing free variables in the query. Results may be sorted by clicking on a column header.
Doing so will sort the results by using the clicked column as an index. Users may toggle
ascending/descending sort order by clicking the header multiple times.
If the user clicks on a cell in the results table, the topmost browser will be updated to
display the selected item. Right-clicking on a query result brings up a context menu which
currently only contains an Explain result menu item. Selecting this will present an HTML
explanation in a separate window. The displayed explanation may contain hyperlinked
objects. Clicking on a hyperlinked object will update the topmost browser to display the
object.
Users may save frequently-executed queries in a query list by clicking the Save button
at the top of the options panel which will prompt them for a query name. Saved queries
will be stored in the preferences file using an XML representation. Saved queries are stored
in the combobox to the left of the save button. Selection of a saved query will prefill the
query dialog with the query and all saved parameters.
Most important PowerLoom query options are controllable in the options dialog, such
as number of results to retrieve, inference control options such as inference level, timeout,
moveout and various others.
8.4.9 Search
Users may search for objects in the KB by entering strings which match the name of the
object. A search dialog as shown in Figure 8.8 can be opened by selecting the Query ->
Search menu item, by typing Ctrl-f, or by pushing a search toolbar button (marked by
a flashlight icon) inside the browser. If the user activates a search toolbar button inside a
navigation pane, the search dialog will be configured to search for objects associated with
the type of object displayed in that pane. For example pushing the search button inside the
concept navigation pane will configure the search dialog to look for concept objects only.
Searches may be constrained in several ways. First, the module may be specified or
the user may specify that the search should be across all modules. Second, the types of
objects to be searched is configurable. For example, users may search for concepts and
instances, instances only, etc. Finally, users may specify that an object’s name must match
the beginning or end of the search string, or match the search string exactly.
Chapter 8: PowerLoom GUI 99
When the user executes the search by hitting RET or selecting the OK button, a list of
results is presented. These results are provided in a table format where one column is the
name of the retrieved object, another column contains the module that the object resides
in, and the final column specifies the type of the object (i.e., concept, instance, etc). As is
the case with query results, clicking on a search result item will update the topmost browser
to display the selected object.
8.4.10 Console
The console window, as shown in Figure 8.9, can be opened by selecting the KB -> Open
PowerLoom Console menu item or by typing Ctrl-p. This opens an internal window, which
allows PowerLoom commands to be typed directly and sent to the PowerLoom server. The
response generated by PowerLoom is sent back to the GUI and printed below the prompt.
This functionality is similar to that of a LISP listener.
Chapter 8: PowerLoom GUI 100
8.4.11 Cut/Copy/Paste/Delete
The PowerLoom GUI supports cut, copy, paste, and delete operations. These operations
can be used to edit text, and in some cases they can be used to edit objects in lists or trees.
For example, the concept hierarchy can be edited within the browser by selecting a con-
cept, executing a cut operation, selecting another concept, and then executing paste. This
sequence of operations will delete the concept from it’s original position in the hierarchy,
and make it a subconcept of the concept that was selected when the paste operation was
performed.
The GUI implements a robust data transfer framework that is capable of recognizing
the types of objects that are being transferred, and the types of potential transfer sources
and destinations. This allows the application to prohibit nonsensical data transfers such as
cutting a concept in a concept navigation pane and then trying to paste it into a module
pane. It also allows data transfer operations to be context sensitive. For example, cutting a
concept in a concept navigation pane means that a move operation is being initiated, while
cutting a concept in a concept editor’s superconcept list means that the concept should be
removed from the list. Additionally, copying an object such as a concept, then executing a
paste inside a text window will paste the name of the object.
As one would expect, text may be cut, copied and pasted between the GUI and outside
applications.
8.5.2 Undo
There is currently no undo facility and changes to the KB are written through to the server
as soon as a user clicks OK in an editing dialog. To support this properly, we would need a
snapshot mechanism that would allow rollback to earlier states of the KB.
8.5.4 Scrapbook
In creating and editing ontologies, it is sometimes desirable to maintain heterogeneous
scraps of information. We envision a scrapbook feature where text and objects of various
types could be dragged to and organized visually for later use.
8.5.6 Security
There is currently no authentication and access control mechanisms in the PowerLoom GUI.
The GUI client assumes that is communicating with a trusted host over a secure network.
Similarly, the PowerLoom server assumes that it is communicating with a friendly client
that has full access to the server. In the future, we need to add security mechanisms which
allow clients to be authenticated, and resources on the server to be made accessible to
authorized users only. In addition, we need to implement encryption mechanisms so that
clear text is not sent over insecure networks, potentially compromising sensitive data.
notification of KB updates, add support for transactions and KB locking, and improve our
caching mechanisms to detect when the GUI state is out of sync with respect to the server.
Chapter 9: Ontosaurus 103
9 Ontosaurus
Ontosaurus is a Web-based KB browser that offers a convenient way to view the contents of
PowerLoom knowledge bases from a standard Web browser. Whenever a user searches for an
object or clicks on a hyperlink, Ontosaurus dynamically generates HTML pages describing
the requested object and related information. The description will itself contain links to
other relevant objects which the user can click on to quickly "surf" through a knowledge
base.
Similar to the PowerLoom GUI (see Chapter 8 [PowerLoom GUI], page 84), Ontosaurus
relies on a PowerLoom server that can handle HTTP requests. For this reason, it is currently
only supported in the Java version of PowerLoom or in Lisp version that supports a Web
server such as AServe or Portable AServe (e.g., Allegro CL).
To use Ontosaurus, do the following. Start PowerLoom in Java or a qualifying Lisp
version. Once PowerLoom is up and running, issue the following command:
PL-USER |= (start-ontosaurus)
PL-USER |=
The command also accepts a :port option to make the server listen to a different port.
Once the Ontosaurus server is running, go to your Web browser and enter the following URL:
http://localhost:9090/ploom/ontosaurus/ Substitute a fully qualified host name and
different port if necessary. Ontosaurus comes with a short online help page and is otherwise
self-explanatory.
Alternatively, the PowerLoom Web Archive available in
powerloom-x.y.z/native/java/lib/ploom.war
can be deployed in an Apache Tomcat server by copying it into the server installation’s
‘webapps’ directory. Ontosaurus can then connect to it at the above URL at the server port
used by Tomcat.
Chapter 10: Installation 104
10 Installation
Any one of the Lisp, C++, or Java implementations of PowerLoom can be used to develop
your own PowerLoom-based applications. Which one you choose is primarily a matter of
your application and programming environment. The Lisp and Java versions are comparable
in speed, the C++ version is usually a factor of 2-3 faster than Lisp or Java.
(powerloom)
which will bring up a PowerLoom listener that will allow you to execute PowerLoom
commands.
IMPORTANT: All unqualified Lisp symbols in this document are assumed to be in the
STELLA Lisp package. Moreover, the STELLA package does NOT inherit anything from the
COMMON-LISP package (see the file ‘sources/stella/cl-lib/cl-setup.lisp’ for the few
exceptions). Hence, you have to explicitly qualify every Lisp symbol you want to use with
CL:. For example, to get the result of the previous evaluation, you have to type CL:* instead
of *.
PL-USER |=
This will run various PowerLoom startup code and then bring up a PowerLoom command
loop where you can execute commands. The c++ argument tells the script to run the
C++ version of PowerLoom (which is also run by default as long as the C++ version was
compiled). If the C++ version was not compiled or the java argument was given instead,
the Java version of PowerLoom will be run.
Type
(demo)
to bring up a menu of available demos, type
Chapter 10: Installation 107
(run-powerloom-tests)
to run the PowerLoom test suite, or type
exit
to exit PowerLoom.
PL-USER |=
Similar to the C++ executable, this will run various PowerLoom startup code and then
bring up a PowerLoom command loop where you can execute commands. Type
(demo)
to bring up a menu of available demos, type
(run-powerloom-tests)
to run the PowerLoom test suite, or type
exit
to exit PowerLoom.
convenient for you to develop new PowerLoom code that is written in STELLA. Finally, if
you don’t need any of the STELLA sources, you can delete the directory ‘sources/stella’.
If you don’t need local copies of the STELLA and PowerLoom documentation, you can delete
parts or all of the directories ‘sources/stella/doc’ and ‘sources/logic/doc’.
11 Miscellaneous
This is a catch-all section for documented functions, methods and relations that haven’t
been categorized yet into any of the previous sections. They are in random order and many
of them will never be part of the official PowerLoom interface. So beware!
2_d_element (array (row integer) (column integer)) : [Method on 2 d array]
(like (any-value self))
Return the element of array at position [row, column].
2_d_element (array (row integer) [Method on 2 d float-array]
(column integer)) : float
Return the element of array at position [row, column].
2_d_element-setter (array (value object) [Method on 2 d array]
(row integer) (column integer)) : (like (any-value self))
Set the element of array at position [row, column] to value and return the result.
2_d_element-setter (array (value float) [Method on 2 d float-array]
(row integer) (column integer)) : (like (any-value self))
Set the element of array at position [row, column] to value and return the result.
add-testing-example ((form cons) (score partial-match-score)) [N-Command]
:
Add a query and score pair to the master list of testing examples
add-training-example ((form cons) [N-Command]
(score partial-match-score)) :
Add a query and score pair to the master list of training examples
all-asserted-types ((self object)) : (cons of named-description) [Function]
Return a set of all of the types that are asserted to be satisfied by self.
all-class-instances ((type surrogate)) : cons [Function]
Return a set of instances that belong to the class type.
all-cycles ((module module) (local? boolean)) : (cons of cons) [Function]
Return a list of lists of descriptions that are provably co-extensional.
all-direct-subrelations ((relation named-description) [Function]
(removeEquivalents? boolean)) : (cons of named-description)
Return a set of relations that immediately specialize relation. If removeEquivalents?
(recommended), don’t include any relations equivalent to relation.
all-direct-superrelations ((relation named-description) [Function]
(removeEquivalents? boolean)) : (cons of named-description)
Return a set of relations that immediately subsume relation. If removeEquivalents?
(recommended), don’t include any relations equivalent to relation.
all-direct-types ((self object)) : (cons of logic-object) [Function]
Return a set of most specific types that are satisfied by self.
Chapter 11: Miscellaneous 110
finalize-objects () : [Function]
Finalize all currently unfinalized objects. The user-level entry point for this is
(process-definitions).
Chapter 11: Miscellaneous 119
load-cmd-line-files () : [Command]
Loads all PowerLoom files specified on the command line. If directories are listed, all
PowerLoom files in those directories are loaded. Since when this is called we might
still have unprocessed command line args, this only looks at files which are to the
right of the last argument that starts with a - character.
powerloom () : [Function]
Run the PowerLoom listener. Read logic commands from the standard input, evaluate
them, and print their results. Exit if the user entered bye, exit, halt, quit, or stop.
reset-query-caches () : [Function]
Zero out all caches managed by the query optimizer, so that it will reoptimize subgoal
queries upon next invocation.
run-powerloom-tests () : [Command]
Run the PowerLoom test suite. Currently this simply runs all demos and echos
commands and their results to standard output. The output can then be diffed with
previously validated runs to find deviations.
upclassify-all-descriptions () : [Function]
Classify all named descriptions.
Chapter 11: Miscellaneous 130
upclassify-all-instances () : [Function]
Classify all named instances.
specified. If no module is specified and the file does not supply an in-module decla-
ration, an error will be signaled. The remaining commands are evaluated one-by-one,
applying the function evaluate to each of them.
main () : [Function]
Main PowerLoom entry point for your code in C++ and Java.
register-computation-function ((name string) [Function]
(function-reference function-code) (arity integer) (module module)
(environment environment)) :
Register name as a function name in module which will invoke the native code pro-
cedure described by function-reference. The name is a fully-qualified name which
will be interpreted by the normal rules for reading names in PowerLoom. The function
must conform to the signature for computation functions used by the computation
specialist. Arity specifies the number of arguments the computation accepts.
The exact form of function-reference depends on the underlying programming lan-
guage. The following type mappings are used: C++: cpp function code (a pointer
to the function code) Common Lisp: FUNCTION (result of #’ or (FUNCTION ...))
Java: java.lang.reflect.Method
register-specialist-function ((name string) [Function]
(function-reference function-code) (module module)
(environment environment)) :
Register name as a function name in module which will invoke the native code pro-
cedure described by function-reference. The name is a fully-qualified name which
will be interpreted by the normal rules for reading names in PowerLoom. The function
must conform to the signature for specialist functions.
The exact form of function-reference depends on the underlying programming lan-
guage. The following type mappings are used: C++: Common Lisp: FUNCTION
(result of #’ or (FUNCTION ...)) Java: java.lang.reflect.Method
s-register-computation-function ((name string) [Function]
(native-name string) (arity integer) (module-name string)
(environment environment)) :
Register name as a function name in the module named module-name. This function
will the native code named native-name. The name is a fully-qualified name which
will be interpreted by the normal rules for reading names in PowerLoom. The native-
name will be processed in a manner that depends on the underlying programming
language. The following type mappings are used: C++: Not available. Error signaled.
Common Lisp: The native-name is read by READ-FROM-STRING and then the
SYMBOL-FUNCTION is taken. Java: A fully package-qualified name is required.
It is looked up using the Reflection tools. The function found must conform to the
signature for computation functions. Arity specifies the number of arguments the
computation accepts.
s-register-specialist-function ((name string) [Function]
(native-name string) (module-name string) (environment environment)) :
Register name as a function name in the module named module-name. This function
will the native code named native-name. The name is a fully-qualified name which
Chapter 11: Miscellaneous 133
will be interpreted by the normal rules for reading names in PowerLoom. The native-
name will be processed in a manner that depends on the underlying programming
language. The following type mappings are used: C++: Not available. Error signaled.
Common Lisp: The native-name is read by READ-FROM-STRING and then the
SYMBOL-FUNCTION is taken. Java: A fully package-qualified name is required.
It is looked up using the Reflection tools. The function found must conform to the
signature for specialist functions.
initialize-kernel-kb () : [Command]
Bootstrap the PowerLoom built-in kernel KB.
Chapter 12: Glossary 134
12 Glossary
This glossary contains brief definitions for terms used in the PowerLoom User’s Manual
and/or used by the knowledge representation community. It is impractical to give a logically
precise definition for many of these terms, because their interpretation varies quite a bit. In
this case, the glossary attempts to indicate a range of interpretations consistent with their
use in PowerLoom.
Assertion: An assertion states that a particular proposition is True or False.
Backward and Forward Inference: ???
Backward Rule: ???
Binary Relation: A relation having two arguments (arity equals two), often as a mapping
from one concept domain to another. This is by far the most common form of relation.
Classifier: A classifier is a type of an inference engine that implements efficient strategies for
computing subsumption relations between pairs of concepts, or for computing instance-of
relations between a concept an a set of instances. PowerLoom implements a classifier that
can be explicitly invoked by an application program.
Clipping: If a function or single-valued binary relation maps an instance to two or more
other instances, a logical contradiction (a clash) exists. If clipping is enabled, PowerLoom
will automatically retract all assertions but the last that lead to a clash. Clipping can be
toggled on or off; it is enabled by default.
Closed-World Semantics: Under closed-world semantics it is assumed that “if proposition
P cannot be proved True, then assume that P is False.” PowerLoom gives programmers
the option to explicitly declare that concept or a relation operates under the assumption of
closed-world semantics (See also Open-World Semantics).
Concept: A concept defines a category or class of individuals. PowerLoom categorizes a
concept as a special kind of relation. The distinction between a concept and a unary relation
is subtle (some logicians do not believe that there is any distinction1 ). In linguistics, the
distinction is that between a noun and an adjective. In logic, the test we favor is whether or
not the relation has a domain — a unary relation has a domain, while a concept does not.
For example, the relation ‘married’ has domain ‘person’, while the concept ‘married-person’
does not have a domain (or is its own domain).
Constraint: “Constraint” at its most general is a synonym for “rule”. Often a constraint is
conceptualized as a rule that restricts the types of the arguments that can appear within a
tuple.
Context: ???
Default Rule: A default rule expresses an conditional implication that applies only when
its consequent is consistent with current state of the knowledge base. In other words, the
rule applies only when it will not lead to a contradition.
Definition: A definition binds a name to a logical expression. PowerLoom syntax defines
several operators with names of the form defxxx (e.g., defconcept and defrule) that
declare definitions for various types of entities.
1
but they are mistaken :).
Chapter 12: Glossary 135
Module: ???
Open-World Semantics: PowerLoom assumes an open-world semantics, unless a user ex-
plicitly specifies that it use closed-world semantics. Under this assumption, if PowerLoom
cannot prove or disprove a proposition, then it assigns that proposition the value Unknown
(See also Closed-World Semantics).
Predicate:. The term predicate is a syntactic notion that refers to the zeroth arguments of
a proposition. Predicates denote relations and properties, i.e., sets.
Proposition:. A logical sentence whose truth value can be evaluated with respect to some
context. Each PowerLoom assertion assigns the value True or False to some proposition.
Primitive Relation: P is a primitive concept or relation if and only if a proof that (P x1 ...
xn) is true exists only for the case that there exists an explicit assertion of a proposition (Q
x1 ... xn) and either Q equals P or Q is a proper subrelation of P. In otherwords, the only
rules that imply membership in P are those that relate P to one of its (proper) subconcepts
or subrelations.
Query: A query probes the informational state of a knowledge base. An ask query test
the truth of its propositional argument. A retrieve asks for sets of constants (bindings)
that make its propositional argument true when the constants are substituted in place of
its variables. The propositional argument to ask and retrieve arbitrary expression in the
first-order predicate calculus. Because of constraints imposed either by resource limitations
or inherent undecidability, PowerLoom cannot guarantee the completeness of its inferences.
Relation: ???
Retraction: A retraction changes the truth value of a proposition from either True or False
to the value Unknown. Retraction is a procedural (non-declarative) operation.
Rule: A “rule” is any universally-quantified proposition, i.e., a proposition of the form
(forall (?x1 ... ?xn) <logical sentence with free variables ?x1 ... ?xn). Power-
Loom supports several different syntactic constructs for defining rules. (See also Forward
Rule and Backward Rule).
Subsumption: A subsumption relation specifies the relative generality of two concepts. A
concept A subsumes a concept B if the definitions of A and B logically imply that members
of B must also be members of A.
Truth-Maintenance: ???
Type: Often used a synonym for the term concept. The phrase “a type of an instance”
generally refers to (one of) the concepts that the instance belongs to. The phrase “nth
domain type” refers to a concept that contains all instances of the nth column of a relation.
World: ???
Chapter 13: PowerLoom Grammar 137
13 PowerLoom Grammar
The syntax of PowerLoom is described below using a modified BNF notation adapted from
the KIF specification.
13.1 Alphabet
We distinguish between terminals, which are part of the language, and nonterminals. All
nonterminals are bracketed as follows <nonterminal>. Squared brackets means zero or
one instances of the enclosed expression; <nonterminal>* means zero or more occurrences
and <nonterminal>+ means one or more occurrences of <nonterminal>. The notation
<nonterminal1> - <nonterminal2> refers to all of the members of <nonterminal1> except
for those in <nonterminal2>.
A word is a contiguous sequence of characters, which include all upper case letters, lower
case letters, digits and alpha characters (ASCII character set from 93 to 128) excluding some
special characters like white spaces, single and double quotes and brackets.
<word> ::= a primitive syntactic object
Special words are those who refer to a variable. All variables are preceded by a question
mark.
<indvar> ::= a word beginning with the character ?
A string <string> is a character sequence including words plus all special charcters
(except double quotes) enclosed in double quotes. A double quote can be included in a
string if it is preceeded by the escape character ’\’.
13.2 Grammar
Legal expressions in PowerLoom are forms, which are either a statement or a definition,
described in more detail below.
<form> ::= <statement> | <definition>
13.2.2 Terms
Terms are used to denote objects in the world being described:
<term> ::= <indvar> | <constant> | <funterm> | <listterm> | <setterm> |
<quanterm>
<listterm> ::= (listof <term>*)
<setterm> ::= (setof <term>*)
<funterm> ::= (<funconst> <term>+)
Note: Zero arguments are allowed for <funterm> in KIF3.0: <term>*
<quanterm> ::= (the <vardecl> <sentence>) |
(setofall <vardecl> <sentence>) |
(kappa {<vardecl> | (<vardecl>+)} <sentence>) |
(lambda {<vardecl> | (<vardecl>+)} <term>)
Note: KIF3.0 allows <term> instead of <vardecl> for setofall. No <quanterm> as well
as no <setterm> in core of KIF as a result of descision 95-3 (March 1995).
13.2.3 Sentences
Sentences are used to express propositions about the world:
<sentence> ::= <constant> | <equation> | <inequality> |
<relsent> | <logsent> | <quantsent>
<equation> ::= (= <term> <term>)
<inequality> ::= (/= <term> <term>)
<relsent> ::= (<constant> <term>+)
Note: Zero arguments allowed in KIF3.0 for <relsent> (<term>*). <funconst> is
currently not allowed in PowerLoom (use (= <funterm> <term>) instead).
<logsent> ::= (not <sentence>) |
(and <sentence>*) |
(or <sentence>*) |
(=> <sentence>* <sentence>) | (=>> <sentence>* <sentence>) |
(<= <sentence> <sentence>*) | (<<= <sentence> <sentence>*) |
(~> <sentence>* <sentence>) | (~>> <sentence>* <sentence>) |
(<~ <sentence> <sentence>*) | (<<~ <sentence> <sentence>*)
<quantsent> ::= (forall {<vardecl> | (<vardecl>+)} <sentence>) |
(forall {<vardecl> | (<vardecl>+)} <sentence> <sentence>)
|
(exists {<vardecl> | (<vardecl>+)} <sentence>)
Chapter 13: PowerLoom Grammar 139
13.2.4 Definitions
PowerLoom supports two distinct categories of definitions — relation definitions (including
concept and function definitions) and rule definitions. A relation definition introduces a
new logical constant, and states some facts about that constant (e.g., who its parents are in
a subsumption taxonomy). A rule definitions binds a new constant to a proposition (so that
the constant denotes the proposition) and asserts the truth of that proposition. Usually, the
proposition asserted by a defrule is an implication. The assertional truth of a proposition
defined by a rule can be altered by asserting or retracting the constant that denotes the
proposition.
<keyword-option> ::= <keyword> <word>
<definition> ::= <reldefinition> | <objdefinition> | <ruledefinition>
<reldefinition> ::=
(defconcept <conceptconst> <vardecl>
[:documentation <string>]
[:<= <sentence>] | [:=> <sentence>] |
[:<<= <sentence>] | [:=>> <sentence>] |
[:<=> <sentence>] | [:<=>> <sentence>] | [:<<=> <sentence>] |
[:<<=>> <sentence>] |
[:axioms {<sentence> | (<sentence>+)}] |
[<keyword-option>*])
|
(deffunction <funconst> (<vardecl>+)
[:documentation <string>]
[:-> <vardecl>]
[:<= <sentence>] | [:=> <sentence>] |
[:<<= <sentence>] | [:=>> <sentence>] |
[:<=> <sentence>] | [:<=>> <sentence>] | [:<<=> <sentence>] |
[:<<=>> <sentence>] |
[:axioms {<sentence> | (<sentence>+)}]
[<keyword-option>*])
|
(defrelation <relconst> (<vardecl>+)
[:documentation <string>]
[:<= <sentence>] | [:=> <sentence>] |
[:<<= <sentence>] | [:=>> <sentence>] |
[:<=> <sentence>] | [:<=>> <sentence>] | [:<<=> <sentence>] |
[:<<=>> <sentence>] |
[:axioms {<sentence> | (<sentence>+)}]
[<keyword-option>*])
[:documentation <string>]
[<keyword-option>*])
<ruledefinition> ::= (defrule <ruleconst> <sentence>)
Function Index 141
Function Index
* all-named-descriptions . . . . . . . . . . . . . . . . . . . . . 110
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 all-named-instances . . . . . . . . . . . . . . . . . . . . . . . . 110
all-named-terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
all-propositions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
+ all-relation-values . . . . . . . . . . . . . . . . . . . . . . . . 111
+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 all-sentences-of. . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
all-slot-value-types . . . . . . . . . . . . . . . . . . . . . . . 111
all-slot-values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
- all-subrelations. . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
all-superrelations . . . . . . . . . . . . . . . . . . . . . . . . . 111
- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
all-taxonomic-types . . . . . . . . . . . . . . . . . . . . . . . . 111
all-terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
/ all-types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
all-unnamed-terms . . . . . . . . . . . . . . . . . . . . . . . . . . 112
/ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 allocate-supported-closure-iterator . . . . . . 112
allocate-transitive-closure-iterator. . . . . 112
< ANTISYMMETRIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
apply-ask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
< . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 apply-kappa? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
apply-retrieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
= ARITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
ask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 40
=< . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 ask-partial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
assert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
assert-binary-proposition . . . . . . . . . . . . . . . . . . 41
> assert-from-query. . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 assert-nary-proposition . . . . . . . . . . . . . . . . . . . . . 41
>= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 assert-proposition . . . . . . . . . . . . . . . . . . . . . . . . . . 41
assert-rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
assert-unary-proposition . . . . . . . . . . . . . . . . . . . 41
2 ASSERTION-QUERY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2_d_element on 2 d array . . . . . . . . . . . . . . . . . . 109
2_d_element on 2 d float-array . . . . . . . . . . . 109
2_d_element-setter on 2 d array . . . . . . . . . . 109 B
2_d_element-setter on 2 d float-array . . . 109 BACKTRACKING-QUERY . . . . . . . . . . . . . . . . . . . . . . . . . . 68
BINARY-RELATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
bottom? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
A BOUND-VARIABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
add-load-path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
add-testing-example . . . . . . . . . . . . . . . . . . . . . . . . 109 C
add-training-example . . . . . . . . . . . . . . . . . . . . . . . 109 call-all-facts-of . . . . . . . . . . . . . . . . . . . . . . . . . . 112
AGGREGATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 call-ask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
all-asserted-types . . . . . . . . . . . . . . . . . . . . . . . . . 109 call-defconcept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
all-class-instances . . . . . . . . . . . . . . . . . . . . . . . . 109 call-deffunction. . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
all-cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 call-defobject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
all-direct-subrelations . . . . . . . . . . . . . . . . . . . 109 call-defproposition . . . . . . . . . . . . . . . . . . . . . . . . 113
all-direct-superrelations . . . . . . . . . . . . . . . . . 109 call-defrelation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
all-direct-types. . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 call-list-undefined-relations . . . . . . . . . . . . . 113
all-equivalent-relations . . . . . . . . . . . . . . . . . . 110 call-propagate-constraints . . . . . . . . . . . . . . . . 113
all-facts-of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 28 call-retrieve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
all-facts-of-instance . . . . . . . . . . . . . . . . . . . . . . 110 call-retrieve-partial . . . . . . . . . . . . . . . . . . . . . . 113
all-facts-of-n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 call-run-forward-rules . . . . . . . . . . . . . . . . . . . . . 113
all-inconsistent-propositions . . . . . . . . . . . . . 110 call-set-inference-level . . . . . . . . . . . . . . . . . . 114
all-instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 CARDINALITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Function Index 142
cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 D
change-module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 default-false? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
class? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 default-true? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
classify-instances . . . . . . . . . . . . . . . . . . . . . . . . . . 30 default-truth-value? . . . . . . . . . . . . . . . . . . . . . . . 116
classify-relations . . . . . . . . . . . . . . . . . . . . . . . . . . 29 defconcept. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
clear-caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30, 41 deffunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
clear-instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 define-arithmetic-operation-on-wrappers
clear-module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30, 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
CLOSED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 define-arithmetic-test-on-wrappers . . . . . . . 116
coerce-to-instance . . . . . . . . . . . . . . . . . . . . . . . . . 114 define-computed-constraint . . . . . . . . . . . . . . . . 116
coerce-to-instance-or-literal . . . . . . . . . . . . . 114 definstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
coerce-to-vector. . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 defmodule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
COLLECT-INTO-ASCENDING-SET . . . . . . . . . . . . . . . . . 69 defobject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
COLLECT-INTO-DESCENDING-SET . . . . . . . . . . . . . . . . 69 defproposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
COLLECT-INTO-LIST. . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 defrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
COLLECT-INTO-ORDERED-SET . . . . . . . . . . . . . . . . . . . 70 defrule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
COLLECT-INTO-SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 delete-rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
collection? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
COLLECTIONOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 deny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
COMMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 deobjectify-tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
COMMUTATIVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 describe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
describe-object on named-description . . . . 116
conceive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30, 41
description-name on description . . . . . . . . . . . 117
conceive-term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
description-name on named-description . . . 116
CONCEPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
CONCEPT-PROTOTYPE. . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
destroy-instance. . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
conjoin-truth-values . . . . . . . . . . . . . . . . . . . . . . . 114 destroy-object . . . . . . . . . . . . . . . . . . . . . . . . . . 43, 117
cons-to-pl-iterator . . . . . . . . . . . . . . . . . . . . . . . . . 41 destroy-proposition . . . . . . . . . . . . . . . . . . . . . . . . 117
consify on justification . . . . . . . . . . . . . . . . . . . . 114 destroy-term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
consify on pl-iterator . . . . . . . . . . . . . . . . . . . . . 133 DIRECT-SUBRELATION . . . . . . . . . . . . . . . . . . . . . . . . . . 71
consify on query-iterator . . . . . . . . . . . . . . . . . 114 DIRECT-SUPERRELATION . . . . . . . . . . . . . . . . . . . . . . . . 71
consify on query-solution-table . . . . . . . . . . 114 direct-superrelations . . . . . . . . . . . . . . . . . . . . . . 117
consify-current-solutions on query-iterator disabled-powerloom-feature? . . . . . . . . . . . . . . . 117
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 disjoin-truth-values . . . . . . . . . . . . . . . . . . . . . . . 117
consify-justification . . . . . . . . . . . . . . . . . . . . . . 115 DISJOINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
constant? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 DISJOINT-COVERING. . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
copy on justification . . . . . . . . . . . . . . . . . . . . . . . 115 disjoint-terms? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 do-clear-instances . . . . . . . . . . . . . . . . . . . . . . . . . 117
COVERING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 do-save-module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 DOCUMENTATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
create-2_d_array. . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 DOMAIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
create-2_d_float-array . . . . . . . . . . . . . . . . . . . . . 115 drop-load-path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
create-concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 DUPLICATE-FREE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
create-enumerated-list . . . . . . . . . . . . . . . . . . . . . . 42 DUPLICATE-FREE-COLLECTION . . . . . . . . . . . . . . . . . . 72
create-enumerated-set . . . . . . . . . . . . . . . . . . . . . . . 42
create-float-vector . . . . . . . . . . . . . . . . . . . . . . . . 115
create-function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
E
create-keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 EMPTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
create-marker-storage . . . . . . . . . . . . . . . . . . . . . . 115 empty? on float-vector . . . . . . . . . . . . . . . . . . . . 117
create-module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 empty? on pl-iterator . . . . . . . . . . . . . . . . . . . . . . . 43
create-object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 empty? on query-solution-table . . . . . . . . . . . 117
enabled-powerloom-feature? . . . . . . . . . . . . . . . . 117
create-relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
EQUIVALENT-RELATION . . . . . . . . . . . . . . . . . . . . . . . . . 72
create-symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
estimated-length on paging-index . . . . . . . . . . 117
create-vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
evaluate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25, 43
current-inference-level . . . . . . . . . . . . . . . . . . . 115
evaluate-proposition . . . . . . . . . . . . . . . . . . . . . . . 118
CUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 evaluate-string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
evaluation-state. . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Function Index 143
Variable Index
A K
abstract? of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 kind of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
all-super-contexts of . . . . . . . . . . . . . . . . . . . . . . . 71
any-value of . . . . . . . . . . . . . . . . . . . . . . . . . . 70, 75, 80
arguments of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 M
method-code of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
method-function? of . . . . . . . . . . . . . . . . . . . . . . . . . 73
B method-parameter-names of . . . . . . . . . . . . . . . . . . 72
base-module of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 method-parameter-type-specifiers of . . . . . . . 73
method-return-type-specifiers of . . . . . . . . . . 73
method-setter? of . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
C method-stringified-source of . . . . . . . . . . . . . . . 73
child-contexts of . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
context-number of . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
O
D operator of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
dependent-propositions of . . . . . . . . . . . . . . . . . . 77
S
F surrogate-value-inverse of . . . . . . . . . . . . . . . . . 82
function-code of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
T
H the-cons-list of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
home-context of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 truth-value of . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Concept Index 148
Concept Index
(Index is nonexistent)