Hello,
Thank you for making such nice work, which I think will benefit my research a lot. When playing with the software, I found something strange. I am running a toy problem of identifying root causes.
Here is my bk.pl
type_of(u1, ut1).
type_of(u2, ut1).
type_of(u3, ut2).
at_state(amf, ns1).
at_state(smf, ns1).
at_state(nrf, ns1).
at_state(ausf, ns2).
at_state(bsf, ns2).
has_user(c1, u1).
has_user(c2, u1).
has_user(c3, u2).
has_user(c4, u3).
has_user(c5, u3).
has_user(c6, u3).
calls_nf(c1, amf).
calls_nf(c2, amf).
calls_nf(c3, nrf).
calls_nf(c4, ausf).
calls_nf(c5, ausf).
calls_nf(c6, bsf).
and my exs.pl
pos(rootcause(c1, r1)).
pos(rootcause(c2, r1)).
pos(rootcause(c3, r1)).
pos(rootcause(c4, r2)).
pos(rootcause(c5, r2)).
pos(rootcause(c6, r2)).
If I impose such bias
head_pred(rootcause,2).
magic_value(rootcause, 1).
body_pred(has_user, 2).
body_pred(type_of, 2).
magic_value(type_of, 1).
It can successfully find the rules
$python ./magicpopper/popper.py ./magicpopper/examples/rca
********** SOLUTION **********
Precision:1.00 Recall:1.00 TP:6 FN:0 TN:0 FP:0 Size:6
rootcause(A,r1):- has_user(A,D),type_of(D,ut1).
rootcause(A,r2):- type_of(D,ut2),has_user(A,D).
******************************
Or if I use another set of bias
head_pred(rootcause,2).
magic_value(rootcause, 1).
body_pred(calls_nf, 2).
body_pred(at_state, 2).
magic_value(at_state, 1).
It can also successfully find the rules
$python ./magicpopper/popper.py ./magicpopper/examples/rca
********** SOLUTION **********
Precision:1.00 Recall:1.00 TP:6 FN:0 TN:0 FP:0 Size:6
rootcause(A,r1):- calls_nf(A,C),at_state(C,ns1).
rootcause(A,r2):- at_state(C,ns2),calls_nf(A,C).
******************************
However, when I put the 2 sets of bias together, hoping that it can induce both set of rules
head_pred(rootcause,2).
magic_value(rootcause, 1).
body_pred(has_user, 2).
body_pred(type_of, 2).
magic_value(type_of, 1).
body_pred(calls_nf, 2).
body_pred(at_state, 2).
magic_value(at_state, 1).
:-
body_literal(Rule1,Q,_,_),
body_literal(Rule2,Q,_,_),
Rule1 != Rule2.
The program runs forever. Does any one know what was going wrong?
OS: ubuntu 20.04
Python: 3.9.7
Prolog: SWI-Prolog (threaded, 64 bits, version 8.5.15-97-g5c7d1f835)
Any comments will be appreciated.