Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL constraints over instance pairs/triples/etc
EVL constraints over instance pairs/triples/etc [message #564475] Mon, 02 February 2009 14:28
No real name is currently offline No real nameFriend
Messages: 92
Registered: July 2009
Member
Hi there,

In EVL is it possible to define constraints whose context is a
pair/triple/etc of model elements?

I have a situation where it would be good to validate a constraint of the
form:

context X {
constraint CheckXPair {
check {
var otherX := MyModel!X.all.select(i | not(i = self));
// some check involving self and otherX ...
}
message : 'Error'
}
}

And so, we're doing a check for each pair of instances of X. However, I
guess when the rule is being evaluated, then each pair of instances will
be evaluated twice. E.g., if x1 and x2 are instances of X, then the rule
would be evaluated when self is x1, and otherX is x2; and the rule would
also be evaluated when self is x2, and otherX is x1. The occurrence of two
evaluations per pair leads to redundant checking in my case, and so being
able to restrict this (to sets of instances) would be great. Do you have
any suggestions? I may be asking something misguided so apologies in
advance.

In general, it would seem quite handy and natural to be able to express a
constraint for n-tuples of instances, e.g., for pairs/triples of
instances. This though, would give rise to a difficulty when referring to
the context, self, directly; but perhaps it could be referenced via a
Collection called self, e.g., self(0), denoting self.at(0), self(1), etc?

Best,

Edd
Previous Topic:Ant and epsilon.loadModel
Next Topic:EVL constraints over instance pairs/triples/etc
Goto Forum:
  


Current Time: Sun Sep 22 18:15:23 GMT 2024

Powered by FUDForum. Page generated in 0.03143 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top