Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Artificial Intelligence 8. The Resolution Method
Some Prolog Prolog is a logic programming language
First-Order Logic.
Inference Rules Universal Instantiation Existential Generalization
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
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.
Logic Use mathematical deduction to derive new knowledge.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Resolution Theorem Proving
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
EE1J2 – Discrete Maths Lecture 4 Analysis of arguments Logical consequence Rules of deduction Rules of equivalence Formal proof of arguments See: Anderson,
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
MATH 224 – Discrete Mathematics
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
F22H1 Logic and Proof Week 6 Reasoning. How can we show that this is a tautology (section 11.2): The hard way: “logical calculation” The “easy” way: “reasoning”
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Fall 98 Introduction to Artificial Intelligence LECTURE 7: Knowledge Representation and Logic Motivation Knowledge bases and inferences Logic as a representation.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
2.3Logical Implication: Rules of Inference From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 13 of 41 Monday, 20 September.
Computing & Information Sciences Kansas State University Lecture 14 of 42 CIS 530 / 730 Artificial Intelligence Lecture 14 of 42 William H. Hsu Department.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
CS6133 Software Specification and Verification
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Propositional Logic Predicate Logic
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Predicates and Quantifiers Dr. Yasir Ali. 1.Predicates 2.Quantifiers a.Universal Quantifiers b.Existential Quantifiers 3.Negation of Quantifiers 4.Universal.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
1 Introduction to Abstract Mathematics Proof Methods , , ~, ,  Instructor: Hayk Melikya Purpose of Section:Most theorems in mathematics.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Chapter 1 Logic and proofs
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Knowledge Representation and Reasoning
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
CSE 311 Foundations of Computing I
Computer Security: Art and Science, 2nd Edition
Negations of quantifiers
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Foundations of Discrete Mathematics
Discrete Structures Prepositional Logic 2
Logical and Rule-Based Reasoning Part I
Presentation transcript:

Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow

Automating Deductive Reasoning Aims of automated deduction – Deduce new knowledge from old – Prove/disprove some open conjectures Theorem proving – Search for a path from axioms to theorem statement – Operators are (sound) inference rules Applications: – Agents that use deductive inference – Mechanising and automating mathematics – Verifying hardware and software specifications – The semantic web

Inference Rules A entails B iff – B is true when A is true – Any model of A is a model of B Then this is a sound inference rule A B Axioms  C  D  …  Z  Theorem – Each step is application of inference rule – Theorem is entailed by the axioms

XYZ YZYZXYXYX  ZX  (Y  Z)((X  Y)  (X  Z)) S true false truefalse true falsetruefalse truefalse true false true falsetrue falsetruefalse true false truefalsetrue false true Tautologies S: (X  (Y  Z))  ((X  Y)  (X  Z)) Show that no matter what truth values for X, Y and Z The statement S is always true Columns 7 and 8 are always the same

Inference with Tautologies P  Q  Q  P is obviously true – Regardless of meaning or truth values of P and Q – This is content-free and a tautology One way to define a rule of inference: – We can replace P  Q with Q  P, and vice versa – They are true for same models – Replacing one for other preserves soundness

Equivalence Rules A and B are logically equivalent (write A  B) – Same models for each – Can replace any instance of A with an instance of B without affecting models Formalised as rewrite rule A  B – Also B  A – Must avoid looping A  B  A  B ... – Choose one direction, or always loop-check Rewrite rules used for inference – Showing theorem and axioms are equivalent – Preprocessing theorem/axioms into a particular format

Commutativity & Associativity Commutativity P  Q  Q  P P  Q  Q  P P  Q  Q  P Associativity (P  Q)  R  P  (Q  R) (P  Q)  R  P  (Q  R)

Distributivity of Connectives ‘and over or’ and ‘or over and’: P  (Q  R)  (P  Q)  (P  R) P  (Q  R)  (P  Q)  (P  R) Over implication P  (Q  R)  (P  Q)  (P  R) P  (Q  R)  (P  Q)  (P  R)

Double Negation Have to be careful in English – “I’m not not hungry” – Does not (necessarily) mean: “I’m hungry” But double negations can always be removed ¬¬P  P Humans would not write this – But it may appear in during agent’s inference

De Morgan’s Law & Contraposition De Morgan’s Law (refers to either) ¬(P  Q)  ¬P  ¬Q ¬(P  Q)  ¬P  ¬Q Contraposition: imagine the opposite is true P  Q  ¬Q  ¬P – Often useful in mathematics proof

