slide 2.1 2 the predicate calculus - radfordmhtay/itec480/lecture/lecture_2_a.pdf · slide 2.21...
TRANSCRIPT
![Page 1: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/1.jpg)
THE PREDICATE CALCULUS22.0 Introduction
2.1 The Propositional Calculus
2.2 The Predicate Calculus
2.3 Using Inference Rules to Produce Predicate Calculus Expressions
2.4 Application: A Logic-Based Financial Advisor
2.5 Epilogue and References
2.6 Exercises
Slide 2.1
![Page 2: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/2.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.2
![Page 3: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/3.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.3
![Page 4: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/4.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.4
![Page 5: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/5.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.5For propositional expressions P, Q and R:
![Page 6: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/6.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.6
Figure 2.1: Truth table for the operator ∧.
![Page 7: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/7.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.7
Figure 2.2: Truth table demonstrating the equivalence of P ∅ Q and P ∆ Q.
![Page 8: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/8.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.8
The Predicate Calculus
• access the components of an individual assertion• allow expression to contain variables
• Example• single proposition
P = it rained on Tuesday
• Using predicate weatherweather(tuesday,rain)
![Page 9: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/9.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.9
The Predicate Calculus Continued
• general assertion about clauses of entities
for all values of X, where X is a day of the week,weather(X,rain)
• means that it rains every day
![Page 10: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/10.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.10
![Page 11: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/11.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.11
![Page 12: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/12.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.12
Examples
• Well-formed function expressionsf(X,Y)father(david)price(bananas)
• arity (argument)in father(david) , arity is 1in plus(2,3) , arity is 2
![Page 13: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/13.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.13
![Page 14: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/14.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.14
Examples of atomic sentences
• A predicate relation is defined by its name and its aritylikes(george,kate)likes(george,sarah,tuesday)friends(bill,george)friends(father_of(david),father_of(andrew))helps(richard,bill)
![Page 15: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/15.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.15
• atomic sentences are also called atomic expressions, atoms, or propositions
• combine atomic sentences using logical operators to form sentences in the predicate calculus
• operators are the same as connectives in propositional calculus
≡→¬∨∧
![Page 16: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/16.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.16
Quantifiers
• Universal quantifier
is true for all values in the domain of the definition of X
• Variable quantifier
is true if there is at least one object, indicated by Y that is a friend of peter
∀
∃),( peterYfriendsY∃
![Page 17: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/17.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.17
![Page 18: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/18.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.18
Examples
• let times and plus be functions symbols of arity 2 and • let equal and foo be predicate symbols with arity 2
and 3 respectively
plus(two,three) is a function, not an atomic sentenceequal(plus(2,3),five) is an atomic sentenceequal(plus(2,3),7) is an atomic sentence
)5),3,2(())3,2(,,( plusequalplustwoXfooX ∧∃
![Page 19: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/19.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.19verify_sentence algorithm
![Page 20: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/20.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.20
Use of predicate calculus
mother(eve,abel)mother(eve,cain)father(adam,abel)father(adam,cain)
)),(),(),(( YXparentYXmotherYXfatherYX →∨∀∀
)),(),(),(( ZYsiblingZXparentYXparentZYX →∧∀∀∀
![Page 21: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/21.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.21
Semantics for the Predicate Calculus
• It is important to determine well-formed expressions’ meaning in terms of objects, predicates and relations in the world
• To use the predicate calculus as a representation for problem solving, we need to describe objects and relations in the domainof interpretation with a set of well-formed expression
• The terms and predicates of these expressions denote objects and relations in the domain
• The database of predicate calculus expressions, each having truth value T, describes as “state of the world”
![Page 22: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/22.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.22
![Page 23: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/23.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.23
Quantification of Variables• likes(george,X)
substituting kate and susie for X in likes(george, X)becomeslikes(george,kate) and likes(george,susie)
• Variable X can be replaced to Y without changing meaning, and so called as “dummy”
• Variables must be quantified in either universally or existentially
• A variable is considered “free” if it is not within the scope of either the universal or existential quantifiers
• An expression is “closed” if all of its variables are quantified• A “ground expression” has no variables at all• In Predicate Calculus, all variables must be quantified
![Page 24: Slide 2.1 2 THE PREDICATE CALCULUS - Radfordmhtay/ITEC480/Lecture/Lecture_2_A.pdf · Slide 2.21 Semantics for the Predicate Calculus • It is important to determine well-formed expressions’](https://reader036.vdocuments.net/reader036/viewer/2022081601/6106976bca67802f390e297e/html5/thumbnails/24.jpg)
A R T I F I C I A L I N T E L L I G E N C E: Structure and Strategies for Complex Problem Solving, 4th Edition George F. Luger © 2002 Addison Wesley
Slide 2.24
• Scope of quantification with parenthesis, X is universally quantified in both p(X) and r(X)
• Relationship between negation and universal and existential quantifiers
))()()(( XrYqXpX →∨∀
)()())()(()()()()(
)()()()(
YqYXpXXqXpXYqYXqXYpXXpX
XpXXpXXpXXpX
∀∧∀≡∧∀∀≡∀∃≡∃
¬∃≡∀¬¬∀≡∃¬
)()())()(( YqYXpXXqXpX ∃∨∃≡∨∃