Closed anthonyanjorin closed 6 years ago
Hi Tony,
in my opinion, it is not the role of the pattern matcher to reorder the modification events. I would solve this problem at the application of a GT rule. I do not know, how deletions and insertions are currently carried out in Ibex (GT/TGG), but enforcing the following order (during GT rule application) would generally solve the problem: (1) delete regular edges, (2) delete containment edges (and nodes), (3) add (nodes and) containment edges, (4) add regular edges. If you already use Democles for red (and green) patterns (like in the original, compiled eMoflon variant), then a simple weight modification (weight of regular edges < weight of containment edges) should solve the problem in the deletion phase.
Bests, Greg
Ok - that makes sense. Should be fairly easy to implement. Thanks for the tip!
@patrickrobrecht Please adjust the red and green interpreters to work in the following order:
Does this have to be corrected for TGGs too? Or do we reuse the same interpreters?
There are different interpreters for GT and TGGs - due to use of different patterns (IBeXCreatePattern
vs. IGreenPattern
for the green part and IBeXDeletePattern
vs. undoing the rule application).
I created an issue for the TGG part: https://github.com/eMoflon/emoflon-ibex-democles/issues/66
During fixing that for GT I'll try to extract as much as possible into some EMFUtils class such that the interpreters for TGG can use that as well.
Hi Greg,
I now have an example where I can actually understand why Democles complains about the deletion:
The problem is that the
umsaetze
edge is a composite edge. So deleting it means that the nodeu:Umsatz
will be floating. As the edgeumsatz
is also a composite edge, everything would be fine if it would be created first before thevorgemerkt
edge (a normal reference) is deleted. Democles chooses to deletevorgemerkt
next, however, and complains of course becauseu:Umsatz
is floating.So what do you think? For a user's perspective a pattern specification cannot enforce the "correct" order so it would be fantastic if Democles could figure out the right thing to do here.
Thanks, Tony