Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.

Slides:



Advertisements
Similar presentations
CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
Advertisements

Resolution Proof System for First Order Logic
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
SLD-resolution Introduction Most general unifiers SLD-resolution
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Automated Reasoning Systems For first order Predicate Logic.
First Order Logic Resolution
Models and Propositional Logic In propositional logic, a model in general simply fixes the truth value – true or false – for every proposition symbol.
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.
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.
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.
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.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CSCE 580 Sp03 Marco Valtorta.
Inference and Resolution for Problem Solving
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Knoweldge Representation & Reasoning
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
FATIH UNIVERSITY Department of Computer Engineering Controlling Backtracking Notes for Ch.5 of Bratko For CENG 421 Fall03.
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.
UIUC CS 497: Section EA Lecture #3 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Logical Agents Logic Propositional Logic Summary
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
CS344: Introduction to Artificial Intelligence Lecture: Herbrand’s Theorem Proving satisfiability of logic formulae using semantic trees (from Symbolic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Systems For first order Predicate Logic.
First-Order Logic and Inductive Logic Programming.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
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.
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
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.
1 Section 9.2 Logic Programming A logic program is a set of clauses with the restriction that there is exactly one positive literal in each clause. Such.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
6/11/2016 Linear Resolution and Introduction to First Order Logic Michael Leuschel Softwaretechnik und Programmiersprachen Lecture 5.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Completeness of the SLD-Resolution
Resolution in the Propositional Calculus
First-Order Logic and Inductive Logic Programming
Horn Clauses and Unification
Biointelligence Lab School of Computer Sci. & Eng.
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Horn Clauses and Unification
Horn Clauses and Unification
Horn Clauses and Unification
Biointelligence Lab School of Computer Sci. & Eng.
Horn Clauses and Unification
Logical Inference 4 wrap up
Presentation transcript:

Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during the refutation process by using an answer literal: § we add a literal Ans(X,...., Z) to each clause coming from the negation of the query, and perform resolution until only an answer literal is left; the variables X,...,Z are all of those variables that occur in the clause form of the negation of the query. The terms substituted during the proof for the variables in the Ans literal will then be instances of the existentially quantified variables in the query.

Resolution System To answer if KB |= Q: §Convert S = KB U {  Q} into S’ = CNF(S) (or INF(S)) convert each formula of S into clauses §Iteratively apply resolution to the clauses in S’ and add the results to S’ either until there are no more resolvents that can be added or until the empty clause is produced.

Refinement Strategies §The procedure described above is inefficient because some resolutions need not be performed at all (are irrelevant). §Refinement strategies disallows certain kinds of resolutions to take place. §Linear resolution with initial set of support

Important Theorems §Let S be a set of wffs and S’ the set of clauses obtained by converting S to CNF (to INF). §In Propositional Logic S and S’ are equivalent; but in FOL they are not equivalent in general §But in both logics we have: S is unsatisfiable iff S’ is unsatisfiable. §Therefore, KB |= Q iff S = KB U {  Q}is unsat iff S’ is unsat

Important Theorems Then we can use resolution to check if S’ |- False(empty clause) and if it is use soundness to infer that S’ is unsat, then S is unsat then KB entails Q; else use completeness to infer that S’ is satisfiable, then S is sat then KB does not entail Q.

SLD Resolution § Language: Horn clauses in INF §S - Selection Function - selects the atom in the goal clause to resolve §L- Linear Resolution §D - Definite Clauses The set of clauses S’ (a set of quasi-definite clauses): a set of definite clauses (representing KB), together with one goal clause (representing  Q).

SLD Resolution §Standard selection function (PROLOG): leftmost atom §Let C1 be a goal clause and C2 a definite clause; if there is an atom P1 in C1 and an atom P in the head of C2 such that P1 and P have a mgu , then these two clauses have the following resolvent: P1 ...  P n1  S1 ...  S n3  P (S1 ...  Sn3  P2...  Pn1)   Remember that the order of atoms is important! resolvent - play DO: body of definite clause then body of the objective clause

PROLOG and AI Computational Intelligence: a logical approach D. Poole, A. Mackworth, R. Goebel Oxford University Press, 1988 Appendix ( ) - Intro to Prolog

PROLOG §Cut Used to prune part of the search-space and to restrict backtracking. When called, it succeeds immediately; when it is retried (backtracked to), it fails the procedure in which it appears The cut effectively tells Prolog to freeze all the decisions made so far in this predicate. That is, if required to backtrack, it will automatically fail without trying other alternatives.

PROLOG Here is the first test case. It has no cut and will be used for comparison purposes. data(one). data(two). data(three). cut_test_a(X) :- data(X). cut_test_a('last clause').

PROLOG This is the control case, which exhibits the normal behavior. ?- cut_test_a(X), write(X), nl, fail. one two three last clause no

PROLOG Next, we put a cut at the end of the first clause. cut_test_b(X) :- data(X), !. cut_test_b('last clause'). Note that it stops backtracking through both the data/1 subgoal (left), and the cut_test_b parent (above). ?- cut_test_b(X), write(X), nl, fail. one no

PROLOG Next we put a cut in the middle of two subgoals. cut_test_c(X,Y) :- data(X), !, data(Y). cut_test_c('last clause'). Note that the cut inhibits backtracking in the parent cut_test_c and in the goals to the left of (before) the cut (first data/1).

PROLOG The second data/1 to the right of (after) the cut is still free to backtrack. ?- cut_test_c(X,Y), write(X-Y), nl, fail. one - one one - two one - three no alternatives.

SLDNF Resolution §Negation in PROLOG: Negation as (finite) Failure Not P if an SLDNF tree starting from P  finitely fails.

PROLOG Negation as Failure in Prolog (written as “\+”): not(G) :- G, ! Fail. not(G).