0% found this document useful (0 votes)
20 views68 pages

CH-3 Knowledge Representation and reasoning (Part II)

The document discusses knowledge representation and reasoning in artificial intelligence, focusing on predicate logic and its advantages over propositional logic. It outlines the syntax and semantics of predicate logic, including the use of quantifiers, functions, and relations, as well as methods for converting statements to Conjunctive Normal Form (CNF) for resolution. Additionally, it provides examples and exercises to illustrate the application of predicate logic in representing facts and reasoning.

Uploaded by

jpt1896
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views68 pages

CH-3 Knowledge Representation and reasoning (Part II)

The document discusses knowledge representation and reasoning in artificial intelligence, focusing on predicate logic and its advantages over propositional logic. It outlines the syntax and semantics of predicate logic, including the use of quantifiers, functions, and relations, as well as methods for converting statements to Conjunctive Normal Form (CNF) for resolution. Additionally, it provides examples and exercises to illustrate the application of predicate logic in representing facts and reasoning.

Uploaded by

jpt1896
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

3.

Knowledge Representation &


Reasoning
Artificial Intelligence and Neural Network (AINN)
Part II
Dr. Udaya Raj Dhungana
Assist. Professor
Pokhara University, Nepal
Guest Faculty
Hochschule Darmstadt University of Applied Sciences, Germany
E-mail: udaya@pu.edu.np and udayas.epost@gmail.com

1
Overview
– Predicate logic
– Inference in predicate logic
– Knowledge Representation Using Rules
– Semantic Nets and Frames

2
Predicate Logic
• Drawbacks of propositional logic
1. The assertion "x > 1", where x is a variable, is not a
proposition
• because it is neither true nor false unless value of x is defined.
2. Consider
“All men are mortal.
John is a man.
Then John is mortal”
• Fails to capture relationship between John and man or John
and mortal.
• In addition, we do not get any information about the
objects involved.
– For example, if asked a question : “who is a man?” we
cannot get answer.

3
Predicate Logic
• Drawbacks of propositional logic
3. Consider
“Not all integers are even.”
“Some integers are not even”
– The Propositional logic treats statements
independently.
– There is no mechanism in propositional logic to
find out whether these two statements are
equivalent.

4
Predicate Logic
• The drawbacks of propositional logic are solved
in predicate logic

• Predicate logic
– is powerful enough for expression and reasoning.
– is built upon the ideas of propositional logic.

5
Predicate Logic
• first-order logic (like natural language) assumes the world contains
– Objects:
• are terms
• Terms are names of objects
• E.g. people, houses, car, John …
– Properties
• Unary predicates on terms
• Predicate represents a property of or relations between terms that can be true or false
• Eg. Hight, red, area …
– Relations:
• N-ary predicates on terms
• A relation takes terms as arguments, and results in a sentence, denoting a claim
• fatherOf("Barack Obama", “Sasha”)
• brother of, bigger than, part of …
– Functions:
• Mapping from terms to other terms
• N-ary function maps a tuple of n terms to another
• A function takes terms as arguments, and results in another term, denoting an object
• getFather("Sasha") --> "Barack Obama”
• plus (1, 2) …
6
Predicate Logic
• Syntax:
– Constants John, 2, CAR,...
– Variables x, y, a, b,...
– Predicates Brother(), IsBlue(),...
– Functions Sqrt, sum,…
– Connectives ¬, ∧, ∨, →,
– Equality =
– Quantifiers ∀ (universal quantifier) and
∃ (existential quantifier)

7
Predicate Logic
• Syntax:
– Atomic sentence
• predicate (term1,...,termn)
• term1 = term2

– Terms
• function (term1,...,termn)
• constant or
• variable
– Complex sentences are made from atomic sentences using
connectives
• ¬S
• S1 ∧ S2
• S1 → S2

8
Predicate Logic
• Syntax
– Universal quantifier (∀)
• ∀x: means “for all” x
• represent phrase “ for all”.
• It says that something is true for all possible values of
a variable.
• Example
“ John loves everyone”
∀x: loves(John , x)

