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

Unexpected Assertion Error in Aggregation #2486

Open
ryokoCL opened this issue Apr 23, 2024 · 1 comment
Open

Unexpected Assertion Error in Aggregation #2486

ryokoCL opened this issue Apr 23, 2024 · 1 comment

Comments

@ryokoCL
Copy link

ryokoCL commented Apr 23, 2024

The issue arises when I attempt to use a variable from outside the aggregation in a range functor. Here's the minimal reproducible example:

.decl test(res:number) 
test(res) :- x = 1, res = count : { y = range(x, 10)} . 
.output test(IO=stdout)

When executing this, I receive the following error message:
Assertion failed: (alreadyGrounded.find(ungroundedVariableName) != alreadyGrounded.end() && "Error: Unable to ground parameter in materialisation-requiring aggregate body"), function groundInjectedParameters.

Could someone help me understand why this error is occurring, and if there's a workaround or a fix for it?

@ryokoCL
Copy link
Author

ryokoCL commented Apr 24, 2024

I debugged it and found the following comments:

  if (const auto* atom = as<Atom>(lit)) {
      // Right now we only allow things to be grounded by atoms.
      // This is limiting but the case of it being grounded by
      // something else becomes complicated VERY quickly.
      // It may involve pulling in a cascading series of literals like
      // x = y, y = 4. It just seems very painful.
      // remove other unnecessary bloating arguments and replace with an underscore

From my understanding, the current design restricts grounding only to atoms. However, the literal : x=1 cannot be converted into an atom, and therefore, no constraints related to x can be added to the clause.

At the moment, I'm unsure how to approach solving this issue.
Looking forward to suggestions and possible fixes from the community. Thank you for your help!

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