1 Inductive Logic Programming. Part 2 Based partially on Luc De Raedt’s slides

Slides:



Advertisements
Similar presentations
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
Advertisements

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),
Resolution.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
ILP : Inductive Logic Programming
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.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Inductive Logic Programming: The Problem Specification Given: –Examples: first-order atoms or definite clauses, each labeled positive or negative. –Background.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Inference and Resolution for Problem Solving
2005certain1 Views as Incomplete Databases – Certain & Possible Answers  Views – an incomplete representation  Certain and possible answers  Complexity.
SPASS: Combining Superposition, Sorts and Splitting Christoph Weidenbach Max-Planck-Institute for Computer Science Presented.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Theory and Applications
CSE (c) S. Tanimoto, 2007 Unification 1 Unification Predicate calculus rules are sometimes so general that we need to create specializations of.
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
Predicates and Quantifiers
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
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.
First Order Predicate Logic
CSE S. Tanimoto Horn Clauses and Unification 1 Horn Clauses and Unification Propositional Logic Clauses Resolution Predicate Logic Horn Clauses.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
CSE 636 Data Integration Conjunctive Queries Containment Mappings / Canonical Databases Slides by Jeffrey D. Ullman Fall 2006.
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,
PROLOG SYNTAX AND MEANING Ivan Bratko University of Ljubljana Faculty of Computer and Info. Sc. Ljubljana, Slovenia.
1 IS 2150 / TEL 2810 Introduction to Security James Joshi Associate Professor, SIS Lecture 3 September 15, 2009 Mathematical Review Security Policies.
For Monday Finish chapter 19 No homework. Program 4 Any questions?
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Mathematical Preliminaries
CS 5751 Machine Learning Chapter 10 Learning Sets of Rules1 Learning Sets of Rules Sequential covering algorithms FOIL Induction as the inverse of deduction.
First-Order Logic and Inductive Logic Programming.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
DEDUCTION PRINCIPLES AND STRATEGIES FOR SEMANTIC WEB Chain resolution and its fuzzyfication Dr. Hashim Habiballa University of Ostrava.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
Propositional SAT The search for a model of a given proposition.
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
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.
Chap. 10 Learning Sets of Rules 박성배 서울대학교 컴퓨터공학과.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
1 Introduction to Artificial Intelligence LECTURE 9: Resolution in FOL Theorem Proving in First Order Logic Unification Resolution.
Lecture 9: Resolution in First Order Logic Heshaam Faili University of Tehran Theorem Proving in First Order Logic Unification Resolution.
Review: Discrete Mathematics and Its Applications
Introduction to Logic for Artificial Intelligence Lecture 2
CSE 341, S. Tanimoto Logic Programming -
Horn Clauses and Unification
Logics for Data and Knowledge Representation
Proper Refinement of Datalog Clauses using Primary Keys
Prolog syntax + Unification
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
Soundness of SLD-Resolution
Logics for Data and Knowledge Representation
Sungho Kang Yonsei University
Horn Clauses and Unification
Review: Discrete Mathematics and Its Applications
Horn Clauses and Unification
Horn Clauses and Unification
5.4 T-joins and Postman Problems
Horn Clauses and Unification
Presentation transcript:

1 Inductive Logic Programming. Part 2 Based partially on Luc De Raedt’s slides

Specialisation operations binding of two distinct variables path(X,Y)... There is a path between nodes X and Y in a graph edge(X,Y)... There is an edge between X and Y spec(path(X, Y )) = path(X, X) adding a most general atom into a clause body arguments are distinct and so far unused variables spec(path(X,Y)) = ( path(X,Y) :- edge(U,V) ) = a minimal set of specialisation operations for logic programs without function symbols:

Specialisation operations Logic programs with functions: A minimal set extended with Substitution a variable with a most general term arguments are distinct and so far unused variables spec(number(X)) = number(0) spec(number(X)) = number(s(Y)).

Specialisation and generalisation Domain-dependent operations - examples triangle ≤ n-angle ≤ plannar object town ≤ district ≤ region ≤ country ≤ continent [0,1) ≤ [0,11) ≤ [0,111) ≤ [0,inf)

Specialisation and generalisation A formula F is a specialisation of a formula G iff F entails from G G |= F = each model of G is also a model of F. Specialisation operator assign a formula a set of all its specialisations Generalisation = the other direction

6 G |= F F follows deductively from G G follows inductively from F therefore induction is the inverse of deduction this is an operational point of view because there are many deductive operators |- that implement |= take any deductive operator and invert it and one obtains an inductive operator

7 Resolution father(X,Y) :- male(X) male(adam) father(adam,kain)

8 Inverse resolution Example: Learn a relation father/2 given domain knowledge parent/2 and male/2: male(adam). male(kain). male(abdullah). male(muhammad). male(moses). parent(adam,kain). parent(eve,kain). parent(abdullah,muhammad), and an example father(adam,kain).

9 Inverse resolution father(adam,kain) Example: Learn a relation father/2 given domain knowledge parent/2 and male/2: male(adam). male(kain). male(abdullah). male(muhammad). male(moses). parent(adam,kain). parent(eve,kain). parent(abdullah,muhammad), and an example father(adam,kain).

10 Inverse resolution male(adam) father(adam,kain) Example: Learn a relation father/2 given domain knowledge parent/2 and male/2: male(adam). male(kain). male(abdullah). male(muhammad). male(moses). parent(adam,kain). parent(eve,kain). parent(abdullah,muhammad), and an example father(adam,kain)