9
Predicate Logic
• Syntax
– Existential quantifier(∃)
• Used to represent the fact “ there exists some”

• Example:

1. John loves someone


∃ y: loves(John , y)

2. some people like reading and hence they gain


knowledge.
∃ x: { [person(x) ∧ like (x , reading)] → gain(x, knowledge) }

10
Predicate Logic
• Syntax
– Nesting of quantifiers

• E.g. “ everybody loves somebody ”

∀x:∃y: loves ( x , y)

11
Predicate Logic
• Syntax
– Properties of quantifiers

• ∀x ∀y is the same as ∀y ∀x
• ∃x ∃y is the same as ∃y ∃x
• ∃x ∀y is not the same as ∀y ∃x

Examples:

• ∃x ∀y Loves(x,y)
–“There is a person who loves everyone in the world”

• ∀y ∃x Loves(x,y)
– “Everyone in the world is loved by at least one person”

12
Predicate Logic
• Syntax
– Properties of quantifiers
• Quantifier duality: each can be expressed using the other

∀x Likes(x, IceCream) = ¬∃x ¬Likes(x, IceCream)


∃x Likes(x, Broccoli) = ¬∀x ¬Likes(x, Broccoli)

In general

∀x ¬P = ¬∃x P
¬∀x P = ∃x ¬ P
∀x P = ¬∃x ¬P
∃x P = ¬∀x ¬P
∀x P(X) ∧ Q(X) = ∀x P(X) ∧ ∀x Q(X)
∃ x P(X) ∧ Q(X) = ∃ x P(X) ∧ ∃ x Q(X)

13
Predicate Logic
• Representing Simple facts in predicate logic
1. Marcus was a man.

man(Marcus)

2. Marcus was a Pompeian

Pompeian(Marcus)

3. All Pompeian were Romans

∀x : Pompeian(x) → Roman (x)

14
Predicate Logic
• Representing Simple facts in predicate logic
4. Caesar was a rular.

rular(Caesar)

5. All Romans were either loyal to Caesar or hated him.

∀x : Roman(x) → loyalto(x, Caesar) ∨ hate(x,


Caesar)

6. Everyone is loyal to someone

∀x : ∃y : loyalto(x, y)

15
Predicate Logic
• Representing Simple facts in predicate logic
7. People only try to assassinate rulers they are not loyal to

∀x : ∀y: person(x) ∧ ruler(y) ∧ try-assassinate(x, y) →


¬loyalto(x, y)

8. Marcus tried to assassinate Caesar

try-assassinate(Marcus, Caesar)

9. All man are people

∀x: man(x) → person (x)

16
Predicate Logic
• Some more examples 1
1. all indoor games are easy.

∀x : indoor-game(x) → easy (x)

2. god helps those who helps themselves

∀x : helps(god, helps(x, x))

3. Any person who is respected by every person is a king.

∃x : ∀y: person (x) ∧ person (y) ∧ respect (y, x)


→ king (x)

17
Predicate Logic
• Practice 1
(represent these statement in predicate
logic)
• Every child loves Santa.
• Everyone who loves Santa loves any reindeer.
• Rudolph is a reindeer, and Rudolph has a red nose.
• Anything which has a red nose is weird or is a clown.
• No reindeer is a clown.
• Scrooge does not love anything which is weird.
• Scrooge is not a child.

18
Predicate Logic
• Practice 1
(Answer)
• Every child loves Santa.
• ∀ x (CHILD(x) → LOVES(x,Santa))

• Everyone who loves Santa loves any reindeer.


• ∀ x (LOVES(x,Santa) → ∀ y (REINDEER(y) → LOVES(x,y)))

• Rudolph is a reindeer, and Rudolph has a red nose.


• REINDEER(Rudolph) ∧ REDNOSE(Rudolph)

• Anything which has a red nose is weird or is a clown.


