cs 2710, issp 2610

18
1 CS 2710, ISSP 2610 Chapter 8, Part 2 First Order Predicate Calculus FOPC

Upload: baina

Post on 05-Jan-2016

24 views

Category:

Documents


0 download

DESCRIPTION

CS 2710, ISSP 2610. Chapter 8, Part 2 First Order Predicate Calculus FOPC. Review. Sentence  AtomicSentence | (Sentence Connective Sentence) | Quantifier Variable, .. Sentence | ~Sentence AtomicSentence  Predicate(Term,…) | Term = Term Term  Function(Term,…) | - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS 2710, ISSP 2610

1

CS 2710, ISSP 2610

Chapter 8, Part 2First Order Predicate Calculus

FOPC

Page 2: CS 2710, ISSP 2610

2

Sentence AtomicSentence | (Sentence Connective Sentence) | Quantifier Variable, .. Sentence | ~SentenceAtomicSentence Predicate(Term,…) | Term = TermTerm Function(Term,…) | Constant | VariableConnective | ^ | v | Quantifier all, existsConstant john, 1, …Variable A, B, C, XPredicate breezy, sunny, redFunction fatherOf, plus

Knowledge engineering involves deciding what types of things Should be constants, predicates, and functions for your problem

Review

Page 3: CS 2710, ISSP 2610

3

ReviewSemantics of FOPC

• Interpretation: assignment of elements from the world and elements of the language

• The world consists of a domain of objects D, a set of predicates, and a set of functions

Page 4: CS 2710, ISSP 2610

4

ReviewSemantics

• Each constant is assigned an element of the domain• Each N-ary predicate is assigned a set of N-tuples• Each N-ary function symbol is assigned a set of N+1

tuples that does not include any pair of tuples with the first N elements and different (n+1)st elements

Page 5: CS 2710, ISSP 2610

5

Sample Domain

• Richard I, the Lionhearted (1189-1199)• King John II, John Lackland, Evil King John• Their left legs• A crown• Picture in text (p. 291)

Page 6: CS 2710, ISSP 2610

6

• Predicate of brotherhood:– {<R,J>,<J,R>}

• Predicate of being on: {<C,J>}• Predicate of being a person:

– {<J>,<R>} or just {J,R}• Predicate of being the king: {J}• Predicate of being a crown: {C}• Function for left legs: {<J,JLL>,<R,RLL>}

(book writes <J> JLL, <R> RLL)• Predicate of being strong: {JLL}(Functions are total, so the crown and left legs have left legs

too. Technical solution: it is the left leg of things that don’t have left legs. This is “invisible” and we will make no assertions about it, so we can ignore it)

Page 7: CS 2710, ISSP 2610

7

Interpretation

• Specifies which objects, functions, and predicates are referred to by which constant symbols, function symbols, and predicate symbols.

• Under the intended interpretation:• “richardI”, “richardLionhearted” refer to R;

“johnII”,”johnLackland” refer to J; “crown” refers to the crown.

• “onHead”,”brother”,”person”,”king”, “isCrown”, “leftLeg”, “strong”

Page 8: CS 2710, ISSP 2610

8

Lots of other possible interpretations

• 5 objects, so just for constants “richardI” and “johnII” there are 25 possibilities

• Note that the legs don’t have their own names! • “johnII” and “johnLackland” may be assigned the same

object, J

Page 9: CS 2710, ISSP 2610

9

Why isn’t the “intended interpretation” enough?

• Vague notion. What is intended may be ambiguous (and often is, for non-toy domains)

• Logically possible: square(x) ^ round(x). Your KB has to include knowledge that rules this out.

Page 10: CS 2710, ISSP 2610

10

Determining truth values of FOPC sentences

• Assign meanings to terms:– “johnII” J; “leftLeg(johnII)” JLL

• Assign truth values to atomic sentences– “brother(johnII,richardI)”– “brother(johnlackland,richardI)”– Both True, because <J,R> is in the set assigned

“brother” – “strong(leftleg(johnlackland))”– True, because JLL is in the set assigned “strong”

Page 11: CS 2710, ISSP 2610

11

Determining Truth Values (continued)

• Connectives and negation are the same as in propositional logic

• All X G is True if G is true with X assigned d, for all d in the domain.

• Exists X G is True if G is true with X assigned d, for some d in the domain.

Page 12: CS 2710, ISSP 2610

12

Examples given the Sample Interpretation

• All X,Y brother(X,Y) FALSE• All X,Y ((person(X) ^ person(Y)) brother(X,Y))

FALSE• All X,Y ((person(X) ^ person(Y) ^ ~(X=Y))

brother(X,Y)) TRUE• Exists X crown(X) TRUE• Exists X Exists Y sister(X,Y) FALSE

Page 13: CS 2710, ISSP 2610

13

Representational Schemes

• What are the objects, predicates, and functions? you need to encode knowledge of specific problem instances and general knowledge.

• In practice, consider interpretations just to understand what the choices are. The world and interpretation are defined, or at least constrained, through the logical sentences we write.

Page 14: CS 2710, ISSP 2610

14

Choices:Functions vs Predicates

• Rep-Scheme 1: tall(fatherOf(bob)).

• Rep-Scheme 2:Exists X (fatherOf(bob,X) ^ tall(X) ^ All Y (fatherOf(bob,Y) X = Y))

• “fatherOf” in both cases is assigned a set of 2-tuples: {<b,bf>,<t,tf>,…}

• But {<b,bf>,<t,tf>,<b,bff>,…} is possible if it is a predicate but not if it is a function

Page 15: CS 2710, ISSP 2610

15

Choices: Predicates versus Constants

• Rep-Scheme 1: Let’s consider the world: D = {a,b,c,d,e}. red: {a,b,c}. pink: {d,e}. Some sentences that are satisfied by the intended interpretation:

red(a). red(b). pink(d). ~(All X red(X)). All X (red(X) v pink(X)).

But what if we want to say that red is a primary color and pink is not?

Page 16: CS 2710, ISSP 2610

16

Choices: Predicates versus Constants

• Rep-Scheme 2: The world: D = {a,b,c,d,e,red,pink} colorof:

{<a,red>,<b,red>,<c,red>,<d,pink>,<e,pink>} primary: {red} color: {red,pink}

• Some sentences that are satisfied by the intended interpretation:

colorOf(a,red). colorOf(b,red). colorOf(d,pink). ~(All X colorOf(X,red)).

All X (colorOf(X,red) v colorOf(X,pink) v color(X)).***~primary(pink). primary(red).***

We have reified predicates pink and red: made them into objects

Page 17: CS 2710, ISSP 2610

Exercise

• [Design a representation scheme for these sentences:]1. Emily is either a surgeon or a lawyer2. Joe is an actor, but he also holds another job3. All surgeons are doctors4. Joe does not have a lawyer (i.e., he isn’t the customer of a lawyer)5. There exists a lawyer all of whose customers are doctors6. Every surgeon has a lawyer• Note: imagine that implications are also added, so the system can

reason about people and their jobs• job, customer, doctor, surgeon, lawyer, actor, emily, joe

17

Page 18: CS 2710, ISSP 2610

Wrap-up

• Read everything in Chapter 8 carefully, including the examples in 8.4

18