[great-users] Will this work or crash?

Aditya Agrawal Aditya at isis.vanderbilt.edu
Tue Jun 15 11:03:49 CDT 2004


Dear Gabriele,

In GReAT, the default execution semantics are that a pattern object will
match a unique host graph object. Thus in your rule you do not need to
give the restriction about unique ids. 

The second question was regarding the different matches. In this case
once an object is deleted and it is tried to be deleted again, GReAT
should ignore it. Feng and Attila could you please say if this is the
current behavior of GRE and CG.

Thanks,
Adi

> 
> Please have a look at the rule in attachment.
> 
> With that rule I want to eliminate all the "Requirement" elements
except
> one.
> 
> This is the Guard implementation:
> ---------
> if (Requirement1.uniqueId() == Requirement2.uniqueId()) return false;
> else return true;
> --------
> First of all, I'm not totally sure that such guard is needed. I don't
> know if it's possible that Requirement1 and Requirement2 will match
the
> same Requirement.
> 
> Secondarily:
> I suppose that the rule will generate all possible combinations of
> Requirement1 and Requirement2. But if all the matches are generated at
> the beginning, then since for each execution of the rule I will
destroy
> some element, at a certain point I suspect that in another execution
of
> the rule an element will be matched but that's one of those that I
have
> already destroyed! Then it might crash or behave erratically.
> Is GReAT safe regarding this?
> 
> BTW My transformation appears to work regarding this, but I haven't
> really put this rule into test and it's difficult to try this right
now.
> 
> 
> Otherwise which GReAT algorithm do you suggest for 'uniquizing' one
> element? (an AttributeMapping snippet could be good as well)


More information about the great-users mailing list