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

Question about @demand("bf") #19

Open
bertram-gil opened this issue Jun 2, 2022 · 1 comment
Open

Question about @demand("bf") #19

bertram-gil opened this issue Jun 2, 2022 · 1 comment

Comments

@bertram-gil
Copy link

Hi,
Consider the following program:

rel path(a, c) = edge(a, c) \/ path(a, b) /\ edge(b, c)
rel a__(a) = path(a, b), not path(a, b)
rel f__(c, e) = path(c, b), d__(c, e), a__(f)
query f__

The above program runs without any problems. But if I add @demand("bf") before path then i get:

@demand("bf")
rel path(a, c) = edge(a, c) \/ path(a, b) /\ edge(b, c)
rel a__(a) = path(a, b), not path(a, b)
rel f__(c, e) = path(c, b), d__(c, e), a__(f)
query f__

[Error] Cannot stratify program: negative cycle detected between predicate `a__` and `path`

But there is no negative path between a__ and path.
Am I doing something wrong? Is this not a valid program if we enable magic transformation?

@Liby99
Copy link
Contributor

Liby99 commented Jun 2, 2022

So on a syntax level there is a negative cycle, but I agree that Scallop could be smarter to detect that the demand on a__ should not be propagated into the demand for path. Let me debug this issue a little more and get back to you.

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

2 participants