Knowledge Representation: Represent and Manipulate The Domain Knowledge
Knowledge Representation: Represent and Manipulate The Domain Knowledge
Knowledge Representation: Represent and Manipulate The Domain Knowledge
Outlines
From Knowledge to Knowledge Representation
Knowledge Representation Methods
Knowledge Definition
The fact or condition of knowing something with familiarity gained through experience or association. (Websters Dictionary, 1988)(Knowing something via seeing, hearing, touching, feeling, and tasting.) The fact or condition of being aware of something .(Ex. Sun is hot, balls are round, sky is blue,)
Knowledge Storing
Natural language for people Symbols for computer: a number or character string that represents an object or idea (Internal representation of the knowledge). The core concepts: mapping from facts to an internal computer representation and also to a form that people can understand.
Knowledge Representation
Simple facts or complex relationships
Mathematical formulas or rules for natural language syntax
Hierarchical method
Complex network graph
Procedural representation
Encode facts and define the sequence of operations step by step. (Hardcoded logic)
The weakness: the knowledge and the
Declarative method
Overcoming the weakness of procedural representation
The states, facts, rules, and relationships are separated declared. The separation of knowledge from the algorithm used to manipulate or reason with that knowledge provides advantages over procedural codes. Because the knowledge is explicitly represented, it can be more easily modified. Separating the control logic and reasoning algorithms from the knowledge allows us to write optimized and reusable inferencing procedures.
Hierarchical representation
Used to represent inheritable knowledge. Inheritable knowledge: it centers on relationships and shared attributes between kinds or classes of objects. Hierarchical knowledge is best used to represent isa relationships, where a general or abstract type (ex, ball) is linked to more specific types (rubber, golf, baseball, football) which inherit the basic properties of the general type.
Hierarchical representation
The strength of object inheritance allows for compact representation of knowledge and allows reasoning algorithm to process at different levels of abstraction or granularity.
The use of categories or types gives structure to the world by grouping similar objects together. Using categories or clusters simplifies reasoning by limiting the number of distinct things we have to deal with. (reduce complexity)
Predicate Logic
The use of formal logic as a primary knowledge representation harkens back to the beginnings of AI research. Mathematical deduction based on logic, was a wellknown method of generating new knowledge from existing knowledge.
Predicate Logic
Formal logic is a language with its own syntax, which defines how to make sentences, and corresponding semantics, which describe the meaning of the sentences. Sentences can be constructed using proposition symbols (P, Q, R) and Boolean connectives, such as conjunction (And), disjunction (Or), implication (P implies Q). Ex: if P and Q then R, the preceding rule, P and Q, is called the premise or antecedent, and R is the conclusion or consequent.
Predicate Logic
Modus Ponens: where given a rule, A implies B, if A is true, we can infer that B is also true. Predicate logic introduces the concept of quantifiers, which allow us to refer to sets of objects. Using objects, attributes, and relations, we can represent almost any type of knowledge. Two quantifiers: : universal (all objects of this type have this attribute), : existential (there exists some object that has the specified attribute)
Predicate Logic
Ex: Minnesota is cold in the winter can be represented in three single parameter:
Place (Minnesota), Temperature(cold) and Season(winter).
Resolution ()
Resolution is an algorithm for proving facts true or false by virtue of contradiction. If we want to prove a theorem X is true, we have to show that the negation of X is not true.
Example of Resolution
Suppose that we know the following two facts:
1.not feathers(Tweety) or bird(Tweety) 2.feathers(Tweety)
Sentence 1 states that either Tweety does not have feathers or else Tweety is a bird. Sentence 2 states that Tweety has feathers. To prove that Tweety is a bird, we first add an assumption that is the negation of that predicate, giving sentence 3:
3.not bird(tweety)
Example of Resolution
In sentence 1 and 2, not feathers(Tweety) and feathers(Tweety) cancel each other out. Resolving sentences 1 and 2 produces the resolvant, sentence 4, which is added to our fact set:
4. Bird(Tweety)
It is clear that sentences 3 and 4 cannot both be true, either Tweety is a bird ot it is not. Thus, we have a contradition. WE have just proved that our first assumption, not bird(Tweety), is false, and the alternative, bird(Tweety), must be true (Winston, 1993).
Resolution
If the clauses to be resolved are selected in systematic ways, then resolution is guaranteed to find a contradiction if one exists, although it may take a long time to find.
Unification ()
Unification is a technique for taking two sentences in predicate logic and finding a substitution that makes them look the same.
lA variable can be replaced by a constant. lA variable can be replaced by another variable. lA variable can be replaced with a predicate, as long as the predicate does not contain that variable.
Example of unification
Given the following set of predicates, lets explore how they can be unified:
hates(X,Y) hates(George, broccoli) hates(Alex, spinach)
We could unify sentence 2 with 1 by binding George to variable X, and broccoli to variable Y. Similarly, we could bind Alex to X and spinach to Y. Note that if the predicate names were different, we could not unify these predicates.
Example of unification
If we introduce a few more predicates, we can explore more complex unifications: 4.hates(X, vegetable(Y)) 5.hates(George, vegetable(Y)) 6.hates(Z, broccoli) We could unify sentence 6 with sentence 1 by replacing variable X with variable Z and variable Y with the constant broccoli. Sentence 4 and 5 could be unified with George bound to X, and broccoli to variable Y.
Frames
A frame is a collection of attributes, which defines the state of an object and its relationship to other frames (objects). But a frame is much more than just a record or data structure containing data. In AI, frames are called slot-filler data representations. The slots are the data values, and the fillers are attached procedures which are called before, during (to compute the value of), or after the slots value is changed. Frames are often linked into a hierarchy to represent has-part ans isa relationships.
Example of Frames
Vehicle Wheels: Yes
isa
isa
Semantic Nets
Semantic nets are used to define the meaning of a concept by its relationships to other concepts. A graph data structure is used, with nodes used to hold concepts, and links with natural language labels used to show the relatjonships. A modern implementation of a semantic net is the Knowledge Utility (KnU) developed by IBM. (http://www.ibm.aqui.com)
has-part
has-part Doors
Motor
Representing Uncertainty
In most cases, there will be some information available, but the rest will have to be inferred or collected as the inferencing proceeds. We have uncertainty. Normally, we have a statistical theory which works well under conditions of uncertainty, call Bayes rule or Bayes theorem. P(H|E): the probability of hypothesis H given that we have observed evidence E.
Representing Uncertainty
Bayes theorem says that we can compute the conditional probability that event Y will occur given that event X already occurred, providing we know the prior probabilities that X and Y could happen, and the conditional probability that X will occur when we know that Y has already occurred. P(Y|X) = P(X|Y) P(Y) / P(X)
Example of KIF
An example rule in KIF : (=> (EventName Agent: Starting) (SetIdentifiedIntervalAlarm NETSCAPE 20 minutes)) Which translates to if we receive an AGENT:STARTING event then start a named interval alarm (a timer) identified by the string NETSCAPE to go off every 20 minutes.
Example of KIF
Example of KIF rule: (GetStockPrice ?price) (IntegerCompare ?price > 150) means get the stock price and place it in variable ?price, then test to see if the price is greater than 150.
When combined with a reasoning system or inference engine, a knowledge base becomes a part of a knowledge-based system.