11 Inverse resolution ? male(adam) father(adam,kain) Example: Learn a relation father/2 given domain knowledge parent/2 and male/2: male(adam). male(kain). male(abdullah). male(muhammad). male(moses). parent(adam,kain). parent(eve,kain). parent(abdullah,muhammad), and an example father(adam,kain)

12 Inverse resolution father(X,Y) :- male(X) male(adam) father(adam,kain)

13 Inverse resolution ? parent(adam, kain) father(X,Y) :- male(X) male(adam) father(adam,kain)

14 Inverse resolution father(X,Y) :- male(X),parent(X,Y) parent(adam, kain) father(X,Y) :- male(X) male(adam) father(adam,kain)

15 Inverse resolution Given C 1 which is of the form A  B, and resolvent which is of the form B  C, the aim is to find C 2. In propositional logic: 1.Find a literal L that appears in C 1 but not in the resolvent. 2.Then C2 is given by either (Resolvent - (Resolvent  C 1 ))  {¬L} or by (Resolvent - (C 1 - {L}))  {¬L}

16 Inverse resolution 1.Find a literals L 1 in C 1 that is not in the resolvent. Then in C 2 there must be L 2 that L 1  =L 2 . 2.Assume  =  1  2 such that L 1  1 =L 2  2.Then L 2 =  L 1  1  Then C 2 = (Resolvent - (C 1 - {L 1 }  1 ))  2 -1   L 1  1  C 1 is ground =>  1 ={} C 2 = (Resolvent - (C 1 - {L 1 }))  2 -1   L 1  2 -1 father(X,Y) :- male(X) male(adam) father(adam,kain) In predicate logic:

17 Inverse resolution Main drawback nondeterminism father(X,Y) :- male(X) father(X,kain) :- male(X) male(adam) father(adam,kain) :- male(adam) father(adam,kain)

18 Subsumption and  -subsumption Clause G subsumes clause F if and only G |= F or, equivalently G  F Example - propositional logic pos :- p,q,r |= pos :- p,q,r,s,t because {pos, ¬p, ¬q,¬r}  {pos, ¬p, ¬q,¬r, ¬s,¬t}

19 Subsumption in propositional logic pos pos :-p pos :-q pos :-r pos :-p,q pos:- p,r pos :-q,r pos :- p,q,r

20 Subsumption in propositional logic Perfect structure Complete lattice –any two clauses have unique least upper bound (least general generalization) greatest lower bound No syntactic variants Easy specialization, generalization

21 Subsumption in predicate logic Subsumption in logical atoms g subsumes s if and only if there is a substiution  such that g  = s e.g. p(X,Y,X) subsumes p(a,Y,a) e.g. p(f(X),Y) subsumes p(f(a),Y)

22 Subsumption in simple logical atoms P(X,Y,Z) P(a,Y,Z)... P(X,b,Z)... P(X,Y,c) P(a,b,Z) … P(a,Y,c)... P(X,b,c) P(a,b,c)

23 Subsumption in simple logical atoms P(X,Y) P(X,X)... P(a,Y) P(b,Y) … P(X,a) … P(X,b) P(a,a) … P(a,b)... P(b,b)...

24 Subsumption in logical atoms P(X) P(f(Y))... P(g(Y))... P(h(Y,Z))... P(f(f(W)) P(f(g(W))) P(f(f(f(U)))) … P(f(f(f(f(V))))...

25 Subsumption in logical atoms G subsumes F iff there is a substitution  such that G  = F Still nice properties and complete lattice up to variable renaming –p(X,a) and p(U,a) –greatest lower bound = unification –unification p(X,a) and p(b,U) gives p(b,a) –least upper bound = anti-unification = lgg –lgg p(X,a,b) and p(c,a,d) = p(X,a,Y) –lgg p(X,f(X,c)) and p(a,f(a,Y)) gives p(U,f(U,T))

26 Ideal Specialization Operator Ideal Specialization operator : –apply a substitution { X / Y } where X,Y already appear in atom –apply a substitution { X / f(Y1, …, Yn)} where Yi new variables –apply a substitution {X / c } where c is a constant Ideal Generalization operator : –apply an inverse substitution Inverse substitution substitutes terms at specified places by variables Invert one of the specialization steps above –Replace some (but not all) occurences of a variable X by a different variable Y –Replace all terms f(Y1,...,Yn) where Yi are distinct by a new variable X –Replace some occurences of a constant by a new variable

27 Ideal Specialization Operator Properties Ideal specialisation operator must be locally complete globally complete proper

28 Ideal Specialization Operator

29 Optimal Specialization Operator

30 Optimal Specialization Operator

31 Theta-subsumption (Plotkin 70) Most important framework for inductive logic programming. Used by all major ILP systems. F and G are single clauses Combines propositional subsumption and subsumption on logical atoms c1 theta-subsumes c2 if and only if there is a substitution  such that c1   c2 c1 : father(X,Y) :- parent(X,Y),male(X) c2 : father(adam,kain) :- parent(adam,kain), parent(adam,an), male(adam), female(an)  = { X / adam, Y /kain }

32 Example d1 : p(X,Y) :- q(X,Y), q(Y,X) d2 : p(Z,Z) :- q(Z,Z) d3 : p(a,a) :- q(a,a) theta(1,2) : {X / Z, Y /Z} theta(2,3) : {Z/a} d1 is a generalization of d3 Mapping several literals onto one leads (sometimes) to combinatorial problems

33 Properties Soundness : if c1 theta-subsumes c2 then c1 |= c2 Incompleteness (but only for self-recursive clauses) wrt logical entailment –c1 : p(f(X)) :- p(X) –c2 : p(f(f(Y))) :- p(Y) Decidable (but NP-complete) transitive and reflexive but not anti-symmetric