Soundness of SLD-Resolution

Slides:



Advertisements
Similar presentations
Simply Logical – Chapter 2© Peter Flach, 2000 Clausal logic Propositional clausal logic Propositional clausal logic expressions that can be true or false.
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
SLD-resolution Introduction Most general unifiers SLD-resolution
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
AR for Horn clause logic Introducing: Unification.
Standard Logical Equivalences
Resolution.
Artificial Intelligence University Politehnica of Bucharest Adina Magda Florea
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.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Logic seminar 5 The resolution principle Slobodan Petrović.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
Inference and Resolution for Problem Solving
Catriel Beeri Pls/Winter 2004/5 type reconstruction 1 Type Reconstruction & Parametric Polymorphism  Introduction  Unification and type reconstruction.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
CSE (c) S. Tanimoto, 2007 Unification 1 Unification Predicate calculus rules are sometimes so general that we need to create specializations of.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
12 October 2006 Foundations of Logic and Constraint Programming 1 Operational Semantics ­An overview The language of programs The computation mechanism.
Logic Programming Part 2: Semantics James Cheney CS 411.
Slides 05 1 The Principal-Type Algorithm In general a typable term has an infinite set of types in TA. For example, it is possible to assign to I  x 
Binary Decision Diagrams for First Order Predicate Logic By: Jan Friso Groote Afsaneh Shirazi.
0 1 Todays Topics Resolution – top down and bottom up j-DREW BU procedure Subsumption – change to procedure Infinite Loops RuleML input – Prolog output.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
First Order Predicate Logic
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
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.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
Automated Reasoning Systems For first order Predicate Logic.
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
第 1 6 章 谓词演算中的归结. 2 Outline Unification Predicate-Calculus Resolution Completeness and Soundness Converting Arbitrary wffs to Clause Form Using Resolution.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Theory of Computation Lecture 5: Primitive Recursive Functions I
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models of Definite Programs.
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.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Converting arbitrary wffs to CNF A wff is in prenex form iff it consists of a string of quantifiers (called a prefix) followed by a quantifier free formula.
1 Hojjat Ghaderi, University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Knowledge Representation III ● Required Readings: 9.1, 9.2,
COMP 412, FALL Type Systems C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
Knowledge Based Systems
Models of Definite Programs
Completeness of the SLD-Resolution
Resolution in the Propositional Calculus
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
FIRST ORDER DIFFERENTIAL EQUATIONS
Theory of Computation Lecture 22: Turing Machines III
Prolog syntax + Unification
Logic: Top-down proof procedure and Datalog
Soundness of SLD-Resolution
Models of Definite Programs
CSE (c) S. Tanimoto, 2004 Unification
CSE S. Tanimoto Unification
Biointelligence Lab School of Computer Sci. & Eng.
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
CSE (c) S. Tanimoto, 2002 Unification
Chapter 4: Prolog (Substitution, Unification and Resolution)
Models of Definite Programs
Resolution Preliminaries
Proofs (2.7) (How to compute logical consequences of a KB rather that
Theory of Computation Lecture 23: Turing Machines III
Presentation transcript:

Soundness of SLD-Resolution Procedural Semantics Soundness of SLD-Resolution

Unifier Definition: Let S be a finite set of simple expressions. A Substitution  is called a unifier for S, if S is a singleton. A unifier  is called a most general unifier (mgu) for S if, for each unifier  of S there exists a substitution  such that =. Example Note: If there exist two mgu's then they are variants.

Disagreement Set Definition: Let S be a finite set of simple expressions. Locate the leftmost symbol position at which not all expressions in S have the same symbol and extract from each expression in S the subexpression beginning at that symbol position. The set of all such subexpressions is the disagreement set. Example: Let S={p(f(x),h(y),a), p(f(x),z,a), p(f(x),h(y),b)}, then the disagreement set is {h(y),z}

Unification Algorithm put k:=0 and 0:= If Sk is a singleton, Then return(k) Else find the disagreement set Dk of Sk If there exist a variable v and a term t in Dk such that v does not occur in t, // non-deterministic choice Then put k+1 := k{v/t}, k++, goto 2 Else exit // S is not unifiable

return. Example , k=1 S={even(0),even(y)} D0={0,y} choose variable y, term 0 put 1 := {y/0}, k=1 S={even(0)} return.

Unification Theorem Theorem: Let S be a finite set of simple expressions. If S is unifiable, then the unification algorithm terminates and gives a mgu for s. If S is not unifiable, then the unification algorithm terminates and reports this fact. Proof Sketch: Assume  is a unifier for S. Show that until termination for all k : =kk

SLD: SL-resolution for definite clauses SLD-Resolution SLD: SL-resolution for definite clauses SL: Linear resolution with selection function

Derivation Definition: Let G be ← A1,…., Am,…, Ak and C be A ← B1,…., Bq. Then G' is derived from G and C using mgu , if: a. Am is an Atom, called the selected atom, in G b.  is an mgu of Am and A. c. G‘ is the goal ← (A1,…., B1,…., Bq,…, Ak). In resolution terminology G‘ is called a resolvent of G and C.

SLD-Derivation Definition: Let P be a definite program and G0 a definite goal. An SLD-Derivation of P  {G0} consists of a (finite or infinite) sequence G0, G1, G2,… of goals, a sequence C1, C2 ,… of variants of program clauses of P and a sequence 1, 2, … of mgu's such that each Gi+1 is derived from Gi and Ci+1 using i+1. standardising apart the variables: subscribe all variables in Ci with i. Otherwise ←p(x). could not be unified with p(f(x)) ← . each program clause variant C1, C2 ,… is called an input clause of the derivation

SLD-Derivation visualised (← A1,…., B1,…., Bq,…, Ak)1 ← A1,…., Am,…, Ak (← A11,..,B11,..,D1,..,Dl,…,Bq1,..,Ak 1) 2 G0 G1 G2 G3 Gn-1 Gn C1 ,1 C2,2 C3 ,3 Cn ,n A ← B1,…., Bq. 1=mgu(A,Am). B ← D1,…., Dl. 2=mgu(B,Bo 1).

Example – Restricted SLD-Refutation ← R(g(f(z))). Program P 1 Q(x) :- R(g(x)). 2 R(y). Goal: Q(f(z)). ← Q(f(z)) Computed Answer {x/f(z), y/g(f(z))} restricted to variables of Q(f(z)) results in  G0 G1 □ C1 ,1 C2,2 Q(x) :- R(g(x)). 1=mgu(Q(x),Q(f(z))) ={x/f(z)} R(y)←. 2=mgu(R(y), R(g(f(z)))) = {y/g(f(z))}

Example – Unrestricted SLD-Refutation unrestricted  unifiers need not be mgu’s ← R(g(f(a))). Program P 1 Q(x) :- R(g(x)). 2 R(y). Goal: Q(f(z)). ← Q(f(z)) Correct Answer: {x/f(a), z/a, y/g(f(z))} restricted to variables of Q(f(z)) results in {z/a} G0 G1 □ C1 ,1 C2,2 Q(x) :- R(g(x)). 1={x/f(a), z/a} R(y)←. 2={y/g(f(a))}

SLD Refutation Definition: An SLD-refutation of P  {G} is a finite SLD-derivation of P  {G}, which has □ as the last goal in the derivation. If Gn=□, we say the refutation has length n. SLD-derivations can be finite or infinite. A finite SLD-derivation can be successful or fail. An SLD-derivation is successful, if it ends in □. An SLD-derivation is failed, if it ends in a non-empty goal, which cannot be unified with the head of a program clause.

Procedural Counterpart of the Least Herbrand Model! Success Set Definition: Let P be a definite program. The success set of P is the set of all ABP such that P  {← A} has an SLD-refutation. Procedural Counterpart of the Least Herbrand Model!

Computed Answer Definition: Let P be a definite program and G a definite goal. Let 1…n be the sequence of mgu's used in an SLD- refutation of P{G}. A computed answer  for P{G} is the substitution obtained by restricting the composition 1…n to the variables of G.

Example: P=Slowsort goal: ← sort(17.22.6.5.nil,y) computed answer: {y/5.6.17.22.nil} sort(x,y) ← sorted(y), perm(x,y) sorted(nil) ← sorted(x.nil) ← sorted(x.y.z) ← xy, sorted(y.z) perm(nil,nil) ← perm(x.y,u.v) ← delete(u,x.y,z),perm(z,v) delete(x,x.y,y) ← delete(x,y.z,y.w) ← delete(x,z,w) 0x ← f(x) f(y) ← xy.

Soundness of SLD-Resolution - 1 Theorem Let P be a definite program and G a definite goal. Then every computed answer for P{G} is a correct answer for P{G}. Proof Let G be the goal ← A1,…, Ak and 1…n the sequence of mgu's in a refutation of P{G}. Show that ((A1,…, Ak )1…n)is a logical consequence of P using induction (starting at the last goal) over the length of the derivation.

Corollary The success set of a definite program is contained in its least Herbrand model. Proof Let the program be P, let ABP and suppose P{← A} has a refutation. By the theorem on the prior slide A is a logical consequence of P. Thus A is in the least Herbrand model of P.

Ground Instances of A strengthen this corollary If ABP and P{← A} has a refutation of length n, then A TPn. Notation [A]={A‘ BP: A‘=A for some substitution }

Completeness of SLD-Resolution Not treated this year, check out http://isweb.uni-koblenz.de/Teaching/SS08/adm08