• ∀ x (REDNOSE(x) → WEIRD(x) ∨ CLOWN(x))

• No reindeer is a clown.
• ¬ ∃ x (REINDEER(x) ∧ CLOWN(x))

• Scrooge does not love anything which is weird.


• ∀ x (WEIRD(x) → ¬ LOVES(Scrooge,x))

• Scrooge is not a child.


• ¬ CHILD(Scrooge)

19
Predicate Logic
• Practice 2
(represent these statement in predicate
logic)
• Anyone whom Mary loves is a football star.
• Any student who does not pass does not play.
• John is a student.
• Any student who does not study does not pass.
• Anyone who does not play is not a football star.
• If John does not study, then Mary does not love John.

20
Predicate Logic
• Practice 2
(Answer)
• Anyone whom Mary loves is a football star.
• ∀ x (LOVES(Mary,x) → STAR(x))

• Any student who does not pass does not play.


• ∀ x (STUDENT(x) ∧ ¬ PASS(x) → ¬ PLAY(x))

• John is a student.
• STUDENT(John)

• Any student who does not study does not pass.


• ∀ x (STUDENT(x) ∧ ¬ STUDY(x) → ¬ PASS(x))

• Anyone who does not play is not a football star.


• ∀ x (¬ PLAY(x) → ¬ STAR(x))

• If John does not study, then Mary does not love John.
• ¬ STUDY(John) → ¬ LOVES(Mary,John)

21
Predicate Logic
• Resolution
– Produces proof by refutation (Proof by
contradiction)
– To prove a statement,
• resolution attempts to show the negation of the
statement produces a contradiction with the known
statements.
– Requires sentences to be in Conjunctive
Normal Form (CNF)

22
Predicate Logic
• Resolution AND = Conjunctions
OR = Disjunction
– Conjunctive Normal Form (CNF)
• In CNF, statements are conjunctions (sequence of
ANDs) of clauses with clauses of disjunctions
(sequence of OR).
• In other words, a statement is a series of ORs
connected by ANDs.
• Examples:
(P ∨ Q) ∧ (¬P ∨ R)

23
Predicate Logic
• Resolution
– Conversion to CNF Form:
1. Eliminate biconditionals ( )and implications (→) using

p q ≡ (p → q) ∧ (q → p)
p→q≡¬p∨q

2. Move ¬ inwards:
¬∀x : p(x) ≡ ∃x : ¬p(x)
¬∃x : p(x) ≡ ∀x : ¬p(x)

¬(α ∨ β) ≡ ¬α ∧ ¬β
¬(α ∧ β) ≡ ¬α ∨ ¬β

¬¬ α ≡ α

24
Predicate Logic
• Resolution
– Conversion to CNF Form:

3. Standardize variables so that each quantifier binds a


unique variable. For instance
∀x : P(x) ∨ ∀x : Q(x) could be converted into
∀x : P(x) ∨ ∀y : Q(y)

4. Move all quantifiers to the left without changing their


relative order.

∀x : P(x) ∨ ∀y : Q(y) ≡
∀x : ∀y : (P(x) ∨ Q(y))

25
Predicate Logic
• Resolution
– Conversion to CNF Form:

5. Skolemize: each existential variable is replaced by a Skolem


constant or Skolem function of the enclosing universally
quantified variables.

1. ∃x Rich(x) ≡ Rich(G1) where G1 is a new Skolem constant.

2. ∀x [∃y animal (y) ∧ ¬ loves(x, y) ] ∨ [∃z loves(z, x)] ≡


∀x [animal (F(x)) ∧ ¬ loves(x, F(x)) ] ∨ [loves(G(x), x)]
where F and G are Skolem functions.

6. Drop universal quantifiers


[animal (F(x)) ∧ ¬ loves(x, F(x)) ] ∨ [loves(G(x), x)]

26
Predicate Logic
• Resolution
– Conversion to CNF Form:

7. Distribute ∧ over ∨

