-
Notifications
You must be signed in to change notification settings - Fork 12
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
BUG: parseAtom does not preserve variable names #11
Comments
It's because in
the two X must be different. see http://graphik-team.github.io/graal/doc/dlgp |
I see. Followup question: What is the use case of parsing an atom with variables if the names are not kept? And why does parseRule preserve the variable names? |
It just asserts that there exists X such as p(X). But, in practice with Graal we usually put all facts in a same AtomSet so we can't assert that there exists X such as p(X) and q(X) which is more specific. So it's why the Graal's dlgp parser rewrites variable names to get "there exists IO, I1 such as p(I0), p(I1)" which is logically equivalent to (there exists X such as p(X)) and (there exists X such as p(X)). To rules and queries, variable names remain local in Graal so no need to rewrite. However, it's true that we should provide a way to disable this behavior. |
I am working on importing Graal into VLog4J. While I am uncertain what the use case for Atoms with Variables is (if one wanted to use them in rules, one would simply create a rule via the parser), it is possible someone will do this. In that case, I want to be able to provide comprehensive documentation explaining what is happening. |
When parsing the Atom "predicate(X)" with DlgpParser.parseAtom, the result is "predicate\1(I0)". I would expect it to be "predicate\1(X)". Is there a reason why the variable name is ignored, or is this a bug?
The text was updated successfully, but these errors were encountered: