Determining whether two elements are equal is fairly simple.
Two DataType-typed values are equal when they have a deep value correspondence (deep is needed for OCL Collection types - UML is vague on reified multiplicity values).
Two Class-typed values are equal when they are exactly the same object (have the same address in typical implementations).