Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete query answering for rules with partially grounded atoms in the body #95

Closed
alloka opened this issue Feb 11, 2022 · 0 comments

Comments

@alloka
Copy link

alloka commented Feb 11, 2022

Using Rulewerk Syntax, consider the following example:

We have the following edb facts:
cont(d12).
cont(d6).
cont(d13).
cont(d7).
cont(d3).
cont(d2).
fetch(d11,b11).
fetch(d3,b5).
fetch(d1,b2).
fetch(d11,b12).
fetch(d3,b6).
fetch(d3,b4).
fetch(d1,b1).
fetch(d3,b3).
fetch(d8,b7).
offset(d12).
offset(d15).
offset(d6).
offset(d8).
offset(d2).
putOn(b11,d13).
putOn(b1,d3).
putOn(b5,d8).
putOn(b4,d7).
putOn(b3,d6).
putOn(b11,d12).
putOn(b1,d2).
putOn(b1,d4).
putOn(b11,d14).
putOn(b6,d9).

and the following rules:
buildWall_p(?x1, ?x0,!p) :- inv(?x1, ?x0), offset(?x0).
inv(?x2, ?x1) :- inv(?x2, ?x0), buildWall_p(?x0, ?x1,?p).
inv(?x2, ?x1) :- fetch(?x2, ?x0), putOn(?x0, ?x1), cont(?x1).
iterate(?p) :- buildWall_p(d1,d2,?p).

where any variable with a ? before is a universal variable and the variable with a ! before is an existential variable, d1 and d2 are constants.

Querying buildWall_p we get the following answers:
?x0 -> d11, ?x1 -> d12, ?p -> _:null1_3_0
?x0 -> d3, ?x1 -> d6, ?p -> _:null1_3_1
?x0 -> d1, ?x1 -> d2, ?p -> _:null1_3_2
?x0 -> d1, ?x1 -> d6, ?p -> _:null1_3_3

which means that we have an idb buildWall_p(d1,d2,_:null1_3_2), and that means that the rule with iterate(?p) in the head should fire, but that is not the case as if we query iterate(?p) we don't get an answer.

CerielJacobs added a commit that referenced this issue Feb 11, 2022
@alloka alloka closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant