We will use PowerLoom for the examples in this chapter. PowerLoom is a first-order predicate logic reasoning system.
I use the PowerLoom knowledge representation and reasoning system because it is free, has a business-friendly open source license, and strikes a good balance between efficiency and expressiveness for modeling concepts and relations. PowerLoom is implemented in a Lisp-like language Stella that compiles to Java, Common Lisp, and C++. While it is possible to create Ruby bindings for the C++ PowerLoom runtime, I decided to use the PowerLoom Java jar file with a JRuby wrapper and that is what we will use for all PowerLoom examples in this book.
You should start by downloading the latest PowerLoom source code snapshot from http://www.isi.edu/isd/LOOM/PowerLoom/ in order to be able to run PowerLoom interactively in development mode.
The ZIP file containing example code for this book contains just the parts of the PowerLoom Java runtime system that are required for my JRuby PowerLoom wrapper.
PowerLoom supports and concepts and relations between concepts. In an object oriented programming sense, ”concept” is ”class”. Assertions can be made in PowerLoom, and later retracted. PowerLoom suports rule based programming with forward and backward chaining, some support for constraint satisfaction, subsumption, explanation of reasoning results, and some support for ”why not?” explanations.
PowerLoom lacks some of the computability neatness of Description Logics (basically first order logic without multiple inheritance) and the very long history of the study of first order logic. That said, I find PowerLoom to make good compromises between ability to express knowledge of the world and guaranteed computability. Description Logic will be covered in the next chapter using the Pellet reasoning system that support the Semantic Web.
PowerLoom supports descriptive logic. Descriptive logic strikes a balance between the full expressiveness of first order logic and efficient computation. A primary limitation of descriptive logics is that they do not support what in object oriented programming is called ”multiple inheritence”. This restriction allows descriptive logic reasoning systems like PowerLoom to efficiently solve some classes of problems.
Here is an example to help you understand concepts and relations:
Consider a top level concept Person and a refinement of this concept Parent. A Parent has a subclass-of relationship with the Person concept. Again, using the language of object oriented programming the subclass-of relationship is like class inheritance. You can define relations; for example, switching from English descriptions to the Lisp-like PowerLoom syntax. The following example is in the file person.plm and is styled loosely from Robert M. NacGregor’s example file business.plm that is included with the PowerLoom distribution.
The file person-data.plm defines test data:
Note that both of these source files contained a (in-module ”EXAMPLE1”) statement. The following output from an interactive PowerLoom session shows why: after loading a file, the current modue is reset.
The obvious point to note from this example is that we never specified that Ken was a parent, rather, PowerLoom deduced this from the parent-of relation.