lecture 12 first-order logic (fol)...

24
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 12 Lecture 12 Friday, 17 September 2004 William H. Hsu Department of Computing and Information Sciences, KSU http://www.kddresearch.org http://www.cis.ksu.edu/~bhsu Reading: Sections 7.5 – 7.10, Russell and Norvig 2e First-Order Logic (FOL) Review

Upload: vuonghanh

Post on 22-Aug-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Lecture 12Lecture 12

Friday, 17 September 2004

William H. HsuDepartment of Computing and Information Sciences, KSU

http://www.kddresearch.orghttp://www.cis.ksu.edu/~bhsu

Reading:Sections 7.5 – 7.10, Russell and Norvig 2e

First-Order Logic (FOL) Review

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Lecture OutlineLecture Outline

• Today’s Reading– Sections 7.5 – 7.10, Russell and Norvig 2e– Recommended references: Nilsson and Genesereth

• Next Week’s Reading: Chapter 8, R&N• Previously: Logical Agents and Calculi

– Logical agent framework– Logic in general: tools for

• Knowledge representation• Inference / theorem proving and problem solving / planning

– Propositional calculus• Normal forms• Sequent rules (modus ponens, resolution)

– Predicate logic– First-order logic (FOL) aka first-order predicate calculus (FOPC)

• Today: FOL Agents, Examples; Frame Problem; Situation Calculus• Next Week: FOL Knowledge Bases (Chapter 8, R&N)

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Review:Review:Simple KnowledgeSimple Knowledge--Based AgentBased Agent

Adapted from slides by S. Russell, UC Berkeley Chapter 7 R&N 2e

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Review: Elements of FOLReview: Elements of FOL

• Logical Agents Overview (Last Tuesday)– Knowledge Bases (KB) and KB agents– Motivating example: Wumpus World– Syntax of propositional calculus– Elements of logic in general

• Syntax: What constitutes legitimate sentences aka well-formed formulae?• Semantics: What constitutes logical entailment?• Proof theory: What constitutes provability? Soundness? Completeness?

• Propositional and First-Order Calculi (Last Thursday)– Propositional calculus (concluded): inference by model checking, sequent rules– Elements of logic in general: normal forms (CNF, DNF, Horn) and their usage– Predicate logic without quantifiers: functions and predicates, terms and atoms– Introduction to First-Order Logic (FOL)

• Domain theory• Syntax of WFFs: proper scoping (existential, universal quantification)• New features: semantics of quantification

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

Validity and SatisfiabilityValidity and Satisfiability

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

Proof MethodsProof Methods

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

Inference (Sequent) Rules forInference (Sequent) Rules forPropositional LogicPropositional Logic

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

Logical Agents:Logical Agents:Taking StockTaking Stock

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

The Road Ahead:The Road Ahead:Predicate Logic and FOLPredicate Logic and FOL

• Predicate Logic– Enriching language

• Predicates• Functions

– Syntax and semantics of predicate logic• First-Order Logic (FOL, FOPC)

– Need for quantifiers– Relation to (unquantified) predicate logic– Syntax and semantics of FOL

• Fun with Sentences• Wumpus World in FOL

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

Syntax of FOL:Syntax of FOL:Basic ElementsBasic Elements

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

FOL: Atomic SentencesFOL: Atomic Sentences(Atomic (Atomic WWellell--FFormed ormed FFormulae)ormulae)

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

EqualityEquality

Adapted from slides by S. Russell, UC Berkeley

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

• “Every Dog Chases Its Own Tail”

– ∀ d . Chases (d, tail-of (d))– Alternative Statement: ∀ d . ∃ t . Tail-Of (t, d) ∧ Chases (d, t)– Prefigures concept of Skolemization (Skolem variables / functions)

• “Every Dog Chases Its Own (Unique) Tail”

– ∀ d . ∃1 t . Tail-Of (t, d) ∧ Chases (d, t) ≡∀ d . ∃ t . Tail-Of (t, d) ∧ Chases (d, t) ∧ [∀ t’ Chases (d, t’) ⇒ t’ = t]

• “Only The Wicked Flee when No One Pursueth”

– ∀ x . Flees (x) ∧ [¬∃ y Pursues (y, x)] ⇒ Wicked (x)– Alternative : ∀ x . [∃ y . Flees (x, y)] ∧ [¬∃ z . Pursues (z, x)] ⇒ Wicked (x)

