Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics 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

Completeness and Expressiveness
First-Order Logic.
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.
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.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Advanced Data Modeling Minimal Models Steffen Staab TexPoint fonts used in EMF. Read.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
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.
CS5371 Theory of Computation
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ć.
Inference and Resolution for Problem Solving
Catriel Beeri Pls/Winter 2004/5 type reconstruction 1 Type Reconstruction & Parametric Polymorphism  Introduction  Unification and type reconstruction.
Complexity 19-1 Complexity Andrei Bulatov More Probabilistic Algorithms.
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.
12 October 2006 Foundations of Logic and Constraint Programming 1 Operational Semantics ­An overview The language of programs The computation mechanism.
Monadic Predicate Logic is Decidable Boolos et al, Computability and Logic (textbook, 4 th Ed.)
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Logic Programming Part 2: Semantics James Cheney CS 411.
Binary Decision Diagrams for First Order Predicate Logic By: Jan Friso Groote Afsaneh Shirazi.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
MATH 224 – Discrete Mathematics
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Stable Models See Bry et al 2007.
Steffen Staab Advanced Data Modeling 1 of 32 WeST Häufungspunkte Bifurkation: x n+1 = r x n (1-x n ) Startwert x 0 = 0,25.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
First Order Predicate Logic
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
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.
Recursive Algorithms &
Unification We can represent any substitution by a set of ordered pairs: s = { t 1 /v 1, t 2 /v 2, …, t n /v n } where: t i /v i means that the term i.
Automated Reasoning Systems For first order Predicate Logic.
Automated reasoning with propositional and predicate logics Spring 2007, Juris Vīksna.
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of an FSA is easy for us to understand, but difficult.
第 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 in First Order Logics.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models of Definite Programs.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Models in First Order Logics.
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.
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,
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Sorting by placement and Shift Sergi Elizalde Peter Winkler By 資工四 B 周于荃.
Information Systems & Semantic Web University of Koblenz ▪ Landau, Germany Advanced Data Modeling Steffen Staab with Simon Schenk TexPoint fonts used in.
Completeness of the SLD-Resolution
Resolution in the Propositional Calculus
Prolog syntax + Unification
Soundness of SLD-Resolution
Biointelligence Lab School of Computer Sci. & Eng.
Chapter 2: Analysis and Verification of Non-Real-Time Systems
Soundness of SLD-Resolution
Resolution Preliminaries
Presentation transcript:

Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution

Steffen Staab Advanced Data Modeling 2 of 19 WeST Properties of Substitution Propositions: Let , ,  be substitutions, E an expression.  =  =  (Identity) (E  )  = E(  ) (  )  =  (  ) (Associativity) Proof: Follows from definition of  prove proposition for E=x prove E(  )  = E  (  ) for E=x and 2. Example

Steffen Staab Advanced Data Modeling 3 of 19 WeST 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.

Steffen Staab Advanced Data Modeling 4 of 19 WeST 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}

Steffen Staab Advanced Data Modeling 5 of 19 WeST Unification Algorithm 1.put k:=0 and  0 :=  2.If S  k is a singleton, Then return(  k ) Else find the disagreement set D k of S  k 3.If there exist a variable v and a term t in D k 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

Steffen Staab Advanced Data Modeling 6 of 19 WeST Example   , k=1 S   ={ even(0),even(y)} D 0 ={0,y} choose variable y, term 0 put  1 :=  {y/0}, k=1 S   ={even(0)} return.

Steffen Staab Advanced Data Modeling 7 of 19 WeST 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

Steffen Staab Advanced Data Modeling 8 of 19 WeST Unification Theorem Proof Sketch: Assume  is a unifier for S. Show that until termination for all k :  =  k  k Induction start:  0 =  0 =  From k to k+1 (we only need to consider S  k, because otherwise, we are done): |S  D  k  Pick a variable v and a term t, then:  v  k = t  k   k+1 =  k {v/t}   k+1 =  k \ {v/v  k }, i.e. if v is bound in  k then  k = {v/v  k }   k+1 = {v/t  k }   k+1 = {v/t  k+1 }   k+1 = {v/t}  k+1  =  k  k =  k {v/t}  k+1 =  k+1  k+1