Other Equivalences Remove implication or equivalence (very useful) – P  Q  ¬P  Q – P  Q  (P  Q)  (Q  P) Reduce to truth value P  ¬P  False P  ¬P  True

An Example Deduction (P  Q)  (¬P  Q) Show that this sentence is false – Show that this rewrites to False – This proves the negation See notes for solution (or do as exercise) Is this easier than a truth table?

Propositional Inference Rules Rewrite rules are good for bidirectional search – But we don’t need equivalence, just entailment Classic example – All men are mortal, socrates is a man – Therefore: Socrates is mortal This is an instance of an inference rule – Known as Modus Ponens (Aristotle) A  B, A B Above line: what we know, below: what we can deduce

Soundness of Modus Ponens Every model of top sentences is a model of the bottom sentence ABABABTop: A  B, ABottom: B True False True FalseTrue False TrueFalseTrue

And-Elimination & -Introduction And-Elimination: A 1  A 2  …  A n A i [1  i  n] And-Introduction: A 1, A 2, …, A n A 1  A 2  …  A n The sentences may be from different places – Selected from the database

Or-Introduction & Unit Resolution Or-introduction A i A 1  A 2  …  A n [1  i  n] Unit resolution (A  B), ¬B A Basis for resolution theorem proving – See next two lectures

First-Order Inference Rules Propositional inference rules (inc. equivs) – Can all be used in first-order inference First-order inference more complicated Soundness depends on concept of models – Potentially infinite models, can’t use a truth table Sentences contain quantifiers – Need the notion of ground substitution

Substitution & Instantiation FOL sentences have quantified variables – Substitute into a variable by assigning a particular value – Replace with given term, remove quantifier Instantiation (grounding) is a kind of substitution – Must substitute a ground term Example:  X.  Y.likes(X,Y) becomes likes(tony, george) We write: – Subst({X/tony, Y/george}, likes(X,Y)) = likes(tony,george)

Universal Elimination Given a sentence, A – Containing a universally quantified variable V – Then we can replace V by any ground term g  V.A Subst({V/g}, A) Remember to remove quantifier Not as complicated as it looks:  X likes(X, ice_cream) becomes likes(ben,ice_cream)

Existential Elimination Given a sentence, A – Containing an existentially quantified variable, V – Then we can replace V by any constant, k – As long as k is not mentioned anywhere else  V.A Subst({V/k}, A) For the sake of argument, let’s call it…

Existential Introduction Given a sentence, A – And a variable, V, which is not used in A – Then any ground term, g, in A can be substituted by V As long as g does not appear in A also A  V. Subst({g/V},A) Exercise: find sentence where V is in A – Such that this inference rule is not sound

Chains of Inference Remember the problem we’re trying to solve – Search for a path from axioms, A, to theorem, T Three approaches – Forward chaining – Backward chaining – Proof by contradiction Specification of a search problem: – Representation of states (first-order logic sentences) – Initial state (depends...) – Operators (inference rules, including equivalences) – Goal state (depends...)

Forward Chaining Deduce new facts from axioms – Deduce new facts from these, etc.,… Hopefully end up deducing the theorem statement Can take a long time: not using the goal to direct search A1A1 A2A2 A3A3 T

Backward Chaining Start with the theorem state and work backwards – Hope to end up at the axioms Each step asks: given the state that I’m at... – Which operator could have been applied to which state to produce the state (sentence) I’m at No problem when using equivalences – Can also use a bidirectional search (from both ends) Difficult when using general inference rules – Many possible ways to invert operators

Proof By Contradiction “Reductio ad absurdum” Assume theorem is false – then show that the assumption contradicts the axioms – which proves that the theorem is true Add negated theorem to the set of axioms – See if we can deduce the ‘False’ sentence Advantage: using the theorem statement from start – Can look to see how close we are to the false statement Possibilities for a heuristic search! Basis for resolution theorem proving

Example: using the Otter resolution theorem prover Input to Otter: set(auto). formula_list(usable). all x (man(x)->mortal(x)). % For all x, if x is a man then x is mortal man(socrates). % Socrates is a man -mortal(socrates). % Socrates is immortal (note: negated) end_of_list. Output from Otter: PROOF [] -man(x)|mortal(x). 2 [] -mortal(socrates). 3 [] man(socrates). 4 [hyper,3,1] mortal(socrates). 5 [binary,4.1,2.1] $F end of proof