• Offline Exercise: What Is An nth Cousin, m Times Removed?

Jigsaw Exercise [1]:Jigsaw Exercise [1]:FirstFirst--Order Logic SentencesOrder Logic Sentences

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Jigsaw Exercise [2]:Jigsaw Exercise [2]:FirstFirst--Order Logic SentencesOrder Logic Sentences

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

TerminologyTerminology

• Logical Frameworks– Knowledge Bases (KB)– Logic in general: representation languages, syntax, semantics– Propositional logic– First-order logic (FOL, FOPC)– Model theory, domain theory: possible worlds semantics, entailment

• Normal Forms– Conjunctive Normal Form (CNF)– Disjunctive Normal Form (DNF)– Horn Form

• Proof Theory and Inference Systems– Sequent calculi: rules of proof theory– Derivability or provability– Properties

• Soundness (derivability implies entailment)• Completeness (entailment implies derivability)

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

More Fun with SentencesMore Fun with Sentences

• “Every Dog Chases Its Own Tail”

– ∀ d . Chases (d, tail-of (d))– Alternative Statement: ∀ d . ∃ t . Tail-Of (t, d) ∧ Chases (d, t)– Prefigures concept of Skolemization (Skolem variables / functions)

• “Every Dog Chases Its Own (Unique) Tail”

– ∀ d . ∃1 t . Tail-Of (t, d) ∧ Chases (d, t) ≡∀ d . ∃ t . Tail-Of (t, d) ∧ Chases (d, t) ∧ [∀ t’ Chases (d, t’) ⇒ t’ = t]

• “Only The Wicked Flee when No One Pursueth”

– ∀ x . Flees (x) ∧ [¬∃ y Pursues (y, x)] ⇒ Wicked (x)– Alternative : ∀ x . [∃ y . Flees (x, y)] ∧ [¬∃ z . Pursues (z, x)] ⇒ Wicked (x)

• Offline Exercise: What Is An nth Cousin, m Times Removed?

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

WumpusWumpus World Revisited:World Revisited:Interacting with FOL Interacting with FOL KBsKBs

Adapted from slides by S. Russell, UC Berkeley

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Knowledge Base forKnowledge Base forThe The WumpusWumpus WorldWorld

Adapted from slides by S. Russell, UC Berkeley

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Deducing Hidden PropertiesDeducing Hidden Properties

Adapted from slides by S. Russell, UC Berkeley

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Keeping Track of Change:Keeping Track of Change:Situation CalculusSituation Calculus

Adapted from slides by S. Russell, UC Berkeley

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Describing Actions [1]:Describing Actions [1]:Frame, Qualification, and Ramification ProblemsFrame, Qualification, and Ramification Problems

Adapted from slides by S. Russell, UC Berkeley

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Adapted from slides by S. Russell, UC Berkeley

Describing Actions [2]:Describing Actions [2]:Successor State AxiomsSuccessor State Axioms

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

Summary PointsSummary Points

• Previously: Logical Agents and Calculi– Logic in general: tools for KR, inference, planning– Propositional calculus: normal forms, sequent rules– Predicate logic– First-order logic (FOL) aka first-order predicate calculus (FOPC)

• Today: FOL in Practice– FOL agents– Example: Wumpus World in FOL– Situation calculus– Frame problem and variants (see R&N sidebar)

• Representational vs. inferential frame problems• Qualification problem: “what if?”• Ramification problem: “what else?” (side effects)

– Successor-state axioms• Thursday: FOL Knowledge Bases (Chapter 8, R&N), Sequent Rules for FOL

Kansas State UniversityDepartment of Computing and Information SciencesCIS 730: Introduction to Artificial Intelligence

TerminologyTerminology

• Logical Languages– Propositional logic– Predicates, terms, functions, atoms (atomic sentences / atomic WFFs), WFFs– First-order logic (FOL, FOPC): universal and existential quantification

• Properties of Knowledge Bases (KBs)– Satisfiability and validity– Entailment and provability

• Properties of Proof Systems: Soundness and Completeness• Normal Forms: CNF, DNF, Horn; Clauses vs. Terms• Situation Calculus• Frame, Ramification, Qualification Problems• Successor-State Axiomatization