Logical Inference 1 introduction

Slides:



Advertisements
Similar presentations
Inference in First-Order Logic
Advertisements

Artificial Intelligence 8. The Resolution Method
Logic Inference CMSC 471 Chapter 7.5, 9 Chuck Dyer, and Lise Getoor
First-Order Logic.
Russell and Norvig Chapter 7
Inference Rules Universal Instantiation Existential Generalization
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
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.
Logical Inference 1 introduction Chapter 9 Some material adopted from notes by Andreas Geyer-Schulz,, Chuck Dyer, and Mary Getoor.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
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.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
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.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Inference in First-Order Logic
Chapter 3 Propositional Logic
Logic - Part 2 CSE 573. © Daniel S. Weld 2 Reading Already assigned R&N ch 5, 7, 8, 11 thru 11.2 For next time R&N 9.1, 9.2, 11.4 [optional 11.5]
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
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 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.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
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.
Propositional Logic or how to reason correctly Chapter 8 (new edition) Chapter 7 (old edition)
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.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Notes 7: Knowledge Representation, The Propositional Calculus
EA C461 Artificial Intelligence
Inference in Propositional Logic (and Intro to SAT)
Logical Inference 2 Rule-based reasoning
Recursive stack-based version of Back-chaining using Propositional Logic
EA C461 – Artificial Intelligence Logical Agent
Resolution in the Propositional Calculus
Logical Inference 4 wrap up
Notes 7: Knowledge Representation, The Propositional Calculus
Logical Inference 2 Rule-based reasoning
Logical Inference: Through Proof to Truth
Artificial Intelligence
Logical Agents Chapter 7 Selected and slightly modified slides from
Logical Agents Reading: Russell’s Chapter 7
CS 416 Artificial Intelligence
Propositional Resolution
CSE 4705 Artificial Intelligence
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Automated Reasoning in Propositional Logic
Methods of Proof Chapter 7, second half.
Propositional Logic: Methods of Proof (Part II)
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Logical Inference 4 wrap up
Logical Agents Chapter 7 Andreas Geyer-Schulz and Chuck Dyer
Presentation transcript:

Logical Inference 1 introduction Chapter 9 Some material adopted from notes by Andreas Geyer-Schulz,, Chuck Dyer, and Mary Getoor

Overview Inference wrap up A: Model checking for propositional logic Rule based reasoning in first-order logic Inference rules and generalized modes ponens Forward chaining Backward chaining Resolution-based reasoning in first-order logic Clausal form Unification Resolution as search Inference wrap up

From Satisfiability to Proof To see if a satisfiable KB entails sentence S, see if KB  S is satisfiable If it is not, then the KB entails S If it is, then the KB does not email S This is a refutation proof Consider the KB with (P, P=>Q, ~P=>R) Does the KB it entail Q? R?

Does the KB entail Q? P ~P v Q P v R ~Q Q P P=>Q ~P=>R P P=>Q ~P => R ~Q P ~P v Q P v R ~Q Q An empty clause represents a contradiction We assume that every sentence in the KB is true. Adding ~Q to the KB yields a contradiction, so ~Q must be false, so Q must be true.

Does the KB entail R? P ~P v Q P v R ~R Q Q v R P Q P P=>Q ~P=>R P P=>Q ~P => R ~R P ~P v Q P v R ~R Q Q v R P Q Adding ~R to KB does not produce a contradiction after drawing all possible conclusions, so it could be False, so KB doesn’t entail R.

Propositional Logic Model checking Given KB, does a sentence S hold? All of the logic variables in S must be in the KB Basically generate and test: Consider models M in which every sentence in the KB is TRUE If M S , then S is provably true If M S, then S is provably false Otherwise (M1 S  M2 S): S is satisfiable but neither provably true or provably false

Efficient PL model checking (1) Davis-Putnam algorithm (DPLL) is generate-and- test model checking with several optimizations: Early termination: short-circuiting of disjunction/conjunction Pure symbol heuristic: symbols appearing only negated or un-negated must be FALSE/TRUE respectively e.g., in [(AB), (BC), (CA)] A & B are pure, C impure. Make pure symbol literal true: if there’s a model for S, making pure symbol true is also a model Unit clause heuristic: Symbols in a clause by itself can immediately be set to TRUE or FALSE

Using the AIMA Code expr parses a string, and returns a logical expression python> python Python ... >>> from logic import * >>> expr('P & P==>Q & ~P==>R') ((P & (P >> Q)) & (~P >> R)) >>> dpll_satisfiable(expr('P & P==>Q & ~P==>R')) {R: True, P: True, Q: True} >>> dpll_satisfiable(expr('P & P==>Q & ~P==>R & ~R')) {R: False, P: True, Q: True} >>> dpll_satisfiable(expr('P & P==>Q & ~P==>R & ~Q')) False >>> dpll_satisfiable returns a model if satisfiable else False The KB entails Q but does not email R

Efficient PL model checking (2) WalkSAT is a local search for satisfiability: Pick a symbol to flip (toggle TRUE/FALSE), either using min-conflicts or choosing randomly …or you can use any local or global search algorithm! There are many model checking algorithms and systems See for example, MiniSat International SAT Competition (2003…2016)

AIMA KB Class >>> kb1 = PropKB() >>> kb1.clauses [] >>> kb1.tell(expr('P==>Q & ~P==>R')) [(Q | ~P), (R | P)] >>> kb1.ask(expr('Q')) False >>> kb1.tell(expr('P')) [(Q | ~P), (R | P), P] {} >>> kb1.retract(expr('P')) PropKB is a subclass A sentence is converted to CNF and the clauses added The KB does not entail Q After adding P the KB does entail Q Retracting P removes it and the KB no longer entails Q

Reminder: Inference rules for FOL Inference rules for propositional logic apply to FOL as well Modus Ponens, And-Introduction, And-Elimination, … New (sound) inference rules for use with quantifiers: Universal elimination Existential introduction Existential elimination Generalized Modus Ponens (GMP)