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:
LLPAD can be dowloaded from here (version 3): llpad.pl, ref_op.pl. Download both files and put them in the same directory.
For version 2, go to this page.
For version 1, go to this page.
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 number of 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 a number of facts of the form determination(h,b), where h is the first atom of one of the ListOfAtoms of head_bias and b is an atom. Such a fact states that atom b can appear in the body of clauses whose head is a subset of ListOfAtoms.
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,Program).
At the end of the execution the set of rules found is printed on the screen, the variable Variables contains a list of the values of variables associated to the various clauses and Program contains the generalized program. For example, the output of the coin example is
| ?- i(coin,Variables,Program).
% consulting e:/fabrizio/codice/lpad/learning/coin.l...
% consulted e:/fabrizio/codice/lpad/learning/coin.l in module user, 0 msec 1048
bytes
Execution time 0.170000 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),[[(biasedtails,biased)],[(fairtails,fair)]]],(biased:0.0816326530
612245 or fair:0.9183673469387755:-tails)).
rule(8,[pos(2),[[(biasedheads,heads)],[(biasedtails,tails)]]],(heads:0.6 or
tail
s:0.39999999999999997:-toss,biased)).
rule(9,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0.
5:-toss,fair)).
rule(10,[pos(2),[[(biasedtails,biased)],[(fairtails,fair)]]],(biased:0.081632653
0612245 or fair:0.9183673469387755:-toss,tails)).
rule(11,[pos(2),[[(biasedheads,heads)],[(biasedtails,tails)]]],(heads:0.6 or
tai
ls:0.39999999999999997:-biased,toss)).
rule(12,[pos(2),[[(fairheads,heads)],[(fairtails,tails)]]],(heads:0.5 or tails:0
.5:-fair,toss)).
rule(13,[pos(2),[[(biasedtails,biased)],[(fairtails,fair)]]],(biased:0.081632653
0612245 or fair:0.9183673469387755:-tails,toss)).
biased:0.1 or fair:0.9:-toss.
heads:0.6 or tails:0.39999999999999997:-biased,toss.
heads:0.5 or tails:0.5:-fair,toss.
Program = [(biased:0.1 or fair:0.9:-toss),(heads:0.6 or tails:0.39999999999999997:-bia
sed,toss),(heads:0.5 or tails:0.5:-fair,toss)],
Variables = [0.0,0.0,0.9999999999999994,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.9999999999999987,0
.9999999999999981,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.
After the rule(N,[pos(M),[[(Int1,Head1),....,(IntJ,HeadJ)],[...],...],Clause) facts, the generalized program is shown, one clause at a line. The generalized program is also returned in variable Program. In variable Variables LLPAD returns the assignment of variables, each position corresponding to the rule with that position as number.
In this example, rules 1, 2, 4, 5, 6, 7, 8 and 9 are absent and rules 3, 11 and 12 are present.
The system also writes on the file filestem.out all the generated rules. For example, here is coin.out.
Other examples are:
[1] J. Vennekens, S. Verbaeten, and M. Bruynooghe. Logic programs with annotated disjunctions. In The 20th International Conference on Logic Programming (ICLP04), 2004