Bài giảng Trí tuệ nhân tạo - Chapter 5: Using predicate logic

Using Predicate Logic  
Chapter 5  
Using Propositional Logic  
Representing simple facts  
It is raining  
RAINING  
It is sunny  
SUNNY  
It is windy  
WINDY  
If it is raining, then it is not sunny  
RAINING → ¬SUNNY  
Cao Hoang Tru  
CSE Faculty - HCMUT  
2
26 March, 2009  
Using Propositional Logic  
• Theorem proving is decidable  
• Cannot represent objects and quantification  
Cao Hoang Tru  
CSE Faculty - HCMUT  
3
26 March, 2009  
Using Predicate Logic  
• Can represent objects and quantification  
• Theorem proving is semi-decidable  
Cao Hoang Tru  
CSE Faculty - HCMUT  
4
26 March, 2009  
Predicate Logic Syntax  
• Constant symbols: a, b, c, John, …  
to represent primitive objects  
• Variable symbols: x, y, z, …  
to represent unknown objects  
• Predicate symbols: safe, married, love, …  
to represent relations  
married(John)  
love(John, Mary)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
5
26 March, 2009  
Predicate Logic Syntax  
• Function symbols: square, father, …  
to represent simple objects  
safe(square(1, 2))  
love(father(John), mother(John))  
• Terms:  
to represent complex objects  
– Constant symbols  
– If f is a function symbol, and t1, t2, …, tn are terms,  
then so is f(t1, t2, …, tn)  
love(mother(father(John)), John)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
6
26 March, 2009  
Predicate Logic Syntax  
• Logical connectives: ¬, ∧, ∨, ⇒, ⇔  
• Universal quantifier: ∀x: p(x)  
∀x: love(father(x), mother(x))  
• Existential quantifier: ∃x: p(x) ≡ ¬∀x: ¬p(x)  
∃x:  
¬married(x)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
7
26 March, 2009  
Predicate Logic Syntax  
• Sentences:  
– Atomic sentences: p(t1, t2, …, tn)  
– If α is a sentence, then so are ¬α and (α)  
– If α and β are sentences, then so are α ∧ β, α ∨ β, α ⇒ β,  
and α ⇔ β  
– If α is a sentence, then so are ∀α and ∃α  
Cao Hoang Tru  
CSE Faculty - HCMUT  
8
26 March, 2009  
Using Predicate Logic  
1. Marcus was a man.  
2. Marcus was a Pompeian.  
3. All Pompeians were Romans.  
4. Caesar was a ruler.  
5. All Pompeians 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.  
Cao Hoang Tru  
CSE Faculty - HCMUT  
9
26 March, 2009  
Using Predicate Logic  
1. Marcus was a man.  
man(Marcus)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
10  
26 March, 2009  
Using Predicate Logic  
2. Marcus was a Pompeian.  
Pompeian(Marcus)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
11  
26 March, 2009  
Using Predicate Logic  
3. All Pompeians were Romans.  
∀x: Pompeian(x) → Roman(x)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
12  
26 March, 2009  
Using Predicate Logic  
4. Caesar was a ruler.  
ruler(Caesar)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
13  
26 March, 2009  
Using Predicate Logic  
5. All Pompeians were either loyal to Caesar or hated him.  
inclusive-or  
∀x: Roman(x) → loyalto(x, Caesar) ∨ hate(x, Caesar)  
exclusive-or  
∀x: Roman(x) → (loyalto(x, Caesar) ∧ ¬hate(x, Caesar)) ∨  
(¬loyalto(x, Caesar) ∧ hate(x, Caesar))  
Cao Hoang Tru  
CSE Faculty - HCMUT  
14  
26 March, 2009  
Using Predicate Logic  
6. Every one is loyal to someone.  
∀x: ∃y: loyalto(x, y) ∃y: ∀x: loyalto(x, y)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
15  
26 March, 2009  
Using Predicate Logic  
7. People only try to assassinate rulers they are not loyal to.  
∀x: ∀y: person(x) ∧ ruler(y) ∧ tryassassinate(x, y)  
→ ¬loyalto(x, y)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
16  
26 March, 2009  
Using Predicate Logic  
7. People only try to assassinate rulers they are not loyal to.  
∀x: ∀y: person(x) ∧ ruler(y) ∧ tryassassinate(x, y)  
→ ¬loyalto(x, y)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
17  
26 March, 2009  
Using Predicate Logic  
8. Marcus tried to assassinate Caesar.  
tryassassinate(Marcus, Caesar)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
18  
26 March, 2009  
Using Predicate Logic  
Was Marcus loyal to Caesar?  
man(Marcus)  
ruler(Caesar)  
tryassassinate(Marcus, Caesar)  
⇓
∀x: man(x) → person(x)  
¬loyalto(Marcus, Caesar)  
Cao Hoang Tru  
CSE Faculty - HCMUT  
19  
26 March, 2009  
Using Predicate Logic  
• Many English sentences are ambiguous.  
• There is often a choice of how to represent knowledge.  
Cao Hoang Tru  
CSE Faculty - HCMUT  
20  
26 March, 2009  
Tải về để xem bản đầy đủ
pdf 57 trang myanh 23600 Free
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Trí tuệ nhân tạo - Chapter 5: Using predicate logic", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

File đính kèm:

  • pdfbai_giang_tri_tue_nhan_tao_chapter_5_using_predicate_logic.pdf