LLPAD version 2

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 2): llpad.pl, ref_op.pl. Download both files and put them in the same directory.

For version 1, go to this page.

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 for the heads and for the bodies. The language bias for the heads is specified with a fact of the form head_bias(ListOfAtoms)., where ListOfAtoms is a list of the atoms allowed in the head of clauses. The language bias for the bodies is specified by means of goals of the form :- modeb(PredicateMode) where PredicateMode is of the form p(ModeType,ModeType,...) where ModeType is either:

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.160000 seconds. Generated rules
def_rule(1,[pos(4),[fairheads,fairtails,biasedheads,biasedtails]],(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:-biased)).
rule(6,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0.
5:-fair)).
rule(7,[pos(2),[[(biasedheads,heads)],[(biasedtails,tails)]]],(heads:0.6 or tail
s:0.39999999999999997:-toss,biased)).
rule(8,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0.
5:-toss,fair)).
rule(9,[pos(2),[[(biasedheads,heads)],[(biasedtails,tails)]]],(heads:0.6 or tail
s:0.39999999999999997:-biased,toss)).
rule(10,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0
.5:-fair,toss)).
ListOfSolutions = [[0.0,0.0,0.9999999999999994,0.0,0.0,0.0,0.0,0.0,0.99999999999
99987,0.9999999999999981],[0.0,0.0,0.9999999999999994,0.0,0.0,0.0,0.0,1.0,0.9999
999999999987,0.0],[0.0,0.0,0.9999999999999994,0.0,0.0,0.0,0.9999999999999987,0.0
,0.0,0.9999999999999981],[0.0,0.0,0.9999999999999994,0.0,0.0,0.0,0.9999999999999
987,1.0,0.0,0.0],[0.0,0.0,0.9999999999999994,0.0,0.0,1.0,0.0,0.0,0.9999999999999
987,0.0],[0.0,0.0,0.9999999999999994,0.0,0.0,1.0,0.9999999999999987,0.0,0.0,0.0]
,[0.0,0.0,0.9999999999999994,0.0,0.9999999999999986,0.0,0.0,0.0,0.0,0.9999999999
999981],[0.0,0.0,0.9999999999999994,0.0,0.9999999999999986,0.0,0.0,1.0,0.0,0.0],
[0.0,0.0,0.9999999999999994,0.0,0.9999999999999986,1.0,0.0,0.0,0.0,0.0],[0.99999
99999999994,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.9999999999999987,0.9999999999999981],[
0.9999999999999994,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.9999999999999987,0.0],[0.999999
9999999994,0.0,0.0,0.0,0.0,0.0,0.9999999999999987,0.0,0.0,0.9999999999999981],[0
.9999999999999994,0.0,0.0,0.0,0.0,0.0,0.9999999999999987,1.0,0.0,0.0],[0.9999999
999999994,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.9999999999999987,0.0],[0.999999999999999
4,0.0,0.0,0.0,0.0,1.0,0.9999999999999987,0.0,0.0,0.0],[0.9999999999999994,0.0,0.
0,0.0,0.9999999999999986,0.0,0.0,0.0,0.0,0.9999999999999981],[0.9999999999999994
,0.0,0.0,0.0,0.9999999999999986,0.0,0.0,1.0,0.0,0.0],[0.9999999999999994,0.0,0.0
,0.0,0.9999999999999986,1.0,0.0,0.0,0.0,0.0]],
Variables = [_A,0.0,_B,0.0,_C,_D,_E,_F,_G,_H],
{_B=0.9999999999999994-_A},
{_G=1.0000000000000013-_C-_E},
{_F=0.9999999999999981-_D-_H},
{_A=<1.0},
{_C+_E=<1.0000000000000013},
{_D+_H=<1.0},
{_C>=0.0},
{_A>=0.0},
{_H>=0.0},
{_E>=0.0},
{_D>=0.0} ?

The meaning of rule(N,[pos(M),[[(Int1,Head1),....,(IntJ,HeadJ)],[...],...],Clause) is that rule Clause is assigned number N and it is non trivially true in M interpretations. These interpretations are indicated in the following list. They are subdivided into sublists, each sublist corresponding to an atom in the head. For example, Int1,...,IntJ correspond to the first atom in the head. Headi is the instantiation of 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