ARTIFICIAL INTELLIGENCE

© All Rights Reserved

33 views

ARTIFICIAL INTELLIGENCE

© All Rights Reserved

- The Aesthetics Of Incorectness
- Ockham.summa Logicae.pdf
- Commonsense Knowledge, Ontology and Ordinary Language
- Turing Machines
- Hart_Dawson & the History We Are Not Told_Modern Age_1997.Summer
- d0001Adequate Approaches Across Basic Behavior of Surround Logics s Envelop
- SRAMAN_FABRUARY_2013
- Logic
- CALCULUS HOMEWORK AM
- MELJUN CORTES Boolean Algebra
- Cs 173 Textbook
- Tractatus Logico-Philosophicus Ed. Gutemberg En
- intelligence and surveillance
- Susanne K. Langer, Abstraction in Science and Abstraction in Art
- siegert.pdf
- Automated Reasoning FOL Handout
- Chapter 1 Display
- Formal Methods to Handle the Complexity of Automat
- Vincent Blanár-Proper Names in the Light of Theoretical Onomastics-Matica Slovenská (2009)
- CSE2315 Lecture 03 Handouts

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

- The Aesthetics Of IncorectnessUploaded bygamahucher
- Ockham.summa Logicae.pdfUploaded byAndrei Mihnea
- Commonsense Knowledge, Ontology and Ordinary LanguageUploaded bySerge
- Turing MachinesUploaded byNashit Kirmani
- Hart_Dawson & the History We Are Not Told_Modern Age_1997.SummerUploaded byAndeanman
- SRAMAN_FABRUARY_2013Uploaded bydvdmega
- LogicUploaded byMarie Antoniette Lozada
- Cs 173 TextbookUploaded byErika Hyemin Yoon
- d0001Adequate Approaches Across Basic Behavior of Surround Logics s EnvelopUploaded byAnonymous 8erOuK4i
- CALCULUS HOMEWORK AMUploaded byblue_l1
- Tractatus Logico-Philosophicus Ed. Gutemberg EnUploaded byadolphe_cabral
- Susanne K. Langer, Abstraction in Science and Abstraction in ArtUploaded bynana_kipiani
- MELJUN CORTES Boolean AlgebraUploaded byMELJUN CORTES, MBA,MPA
- intelligence and surveillanceUploaded byMuhammad Atif
- siegert.pdfUploaded byNathaniel Wolfson
- Automated Reasoning FOL HandoutUploaded byJan Hula
- Chapter 1 DisplayUploaded byjulianli0220
- Formal Methods to Handle the Complexity of AutomatUploaded bySwati Kar
- Vincent Blanár-Proper Names in the Light of Theoretical Onomastics-Matica Slovenská (2009)Uploaded byarlo_10
- CSE2315 Lecture 03 HandoutsUploaded byashis.csedu
- mlj05 - Markov Logic Networks.pdfUploaded bylcm3766l
- Ludwig Wittgenstein - Tractatus Logico-PhilosophicusUploaded bystonebrain
- Frege, Kant, and the Logic in LogicismUploaded byZhennya Slootskin
- Practical Artificial IntelligenceUploaded byRodrigo Vaz
- Week 1Uploaded byHarold Lucero
- set and logicUploaded byanon_267791969
- Chapter_03 (1).pdfUploaded byhazwani
- 1908.05381Uploaded byGaston GB
- Four CornersUploaded bytrelteopet
- [Monographs and Research Notes in Mathematics] Jose Iovino - Beyond First Order Model Theory (2017, Chapman and Hall_CRC)Uploaded byjai ramanathan

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

- Basic of Parallel Algorithm DesignUploaded bycleopatra2121
- ECMA-262Uploaded byAndrej
- Global Mapper Shortcut Key ListUploaded byrenatoacaldas
- Ndt 4 METHODSUploaded bywelding inspector
- Anti Friction Bearings for PumpsUploaded byJaime Berry
- THE SOCIOLOGICAL RESEARCH INQUIRY.docxUploaded byMarose
- how to convert RGB to grayscale pic if: The Input Image I Can Be of Class Uint8Uploaded byaisyah mohamad othman
- PCS-1aUploaded bysudhakar1705
- up1 math sUploaded bymasyati
- Eksponencijalne i Logaritamske JednacineUploaded byAnonymous WkbmWCa8M
- University of PennsylvaniaUploaded byapi-19772149
- Theoretical PEUploaded bypappu.subscription
- 15.Project Attendence Managemnt SystemUploaded byNirmal Ram
- Classical Method of Quatitative Analysis - Humam Ahmed and Hira MehmoodUploaded byWillmann Jimenez Morales
- PWillems - Part 2 - Hydrological Time Series AnalysisUploaded byPAUL ESTEBAN PENAFIEL GORDILLO
- 2. Maths - The Problem - Bronislaw CerankaUploaded byTJPRC Publications
- Seismology1Uploaded byyyamid
- ELI-NP-WhiteBookUploaded bySebastian Valentinovici Toma
- Percentage Problems With Answers-students3k.comUploaded byJuan Jackson
- Harp_Concerto_Scoring_Guide.pdfUploaded byiamceh
- GIA_Ruby_Montepuez_Mozambique.pdfUploaded byVaishali Jhaveri
- Boiler Manual Foster WheelerUploaded byjleonardopraxedes
- TcpUploaded byFrank Mack
- 01 Du Fay Missa Sine NomineUploaded byJonatan Alvarado
- Dbms Lab Manual1Uploaded byaksagar22
- ccsspractices posters grades2-3Uploaded byapi-194028742
- Analog Circuit Design on Digital CMOSUploaded bysam
- Hepatitis cUploaded byLeila Ibadula
- Internet Encyclopedia of PhilosophyUploaded byShannon Hopkins
- ppt tribology.pptxUploaded byMtech Design [Golden Batch]

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.