Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Some Prolog Prolog is a logic programming language
Resolution Proof System for First Order Logic
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Introduction to Theorem Proving
Standard Logical Equivalences
Automated Reasoning Systems For first order Predicate Logic.
First Order Logic Resolution
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.
Resolution
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
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 386 Artificial Intelligence Ellen Walker Hiram College.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
CSE (c) S. Tanimoto, 2008 Propositional Logic
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Inference and Resolution for Problem Solving
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Artificial Intelligence
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
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.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Automated Reasoning ARTIFICIAL INTELLIGENCE 6th edition George F Luger
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
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.
Production Systems A production system is –a set of rules (if-then or condition-action statements) –working memory the current state of the problem solving,
MATH 224 – Discrete Mathematics
Propositional Calculus Composed of symbols –P – some true statement P might represent something like “It is Monday” or “the car is red” And sentences –a.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
Planning, page 1 CSI 4106, Winter 2005 Planning Points Elements of a planning problem Planning as resolution Conditional plans Actions as preconditions.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
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.
Tasks Task 41 Solve Exercise 12, Chapter 2.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
1CS3754 Class Notes 14B, John Shieh, Figure 2.5: Further steps in the unification of (parents X (father X) (mother bill)) and (parents bill.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
KU NLP Resolution Theorem Proving Resolution Theorem Proving q Introduction - Resolution Principle q Producing the Clause Form q
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Reasoning using First-Order Logic
Propositional Logic Predicate Logic
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Resolution Theorem Proving in Predicate Calculus Lecture No 10 By Zahid Anwar.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Resolution in the Propositional Calculus
Logic Use mathematical deduction to derive new knowledge.
RESOLUTION.
Resolution Proof System for First Order Logic
Presentation transcript:

Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as opposed to strong methods because they do not require a great deal of knowledge formal mechanism for representation and precise inference rules search processes but unlike the search spaces we examined in chapters 3 & 4, these processes identify rule(s) to apply and on what data to apply them through a matching algorithm – we focus on two forms of reasoning here to perform automated theorem proving in predicate calculus the general problem solver strategy and means-ends analysis resolution and unification

Theorem Proving We first examine the Logic Theorist system – given two statements in propositional calculus, it would try to prove their equality – it would use a collection of rules (shown in a few slides) LT’s rules performed one of three types of operations – substitution – substitute one expression for every occurrence of a symbol that is already known to be true (X v X)  X can be replaced by (!A v !A)  !A This is a form of unification, here unifying X to !A – replacement – substitute an expression that has a connective (e.g.,  ) by its equivalent form or definition A  B can be replaced by !A v B since they are equivalent – detachment – apply modus ponens to introduce a new, true statement or clause

Means-Ends Analysis, GPS and LT Means-ends analysis – weak method approach – compare current state to goal state to determine differences – select an operator to reduce some of these differences GPS is the general problem solver, a system that embodies this weak method approach – GPS is a generalized version of the process used in LT – GPS requires a difference table which maps differences (between current and goal states) to operators so that the GPS can select an operator at each step LT is an example implementation using GPS In LT, two logical statements are introduced: the start state and the goal state – LT attempts to show their equivalence by reducing one into the other – the difference table consists of actions to either reduce a term, add a term, or change a term including changes in sign (AND to OR, OR to AND) and connective (  to OR) – the rules to apply (there were 12 of them) would all be based on boolean algebra laws such as DeMorgan’s Law

How LT Works LT applies inference rules in a breadth-first, goal- driven manner, using four methods – substitute a symbol in the current goal to see if it matches any known axiom or theorem, if so, that goal has been proved – try all possible detachments and replacements to the goal test each generated term using substitution any that fail to prove the goal are added to a subproblem list – employ transitivity of implication to see if it would solve the problem and if so, add the new term as a new subprogram e.g., if we are trying to prove A  C and we know B  C, then we add A  B as a step to be proven, if we can prove it, then we have proven A  C – if none of the above work, remove the first term off the subproblem list and repeat with this as the goal – that is, use the first term as a subgoal

Example LT attempts to prove (p  !p)  !p is true – first, (AvA)  A is the closest axiom to match the structure of our target expression (the goal) so we attempt to use substitution first (!Av!A)  !A by substituting !A for A (A  !A)  !A by replacement – recall that !x v y is the same as x  y, so here !A v !A is A  !A (p  !p)  !p by substituting p for A, done Notice how LT works backward – LT starts with an axiom that best matches the goal – then LT applies substitution, replacement, detachment, as necessary to alter the axiom until we reach the goal or generates a new subgoal to reach if LT reaches a deadend, it introduces new terms as subgoals to solve and repeats the entire process by attempting to solve the first subgoal

LT Rules and Examples If we have (X * Y), by rule 1, we can change this to (Y * X) or by rule 8, we can conclude X is true and/or Y is true If we have X * Y  !Z, by rule 2, we can change this to !(X * Y) v !Z and then apply rule 5 to obtain !X v !Y v !Z If we know X is true and Y is true, we can use rule 10 to obtain X * Y If we need to have X, and we know A and B are true and (A & B)  (X & Y), we can use rules 10, 11 and 8 to obtain X

Longer Example We want to prove that The proof is shown to the left with the rules used to denote how the proof was generated Note this solution is not the most efficient proof

How Does LT Select a Rule? LT uses means-ends analysis given the difference table below – given a goal, determine the difference between goal and current state – select a rule to reduce this difference – if the rule can reduce the difference directly, great, otherwise produce a subgoal and add it to the list of goals/subgoals In the reduction table for instance, – to delete a term, use rule 3, 7, 8, 11 or 12 – to change a sign, use rule 5

Example Goals and Strategies

Resolution When we first examined first order predicate calculus, we used our representation by applying chaining, modus ponens/tollens and unification – another way to use predicate calculus is resolution and unification In resolution, introduce the negation of what you want to prove into your knowledge base – in first order predicate calculus, everything known is true – you have assumed the new piece of knowledge is true – now, resolve terms by combining terms together If you have X v Y and introduce !X, this resolves into Y (the !X and X cancel each other out) – add unification as necessary – continue to resolve clauses until you reach the empty clause (all terms have been canceled out) – this is an inconsistency – you have started with true statements but end up knowing nothing is true, thus either you have something incorrect in your original knowledge base (which was all assumed to be true) or the item you just introduced as true is actually false – if the new term is false, then its opposite must be true (if you introduced !x which we have proved is false, then x must be true)

Clausal Form To use resolution, you must translate your knowledge into predicate calculus statements and then into clausal form – eliminate  by using the equivalent form A  B = !A v B – reduce negation so that it appears immediately before predicates, not terms by applying DeMorgan’s Law for instance !(A AND B) becomes !A v !B apply Double Negation if needed move quantifiers to immediately before each term (see page 586) – remove any universal quantifiers by renaming variables if you have for all x:… for all x: …, change the latter grouping into y – remove any existential quantifiers by replacing the variables with constants – convert all clauses to be conjuncts of disjuncts each term should consist of only ANDs, ORs, and NOTs arrange them so that they are all sums of products (ORed items of individual predicates or of ANDed predicates as in A*B v !B*C*D v !A) – separate each conjunct into its own term – these terms will only comprise predicates, NOTs and ANDs in some combination Now, introduce the negation of what you want to prove

Example: Dead Dog Problem All dogs are animal – V(X) (dog(X)  animal(X)). – V(X) (!dog(X) v animal(X)). – !dog(X) v animal(X) Fido is a dog – dog(Fido). All animals die – V(X) (animal(X)  die(X)). – V(X) (!animal(X) v die(X)). – !animal(Y) v die(Y) We want to prove that Fido will die, so we introduce !die(Fido) – proof shown to the right – since we reach an empty clause, it proves !die(Fido) is false, so die(Fido) is true, Fido will die

Example: Is John Happy?

Proof of John’s Happiness

Question Answering Given a KB with knowledge of specific instances, we can use resolution to pose a question – e.g., who is ready to graduate? The process is almost identical to our previous resolution where we tried to prove something was true – here, we introduce the negation of the question we want to answer (e.g., ~ready_to_graduate(X)) – through unification, we are hoping to find an X that makes the above statement false, and therefore the person that we unified to X is ready to graduate – this process can only work by having instances that can unify to the term that we are attempting to prove – the answer is the instance(s) that unified to X – in the Prolog language, the system will find all X’s but in resolution, we usually stop when we have found an X

Exciting Life Example

Continued By unifying Y to John, our answer is that John has an exciting life

Clause Selection Strategies As with our previous AI solutions, resolution is search based – which clause should we select to attempt to resolve? – what instance do we unify with a variable? so resolution/unification is intractable (too computationally complex) There are many different approaches to tackling the search problem – breadth-first – while this strategy computationally is poor because it generates all possible solution spaces until one is found, the proof itself will take the fewest steps – depth-first – this strategy may “luck” into a solution much quicker than breadth-first and is easy to implement using recursion We can also use one or more heuristic approaches – support – select a clause to unify where one of the terms is related to a term to be resolved (related in terms of hierarchical) – unit preference – select a clause with the fewest terms (1 preferably) – linear input – always select a clause that has the negation of at least one term in the resolvent – that is, make sure you are always removing clauses as you go