Automated Reasoning in Propositional Logic

Slides:



Advertisements
Similar presentations
Russell and Norvig Chapter 7
Advertisements

UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
1 Logical Inference Algorithms CS 171/271 (Chapter 7, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
Automated Reasoning in Propositional Logic Problem Given: KB: a set of sentence  : a sentence Answer: KB  ?
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Automated Reasoning in Propositional Logic Russell and Norvig: Chapters 6 and 9 Chapter 7, Sections 7.5—7.6 CS121 – Winter 2003.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Inference in Propositional Logic (and Intro to SAT)
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
Logical Inference 1 introduction
Recursive stack-based version of Back-chaining using Propositional Logic
Instructor: Vincent Conitzer
Propositional Logic.
Knowledge Representation and Reasoning
Knowledge and reasoning – second part
EA C461 – Artificial Intelligence Logical Agent
Resolution in the Propositional Calculus
The Propositional Calculus
Logical Inference: Through Proof to Truth
Logical Agents Chapter 7.
Logical Agents Chapter 7 Selected and slightly modified slides from
Logical Agents Reading: Russell’s Chapter 7
Propositional Resolution
Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Knowledge and reasoning – second part
Back to “Serious” Topics…
CPS 570: Artificial Intelligence Logic
Biointelligence Lab School of Computer Sci. & Eng.
Methods of Proof Chapter 7, second half.
Propositional Logic: Methods of Proof (Part II)
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Artificial Intelligence Propositional Logic
CPS 570: Artificial Intelligence Logic
Problems in AI Problem Formulation Uninformed Search Heuristic Search
Presentation transcript:

Automated Reasoning in Propositional Logic Russell and Norvig: Chapters 6 and 9 Chapter 7, Sections 7.5—7.6 CS121 – Winter 2003

Problem Given: KB: a set of sentence : a sentence Answer: KB  ?

Deduction vs. Satisfiability Test KB  iff {KB,} is unsatisfiable Hence: Deciding whether a set of sentences entails another sentence, or not Testing whether a set of sentences is satisfiable, or not are closely related problems

Computational Approaches Enumeration of models Construction of a proof Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlights-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Battery-OK  Starter-OK  (5+6) Battery-OK  Starter-OK  Empty-Gas-Tank  (9+7) Engine-Starts  (2+10) Engine-Starts  Flat-Tire  (3+8) Flat-Tire  (11+12)

Enumeration of Models P: Set of propositional symbols in {KB,} n: Size of P ENTAILS?(KB,) For each of the 2n models on P do If it is a model of {KB,} then return no Return yes

Satisfiability Test as CSP Each propositional symbol is a variable The domain of each variable is {True, False} Each sentence in {KB,} is a constraint on the value(s) taken by one or several variables Recursive backtracking CSP techniques and heuristics are applicable

Construction of a Proof Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlights-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Battery-OK  Starter-OK  (5+6) Battery-OK  Starter-OK  Empty-Gas-Tank  (9+7) Engine-Starts  (2+10) Engine-Starts  Flat-Tire  (3+8) Flat-Tire  (11+12)

Construction of a Proof Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlight-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Battery-OK  Starter-OK  (5+6) Battery-OK  Starter-OK  Empty-Gas-Tank  (9+7) Engine-Starts  (2+10) Engine-Starts  Flat-Tire  (3+8) Flat-Tire  (11+12) What do we need? A complete set of sound inference rules A complete search algorithm to decide which rule to apply next and to which sentences

Complementary Literals A literal is a either an atomic sentence or the negated atomic sentence, e.g.: P or P Two literals are complementary if one is the negation of the other, e.g.: P and P

Unit Resolution Rule Given two sentences: L1  …  Lp and M where Li,…, Lp and M are all literals, and M and Li are complementary literals Infer: L1  …  Li-1  Li+1  …  Lp

Examples From: Engine-Starts  Car-OK Engine-Starts Infer: Car-OK Modus ponens Engine-Starts  Car-OK From: Engine-Starts  Car-OK Car-OK Infer: Engine-Starts Modus tolens

Another Example Engine-Starts  Flat-Tire  Car-OK Engine-Starts

Detection of Unsatisfiability Car-OK Car-OK False

Soundness of Unit Resolution Let m be a model of: L1  …  Lp and M where M and Li are complementary literals Li must be False in m, hence L1  …  Li-1  Li+1  …  Lp must be True

Shortcoming of Unit Resolution From: Engine-Starts  Flat-Tire  Car-OK Engine-Starts  Empty-Gas-Tank we can infer nothing!

Full Resolution Rule Given two sentences: L1  …  Lp and M1  …  Mq where L1,…, Lp, M1,…, Mq are all literals, and Li and Mj are complementary literals Infer: L1 … Li-1Li+1…LkM1 … Mj-1Mj+1…Mk in which only one copy of each literal is retained (factoring)

Example From: Engine-Starts  Flat-Tire  Car-OK Engine-Starts  Empty-Gas-Tank Infer: Empty-Gas-Tank  Flat-Tire  Car-OK

Example From: P  Q ( P  Q) Q  R ( Q  R) Infer: P  R ( P  R)

Not All Inferences are Useful! From: Engine-Starts  Flat-Tire  Car-OK Engine-Starts  Flat-Tire Infer: Flat-Tire  Flat-Tire  Car-OK

Not All Inferences are Useful! From: Engine-Starts  Flat-Tire  Car-OK Engine-Starts  Flat-Tire Infer: Flat-Tire  Flat-Tire  Car-OK tautology

Not All Inferences are Useful! From: Engine-Starts  Flat-Tire  Car-OK Engine-Starts  Flat-Tire Infer: Flat-Tire  Flat-Tire  Car-OK  True tautology

Soundness of Full Resolution Left as an exercise

Full Resolution Rule clauses Given two sentences: L1  …  Lp and M1  …  Mq Infer: L1 … Li-1Li+1…LkM1 … Mj-1Mj+1…Mk clauses

Sentence  Clause Form Example: (A  B)  (C  D)

Sentence  Clause Form Example: (A  B)  (C  D) 1. Eliminate  (A  B)  (C  D)

Sentence  Clause Form Example: (A  B)  (C  D) 1. Eliminate  (A  B)  (C  D) 2. Reduce scope of  (A  B)  (C  D)

Sentence  Clause Form Example: (A  B)  (C  D) 1. Eliminate  (A  B)  (C  D) 2. Reduce scope of  (A  B)  (C  D) 3. Distribute  over  (A  (C  D))  (B  (C  D)) (A  C)  (A  D)  (B  C)  (B  D)

Sentence  Clause Form Example: (A  B)  (C  D) 1. Eliminate  (A  B)  (C  D) 2. Reduce scope of  (A  B)  (C  D) 3. Distribute  over  (A  (C  D))  (B  (C  D)) (A  C)  (A  D)  (B  C)  (B  D) Set of clauses: {A  C , A  D , B  C , B  D}

Resolution Refutation Algorithm RESOLUTION-REFUTATION(KB,a) clauses  set of clauses obtained from KB and a new  {} Repeat: For each C, C’ in clauses do res  RESOLVE(C,C’) If res contains the empty clause then return yes new  new U res If new  clauses then return no clauses  clauses U new

Completeness of Resolution Refutation Left as an exercise

Example Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlights-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire Starter-OK  Empty-Gas-Tank  Engine-Starts Battery-OK  Empty-Gas-Tank  Engine-Starts Battery-OK  Starter-OK  Engine-Starts Engine-Starts  Flat-Tire Engine-Starts  Car-OK

Example Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlight-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire Starter-OK  Empty-Gas-Tank  Engine-Starts Battery-OK  Empty-Gas-Tank  Engine-Starts Battery-OK  Starter-OK  Engine-Starts Engine-Starts  Flat-Tire Engine-Starts  Car-OK

Example … Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire Battery-OK  Starter-OK  Engine-Starts Engine-Starts  Flat-Tire

Example … Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire Battery-OK  Starter-OK  Engine-Starts Engine-Starts  Flat-Tire Battery-OK  Starter-OK  Flat-Tire Starter-OK  Flat-Tire Flat-Tire False (empty clause)

Resolution Heuristics Set-of-support heuristics: At least one ancestor of every inferred clause comes from a Shortest-clause heuristics: Generate a clause with the fewest literals first Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

Example (Set-of-Support) Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlight-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire

Example (Set-of-Support) Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlight-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire Engine-Starts  Car-OK Engine-Starts Battery-OK  Starter-OK  Empty-Gas-Tank Starter-OK  Empty-Gas-Tank Empty-Gas-Tank False Note the goal-directed flavor

Resolution Heuristics Set-of-support heuristics: At least one ancestor of every inferred clause comes from a Shortest-clause heuristics: Generate a clause with the fewest literals first Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

Example (Shortest-Clause) Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlight-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire

Example (Shortest-Clause) Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlight-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire Engine-Starts  Car-OK Engine-Starts Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank Starter-OK  Empty-Gas-Tank Empty-Gas-Tank False

Resolution Heuristics Set-of-support heuristics: At least one ancestor of every inferred clause comes from a Shortest-clause heuristics: Generate a clause with the fewest literals first Simplifications heuristics: Remove any clause containing two complementary literals (tautology) Remove any clause C that contains all the literals of another clause C’ If a symbol always appears with the same “sign”, remove all the clauses that contain it (pure symbol)

Example (Pure Literal) Battery-OK  Bulbs-OK  Headlights-Work Battery-OK  Starter-OK  Empty-Gas-Tank  Engine-Starts Engine-Starts  Flat-Tire  Car-OK Headlights-Work Battery-OK Starter-OK Empty-Gas-Tank Car-OK Flat-Tire

When to Use Logic? When the knowledge base is large and can be made explicit When formulating a problem as a CSP problem would yield complex constraints When the agent’s environment is conveniently described by true or false sentences

Summary Entailment problem Resolution rule Clause form of a set of sentences Resolution refutation algorithm Resolution heuristics