eMoflon / emoflon-ibex

Shared, eMoflon-specific component for incremental unidirectional and bidirectional graph transformations
GNU General Public License v3.0
12 stars 4 forks source link

Tests failing due to "Join Failed Exception" #150

Closed FStolte closed 7 years ago

FStolte commented 7 years ago

Hi Greg,

I am currently getting unexpected matches for a negative pattern invocation of one of my patterns. My first guess would be that those matches are not injective, although i want them to be. Can you please tell me how I can control whether a pattern should be matched injectively or not?

Thanks, Florian

gervarro commented 7 years ago

Hi Florian,

specify manually (or in a generated manner) unequal constraints (from the relational package) for the variables that have to be injectively mapped (typically the variables with compatible types).

Best regards, Greg

FStolte commented 7 years ago

Thanks, that's just what I needed.

When I created a first minimal example using the unequal constraint, I ran into the following NullPointerException:

Exception in thread "main" java.lang.RuntimeException
    at org.gervarro.democles.interpreter.incremental.rete.RetePatternMatcherModule.performIncrementalUpdates(RetePatternMatcherModule.java:117)
    at org.emoflon.ibex.tgg.operational.util.DemoclesHelper.updateMatches(DemoclesHelper.java:460)
    at org.emoflon.ibex.tgg.operational.OperationalStrategy.run(OperationalStrategy.java:172)
    at org.emoflon.ibex.tgg.operational.strategies.gen.MODELGEN.run(MODELGEN.java:103)
    at org.emoflon.ibex.tgg.run.MODELGEN_App.main(MODELGEN_App.java:52)
Caused by: java.lang.NullPointerException
    at org.gervarro.util.index.CompoundIndex.remove(CompoundIndex.java:58)
    at org.gervarro.democles.runtime.indexer.UnfilteredIndexer.remove(UnfilteredIndexer.java:128)
    at org.gervarro.democles.runtime.Indexer.handleEvent(Indexer.java:43)
    at org.gervarro.democles.event.MatchEventSource.deliverEvent(MatchEventSource.java:56)
    at org.gervarro.democles.event.MatchEventSource.sendEvent(MatchEventSource.java:62)
    at org.gervarro.democles.runtime.BidirectionalAntiJoinOperation.handleChangeOnNegativeSide(BidirectionalAntiJoinOperation.java:72)
    at org.gervarro.democles.runtime.BidirectionalAntiJoinOperation.execute(BidirectionalAntiJoinOperation.java:66)
    at org.gervarro.democles.runtime.EventHandlingTask.perform(EventHandlingTask.java:37)
    at org.gervarro.democles.common.runtime.Session.run(Session.java:34)
    at org.gervarro.democles.runtime.IncrementalUpdateSession.call(IncrementalUpdateSession.java:176)
    at org.gervarro.democles.interpreter.incremental.rete.RetePatternMatcherModule.performIncrementalUpdates(RetePatternMatcherModule.java:115)
    ... 4 more

It seems that during a DELETE event for the pattern containing the unequal constraint, the entry variable in CompoundIndex.remove() is null. Attached are the patterns for which I get the exception. The FatherToMaleRule__CONSTRAINT pattern is the one with the unequal constraint.

patterns.zip

gervarro commented 7 years ago

Hi Florian,

could you please send me some models as well, for which the exception is thrown?

@anthonyanjorin Btw. I also found the (one) reason for the join failed exception. I am now working on that fix as well.

Best regards, Greg

FStolte commented 7 years ago

Hi Greg,

While trying to create models for you, I found out that this exception is not even related to the unequal constraint. I have a new set of patterns (and models) for you that do not contain any unequal constraints. Still, the exception occurs most of the time (though not always) for these simple models.

patternsAndModels.zip

Best regards, Florian

FStolte commented 7 years ago

We were now able to eliminate one case where the exception occurs, so the above models are not relevant anymore.

However, I found another example where the exception seems to occur consistently. Patterns and Models are below.

patternsAndModels.zip

Thanks, Florian

gervarro commented 7 years ago

Hi,

@FStolte, @anthonyanjorin: Sorry for the delay. I did not forget about this issue, but the simplest bug fix was not sufficient, and I had to rearrange some pattern invocation code as part of a somewhat larger change, which might be related to #167 as well. I am going to test the new solution, and hopefully upload the fixed code next week.

Bests, Greg

anthonyanjorin commented 7 years ago

Hi Greg,

great to hear that a fix is coming soon :)

Please remember that we now have tests that you should be able to very easily run (if not complain and we'll try to further simplify the process).

Taken from one of my emails:

  1. Democles installieren (bzw. im Dev-Workspace haben)
  2. Xtext/Xtend installieren
  3. Diese PSF-Datei im Workspace importieren: https://github.com/eMoflon/emoflon-ibex/blob/master/org.emoflon.ibex.tgg.workspace_configuration/testProjectSet.psf
  4. Die Projekte enthalten JUnit-Tests, die du einfach per Rechts-Click auf dem jeweiligen Projekt laufen lassen kannst.

Cheers and thanks, Tony

gervarro commented 7 years ago

Hi,

I uploaded a new version of Democles to the update site that should fix this issue.

@anthonyanjorin Now I managed to install the test workspace. In my setup, the two Comparator.xtend files were buggy in the sense that they had been committed with some other character encodings, and the << and >> characters were wrong.

I am going to check #167.

Bests, Greg

anthonyanjorin commented 7 years ago

Hi Greg,

yes, sorry. For xtend files with their silly << >> characters we all have to switch the workspace encoding in Eclipse to UTF 8.

Btw. I just updated and tried our tests -- I still get 6 errors due to a "Join Failed" runtime exception. Don't you?

Cheers and thanks, Tony

gervarro commented 7 years ago

Hi Tony,

I have not fixed the "Join failed" exception yet, although I already identified what the problem is.

Bests, Greg

anthonyanjorin commented 7 years ago

Ok - I was worried that my update went wrong. Thanks, Greg!

gervarro commented 7 years ago

The fix for the join failed exception is now available on the 2 update sites.