33 views

Uploaded by Pabitha Chidambaram

ARTIFICIAL INTELLIGENCE

- 2-1
- Chaining
- MELJUN CORTES Boolean Algebra
- 3-PredicateLogic+Proofs
- Lecture 02 Fundamentals of Proof
- 2T-Functions.YolaFile-161107 (1)
- Concurrent Systems 1
- Clips_ Design Examples
- Discrete Mathematics
- unit2
- Cse Dis Mat Unit 1
- Truth Trees
- KnowRep Logic
- 3-07-sgn-meas
- Ueberweg, System of Logic
- Course Outlines for AI
- GOODY JACK the Power of the Written Tradition 2000
- Philosophy Reviewer
- CTU Teaching Rubric Critique
- Aspiration modes across exploiting expertise environment.pdf

You are on page 1of 62

&

INFERENCE IN FIRST ORDER LOGIC

By

Predicate Logic

C.PABITHA., AP

1/17/16

Propositional Logic

Propositional logic isnt powerful enough as a

an exam they either pass or fail.

Find Pits in Wumpus world

Bx,y (Px,y+1 Px,y-1 Px+1,y Px-1,y) (Breeze next to Pit)

16 rules

Find Wumpus

Sx,y (Wx,y+1 Wx,y-1 Wx+1,y Wx-1,y) (stench next to Wumpus) 16 rules

At least one Wumpus in world

W1,1 W1,2 W4,4 (at least 1 Wumpus) 1 rule

At most one Wumpus

W1,1 W1,2 (155 RULES)

Predicate Logic

1/17/16

More expressive logic than propositional

Constants are objects: john, apples

likes(john, apples)

Functions transform objects:

likes(john, fruit_of(apple_tree))

Variables represent any object: likes(X, apples)

True for all objects (Universal):

X. likes(X, apples)

Exists at least one object (Existential): X. likes(X, apples)

First-order logic

Whereas propositional logic assumes the world

contains facts,

first-order logic (like natural language) assumes

the world contains

games, wars,

Functions: father of, best friend, one more than,

plus,

Predicate Logic

1/17/16

Constants King, John, 2, NUS,...

Predicates Brother, >,...

Functions

Variables

Connectives

Equality

Quantifiers

Predicate Logic

Sqrt( ), LeftLegOf,...

x, y, a, b,...

, , , ,

,

1/17/16

Terms

Term = logical expression that refers to an object.

There are 2 kinds of terms:

function symbols: LeftLeg(Pete), Sqrt(3), Plus(2,3) etc

Pat_Grandfather(x) = father(father(x))

7

Predicate Logic

1/17/16

Atomic Sentences

Atomic sentences state facts using terms and predicate symbols

P(x,y) interpreted as x is P of y

Examples:

LargerThan(2,3) is false.

Brother_of(Mary,Pete) is false.

Married(Father(Richard), Mother(John)) could be true or false

Note: Functions do not state facts and form no sentence:

Brother(Pete) refers to John (his brother) and is neither true nor false.

Brother_of(Pete,Brother(Pete)) is True.

Binary relation

Predicate Logic

Function

1/17/16

Complex Sentences

We make complex sentences with connectives (just

property

binary

relation

function

objects

connectives

Predicate Logic

1/17/16

Universal Quantification

Allows

Can

x Person(x) => HasHead(x)

i

Note that

x King(x) Person(x) is not correct!

This would imply that all objects x are Kings and are People

x King(x) => Person(x) is the correct way to say

10

Predicate Logic

1/17/16

Existential Quantification

x means there exists an x such that.

Examples:

King(x)

Lives_in(John, Castle(x))

Integer(i) GreaterThan(i,0)

(And => is the natural connective to use with )

11

Predicate Logic

1/17/16

Typically is the main connective with

Common mistake: using as the main

connective with

12

Predicate Logic

1/17/16

Typically, is the main connective with

Common mistake: using as the main

connective with

13

Predicate Logic

1/17/16

Examples

Everyone likes McDonalds

x, likes(x, McDonalds)

Someone likes McDonalds

x, likes(x, McDonalds)

All children like McDonalds

x, child(x) likes(x, McDonalds)

Everyone likes McDonalds unless they are allergic to it

x, likes(x, McDonalds) allergic(x, McDonalds)

x, allergic (x, McDonalds) likes(x, McDonalds)

14

Predicate Logic

1/17/16

x ( Student(x) Smart(x) )

There exists a student.

x Student(x).

x ( Student(x) Smart(x) )

15

Predicate Logic

1/17/16

There is a student who is loved by every other student.

Bill is a student.

Student(Bill)

Takes(Bill, Analysis) Takes(Bill, Geometry)

Bill takes Analysis or Geometry (or both).

Bill takes Analysis and Geometry.

Bill does not take Analysis.

Takes(Bill, Analysis).

16

Predicate Logic

1/17/16

Bill has at least one sister.

x SisterOf(x,Bill)

Bill has no sister.

x SisterOf(x,Bill)

Bill has exactly one sister.

Bill has at least two sisters.

17

Predicate Logic

1/17/16

Properties of Quantifiers

x y is the same as y x

x y is the same as y x

x y Loves(x, y)

There is a person who loves everyone in the world

y x Loves(x, y)

18

Predicate Logic

1/17/16

Nesting Quantifiers

Everyone likes some kind of food

y x, food(x) likes(y, x)

x y, food(x) likes(y, x)

y x, food(x) likes(y, x)

x y, food(x) likes(y, x)

19

Predicate Logic

1/17/16

Example Domains

Kinship domain

What is a second cousin once removed, anyway?

Numbers, sets, and lists

This one is a classic. You should understand these, even if

you dont memorize them.

The Wumpus World

Note how much simpler the description is in FOL!

Whatever your domain, if the axioms correctly and

complete logical inference procedure will infer the

strongest possible description of the world, given

the available percepts

20

Predicate Logic

1/17/16

Remember:

proposition

al

logic

21

Predicate Logic

1/17/16

Reminder

Ground term: A term that does not contain a

variable.

A constant symbol

A function applies to some ground term

22

Predicate Logic

1/17/16

Proofs

23

Predicate Logic

1/17/16

Proofs

The three new inference rules for FOL (compared to propositional logic) are:

Universal Elimination (UE):

x

{x/g}

x

{x/k}

x {g/x}

24

Predicate Logic

1/17/16

Proofs

The three new inference rules for FOL (compared to propositional logic) are:

Universal Elimination (UE):

x e.g., from x Likes(x, Candy) and {x/Joe}

{x/} we can infer Likes(Joe, Candy)

x e.g., from x Kill(x, Victim) we can infer

{x/k} Kill(Murderer, Victim), if Murderer new symbol

e.g., from Likes(Joe, Candy) we can infer

x {g/x} x Likes(x, Candy)

25

Predicate Logic

1/17/16

Identify the task

26

Predicate Logic

1/17/16

The

problem instances to answers. This step is analogous to the PEAS process for designing

agents.

PEAS

PAGE

Assemble

The

work with real experts to extract what they know-a process called knowledge

acquisition

Decide

That

27

Predicate Logic

1/17/16

The knowledge engineer writes down the axioms for all the vocabulary terms. This

pins down (to the extent possible) the meaning of the terms, enabling the expert to

check the content

For a logical agent, problem instances are supplied by the sensors/ percepts

answers

Debug the knowledge base.

28

Predicate Logic

1/17/16

30

Predicate Logic

1/17/16

Every instantiation of a universally quantified sentence is

entailed by it:

v

Subst({v/g}, )

E.g., x King(x) Greedy(x) Evil(x) yields:

King(Richard) Greedy(Richard) Evil(Richard)

King(Father(John)) Greedy(Father(John)) Evil(Father(John))

.

.

.

31

Predicate Logic

1/17/16

For any sentence , variable v, and constant

the knowledge base:

v

Subst({v/k}, )

Crown(C1) OnHead(C1,John)

provided C1 is a new constant symbol, called

a Skolem constant

32

Predicate Logic

1/17/16

The law says that it is a crime for an American

Nono, an enemy America, has some missiles,

and all of its missiles were sold to it by Col.

West, who is an American.

33

it is a crime for an American to sell weapons to

hostile nations

34

it is a crime for an American to sell weapons to

hostile nations

Criminal(x)

35

it is a crime for an American to sell weapons to

hostile nations

Criminal(x)

36

it is a crime for an American to sell weapons to

hostile nations

Criminal(x)

x Owns(Nono, x) Missiles(x)

37

it is a crime for an American to sell weapons to

hostile nations

Criminal(x)

x Owns(Nono, x) Missiles(x)

all of its missiles were sold to it by Col. West

38

it is a crime for an American to sell weapons to hostile

nations

Criminal(x)

x Owns(Nono, x) Missiles(x)

Owns(Nono, M1) and Missle(M1)

x Missile(x) Owns(Nono, x) Sells( West, x, Nono)

39

it is a crime for an American to sell weapons to hostile nations

x ,y,z American(x) Weapon(y) Sells(x,y,z) Hostile(z) Criminal(x)

Nonohas some missiles

x Owns(Nono, x) Missiles(x)

Owns(Nono, M1) and Missle(M1)

x Missle(x) Owns(Nono, x) Sells( West, x, Nono)

Missiles are weapons

Missle(x) Weapon(x)

40

An enemy of America counts as hostile

Enemy(Nono, America)

41

Unification

We can get the inference immediately if we can find a substitution such that King(x) and

Greedy(x) match King(John) and Greedy(y)

= {x/John,y/John} works

Unify(,) = if =

p q

Knows(John,x)

Knows(John,x)

Knows(John,x)

Knows(John,x)

Knows(John,Jane)

Knows(y,OJ)

Knows(y,Mother(y))

Knows(x,OJ)

{x/Jane}}

Unification

We can get the inference immediately if we can find a substitution such that King(x) and

Greedy(x) match King(John) and Greedy(y)

= {x/John,y/John} works

Unify(,) = if =

p q

Knows(John,x)

Knows(John,x)

Knows(John,x)

Knows(John,x)

Knows(John,Jane) {x/Jane}}

Knows(y,OJ) {x/OJ,y/John}}

Knows(y,Mother(y))

Knows(x,OJ)

Unification

We can get the inference immediately if we can find a substitution such that King(x) and

Greedy(x) match King(John) and Greedy(y)

= {x/John,y/John} works

Unify(,) = if =

p q

Knows(John,x)

Knows(John,x)

Knows(John,x)

Knows(John,x)

Knows(John,Jane) {x/Jane}}

Knows(y,OJ) {x/OJ,y/John}}

Knows(y,Mother(y))

{y/John,x/Mother(John)}}

Knows(x,OJ)

We can get the inference immediately if we can find a substitution such

that King(x) and Greedy(x) match King(John) and Greedy(y)

= {x/John,y/John} works

Unify(,) = if =

p q

Knows(John,x)

Knows(John,x)

Knows(John,Jane)

{x/Jane}}

Knows(y,OJ) {x/OJ,y/John}}

Knows(John,x)

Knows(John,x)

Knows(y,Mother(y))

Knows(x,OJ) {fail}

{y/John,x/Mother(John)}}

Unification

Examples

UNIFY(Knows(John,x), Knows(y,Bill)) = {x/Bill, y/John}

UNIFY(Knows(John,x), Knows(y,Mother(y))= {y/John, x/Mother(John)

UNIFY(Knows(John,x), Knows(x,Elizabeth)) = fail

Last example fails because x would have to be both John and Elizabeth

We can avoid this problem by standardizing:

The two statements now read

UNIFY(Knows(John,x), Knows(z,Elizabeth))

This is solvable:

Unification

To unify Knows(John,x) and Knows(y,z)

Can use = {y/John, x/z }

Or = {y/John, x/John, z/John}

The first unifier is more general than the

second.

There is a single most general unifier

(MGU) that is unique up to renaming of

variables.

MGU = { y/John, x/z }

Unification

Unification algorithm:

side

Build up a unifier along the way

Fail if two corresponding points do not match

FORWARD CHAINING

&

BACKWARD CHAINING

49

Predicate Logic

1/17/16

Forward Chaining

Forward Chaining

Idea:

Start with atomic sentences in the KB

Apply Modus Ponens

Add new atomic sentences until no further inferences

can be made

Works well for a KB consisting of Situation

data

Backward Chaining

Idea:

the query.

Algorithm:

Algo finds every clause in the KB that unifies with the

of goals

THANK YOU

63

Predicate Logic

1/17/16

- 2-1Uploaded byVara
- ChainingUploaded bySanjay Kumar
- MELJUN CORTES Boolean AlgebraUploaded byMELJUN CORTES, MBA,MPA
- 3-PredicateLogic+ProofsUploaded byAngelyn Natividad
- Lecture 02 Fundamentals of ProofUploaded byMohamad Zulhilmi
- 2T-Functions.YolaFile-161107 (1)Uploaded byCha risse
- Concurrent Systems 1Uploaded byEduardo Macetas
- Clips_ Design ExamplesUploaded byEhsan Ghasisin
- Discrete MathematicsUploaded byHari Aakash
- unit2Uploaded byssssss
- Cse Dis Mat Unit 1Uploaded byYogi Gabani
- Truth TreesUploaded byJohn O'shea
- KnowRep LogicUploaded bysurajka1
- 3-07-sgn-measUploaded byHoang Tung
- Ueberweg, System of LogicUploaded byMerrim43
- Course Outlines for AIUploaded byhafsabukhary
- GOODY JACK the Power of the Written Tradition 2000Uploaded byvisio2010
- Philosophy ReviewerUploaded bySamantha Calucag
- CTU Teaching Rubric CritiqueUploaded byeldeee143
- Aspiration modes across exploiting expertise environment.pdfUploaded bysfofoby
- Russell paradox wiki pageUploaded bydavparan
- The Will L1Uploaded byhawku
- Parent - Quine and Logical TruthUploaded byeyeyethink
- Wisdom Outline Phil PerplexityUploaded byjuan
- Unification KnightUploaded byabdullah318
- HOQUploaded bySagar Dalvi
- DMS questionsUploaded bynityakulkarni
- Lab 1 Introduction to PROLOGUploaded bychakravarthyashok
- computable-func.pptUploaded byCan Eroğlu
- BoolUploaded byashraf

- impques2Uploaded byPabitha Chidambaram
- gcc1Uploaded byPabitha Chidambaram
- FosUploaded byPabitha Chidambaram
- Unit II,III Additional 2marksUploaded byPabitha Chidambaram
- distributes system Unit 1.pdfUploaded byAnonymous SwS8ipxbd
- UNIT 45Uploaded byPabitha Chidambaram
- CS6702-Graph Theory and ApplicationsUploaded byPabitha Chidambaram
- evsqbUploaded byPabitha Chidambaram
- 2marksUploaded byPabitha Chidambaram
- AndroidUploaded byPabitha Chidambaram
- Blooms Taxonomy Questions LEVELSUploaded bySuzette von Trixbunny
- Blooms Taxonomy Questions LEVELSUploaded bySuzette von Trixbunny
- Lesson Plan (1)Uploaded byPabitha Chidambaram
- Grid and Cloud Question BankUploaded byPabitha Chidambaram
- Software AgentsUploaded byPabitha Chidambaram
- Cs2406 Open Source Lab VivaUploaded byPabitha Chidambaram
- Anna UniversityUploaded byDheepika Karunanithi
- DSQ1Uploaded byPabitha Chidambaram
- pcdlabmanualUploaded byPabitha Chidambaram
- AIKEYUploaded byPabitha Chidambaram
- Introduction to ProcessesUploaded byPabitha Chidambaram
- AI2marksUploaded byPabitha Chidambaram
- AI - FOLUploaded byPabitha Chidambaram
- AI UNIT5Uploaded byPabitha Chidambaram
- GMUploaded byPabitha Chidambaram
- Cs2406 Open Source Lab VivaUploaded byPabitha Chidambaram
- Cs2406 Open Source Lab VivaUploaded byPabitha Chidambaram
- mcq_m1Uploaded byknduna

- Atmosphere WorksheetsUploaded bychan
- Problem Solving FinalUploaded bySeefan Anatlus
- Citrix Load Balancing Policies XenApp 6Uploaded byJunaid A. Khan
- ANSI_IEEE 576-1989 IEEE Recommended Practice for Installation, Termination, And Testing of Insulated Power Cable as Used in the Petroleum and Chemical IndustryUploaded byAlejandro Ushiña
- Jack Oughton - Quark Star JournalUploaded byJack Oughton
- Appeal Decision - Freeman HomesUploaded byMark Watts-Jones
- EAMCET2013 Course Fee DetailsUploaded byharsha919
- Rory Sutherland - Lecture 2011Uploaded byThomas Scott Jones
- BearingsUploaded bypaty
- The DLX Instruction SetUploaded byapi-26356906
- Customer Oriented Behavior on QualityUploaded byHarryPermana
- Effects of Drug Abuse and AddictionUploaded byCathyLeePacaldoMelendres
- E165E165M.14367Uploaded byrobstaert
- INPAGE SEEKHEY.pdfUploaded byمحمد نعمان حمید
- Succeeding With 5 sUploaded byRey Francisco
- Raouf n Effect of ISO9001-2015 on Q1Uploaded byjamil vora
- gephi-tutorial-visualization.pdfUploaded bytonitt
- Tandem Dyes for Flow Cytometry, Quality Concerns, Beckman CoUploaded bycandiddreams
- A Prefix and Suffix OthersUploaded byMarianita Flores
- System BusUploaded byfgklo
- ColgateUploaded bygargatwork
- techniques of working togetherUploaded byShaells Joshi
- Rainer E. Zimmermann- Loops and Knots as Topoi of Substance: Spinoza RevisitedUploaded byArsLexii
- WebDynpro QuestionsUploaded bydkr1234
- crm1 - Introduciton to Loss ReservingUploaded byDKz
- 2013 WANG Aeroelastic and Flight Dynamics Analysis of Folding Wing SystemsUploaded bydiegopena
- Chapter 2 Developing Marketing Strategies and PlansUploaded byAtif Khan
- Step-By-Step Guide for LSMW Using ALE-IDOC Method - 1Uploaded bySrishti
- Kruskal Wallis Test 3Uploaded byElizalde Husband
- Coordinates - Lesson PlanUploaded byNZ MA