eclipse-viatra / org.eclipse.viatra

Main components of the VIATRA framework
https://eclipse.dev/viatra
Eclipse Public License 2.0
0 stars 1 forks source link

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

Open eclipse-viatra-bot opened 3 months ago

eclipse-viatra-bot commented 3 months ago

| --- | --- | | 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