Presentation is loading. Please wait.

Presentation is loading. Please wait.

NMR98 - Logic Programming1 Learning with Extended Logic Programs Evelina Lamma (1), Fabrizio Riguzzi (1), Luís Moniz Pereira (2) (1)DEIS, University of.

Similar presentations


Presentation on theme: "NMR98 - Logic Programming1 Learning with Extended Logic Programs Evelina Lamma (1), Fabrizio Riguzzi (1), Luís Moniz Pereira (2) (1)DEIS, University of."— Presentation transcript:

1 NMR98 - Logic Programming1 Learning with Extended Logic Programs Evelina Lamma (1), Fabrizio Riguzzi (1), Luís Moniz Pereira (2) (1)DEIS, University of Bologna, Italy (2)CENTRIA, Departamento de Informática Universidade Nova de Lisboa, Portugal

2 NMR98 - Logic Programming2 Summary Concept learning in a 3-valued setting Consider positive and negative examples as instances of two disjoint classes Learn a definition for both the target concept and its opposite Extended Logic Programs under WSFX Default negation to handle exceptions, and inconsistencies

3 NMR98 - Logic Programming3 2-valued vs 3-valued setting Explicit definition of the negated concept (De Raedt, Bruynooghe 1990) Requires the adoption of a more expressible class of programs + + + ++ + ++ - -- - --- - + + + ++ + ++ - -- - --- - + + + ++ + ++ - -- - --- - a c b

4 NMR98 - Logic Programming4 Learning ELP Useful in partially known domains Extend Inductive Logic Programming framework to the case of ELP Learn a definition for concept p using E +, E - as training set Learn a definition for concept  p using E -, E + as training set

5 NMR98 - Logic Programming5 The new ILP problem Given –a set P of possible ELP programs (bias) –a set E + of positive examples –a set E - of negative examples –a consistent extended logic program  (the background knowledge) Find an ELP, P  P such that P   E +,  E - (completeness) P  E -,  E + (consistency)

6 NMR98 - Logic Programming6 Intersection of definitions E+E+ E-E- p-p- p+p+ Exceptions to the positive definition: negative atoms Exceptions to the negative definition: positive atoms Unseen atoms

7 NMR98 - Logic Programming7 Unseen atoms Unseen atoms are classified as unknown p(X)  p + (X), not  p(X).  p(X)  p - (X), not p(X). unless the concept is true and its opposite undefined: p(X)  p + (X), undefined(  p(X)).  p(X)  p - (X), undefined(p(X)).

8 NMR98 - Logic Programming8 Training set atoms They must be classified according to the training set Default literals, representing non- abnormality conditions, added to rules p(X)  p + (X), not ab p (X), not  p(X).  p(X)  p - (X), not ab  p (X), not p(X).

9 NMR98 - Logic Programming9 Example B: bird(a).has_wings(a). jet(b).has_wings(b). angel(c).has_wings(c). has_limbs(c). penguin(d).has_wings(d). has_limbs(d). dog(e).has_limbs(e). cat(f).has_limbs(f). E + = {flies(a)} E - = {flies(d), flies(e)}

10 NMR98 - Logic Programming10 flies + E+E+ abcf de flies - E-E-

11 NMR98 - Logic Programming11 flies + (X)  has_wings(X). flies - (X)  has_limbs(X). flies(X)  flies + (X),not ab flies+ (X),not  flies(X).  flies(X)  flies - (X), not flies(X). ab flies+ (d). flies(X)  flies + (X), undefined(  flies(X)).  flies(X)  flies - (X), undefined(flies(X)). Generalizing exceptions, we obtain: ab flies+ (X)  penguin(X).

12 NMR98 - Logic Programming12 The Learning Algorithm Input: E +, E -, B Output: H, learned theory –LearnHierarchy(E +, E -, B; H p ) LearnHierarchy(E -, E +, B; H  p ) –Obtain H by transforming H p and H  p into non- deterministic rules and adding clauses for undefined case Coverage of examples through SLX interpreter (Alferes, Damásio, Pereira, 1994)

13 NMR98 - Logic Programming13 LearnHierarchy Input: E +, E -, B Output: H, learned theory –Learn (E +, E -, B; H p ) –H= H p –For each r  H p : if some negative example p(t) is covered, specialize r through a default literal not ab r (t) Learn a definition for ab r (LearnHierarchy) and add it to H

14 NMR98 - Logic Programming14 Example B:penguin(1).penguin(2). bird(3).bird(4).bird(5). bird(X)  penguin(X). animal(6). animal(7). animal(8). animal(9). animal(10). animal(11). animal(12). animal(X)  bird(X). E + ={flies(3),flies(4),flies(5)} E - ={flies(1), flies(2), flies(6), flies(7), flies(8), flies(9),flies(10),flies(11),flies(12)}

15 NMR98 - Logic Programming15 Procedure Learn generates: (1) flies(X)  bird(X). covers E - 1 ={flies(1),flies(2)} (2) flies(X)  bird(X), not ab 2 (X). Learning a definition for exceptions: E + ={ab 2 (1),ab 2 (2)} E - ={ab 2 (3), ab 2 (4), ab 2 (5)} (3) ab 2 (X)  penguin(X). (consistent)

16 NMR98 - Logic Programming16 Learning the negative concept: (4)  flies(X)  animal(X). covers E - 4 ={flies(3),flies(4),flies(5)} (5)  flies(X)  animal(X),not ab 5 (X). Learning a definition for exceptions: E + ={ab 5 (3),ab 5 (4),ab 5 (5)} E - ={ab 5 (1),ab 5 (2),ab 5 (6),ab 5 (7),ab 5 (8),ab 5 (9),ab 5 (10), ab 5 (11),ab 5 (12)} (6) ab 5 (X)  bird(X). covers E - 7 ={ab 5 (1),ab 5 (2)}

17 NMR98 - Logic Programming17 (7) ab 5 (X)  bird(X), not ab 7 (X). Learning a definition for exceptions: E + ={ab 7 (1),ab 7 (2)} E - ={ab 7 (3),ab 7 (4),ab 7 (5)} (8) ab 7 (X)  penguin(X). The algorithm terminates by making the clauses for flies and  flies non-deterministic and by adding the clauses for the undefined case

18 NMR98 - Logic Programming18 Related work LELP (Inoue, Kudoh, 1997) relies on answer-set semantics –bottom-up approach, only –redundant clauses, in some cases We can choose whether to learn Least General Solution or Most General Solution for a concept

19 NMR98 - Logic Programming19 Least General vs Most General Solutions Bottom-up methods search the space of clauses specific to general –RLGG, Inverse Resolution, Inverse Entailment –GOLEM Top-down methods search the space of clauses general to specific –FOIL, Progol

20 NMR98 - Logic Programming20 LGS, MGS: Example B: bird(a).animal(a). cat(b).animal(b). E + = {flies(a)} E - = {flies(b)} flies + MGS (X)  bird(X). flies + LGS (X)  bird(X),animal(X). flies - MGS (X)  cat(X). flies - LGS (X)  cat(X),animal(X).

21 NMR98 - Logic Programming21 Example: Mixing LGS, MGS Concept about who is likely to attack one person, (maximize the concept and minimize its opposite) attacker1(X)  attacker + MGS (X), not  attacker1(X).  attacker1(X)  attacker - LGS (X), not attacker1(X). Concept about beggars (one wants to give money strictly to those appearing to need it - minimize the concept and maximize its opposite) beggar1(X)  beggar + LGS (X), not  beggar1(X).  beggar1(X)  beggar - MGS (X), not beggar1(X).

22 NMR98 - Logic Programming22 However, rejected beggars, may turn into attackers (maximize the concept and minimize its opposite) beggar2(X)  beggar + MGS (X), not  beggar2(X).  beggar2(X)  beggar - LGS (X), not beggar2(X). Concepts can be used in order to minimize the risk when carrying a lot of money run  lot_of_money, attacker1(X), not beggar2(X).  run  give_money. give_money  beggar1(X). give_money  attacker1(X), not beggar2(X).

23 NMR98 - Logic Programming23 n disjoint classes p 1 (X)  p 1 + (X),not ab p1+ (X),not p 2 (X),…, not p n (X). p 2 (X)  p 2 + (X),not ab p2+ (X),not p 1 (X),…, not p n (X). … p n (X)  p n + (X),not ab pn+ (X),not p 1 (X),…,not p n-1 (X). p 1 (X)  p 1 + (X), undef(p 2 (X)),…, undef(p n (X)). … p n (X)  p n + (X), undef(p 1 (X)),…, undef(p n-1 (X)).

24 NMR98 - Logic Programming24 Future Work System able to learn ELP, with various approaches in learning Implementation under development Integration with abductive reasoning in order to guess new examples and cope with exceptions (Lamma, Mello,Milano, Riguzzi, 1997) Extension to the case of multi-predicate learning Revision of theories in form of ELP


Download ppt "NMR98 - Logic Programming1 Learning with Extended Logic Programs Evelina Lamma (1), Fabrizio Riguzzi (1), Luís Moniz Pereira (2) (1)DEIS, University of."

Similar presentations


Ads by Google