|
|
|
|
|
|
Re: Helper functions in OCL constraints [message #989129 is a reply to message #989061] |
Tue, 04 December 2012 12:48  |
Eclipse User |
|
|
|
Ralph,
Thanks a lot! With your information and a some adjusts in the sentences I was able to specify these functions.
If someone is passing through the same, here's my final specification for the functions. (Some names are a little bit diferent like Role = Concept, and superrolePlus = superconceptStar)
operation superconceptStar() : Concept[*]
{
body: self.superconceptStarOnSet(self.superconcept());
}
operation superconceptStarOnSet(rs : Concept[*]) : Concept[*]
{
body:
if rs.superconcept()->exists(r : Concept | rs->excludes(r))
then self.superconceptStarOnSet(rs->union(rs.superconcept())->asSet())
else rs->including(self)
endif;
}
The invariant for no cicles is:
self.superconcept()->forAll(r|r.superconceptStar()->excludes(self))
Thanks a lot again Ralph!
|
|
|
Powered by
FUDForum. Page generated in 0.03324 seconds