Steffen Staab Advanced Data Modeling 9 of 19 WeST SLD-Resolution SLD: SL-resolution for definite clauses SL: Linear resolution with selection function

Steffen Staab Advanced Data Modeling 10 of 19 WeST Derivation Definition: Let G be ← A 1,…., A m,…, A k and C be A ← B 1,…., B q. Then G' is derived from G and C using mgu , if: a. A m is an Atom, called the selected atom, in G b.  is an mgu of A m and A. c. G‘ is the goal ← (A 1,…., B 1,…., B q,…, A k ) . In resolution terminology G‘ is called a resolvent of G and C.

Steffen Staab Advanced Data Modeling 11 of 19 WeST SLD-Derivation Definition: Let P be a definite program and G 0 a definite goal. An SLD-Derivation of P  {G 0 } consists of a (finite or infinite) sequence G 0, G 1, G 2,… of goals, a sequence C 1, C 2,… of variants of program clauses of P and a sequence  1,  2, … of mgu's such that each G i+1 is derived from G i and C i+1 using  i+1. standardising apart the variables: subscribe all variables in C i with i. Otherwise ←p(x). could not be unified with p(f(x)) ←. each program clause variant C 1, C 2,… is called an input clause of the derivation

Steffen Staab Advanced Data Modeling 12 of 19 WeST SLD-Derivation visualised G0G0 G1G1 G2G2 G3G3 G n-1 GnGn C 1,  1 C2,2C2,2 C 3,  3 C n,  n ← A 1,…., A m,…, A k A ← B 1,…., B q.  1 =mgu(A,A m ). (← A 1,…., B 1,…., B q,…, A k )  1 B ← D 1,…., D l.  2 =mgu(B,B o  1 ). (← A 1  1,..,B 1  1,..,D 1,..,D l,…,B q  1,..,A k  1 )  2

Steffen Staab Advanced Data Modeling 13 of 19 WeST Example – Restricted SLD-Refutation Program P 1 Q(x) :- R(g(x)). 2 R(y). Goal: Q(f(z)). G0G0 G1G1 C 1,  1 C2,2C2,2 ← Q(f(z)) 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))} ← R(g(f(z))). □ Computed Answer {x/f(z), y/g(f(z))} restricted to variables of Q(f(z)) results in 

Steffen Staab Advanced Data Modeling 14 of 19 WeST Example – Unrestricted SLD-Refutation unrestricted  unifiers need not be mgu’s Program P 1 Q(x) :- R(g(x)). 2 R(y). Goal: Q(f(z)). G0G0 G1G1 C 1,  1 C2,2C2,2 ← Q(f(z)) Q(x) :- R(g(x)).  1 ={x/f(a), z/a} R(y)←.  2 ={y/g(f(a))} ← R(g(f(a))). □ Correct Answer: {x/f(a), z/a, y/g(f(z))} restricted to variables of Q(f(z)) results in {z/a}

Steffen Staab Advanced Data Modeling 15 of 19 WeST 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 G n =□, 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.

Steffen Staab Advanced Data Modeling 16 of 19 WeST Success Set Definition: Let P be a definite program. The success set of P is the set of all A  B P such that P  {← A} has an SLD-refutation. Procedural Counterpart of the Least Herbrand Model!

Steffen Staab Advanced Data Modeling 17 of 19 WeST 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.

Steffen Staab Advanced Data Modeling 18 of 19 WeST Example: P=Slowsort 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. goal: ← sort( nil,y) computed answer: {y/ nil}

Steffen Staab Advanced Data Modeling 19 of 19 WeST 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 ← A 1,…, A k and  1 …  n the sequence of mgu's in a refutation of P  {G}. Show that  ((A 1,…, A k )  1 …  n )is a logical consequence of P using induction (starting at the last goal) over the length of the derivation.

Steffen Staab Advanced Data Modeling 20 of 19 WeST Corollary The success set of a definite program is contained in its least Herbrand model. Proof Let the program be P, let A  B P 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.

Steffen Staab Advanced Data Modeling 21 of 19 WeST Ground Instances of A strengthen this corollary If A  B P and P  {← A} has a refutation of length n, then A  T P  n. Notation [A]={A‘  B P : A‘=A  for some substitution  }

Steffen Staab Advanced Data Modeling 22 of 19 WeST Completeness of SLD-Resolution  Not treated this year, check out 