[animal (F(x)) ∧ ¬ loves(x, F(x)) ] ∨ [loves(G(x), x)] ≡


[animal (F(x)) ∨ loves(G(x), x)] ∧ [¬ loves(x, F(x)) ∨ loves(G(x), x) ]

• This sentence is now in CNF


• Consists of two clauses
[animal (F(x)) ∨ loves(G(x), x)]
[¬ loves(x, F(x)) ∨ loves(G(x), x) ]
• Is quite unreadable (human seldom need look at CNF sentences)

27
Predicate Logic
• Resolution
– Example: Conversion to CNF
“Everyone who loves all animal is loved by someone”
In predicate logic:
∀x [∀y animal (y) → loves(x, y) ] → [ ∃y loves(y, x)]

1. Eliminate implications
∀x [∀y ¬animal (y) ∨ loves(x, y) ] → [ ∃y loves(y, x)] ≡
∀x [¬ [∀y ¬animal (y) ∨ loves(x, y) ]] ∨ [ ∃y loves(y, x)]

2. Move ¬ inwards
∀x [¬∀y ¬ (¬ animal (y) ∨ loves(x, y) )] ∨ [ ∃y loves(y, x)] ≡
∀x [∃y animal (y) ∧ ¬loves(x, y) ] ∨ [ ∃y loves(y, x)]

3. Standardize variables
∀x [∃y animal (y) ∧ ¬loves(x, y) ] ∨ [ ∃z loves(z, x)]

28
Predicate Logic

4. Skolemize (process of removing existential quantifiers)

∀x [animal (F(x)) ∧ ¬loves(x, F(x)) ] ∨ loves(G(x), x)


Where F and G are skolem functions.

5. Drop universal quantifiers

[animal (F(x)) ∧ ¬loves(x, F(x)) ] ∨ loves(G(x), x)

3. Distribute ∧ over ∨

[animal (F(x)) ∨ loves(G(x), x)] ∧ [¬ loves(x, F(x)) ∨ loves(G(x), x) ]

– This is in CNF and has two clauses


[animal (F(x)) ∨ loves(G(x), x)]
[¬ loves(x, F(x)) ∨ loves(G(x), x) ]

29
Predicate Logic
• Unification
– It’s a matching procedure that compares two literals and
discovers whether there exists a set of substitutions that
can make them identical.

– Similarly,
• Hate(X,Y) and Hate( john, Z) could be unified as:
– John/X and y/z

30
Predicate Logic
• Resolution
– Is rule of inference
– Pre-processing steps:
1. Convert the given English sentence into predicate
sentence.
2. Convert all of these sentences into CNF.

31
Predicate Logic
• Resolution
– Assume that a set of given statements F and a statement to be
proved P:

– ALGORITHM: RESOLUTION IN PREDICATE LOGIC


1. Convert all the statements of F to clause form
2. Negate P and convert the result to clause form. Add it to the
set of clauses obtained in step 1.
3. Repeat until either a contradiction is found or no progress can
be made:
a. Select two clauses. Call these the parent clauses.
b. Resolve them together. The resulting clause is called the resolvent.
c. If the resolvent is the empty clause, then a contradiction has been found.
(It means the assumption is wrong and the original clause is true.)
If it is not then add it to the set of clauses available to the procedure.

32
Predicate Logic
• Resolution
– Example: Let facts about Marcus:
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Romans were either loyal to Caesar or hated him.
6. Every one is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
9. All men are people

33
Predicate Logic
• Resolution
– Example: given facts in predicate logic:
1. Man(Marcus)
2. Pompeian(Marcus)
3. ∀x : Pompeian(x) → Roman (x)
4. rular(Caesar)
5. ∀x : Roman(x) → loyalto(x, Caesar) ∨ hate(x, Caesar)
6. ∀x : ∃y : loyalto(x, y)
7. ∀x : ∀y: person(x) ∧ ruler(y) ∧ try-assassinate(x, y) →
¬loyalto(x, y)
8. try-assassinate(Marcus, Caesar)
9. ∀x : man(x) →person(x)

