constraint satisfaction problem (answer/do something) 4 10/30/2017 3 agents with knowledge and...

12
10/30/2017 1 Logical Agents Deepak Kumar October-November 2017 What is AI? – Recall from Week 1 & 2 Reasoning with Logic Aristotle: What are correct arguments/thought processes? Formal Logics: Socrates is human. All humans are mortal. Therefore Socrates is mortal. Laws of thought govern the operation of the mind. Machines with logic “laws of thought” Logic Reasoning Etc. Thinking Rationally 2

Upload: dangthu

Post on 17-Mar-2018

219 views

Category:

Documents


4 download

TRANSCRIPT

10/30/2017

1

Logical AgentsDeepak Kumar

October-November 2017

What is AI? – Recall from Week 1 & 2

Reasoning with Logic

• Aristotle: What are correct arguments/thought processes?

• Formal Logics:

Socrates is human.All humans are mortal.Therefore Socrates is mortal.

• Laws of thought govern the operation of the mind.

Machines with logic“laws of thought”

Logic

Reasoning Etc.

Thinking Rationally

2

10/30/2017

2

Computer Science - Databases

• Database Systems

Database

Data

Query

Response

3

Agents with Knowledge and Reasoning

• Knowledge-Based Systems

KnowledgeBase

“Knowledge”

Tell/Sense/Ask

Response (Answer/Do Something)

4

10/30/2017

3

Agents with Knowledge and Reasoning

• Knowledge-Based Systems

• Knowledge – set of sentences that describe facts about the world (or domain)

KnowledgeBase

“Knowledge”

Tell/Sense/Ask

Response (Answer/Do Something)

5

Agents with Knowledge and Reasoning

• Knowledge Representation & Reasoning (KRR) Systems

• Knowledge – set of sentences that describe facts about the world (or domain)

• Inferences – procedures/rules that operate on facts to infer new facts

KnowledgeBase

“Knowledge”+

Inference Engine

Tell/Sense/Ask

Response (Answer/Do Something)

6

10/30/2017

4

Examples – Rule-Based Systems

• MYCIN

if stain of organism is gram positive, andmorphology of organism is coccus, andthe growth confirmation of organism is chains

thenid of organism is streptococcus

7

Examples – KRR Systems

• BLOCKSWORLD with declarative knowledge

if a block is on top of another blockthen

the latter block is not clear

Facts

blue block is on top of red blockred block is on the tableblue block is clear

∴ red block is not clear

8

10/30/2017

5

Knowledge Representation

• Syntax: How sentences are formed

• Semantics: Meaning of sentences

• Computation: How sentences are manipulated

Facts

blue block is on top of red blockred block is on the tableblue block is clear

∴ red block is not clear

9

Knowledge Representation

red block is not clear

KR Sentences KR Sentences

Facts about the world Fact about the world

inference

follows

World

Representation

sem

anti

cs

sem

anti

cs

blue block is on top of red blockred block is on the tableblue block is clear

10

10/30/2017

6

Knowledge Representation

red block is not clear

KR Sentences KR Sentences

Facts about the world Fact about the world

inference

follows

World

Representation

sem

anti

cs

sem

anti

cs

blue block is on top of red blockred block is on the tableblue block is clear

Logic is one way of doing this!11

What is a logic?

• Study of correct inferences

Premises

………

True

Conclusion

∴ ሽ… is also True

If it is cold then my car will not start.My car will not start.

∴ It is cold.

If it is cold then my car will not start.It is cold.

∴ My car will not start.

12

10/30/2017

7

What is a logic?

• Study of correct inferences – Truth preserving consequences

Premises

………

True

Conclusion

∴ ሽ… is also True

If it is cold then my car will not start.My car will not start.

∴ It is cold.

If it is cold then my car will not start.It is cold.

∴ My car will not start.

13

What is a logic?

• Study of correct inferences – Truth preserving consequences

Premises

………

True

Conclusion

∴ ሽ… is also True

If it is cold then my car will not start.My car will not start.

∴ It is cold.

If it is cold then my car will not start.It is cold.

∴ My car will not start.

This is NOTTruth preserving.

This isTruth preserving.

14

10/30/2017

8

What is a logic?

• Study of correct inferences – Truth preserving consequences

Premises

………

True

