karmaresearch / vlog

Apache License 2.0
55 stars 9 forks source link

Missing derivations in VLog #58

Closed mkroetzsch closed 4 years ago

mkroetzsch commented 4 years ago

On a specific input, I am missing a derivation from VLog. The input KB in Rulewerk syntax is:

TRIPLE(i1, first, element1) .
TRIPLE(i1, rest, i2) .
TRIPLE(i2, first, element2) .
TRIPLE(i2, rest, nil) .
TRIPLE(c, intersectionOf, i1) .

element(?L, ?E) :- TRIPLE(?L, first, ?E) .
next(?L1, ?L2) :- TRIPLE(?L1, rest, ?L2), element(?L2, ?E) .
List(?Y), hasList(?X, ?Y) :- TRIPLE(?X, intersectionOf, ?Y) .
List(?Z) :- List(?Y), next(?Y, ?Z) .

This should derive List(i1) and List(i2), but only List(i1) is derived. If I change the order of rules or facts, or if I remove the "hasList" head atom, it works correctly. I believe that this is a VLog bug, since the query results and the query result count reported by VLog agree, so I do not have any indication that Rulewerk could somehow cause this. The full list of inferred facts, as queries through Rulewerk, is:

hasList(c, i1) .
next(i1, i2) .
TRIPLE(i1, first, element1) .
TRIPLE(i1, rest, i2) .
TRIPLE(i2, first, element2) .
TRIPLE(i2, rest, nil) .
TRIPLE(c, intersectionOf, i1) .
element(i1, element1) .
element(i2, element2) .
List(i1) .
CerielJacobs commented 4 years ago

Fixed by fixing issue #59 .