34
Predicate Logic
• Resolution
– Example: given facts in predicate logic:
1. Man(Marcus)
2. Pompeian(Marcus)
3. ∀x : Pompeian(x) → Roman (x)
4. rular(Caesar)
5. ∀x : Roman(x) → loyalto(x, Caesar) ∨ hate(x, Caesar)
6. ∀x : ∃y : loyalto(x, y)
7. ∀x : ∀y: person(x) ∧ ruler(y) ∧ try-assassinate(x, y) →
¬loyalto(x, y)
8. try-assassinate(Marcus, Caesar)
9. ∀x : man(x) →person(x)

35
Predicate Logic
• Resolution
– Example: given facts in CNF:
1. Man(Marcus)
2. Pompeian(Marcus)
3. ∀x : Pompeian(x) → Roman (x) ≡
∀x : ¬ Pompeian(x) ∨ Roman (x) ≡
¬ Pompeian(x1) ∨ Roman (x1)
4. rular(Caesar)
5. ∀x : Roman(x) → loyalto(x, Caesar) ∨ hate(x, Caesar) ≡
∀x : ¬ Roman(x) ∨ [loyalto(x, Caesar) ∨ hate(x, Caesar)] ≡
¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2, Caesar)

36
Predicate Logic
• Resolution
– Example: given facts in CNF:
6. ∀x : ∃y : loyalto(x, y) ≡
∀x : loyalto(x, f(x)) ≡
∀x3 : loyalto(x3, f(x3)) ≡
loyalto(x3, f(x3))
7. ∀x : ∀y: person(x) ∧ ruler(y) ∧ try-assassinate(x, y) → ¬loyalto(x, y) ≡
∀x : ∀y: ¬[person(x)∧ruler(y)∧try-assassinate(x, y)]∨ ¬loyalto(x, y) ≡
∀x4 : ∀y1: ¬person(x4) ∨ ¬ruler(y1) ∨ ¬try-assassinate(x4, y1)∨
¬loyalto(x4, y1) ≡
¬person(x4) ∨ ¬ruler(y1) ∨ ¬try-assassinate(x4, y1)∨ ¬loyalto(x4, y1)

37
Predicate Logic
• Resolution
– Example: given facts in CNF:

8. try-assassinate(Marcus, Caesar)

9. ∀x : man(x) →person(x) ≡
∀x : ¬ man(x) ∨ person(x) ≡
¬ man(x5) ∨ person(x5)

38
Predicate Logic
• Resolution
– Example: given facts in CNF:
1. Man(Marcus)
2. Pompeian(Marcus)
3. ¬ Pompeian(x1) ∨ Roman (x1)
4. rular(Caesar)
5. ¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2, Caesar)
6. loyalto(x3, f(x3))
7. ¬person(x4) ∨ ¬ruler(y1) ∨ ¬try-assassinate(x4, y1)∨ ¬loyalto(x4,
y1)
8. try-assassinate(Marcus, Caesar)
9. ¬ man(x5) ∨ person(x5)

39
Predicate Logic
• Resolution
– Prove that Marcus hate Caesar. That is
hate(Marcus, Caesar)
Negate: ¬ hate(Marcus, Caesar)
which is already in CNF

40
Predicate Logic
• Resolution
¬ hate(Marcus, Caesar)

41
Predicate Logic
¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2,
Caesar)
¬ hate(Marcus, Caesar)

42
Predicate Logic
• Resolution ¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2,
Caesar)
¬ hate(Marcus, Caesar)
Marcus/X2

43
Predicate Logic
• Resolution ¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2,
Caesar)
¬ hate(Marcus, Caesar)
Marcus/X2

¬ Roman(Marcus) ∨ loyalto(Marcus, Caesar)

44
Predicate Logic
• Resolution ¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2,
Caesar)
¬ hate(Marcus, Caesar)
Marcus/X2

