<div>Hello Guys</div>
<div> </div>
<div>I can't seem find any reference to polymorphism in the OCL reference, although its present in UML. In GME for example the following doesn't produce the desired results:</div>
<div> </div>
<div>self->parts(ValueType)->forAll(q1, q2 : ValueType | q1 <> q2 implies q1.Index <> q2.Index)</div>
<div> </div>
<div>In the above scenario, various Models inherit from ValueType. The variable Index is defined in ValueType, and containment of ValueType is defined for the current object (self) class. But all the objects contained in self are child types of ValueType, and not of ValueType itself. But the condition q1, q2: ValueType doesn't seem to include the child types and therefore the constraint is not applied.
</div>
<div> </div>
<div>The question is: is this an OCL shortcoming or is it something thats missing in the implementation?</div>
<div> </div>
<div>Regards</div>
<div>Zawar</div>