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

Recursion + aggregation gives incorrect results (should work with default algo?) #133

Open
eclipse-viatra-bot opened this issue Mar 12, 2024 · 0 comments
Labels
bug Something isn't working bugzilla Issues migrated from Eclipse bugzilla. Query Issues related to the query component of VIATRA, including runtime or pattern language issues.

Comments

@eclipse-viatra-bot
Copy link

| --- | --- |
| Bugzilla Link | 576122 |
| Status | NEW |
| Importance | P3 normal |
| Reported | Sep 20, 2021 13:18 EDT |
| Modified | Sep 20, 2021 13:18 EDT |
| Version | 2.6.0 |
| Reporter | Gabor Bergmann |

Description

private incremental pattern owner(
a,b
) {
a == 1; b==2;
} or {
a == 2; b==3;
} or {
a == 3; b==5;
} or {
a == 4; b==5;
} or {
a == 6; b==9;
} or {
a == 7; b==9;
} or {
a == 8; b==9;
} or {
a == 5; b==10;
} or {
a == 9; b==10;
}

incremental pattern structureRollup(\
  owner, element, totalContents: java Integer
) { \
  find owner(element, owner); \
  totalContentsExceptSelf == sum find structureRollup(element, _, #);\
  totalContents == eval(1 + totalContentsExceptSelf);\
}

OBSERVED:

owner element totalContents
3 2 2
3 2 1
9 6 1
10 9 4
5 3 2
10 9 1
10 5 5
10 5 1
10 5 3
9 8 1
9 7 1
10 5 9
5 3 4
5 4 1
5 3 1
2 1 1

EXPECTED:

owner element totalContents
10 9 4
10 5 5
9 8 1
9 7 1
9 6 1
5 4 1
5 3 3
3 2 2
2 1 1

@eclipse-viatra-bot eclipse-viatra-bot added bugzilla Issues migrated from Eclipse bugzilla. legacy Query Issues related to the query component of VIATRA, including runtime or pattern language issues. labels Mar 12, 2024
@ujhelyiz ujhelyiz removed the legacy label Mar 25, 2024
@ujhelyiz ujhelyiz added the bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bugzilla Issues migrated from Eclipse bugzilla. Query Issues related to the query component of VIATRA, including runtime or pattern language issues.
Projects
None yet
Development

No branches or pull requests

2 participants