¬ Roman(Marcus) ∨ loyalto(Marcus, Caesar) ¬ Pompeian(x1) ∨ Roman (x1)


Marcus/x1

45
Predicate Logic
• Resolution ¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2,
Caesar)
¬ hate(Marcus, Caesar)
Marcus/X2

¬ Roman(Marcus) ∨ loyalto(Marcus, Caesar) ¬ Pompeian(x1) ∨ Roman (x1)


Marcus/x1

loyalto(Marcus, Caesar) ∨ ¬ Pompeian(Marcus)

46
Predicate Logic
• Resolution ¬ Roman(x2) ∨ loyalto(x2, Caesar) ∨ hate(x2,
Caesar)
¬ hate(Marcus, Caesar)
Marcus/X2

¬ Roman(Marcus) ∨ loyalto(Marcus, Caesar) ¬ Pompeian(x1) ∨ Roman (x1)


Marcus/x1

Pompeian(Marcus) loyalto(Marcus, Caesar) ∨ ¬ Pompeian(Marcus)

loyalto(Marcus, Caesar)

47
Predicate Logic
¬person(x4) ∨ ¬ruler(y1) ∨
• Resolution ¬try-assassinate(x4, y1)∨ ¬loyalto(x4, y1)
loyalto(Marcus, Caesar)
Marcus/x4, Caesar/y1

rular(Caesar) ¬person(Marcus) ∨ ¬ruler(Caesar)



¬try-assassinate(Marcus, Caesar)

¬person(Marcus) ∨ try-assassinate(Marcus, Caesar)


¬try-assassinate(Marcus, Caesar)

¬person(Marcus)

48
Predicate Logic
• Resolution
¬ man(x5) ∨ person(x5) ¬person(Marcus)

Marcus/x5

¬ man(Marcus) man(Marcus)

[]
• What we did is Empty clause
– Backward reason
– Got contradiction, ie ¬ hate(Marcus, Caesar) was found wrong
• Therefore, “Marcus hates Caesar” is true.

49
Predicate Logic
• Resolution
– Question Answering
– Resolution can also be used to answer the questions
– Example: Assume the following facts:
• John only likes easy courses.
• All science courses are hard.
• All the courses in Arts are easy.
• A101 is an Art course.
• S201 is a science course.
– Now, using resolution answer the following:
• Which course would John like?

50
Predicate Logic
• Resolution
– Given facts in predicate logic
• John only likes easy courses.
∀x: easyCourse(x) → likes(John, x)
• All science courses are hard.
∀x: scienceCourse(x) → hardCourse(x)
• All the courses in Arts are easy.
∀x: artCourse(x) → easyCourse(x)
• A101 is an Art course.
artCourse(A101)
• A201 is a science course.
scienceCourse(S201)

51
Predicate Logic
• Resolution
– Given facts in CNF
¬ easyCourse(x1) ∨ likes(John, x1)
¬ scienceCourse(x2) ∨ hardCourse(x2)
¬ artCourse(x3) ∨ easyCourse(x3)
artCourse(A101)
scienceCourse(S201)

52
Predicate Logic
• Resolution
– Question clause is

Likes(John, x)

– For this, first prove that John like some course


first.
That is,
likes(John, x)

53
Predicate Logic
• Resolution ¬ easyCourse(x1) ∨ likes(John, x1)
¬ likes(John, x)
X1/x

¬ artCourse(x3) ∨ easyCourse(x3)
¬ easyCourse(x1)
x3/x1

artCourse(A101) ¬ artCourse(x3)

A101/x3
[]

It means John likes some course x.


Which course would John like?
54
Predicate Logic
• Resolution ¬ easyCourse(x1) ∨ likes(John, x1)
¬ likes(John, x) ∨
X1/x
likes(John, x)
¬ artCourse(x3) ∨ easyCourse(x3)
likes(John, x1) ∨ ¬ easyCourse(x1)
x3/x1

artCourse(A101) likes(John, x3) ∨ ¬ artCourse(x3)

