Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional...

21
Propositional & Propositional & Predicate Calculus _ Predicate Calculus _ I I

Transcript of Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional...

Page 1: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Propositional & Propositional & Predicate Calculus _Predicate Calculus _II

Page 2: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Propositional Logic vs. Predicate Calculus•Propositional Logic

▫The world consists of propositions (sentences) which can be true or false.

•Predicate Calculus (First Order Logic)▫The world consists of objects, functions

and relations between the objects.

Page 3: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

•Propositional calculus: The proposition calculus and the predicate calculus are first of all

language using their word , phrase and sentences which we can represent and reason about

properties and relation ship in the world.

Page 4: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Proposition calculus symbol: the symbol about the proposition calculus

are :

Proposition symbol P,Q,R….. Truth Symbol :True , falseand Connective =, , , , …..

Page 5: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

example The wumpus world• Hunt the Wumpus is an early

computer game, based on a simple hide and seek format .

We might use W1,2 stand for proposition that the wumpus is in [1,2]. Symbole such W1,2

is atomic as shown in the next slide.

Page 6: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)
Page 7: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Syntax of FOL: Basic elements

•ConstantsKingJohn, 2, NUS,... •Predicates Brother, >,...•FunctionsSqrt, LeftLegOf,...•Variables x, y, a, b,...•Connectives , , , , •Equality = •Quantifiers ,

Page 8: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

with examples Syntax

•Term: ▫constant|variable|function(term, …, term)

War-and-Peace author-of(War-and-Peace) father-of(author-of(War-and-Peace))

•Atomic Sentence▫predicate(term, …, term)

•Complex Sentence

Page 9: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

•Every propositional symbol and truth symbol is a sentence.

• Examples: true, P, Q, R.•The negation of a sentence is a sentence.• Examples: P, false.•The conjunction, or and, of two sentences

is a sentence.• Example: P P

Page 10: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

•The disjunction, or or, of two sentences is a sentence.

• Example: P P•The implication of one sentence from

another is a sentence.• Example: P Q•The equivalence of two sentences is a

sentence.• Example: P Q R•Legal sentences are also called well-

formed formulas or WFFs.

Page 11: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

•P means “It is hot.”•Q means “It is humid.”•R means “It is raining.”•(P Q) R

“If it is hot and humid, then it is raining”

•Q P “If it is humid, then it is hot”

example

Page 12: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Truth tables for connectives

Page 13: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Universal Quantifier

•Brothers are siblings

•Mother: a female parent of a plant or animal

Page 14: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Existential Quantifier•A red object is on top of a green one

•An author is a person who writes documents

•A grandparent is the parent of one’s parent

Page 15: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Quantifier

•allow statements about many objects▫apply to sentence containing variable

•universal : true for all substitutions for the variable

•existential : true for at least one substitution for the variable.

Page 16: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Properties of Quantifiers

Page 17: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

•The cost of an omelette at the Red Lion is £5”

•Normally:▫cost_of(omelette,red_lion,five_pounds)

Page 18: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

Examples on predicate calculus

Page 19: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

• Examples of representing English sentence

▫If it doesn’t rain tomorrow, Tom will go to the mountains weather(rain, tomorrow) go(tom,

mountains)▫Bisang is a Jindogae and a good dog

gooddog(bisang) isa(bisang, jindogae)▫All basketball players are tall

X (basketball_player(X) tall(X))▫If wishes were horses, beggars would ride.

equal(wishes, horses) ride(beggars).▫Nobody likes taxes

X likes(X, taxes)

Page 20: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

• Given statements converted to formulae in predicate logic:

1. Marcus was a man.man(Marcus).

2. Marcus was a Pompein.Pompein(Marcus).

3. All Pompeins were Romans. x Pompein(x) → Roman(x).

Page 21: Propositional & Predicate Calculus _ I. Propositional Logic vs. Predicate Calculus Propositional Logic ▫The world consists of propositions (sentences)

4. Caesaer was a ruler. ruler(Caeser). 5. All Romans were either loyal to Caeser or

(EOR) hated him x Roman(x) → loyalto(x, Caeser) \/ hate(x,Caeser). OR

x Roman(x) → ((loyalto(x, Caeser) \/ hate(x,Caeser) /\

~(loyalto(x, Caeser) /\ hate(x,Caeser))) . EOR