Conclusion

∴ ሽ… is also True

If it is cold then my car will not start.My car will not start.

∴ It is cold.

If it is cold then my car will not start.It is cold.

∴ My car will not start.

This is NOTTruth preserving.This is sometimesused in diagnosis!

This isTruth preserving.

15

What is a logic?

• Study of correct inferences

• Formalize the notion of correct inference

• Step1: Define a formal language to write sentences – syntaxwell-formed sentences (wffs)

• Step 2: What do the wffs mean? – Semantics/Model TheoryNeed an interpretation for wffs

• Step 3: Rules of Inference – Proof Theory

16

10/30/2017

9

Rules of Inference red block is not clearKR Sentences KR Sentences

Facts about the world Fact about the world

inference

follows

World

Representation

sem

anti

cs

sem

anti

cs

blue block is on top of red blockred block is on the tableblue block is clear

Properties

Soundness: Every new sentence thatcan be derived from KR is avalid consequence.

Completeness: Every valid consequence ofKR can be formally derived.

17

Rules of Inference red block is not clearKR Sentences KR Sentences

Facts about the world Fact about the world

inference

follows

World

Representationse

man

tics

sem

anti

cs

blue block is on top of red blockred block is on the tableblue block is clear

Properties

Soundness: Every new sentence thatcan be derived from KR is avalid consequence.

Completeness: Every valid consequence ofKR can be formally derived.

This is easy to show

This is true for some logics.

18

10/30/2017

10

There are many types of logic

• Propositional Logic

• First-Order Logic

• Second-Oder Logic

• Temporal Logic

• Modal Logic

• Constraint Logic

• Etc.

19

There are many types of logic

• Propositional Logic

• First-Order Logic

• Second-Oder Logic

• Temporal Logic

• Modal Logic

• Constraint Logic

• Etc.

20

10/30/2017

11

Propositional Logic

• A language for symbolic reasoning

• Proposition – a statement that is either True or False.

E.g.

Bryn Mawr College is located in Canada.Today is a sunny day.23 is a prime number.This class is boring.

21

Propositional Logic - Syntax• Symbols

• Atoms:• Constants - 𝑇𝑟𝑢𝑒 (𝑇), 𝐹𝑎𝑙𝑠𝑒 (𝐹)• Propositional Symbols – 𝑃, 𝑄, 𝑅, 𝑅𝐴𝐼𝑁𝐼𝑁𝐺, 𝐶𝐿𝑂𝑈𝐷𝑌, 𝐵𝑂𝑅𝐼𝑁𝐺, etc.

• Connective Symbols - ∨, ∧, ¬, ⇒

• Sentences – Well-formed formulas (wffs)• Any atom is a wff [Atomic Sentences]

e.g. 𝑃, 𝑄, 𝑅, 𝑅3• Complex Sentences

• If ω1and ω2 are wffs, then so areω1ω1∨ ω2 disjunctionω1∧ ω2 conjunctionω1⇒ ω2 implication¬ ω1 negation

• There are no other wffs.22

10/30/2017

12

Propositional Logic - Syntax• Sentences – Well-formed formulas (wffs)

• Any atom is a wff [Atomic Sentences]e.g. 𝑃, 𝑄, 𝑅, 𝑅3

• Complex Sentences• If ω1and ω2 are wffs, then so are

ω1ω1∨ ω2 disjunctionω1∧ ω2 conjunctionω1⇒ ω2 implication¬ ω1 negation

• There are no other wffs.

23

Examples

𝑃(𝑃 ∨ 𝑄) ⇒ ¬P𝑃 ∧ 𝑄¬ ¬ PP ⇒⇒ ¬P

etc.

Propositional Logic - Syntax• Sentences – Well-formed formulas (wffs)

• Any atom is a wff [Atomic Sentences]e.g. 𝑃, 𝑄, 𝑅, 𝑅3

• Complex Sentences• If ω1and ω2 are wffs, then so are

ω1ω1∨ ω2 disjunctionω1∧ ω2 conjunctionω1⇒ ω2 implication¬ ω1 negation

• There are no other wffs.

24

Examples

𝑃(𝑃 ∨ 𝑄) ⇒ ¬P𝑃 ∧ 𝑄¬ ¬ P

P ⇒⇒ ¬P X

etc.