Learn

Sunday, 3 December 2017

Basics of Power Loom Framework Java Artificial Intelligence



PowerLoom Framework:

             PowerLoom is designed to be an expressive language for knowledge representation and reasoning. As a result, PowerLoom is not a complete reasoning system but makes tradeoffs for completeness of inferences and expressivity vs. computational efficiency. It is interesting to note that Loom and PowerLoom were designed and implemented to solve real-world problems and the tradeoffs to make these problems computationally tractable have informed the design and implementation of these systems. PowerLoom does not make all possible inferences from concepts that it operates on. The PowerLoom distribution contains two very detailed examples for representing relationships between companies and for information dealing with airplanes. These examples are more detailed than the simpler example of data from news stories used in this chapter. We will look one of these examples (business rules and relations) and after working through this chapter, I encourage you to interactively experiment with the two examples that ship with PowerLoom. We will start by defining some terms used in PowerLoom: 

  • concept – the Java equivalent would be an instance of a class
  • relation – specifies a link between two concepts
  • function – functional mapping of one concept to another
  • rule – allows new concepts to be deduced without explicitly asserting them

A relation can specify the types of concepts that a relation connects. An example will make this clear and introduce the Lisp-like syntax of PowerLoom statements:

;;; Concepts:

(defconcept person)

(defconcept parent (?p person))

;;; Relation:

(defrelation parent-of ((?p1 parent) (?p2 person)))

Here I have defined two concepts: person and parent. Note that we have a hierarchy of concept types here: the parent is a more specific concept type than the person concept. All instances that are parents are also of type person. The relation parent of links a parent concept to a person concept.

We will learn more about basic PowerLoom functionality in the next two sections as we use PowerLoom in an interactive session and when we embed PowerLoom in a Java example program.

How to use Login in AI? Which Libraries are used in Artificial Intelligence Logic programming


Logic:

    Logic is the basis for both Knowledge Representation and for reasoning about knowledge. We will encode knowledge using logic and see that we can then infer new facts that are not explicitly asserted.

    First Order Logic was invented by the philosophers Frege and Peirce and is the most widely studied logic system. Unfortunately, full First Order Logic is not computationally tractable for most non-trivial problems so we use more restricted logics. We will use two reasoning systems in this book that support more limited logics:

  • We use PowerLoom is this chapter. PowerLoom supports a combination of limited first order predicate logic and features of description logic. Power-Loom is able to classify objects, use rules to infer facts from existing facts and to perform subsumption (determining class membership of instances).

  • We will use RDF Schema (RDFS) reasoning in Chapter 4. RDFS supports more limited reasoning than descriptive logic reasoners like PowerLoom and OWL Description Logic reasoners.


Examples of Different Logic Types:

Propositional logic is limited to atomic statements that can be either true or false:

Brady-is-a-bird

Brady-has-feathers

First Order Predicate Logic allows access to the structure of logic statements dealing with predicates that operate on atoms. To use a Prolog notation:

feathers(X) :- bird(X).

bird(brady).

Here “feathers” and “bird” are predicates and “Brady” is an atom. The first example states that for all X, if X is a bird, then X has feathers. In the second example, we state that Brady is a bird. Notice that in the Prolog notation that we are using, variables are capitalized and predicate names and literal atoms are lower cases. Here is a query that asks who has feathers:

?- feathers(X).

X = brady

                    In this example, through inference, we have determined a new fact, that Brady has feathers because we know that Brady is a bird and we have the rule (or predicate)  stating that all birds have feathers. Prolog is not strictly a pure logic programming language since the order in which rules (predicates) are defined changes the inference results. Prolog is a great language for some types of projects (I have used Prolog in both natural language processing and in planning projects). We will see that PowerLoom is considerably more flexible than Prolog but does have a steep
learning curve.

Description Logic deals with descriptions of concepts and how these descriptions define the domain of concepts. In terms used in object-oriented programming languages:

                  membership in a class is determined implicitly by the description of the object and not by explicitly stating something like “Brady is a member of the bird class.” Description logics divide statements into relations (historically referred to as TBox) and concepts (historically called ABox). We would say that a statement like “All birds have feathers” is stored in the TBox while a specific assertion like “Brady is a bird” is stored in the ABox.