logic-and-learning-lab / Popper

An inductive logic programming system
MIT License
206 stars 36 forks source link

Adding direction to unneccessary predicate seems to cause stopping finding a solution #47

Closed adam-antonik closed 1 year ago

adam-antonik commented 2 years ago

If I have bk edge(1,2). edge(2,3). edge(3,4). edge(5,5). geq(A,B):- nonvar(A), nonvar(B), A >= B.

with bias head_pred(path,2). body_pred(edge,2).

and examples pos(path(1,2)). pos(path(1,3)). pos(path(2,4)). neg(path(1,5)). neg(path(2,5)).

then Popper will find that desired fact that path is the transitive closure of edge. If I add to bias body_pred(gte,2). then it will find something else, due to the small number of example. But if I also add direction(gte,(in,in)). then it will halt straight away, exploring no hypotheses, saying "NO SOLUTION FOUND"

Presumably I'm setting up something wrong here, but I can't see at all what it is.

celinehocquette commented 2 years ago

Popper currently cannot learn with partial directions (#31), if you add the following it should find the same hypothesis:

direction(path,(in,out)).
direction(edge,(in,out)).
adam-antonik commented 2 years ago

Ah, I see. This would probably be a good thing to add to the main readme under "Directions"