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

Conditional #demand #17

Open
robsimmons opened this issue Jun 3, 2024 · 0 comments
Open

Conditional #demand #17

robsimmons opened this issue Jun 3, 2024 · 0 comments

Comments

@robsimmons
Copy link
Owner

I don't think there's any value for

#forbid a :- b.

which I think I naturally want to read as "if b, forbid a", but that's the same as #forbid a, b. I guess that's the reading (#forbid a) :- b, whereas #forbid (a :- b) would maybe have more of a "not (not b or a)" which is "b and not a", but THAT can be currently encoded more clearly as #demand b. #forbid a.

However, I do conversely think there's value for

#demand a :- b

which expresses "if b holds in the database, then a better hold as well, or else something has gone wrong. This can't easily be expressed with existing primitives (though maybe it can be indirectly encoded), and it's even more powerful to be able to write e.g.

#demand parent _ is X :- node X.

which is saying "if X is a node, then X must be someone's parent" - that's gonna be a weird constraint to encode directly. These #demand statements are much more like the kind of constraints LogiQL supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant