Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
JSS/LEC006/ITT/R000/V001/DT 240704
/41
Knowledge Representations
1. First Order Predicate Calculus
2. Skolemization
3. Resolution principal & Unification 4. Inference Mechanisms 5. Horns Clauses 6. Semantic Networks
Next
JSS/LEC006/ITT/R000/V001/DT 240704
End
/41
Knowledge Representations
7. Frame System and Value Inheritance 8. Scripts 9. Conceptual Dependency
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
/41
knowledge Representation
Assumption of (traditional) AI work is that: Knowledge may be represented as symbol structures (essentially, complex data structures) representing bits of knowledge (objects, concepts, facts, rules, strategies..). E.g., red represents colour red. car1 represents my car. red(car1) represents fact that my car is red. Intelligent behaviour can be achieved through manipulation of symbol structures
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
/41
Knowledge Representation
Knowledge Representation Language A KR language should allow you to: represent adequately the knowledge you need for your problem (representational adequacy) do it in a clear, precise and natural way. allow you to reason on that knowledge, drawing new conclusions.
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
/41
Knowledge Representation
Representational adequacy:
John believes no-one likes brussel sprouts. Most children believe in Santa. John will have to finish his assignment before he
Can all be represented as a string! But hard then to manipulate and draw conclusions. How do we represent these formally in a way that can be manipulated in a computer program?
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
/41
Knowledge Representation
Some notations/languages only allow you to represent certain things.
Time, beliefs, uncertainty, all hard to
represent.
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
/41
Knowledge Representation
In other word through knowledge representation we are representing facts. there are few entities which must be discussed:
Facts-Truths
formalism
JSS/LEC006/ITT/R000/V001/DT 240704
/41
Knowledge Representation
we can structure these entity in two
levels: 1.The knowledge level, at which facts are described. 2.the symbol level,at which representation of object at the knowledge level are defined in terms of symbol that can be manipulated by program
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
/41
Knowledge Representation
Facts
*
* English
Programs
understanding
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
10
/41
Knowledge Representation
Approaches to Knowledge Representation Representation Adequacy-the ability to represent all kind of knowledge that are needed in that domain. Acquisitional Efficiency-the ability to acquire new information easily .
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
11
/41
Knowledge Representation(cont..)
Inferential Adequacy
Representing knowledge not very interesting unless you can use it to make inferences: Draw new conclusions from existing facts. If its raining John never goes out + Its raining today so.. Come up with solutions to complex problems, using the represented knowledge. Inferential adequacy refers to how easy it is to draw inferences using represented knowledge. Representing everything as natural language strings has good representational adequacy and naturalness, but very poor inferential adequacy.
Previous Next End
12 /41
JSS/LEC006/ITT/R000/V001/DT 240704
Knowledge Representation
Logic as a Knowledge Representation Language A Logic is a formal language, with precisely defined syntax and semantics, which supports sound inference. Independent of domain of application. Different logics exist, which allow you to represent different kinds of things, and which allow more or less efficient inference.
propositional logic, predicate logic, temporal
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
13
/41
Knowledge Representation(continue)
But representing some things in logic may not be very natural, and inferences may not be efficient. More specialised languages may be better..
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
14
/41
And
for all there exits
=
= =
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
15
/41
JSS/LEC006/ITT/R000/V001/DT 240704
16
/41
6. X s. 7. X s.
Remember that logic sentences evaluate to true or false, therefore only such objects are atomic sentences. Functions are not atomic sentences.
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
17
/41
3. The value of a function expression is that element of D obtained by evaluating the function for the parameter values assigned by the interpretation.
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
18
/41
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
19
/41
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
20
/41
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
21
/41
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
22
/41
In predicate logic ,we can represent real world facts as statements written as well form formulas.
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
23
/41
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Continue
End
25
/41
JSS/LEC006/ITT/R000/V001/DT 240704
27
/41
x: y:loyalto(x,y)
7.people only try to assassinate rulers they are not loyal to.
JSS/LEC006/ITT/R000/V001/DT 240704
28
/41
x:man(x)person(x)
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Next
End
29
/41
JSS/LEC006/ITT/R000/V001/DT 240704
30
/41
JSS/LEC006/ITT/R000/V001/DT 240704
31
/41
x:instance(x,Roman) hate(x,Caesar)
loyalto(x,Caesar) v
x:instance(x,Roman) hate(x,Caesar)
loyalto(x,Caesar) v
32 /41
JSS/LEC006/ITT/R000/V001/DT 240704
5. 6.
x:instance(x,Roman) hate(x,Caesar)
loyalto(x,Caesar) v
x:y:z:instance(x,y) isa(y,z)
instance(x,z)
JSS/LEC006/ITT/R000/V001/DT 240704
33
/41
Skolemization
Introduction of constants or functions when
removing existential quantifier. There exists an x such that P(x) becomes: P(A) for some new constant symbol A. example Everyone has someone who loves him For all x, Loves(F(x),x) where F(x) is a new function.
JSS/LEC006/ITT/R000/V001/DT 240704
34
/41
Resolution principle
resolution is such a procedure which gain its efficiency from the fact that it operates on the statement that have been converted to a very convenient standard form. means resolution attempts to show that the negation of the statement produces contradiction with the known statement
JSS/LEC006/ITT/R000/V001/DT 240704
35
/41
Resolution principle
All Romans who know Marcus either hate Caesar or think that anyone who hates anyone is crazy
Algorithm: Eliminate ,using the fact a b is equivalent to a v b ex- x : [Roman(x) know(x,Marcus)] v[hate(x,Caesar) v (y: z:hate(y,z) v thinkcrazy(x,y))]
JSS/LEC006/ITT/R000/V001/DT 240704
36
/41
Resolution principle
2.Reduce the scope of to a single term,using the fact that (p)=p.
3.Standardize variables so that each quantifier binds a unique variable. ex- x:P(x)v x:Q(x) would be converted to x:P(x)v y:Q(y)
JSS/LEC006/ITT/R000/V001/DT 240704
37
/41
Resolution principle
4.Move all quantifier to the left of the formula without changing their relative order. x: y:z:[Roman(x) v know(x,Marcus)] v [hate(x,Caesar) v(hate(y,z) v thinkcrazy(x,y))] 5.Eliminate essential quantifiers. ex1- y:President(y) can be transformed into the formula President(S1) where S1 is the formula with no argument. ex12- x:y: father-of(y,x) can be transformed into x :father-of(S2(x),x)
38 /41
JSS/LEC006/ITT/R000/V001/DT 240704
Resolution principle
6.Drop the prefix. [Roman(x) v know(x,Marcus)] v [hate(x,Caesar) v(hate(y,z) v thinkcrazy(x,y))] 7.Convert the matrix into conjunction of disjunction. Roman(x) v know(x,Marcus) v hate(x,Caesar) v hate(y,z) v thinkcrazy(x,y) 8.Create a separate clause for each conjunct. 9.Standardize apart the variable in the set of clause generated in step 8. (x:P(x)
JSS/LEC006/ITT/R000/V001/DT 240704
Unification
Contradiction
man(john) and man(john) In order to determine contradiction,we need a matching procedure that compares two literals and discovers whether there exits a substitution that make them identical,there is straightforward recursive procedure unification algorithm that does this .
JSS/LEC006/ITT/R000/V001/DT 240704
40
/41
Unification
Algorithm:unify(L1,L2) 1.If L1 or L2 are both variable and constant, then (a)if L1 and L2 are identical then return NIL.
Unification
2.if the initial predicate symbol in L1 and L2 are not identical ,then return {FAIL}. 3.if L1 and L2 have different number of argument ,then return {FAIL}. 4.set SUBST to NIL (at the end of this procedure,SUBST will contain all the substitution used to unify L1 and L2) 5.For i 1 the number of the arguments in L1: (a) Call Unify with the ith argument of L1 and ith argument of L2,putting result in S. (b) If S contain FAIL then return {FAIL}
JSS/LEC006/ITT/R000/V001/DT 240704
42 /41
Unification
c)if S is not equal to NIL then: i.apply S to the remainder of both L1 and L2. ii. SUBST:=APPEND(S,SUBST). 6.Return SUBST.
JSS/LEC006/ITT/R000/V001/DT 240704
43
/41
Unification
Make sentences look alike. Unify p(a,X) and p(a,b) Unify p(a,X) and p(Y,b) Unify p(a,X) and p(Y, f(Y)) Unify p(a,X) and p(X,b) Unify p(a,X) and p(Y,b) Unify p(a,b) and p(X, X)
JSS/LEC006/ITT/R000/V001/DT 240704
44
/41
Unification
Unify
p(a,X) and p(a,b) answer: b/X p(a,b) Unify p(a,X) and p(Y,b) answer: a/Y, b/X p(a,b) Unify p(a,X) and p(Y, f(Y)) answer: a/Y, f(a)/X p(a,f(a))
JSS/LEC006/ITT/R000/V001/DT 240704
45
/41
Unification
Unify
p(a,X) and p(X,b) failure Unify p(a,X) and p(Y,b) answer: a/Y, b/X Unify p(a,b) and p(X,X) failure
p(a,b)
JSS/LEC006/ITT/R000/V001/DT 240704
46
/41
Inference Mechanisms
JSS/LEC006/ITT/R000/V001/DT 240704
47
/41
Horn Clause
A horn clause is a clause that has at most one positive literal. example: p, p v q and p q p q does not look like horn clause but we know that any logical expression can be converted into clause form so after conversion the resulting clause is p v q horn clauses are written in PROLOG program.
JSS/LEC006/ITT/R000/V001/DT 240704
48 /41
Semantic Network
Information is represented as a set of nodes connected to each other by set of labeled arcs,which represent the relationship among the nodes. Semantic nets is that meaning of the concept comes from the ways in which it is connected to the other concepts.
JSS/LEC006/ITT/R000/V001/DT 240704
49
/41
Semantic Network
JSS/LEC006/ITT/R000/V001/DT 240704
50
/41
Semantic Network
Mammal
isa
Person
has-part
Nose
instance
Blue
uniform-color
Pee-Wee-Reese
team
Brooklyn-Dodgers
JSS/LEC006/ITT/R000/V001/DT 240704
51 /41
Semantic Network
Intersection Search
Semantic nets were used was to find relationship among objcts by spreading activation out from each of two nodes and seeing where the activation met. ex-what is the relation between the Brooklyn Dodgers and blue?
JSS/LEC006/ITT/R000/V001/DT 240704
52
/41
Semantic Network
Representing Nonbinary Predicates
Semantic nets are a natural way to represent relationships that would appear as a ground instance of binary predicate in predicate logic ex-isa(Person,Mammal) instance(Pee-Wee-Reese,person) team(Pee-Wee-Reese,Brooklyn-Dodgers) uniform-color(Pee-Wee-Reese,Blue)
JSS/LEC006/ITT/R000/V001/DT 240704
53
/41
Semantic Network
Making some important distinction
There should be a difference between a link that defines a new entity and one that relates two existing entities. ex- consider the net height john
72
Both node represent objects that exits independently of their relationship to each other.
JSS/LEC006/ITT/R000/V001/DT 240704
54 /41
Semantic Network
suppose we want to show the fact that john is taller than Bill,using the net
John Bill
height
H2
JSS/LEC006/ITT/R000/V001/DT 240704
55
/41
Semantic Network
H1=Johns height and H2=Bills height . Using these concept ,it is possible to represent such a facts as that Johns height increased.
JSS/LEC006/ITT/R000/V001/DT 240704
56
/41
Frame System
A frame is a collection of attributes and associated values that describe some entity in the world A single frame taken alone is rarely useful. we build frame systems out of collections of frame that are connected to each other by virtue of the fact that the value of an attribute of one frame may be another frame.
JSS/LEC006/ITT/R000/V001/DT 240704
57
/41
Frame Systems
Also
called schemas Similar to semantic networks, but all the information relevant to an object is held inside the node Frames have two main parts:
Slots which hold variable data Fixed parts which hold static data
Data
JSS/LEC006/ITT/R000/V001/DT 240704
Frame Systems
b
Panda
Colour: black and white NoEars: 2 Food: Bamboo EatFunc: .. Name: Height: Age: 0 Fixed part
Slot
JSS/LEC006/ITT/R000/V001/DT 240704
59
/41
Frame Systems
Panda Bamboo Type: Plant GrowFunc: .. Location: Height: 2 Type: Animal Colour: Black and white Food: EatFunc: .. Name: Height: Age: 0 Sibling
Jenny
JSS/LEC006/ITT/R000/V001/DT 240704
60
/41
Frame Systems
For a knowledge representation system to represent a changing world, it must be able to change itself Archetypes of frames exist, when the system finds a new object it searches the archetypes for something that looks like the new object When a suitable archetype is found, a new instantiation of that archetype is made
JSS/LEC006/ITT/R000/V001/DT 240704
61
/41
Frame Systems
frame, and the Bamboo frame is nested within the Panda frame
class From default values from the super-class By the execution of proceedures within frames
When a frame is instantiated it attempts to fill all its slots, using the above methods
62 /41
JSS/LEC006/ITT/R000/V001/DT 240704
It is difficult to implement some logical relationships between concepts How could you represent the fact that a panda is either male OR female? Or that a person prefers either trains Or aeroplanes What about the there exists relationship there exists a person who does not like chocolate? For frames, instantiating new frames by matching to archetypes is very difficult How closely must a new concept match an archetype before it is instantiated?
JSS/LEC006/ITT/R000/V001/DT 240704
63 /41
Conceptual Dependency
JSS/LEC006/ITT/R000/V001/DT 240704
64
/41
JSS/LEC006/ITT/R000/V001/DT 240704
65
/41
JSS/LEC006/ITT/R000/V001/DT 240704
66
/41
JSS/LEC006/ITT/R000/V001/DT 240704
67
/41
JSS/LEC006/ITT/R000/V001/DT 240704
68
/41
JSS/LEC006/ITT/R000/V001/DT 240704
69
/41
JSS/LEC006/ITT/R000/V001/DT 240704
70
/41
JSS/LEC006/ITT/R000/V001/DT 240704
71
/41
JSS/LEC006/ITT/R000/V001/DT 240704
72
/41
JSS/LEC006/ITT/R000/V001/DT 240704
73
/41
JSS/LEC006/ITT/R000/V001/DT 240704
74
/41
JSS/LEC006/ITT/R000/V001/DT 240704
75
/41
JSS/LEC006/ITT/R000/V001/DT 240704
76
/41
JSS/LEC006/ITT/R000/V001/DT 240704
77
/41
JSS/LEC006/ITT/R000/V001/DT 240704
78
/41
JSS/LEC006/ITT/R000/V001/DT 240704
79
/41
JSS/LEC006/ITT/R000/V001/DT 240704
80
/41
JSS/LEC006/ITT/R000/V001/DT 240704
81
/41
JSS/LEC006/ITT/R000/V001/DT 240704
82
/41
JSS/LEC006/ITT/R000/V001/DT 240704
83
/41
JSS/LEC006/ITT/R000/V001/DT 240704
84
/41
JSS/LEC006/ITT/R000/V001/DT 240704
85
/41
JSS/LEC006/ITT/R000/V001/DT 240704
86
/41
JSS/LEC006/ITT/R000/V001/DT 240704
87
/41
JSS/LEC006/ITT/R000/V001/DT 240704
88
/41
JSS/LEC006/ITT/R000/V001/DT 240704
89
/41
JSS/LEC006/ITT/R000/V001/DT 240704
90
/41
JSS/LEC006/ITT/R000/V001/DT 240704
91
/41
JSS/LEC006/ITT/R000/V001/DT 240704
92
/41
JSS/LEC006/ITT/R000/V001/DT 240704
Previous
Quit
93
/41