Aleph Practice (based on a workshop from University of Melbourne)

This workshop aims to give you a very high level introduction to the Inductive Logic Programming (ILP) system Aleph.

Brief Overview of Aleph

Inductive Logic Programming (ILP) is a machine learning technique which aims at constructing a Hypothesis (H) to explain some Examples (E), typically making use of some existing Background Knowledge (B). All of H, B and E are represented as logic programs. The idea is to come up with H given B and E such that B ^ H |= E.

Hypothesis construction is the core of any ILP system and, unsurprisingly, there are many different techniques for constructing hypotheses, including Inverse Resolution (IR), Relative Least General Generalisations (RLGG), Inverse Implication (II), and Inverse Entailment (IE). A good introduction to various ILP techniques is here.

Aleph is the latest implementation of the Inverse Entailment algorithm. It has also incorporated features from many of its predecessors based on other techniques. Aleph is implemented in Prolog and can be run in YAP or SWI prolog (for now, my suggestion is to use SWI prolog and comment the yap_flag predicate in the beginning of the Aleph prolog file). -->

Aleph takes 3 files as input: one defining the background knowledge (with an extension .b), one defining the positive examples (.f) and one defining the negative examples (.n), as in family1.b, family1.f and family1.n which will be used for the first exercise of this practical class.

Exercise 1:

The sample files (family1.b, family1.f and family1.n) contain as background knowledge some basic definitions of family relationships, such as father/2 and mother/2. There is no definition for parent/2. However, there are positive and negative examples provided for parent/2. We would like Aleph to come up with the definition for parent/2.

  1. Copy Aleph (aleph.pl) and the sample files into your working directory.
  2. Start the Prolog interpreter (e.g. by typing 'yap' or 'swipl' in UNIX).
  3. Load Aleph by typing

    :- ['aleph.pl'].

  4. Tell Aleph to read in the sample files by typing

    :- read_all(family1).

    This loads all 3 files into Aleph.

  5. Ask Aleph to induce the definition for 'parent' by typing

:- induce.

Task:

  1. At this stage, Aleph displays the 'theory' (the hypothesis) constructed by its inductive algorithm at the bottom of a very lengthy output. It also outputs a trace showing how it constructs this theory as well as some statistics on how many positive/negative examples the theory covers. Take a close look at the output and try to understand it.
  2. Take a look at the source files, especially the file containing the background knowledge (i.e. family1.b). Again, try to understand it because you will need to extend it in the next exercise.
  3. You will find the --> Aleph Manual very useful while you are exploring deeply into the source files.

Exercise 2:

In the previous exercise, Aleph successfully constructed the definition for parent/2 as:

parent(A, B) :- father(A, B).
parent(A, B) :- mother(A, B).

In this exercise, your task is to provide Aleph with some examples (positive and negative) and ask it to come up with a definition for grandparent/2.

Hint: You don't need to modify or add any new background knowledge. Just modify the type declaration section and the files containing the examples.

What does Aleph give you as the definition for grandparent/2? Is the definition what you expect? Is it actually correct? Think about what correctness means for an inductive task.

Don't give up too quickly, but a possible answer is available in (family2.b, family2.f and family2.n).