A101/x3
likes(John, A101)

Therefore, John likes Art course A101


55
Predicate Logic
• Resolution
– Consider the following axioms.
• Every bird sleeps in some tree.
• Every loon is a bird, and every loon is aquatic.
• Every tree in which any aquatic bird sleeps is
beside some lake.
• Anything that sleeps in anything that is beside
any lake eats fish.
Using resolution prove that “Every loon eats fish”.

Solution: http://www.sc.ehu.es/jiwlucap/Tema3-
RA-2013-2014.pdf

56
Predicate Logic
• Resolution
– Consider the following axioms.
• John likes all kind of food.
• Apples and chicken are food
• Anything anyone eats and is not killed is food
• Mary eats peanuts and is still alive
• Bob eats everything that Mary eats
• Everyone who is alive is not killed.
• Everyone who is not killed is alive.

Prove by resolution that John likes


peanuts using resolution.

57
Predicate Logic
• Resolution
– facts in predicate logic.
∀x : food(x) →likes (John, x)
food (Apple) ^ food (chicken)
∀a : ∀b: eats (a, b) ^ ~killed (a) →food (b)
eats (Mary, Peanuts) ^ alive (Mary)
∀c : eats (Mary, c) → eats (Bob, c)
∀d : alive(d) → ~killed (d)
∀e: ~killed(e) → alive(e)
Conclusion: likes (John, Peanuts)

58
Predicate Logic
• Resolution
– Facts in CNF.
1. ~food(x) v likes(John, x)
2. Food (apple)
3. Food (chicken)
4. ~ eats (a, b) v killed (a) v food (b)
5. Eats (Mary, Peanuts)
6. Alive(Mary)
7. ~eats (Mary, c) V eats (Bob, c)
8. ~alive (d) v ~ killed (d)
9. Killed (e) v alive (e)
• To prove: likes (John, Peanuts)

59
Semantic Nets
• is simple KR scheme
• uses a graph of labeled nodes and labeled
directed arcs to encode knowledge
– Nodes
– objects, concepts, events
– represents the information
– Arcs – relationships between nodes
• particularly isa arcs -
• allow inheritance of properties.

60
Semantic Nets
• Example: semantic net

In logic representation

isa(Person, Mammal)
has-part(Person, Nose)
instance(Pee-Wee-Reese, Person)
team(Pee-Wee-Reese, Brooklyn-Dodgers)
uniform-color(Pee-Wee-Reese, Blue)
61
Semantic Nets
• Example: semantic net

62
Semantic Nets
• Benefits of semantic net
– Easy to visualize
– Formal definitions of semantic networks have been
developed.
– Related knowledge is easily clustered.
– Efficient in space requirements
• Objects represented only once
• Relationships handled by pointers

63
Frames
• A frame is a collection of attributes (usually
called slots) and associated values(called filler)
that describe some entity in the World.
• Three components of a frame
• frame name
• attributes (slots)
• values (fillers: list of values, range, string, etc.)
• Example: Book
Book
Title: Artificial Intelligence, a modern approach
Author: Russell & Norvig
Year: 2014
64
Frames
Frames

Inheritable knowledge

65
Frames
• Benefits of frame
• Makes programming easier by grouping related
knowledge
• Easily understood by non-developers
• Expressive power
• Easy to set up slots for new properties and relations
• Easy to include default information and detect
missing values

66
Questions
1. What are the drawbacks of propositional logic?
2. How resolution produce a proof for a statement? Convert the
statement (p→q) (p →r) to CNF?

3. Consider the following axioms.


A. Every bird sleeps in some tree.
B. Every loon is a bird, and every loon is aquatic.
C. Every tree in which any aquatic bird sleeps is beside some lake.
D. Anything that sleeps in anything that is beside any lake eats fish.
Using resolution, prove that "Every loon eats fish".
4. What are semantic nets and frames? Give examples.

67
THANK YOU

End of Chapter

68

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy