LLPAD version 1

A System for Learning Logic Programs with Annotated Disjunctions


LLPAD (Learning LPADs) is a system for learning Logic Programs with Annotated Disjunctions (LPADs)

The following paper provides a description of the main ideas behind the system:

Obtaining LLPAD:

LLPAD can be dowloaded from here (version 1): llpad_v1.pl.

Instructions of Use:

To run the system you have to prepare two input files, filestem.kb and filestem.l.

The .kb filecontains the example interpretations in the format of Claudien and ICL. The only difference is that in each interpretation there is an extra atom prob(X). where X is the probability of the interpretation. The .kb file for the coin example in [1] is here: coin.kb.

The .l file contains the language bias in the format of a set of facts for a bias/3 predicate. The first argument of bias/3 is a list of literals allowed in the head of clauses. The second argument is a list of all the variables appearing in the clause and the third argument is a list of literals allowed in the body of clauses. The .l file for the coin example in [1] is here: coin.l.

To execute the system on the filestem files you must first load llpad.pl into Sicstus Prolog:

| ?- [llpad].

then you run the system by typing

| ?- i(filestem,Variables,ListOfSolutions).

At the end of the execution the set of rules found is printed on the screen, the variable Variables contains a list of the CLP variables associated to the various clauses and ListOfSolutions contains all possible instantiation of the variables that are consistent with the constraints. The system also shows the constraints still pending on the variables. The variables in Variables refer to the clauses in order of appearance. For example, the output of the coin example is

| ?- i(coin,Variables,ListOfSolutions).
Execution time 0.090000 seconds. Generated rules
def_rule(1,[pos(4),[(fairheads,toss),(fairtails,toss),(biasedheads,toss),(biased
tails,toss)]],(toss:-true)).
rule(1,[pos(4),[[(biasedheads,biased),(biasedtails,biased)],[(fairheads,fair),(f
airtails,fair)]]],(biased:0.1 or fair:0.9:-true)).
rule(2,[pos(4),[[(fairheads,heads),(biasedheads,heads)],[(fairtails,tails),(bias
edtails,tails)]]],(heads:0.51 or tails:0.49:-true)).
rule(3,[pos(4),[[(biasedheads,biased),(biasedtails,biased)],[(fairheads,fair),(f
airtails,fair)]]],(biased:0.1 or fair:0.9:-toss)).
rule(4,[pos(4),[[(fairheads,heads),(biasedheads,heads)],[(fairtails,tails),(bias
edtails,tails)]]],(heads:0.51 or tails:0.49:-toss)).
rule(5,[pos(2),[[(biasedheads,heads)],[(biasedtails,tails)]]],(heads:0.6 or tail
s:0.39999999999999997:-toss,biased)).
rule(6,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0.
5:-toss,fair)).
rule(7,[pos(2),[[(biasedheads,heads)],[(biasedtails,tails)]]],(heads:0.6 or tail
s:0.39999999999999997:-biased)).
rule(8,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0.
5:-fair)).
ListOfSolutions = [[0.0,0.0,0.9999999999999869,0.0,0.0,0.0,1.0000000000000595,1.
0],[0.0,0.0,0.9999999999999869,0.0,0.0,1.0,1.0000000000000595,0.0],[0.0,0.0,0.99
99999999999869,0.0,1.0,0.0,0.0,1.0],[0.0,0.0,0.9999999999999869,0.0,1.0,1.0,0.0,
0.0],[1.0,0.0,0.0,0.0,0.0,0.0,1.0000000000000595,1.0],[1.0,0.0,0.0,0.0,0.0,1.0,1
.0000000000000595,0.0],[1.0,0.0,0.0,0.0,1.0,0.0,0.0,1.0],[1.0,0.0,0.0,0.0,1.0,1.
0,0.0,0.0]],
Variables = [_A,0.0,_B,0.0,_C,_D,_E,_F],
{_B=0.9999999999999869-_A},
{_F=1.0-_D},
{_E=1.0000000000000595-_C},
{_A=<0.9999999999999869},
{_D=<1.0},
{_C=<1.0},
{_A>=0.0},
{_D>=0.0},
{_C>=0.0} ?

The meaning of rule(N,[pos(M),[(Int1,Head1),....,(IntM,HeadM)],Clause) is that rule Clause is assigned number N, it is non trivially true in M interpretations and these interpretations are Int1,...,IntM. Headi is the head of the clause that is true in interpretation Inti. def_rule/3 is the analogous for definite clauses.

In this example, rule 1 is assigned variable _A, rule 2 is absent from any solution, rule 3 is assigned variable _B, rule 4 is absent from any solution and so on. From the first constraint we can say that rule 4 is present if rule 1 is absent and viceversa, and so on.

The system also writes on the file filestem.out all the generated rules. For example, here is coin.out.

References

[1] J. Vennekens, S. Verbaeten, and M. Bruynooghe. Logic programs with annotated disjunctions. In The 20th International Conference on Logic Programming (ICLP04), 2004