1 / 19

Proper Refinement of Datalog Clauses using Primary Keys

This paper discusses the proper refinement of Datalog clauses using primary keys and its impact on performance and flexibility in Inductive Logic Programming algorithms.

bschrader
Download Presentation

Proper Refinement of Datalog Clauses using Primary Keys

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Proper Refinement of Datalog Clauses using Primary Keys Siegfried Nijssen and Joost N. Kok BNAIC-2003, Nijmegen

  2. Introduction • Inductive Logic Programming algorithm: C: Set of Datalog clauses, initially empty D: Database of facts (Knowledge base) repeat make clauses in C more specific (downward refinement) evaluate C against D 2. 1. BNAIC-2003

  3. Database of Facts g1 g2 • {e(g1,n1,n2,a),e(g1,n2,n1,a),e(g1,n2,n3,a), e(g1,n3,n1,b),e(g1,n3,n4,b),e(g1,n3,n5,c), e(g2,n6,n7,b)} n2 n4 n6 a a b b a n1 n5 n7 b c n3 BNAIC-2003

  4. Clause N4 • k(G)  e(G,N1,N2,a),e(G,N2,N3,a), e(G,N1,N4,a),e(G,N4,N5,b) b N5 a N1 a N3 a N2 BNAIC-2003

  5. ={G/g1,N1/n2,N2/n1,N3/n2,N4/n3,N5/n1} Evaluation of a clause • -subsumption: DC iff there is a substitution , (C)  D • Database D: {e(g1,n1,n2,a),e(g1,n2,n1,a),e(g1,n2,n3,a), e(g1,n3,n1,b),e(g1,n3,n4,b),e(g1,n3,n5,c), e(g2,n6,n7,b)} • Clause C: k(G)  e(G,N1,N2,a),e(G,N2,N3,a), e(G,N1,N4,a),e(G,N4,N5,b) BNAIC-2003

  6. a a a b N4 b N1 N5 a a a N1 a N3 a N3 a b N2 N2 N5 N4 Evaluation of a clause g1 g2 n2 n4 n6 a a b b b a n1 n5 n7 b a n3 BNAIC-2003

  7. N3 a N1 Equivalent a N1 N2 a N2 Evaluation of a clause g1 g2 n2 n4 n6 a a b b b a n1 n5 n7 b a n3 N5 N3 BNAIC-2003

  8. N3 a N1 Equivalent a N1 N2 a N2 Evaluation of a clause k(G)  e(G,N1,N2,a) k(G)  e(G,N1,N2,a), e(G,N1,N3,a) n3 N5 N3 BNAIC-2003

  9. N1 N2 a Evaluation of a clause • OI-subsumption: DC iff there is a substitution , (C)  D, while: •  is injective •  does not map to constants in C N3 a N1 a N2 BNAIC-2003

  10. e(G,N1,N2,a) ,e(G,N2,N1,a) ,e(G,N1,N3,a) a Using M only edge labeled trees can be constructed! b a Clause Refinement - modes + old variable- new variable# constant • User defined Refinement using modes [Progol,Aleph,Warmr,Tilde,Farmer] • T={k(G),e(G,N,N,L)} M={e(+,-,-,#),e(+,+,-,#)} • k(G) BNAIC-2003

  11. Clause Refinement - modes • k(G) e(G,N1,N2,a) k(G) e(G,N1,N2,a),e(G,N1,N3,a) • k(G) e(G,N1,N2,a),e(G,N1,N3,a), e(G,N2,N4,a),e(G,N3,N5,b) • Complete & proper refinement is possible with OI-subsumption, not with -subsumption. a b a a BNAIC-2003

  12. Refinement using Primary Keys • Assume we know: between a pair of nodes there is at most one edge with one label • How to incorporate this knowledge in the refinement operator? • M={e(+,-,-,#),e(+,+,-,#),e(+,+,+,#)} • These modes allow: • k(G)  e(G,N1,N2,a), e(G,N1,N2,b) • k(G)  e(G,N1,N2,a), e(G,N1,N2,L1) • Primary key: {1,2,3} (first 3 arguments of e) BNAIC-2003

  13. Expressiveness OI vs -subsumption a ? b • k(G) e(G,N1,N2,a),e(G,N2,N3,L),e(G,N3,N4,b) • For proper and complete refinement:OIis required • Under OI: L  a, L  b BNAIC-2003

  14. In an ideal situation... • We have complete & proper refinement • We are not required to use OI for all types (weak Object Identity) BNAIC-2003

  15. Proper refinement using Primary Keys • In many cases, this ideal situation exists for refinement using primary keys! • k(G) e(G,N1,N2,a),e(G,N2,N3,L),e(G,N3,N4,b) BNAIC-2003

  16. Proper refinement using Primary Keys • T={k(G),e(G,N,N,L),t(L,C)} M={e(+,-,-,-),e(+,+,-,-),t(+,#)}K(p)={1,2,3} K(t)={1,2}OI={G,N} • k(G) e(G,N1,N2,L1),t(L1,a), e(G,N1,N3,L2),t(L2,a) BNAIC-2003

  17. Proper refinement using Primary Keys • Given predicates, types, modes, primary keys and a partition of types into OI and non-OI • We prove refinement is proper and complete if for every mode there is a primary key which does not include any non-OI output. BNAIC-2003

  18. Conclusions • Higher performance for ILP algorithms • primary keys restrict the search space efficiently • refinement is proper • Higher flexibility • weak OI is more flexible than full OI BNAIC-2003

  19. Clause refinement - other representation better? Background knowledge:a(G,N1,N2)  e(G,N1,N2,a)b(G,N1,N2)  e(G,N1,N2,b)e(G,N1,N2)  e(G,N1,N2,L) • k(G) a(G,N1,N2),e(G,N2,N3),b(G,N3,N4) • k(G) a(G,N1,N2),e(G,N1,N2) BNAIC-2003

More Related