Lecture Notes on Artificial Intelligence - Prolog and Learning | CSE 571, Study notes of Computer Science

Material Type: Notes; Class: Artificial Intelligence; Subject: Computer Science and Engineering; University: Arizona State University - Tempe; Term: Fall 2003;

Typology: Study notes

Pre 2010

Uploaded on 09/02/2009

koofers-user-qvk-1
koofers-user-qvk-1 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE571 ARTIFICL INTELLIGNCE – Fall 2003
5th November 2003 Class Note
Title: PROGOL / Learning AnsProlog – by Luis Tari
What is Progol?
It is a language implementation of “Inductive Logic Programming (ILP)”.
What is ILP?
Given a logic program B representing background knowledge, a set of positive
examples E+, and a set of negative examples E-, find hypothesis H such that
B UH e for every e Î E+.
B UH f for every f Î E-.
B UH is consistent.
Assume that B e for some e Î E+.
Example:
parent_of(charles,george). parent_of(george,diana).
parent_of(bob,harry). parent_of(harry,elizabeth).
grandparent_of(charles,diana).
grandparent_of(bob,elizabeth).
grandparent_of(X,Y) :- parent_of(X,Z), parent_of(Z,Y).
Basic idea is, run a “rule” from examples (Horn clauses).
Progol is developed by Stephen Muggleton et.al. and it is one of the most popular rule-
learning systems for classification and prediction.
Syntax:
To declare the kind of rule we would like to lean… For examples,
:- modeh(1, p(+type,+type))?
:- modeb(1, q(+type,-type))?
:- modeb(1, r(+type,+type))?
B
E+
H
pf3
pf4

Partial preview of the text

Download Lecture Notes on Artificial Intelligence - Prolog and Learning | CSE 571 and more Study notes Computer Science in PDF only on Docsity!

CSE571 ARTIFICL INTELLIGNCE – Fall 2003 5th November 2003 Class Note Title: PROGOL / Learning AnsProlog – by Luis Tari What is Progol? It is a language implementation of “Inductive Logic Programming (ILP)”. What is ILP?

  • Given a logic program B representing background knowledge, a set of positive examples E +, and a set of negative examples E -, find hypothesis H such that - B U H e for every e Î E +. - B U H f for every f Î E -. - B U H is consistent. Assume that B e for some e Î E +. Example: parent_of(charles,george). parent_of(george,diana). parent_of(bob,harry). parent_of(harry,elizabeth). grandparent_of(charles,diana). grandparent_of(bob,elizabeth). grandparent_of(X,Y) :- parent_of(X,Z), parent_of(Z,Y). Basic idea is, run a “rule” from examples (Horn clauses). Progol is developed by Stephen Muggleton et.al. and it is one of the most popular rule- learning systems for classification and prediction. Syntax: To declare the kind of rule we would like to lean… For examples, :- modeh(1, p(+type,+type))? :- modeb(1, q(+type,-type))? :- modeb(1, r(+type,+type))?

B

E+

H

That means we want to learn a rule that has predicate p as the head, and predicates q and r are possible candidates for the body of the rule. “modeh" – to define the head of the hypothesis while “modeb” is to define the literals that should appear in the body of the hypothesis. The first number (in the example is 1) is called “recall.” It shows how many number of solutions you need. You can specify * as “no limit.” “+” and “-“ are used to impose an ordering of predicates in the rule to be learned. (and you can specify “#” as a constant). More Examples: %% Mode declaration :- modeh(1,p(+v,+v))? :- modeb(1,q(+v,-v))? :- modeb(1,r(+v,+v))? %% Background knowledge v(a). v(b). v(c). v(d). v(e). v(f). v(g). v(h). v(i). %% Positive examples p(a,d). q(a,g). r(g,d). p(b,e). q(b,h). r(h,e). p(c,f). q(c,i). r(i,f). %% Negative examples :- p(a,g). :- p(g,d). :- p(a,e). :- p(b,f).

Learning AnsProlog Rules Drawbacks of Progol was:

  • Cannot learn rules with classical negation, or negation as failure.
  • Cannot learn from programs with multiple models. How to solve the problem? Learning from Positive Examples B = { bird(X) :- penguin(X). bird(tweety). penguin(polly). } E = { flies(tweety).}
  1. Let the current example posEx = { flies ( tweety ).}.
  2. Lit = { penguin ( tweety ), penguin ( polly ), bird ( tweety ), bird ( polly ), flies ( tweety ), flies ( polly )}.
  3. S = { penguin ( polly ), bird ( tweety ), bird ( polly )}.
  4. S + = { penguin ( polly ), bird ( tweety ), bird ( polly ), not penguin ( tweety ), not flies ( tweety ), not flies ( polly )}.
  5. Rel = { not flies ( tweety ), bird ( tweety ), not penguin ( tweety )}.
  6. ¬ G = ¬ not flies ( tweety ), bird ( tweety ), not penguin ( tweety ).
  7. R = flies ( tweety ) ¬ bird ( tweety ), not penguin ( tweety ).
  8. q = A / tweety. SH = flies ( A ) ¬ bird ( A ), not penguin ( A ). Class hour is ended at this point. (Rest of topic is “Learning from Negative example” and “Learning Enumeration Rules.”