Search code examples
umlproofcardinality

Proof there is no instance for a given UML-Diagram


Given the diagram in the top-right corner, I'm supposed to decide whether there is any valid instance of it. Now the given image is a counterproof by example ('wegen' means 'because of'). The counterproof uses the cardinality ('Mächtigkeit') of the objects.

I don't understand, why for example 2*|A| equals |C|, as in UML, A would be in relation with 2 objects of C (rel1). So for every A there have to be 2 C to make a valid instance. 2*|A| = |C| should therefore be |A| = 2*|C|.

Why is it the other way around?

enter image description here


Solution

    • 2*|A| = |C| since there is double the amount of C objects compared to A because each A has two C associated.
    • |A| = |B| because they have a 1-1 relation
    • 3*|C| = 2*|B| because each C has 3 B and each B has 2 C
    • (4) and (5) are just substitutions where the last gives a contradiction

    q.e.d

    P.S. As @ShiDoiSi pointed out there is no {unique} constraint in the multiplicities. This will make it possible to have multiple associations to the same instance. Ergo, you have 1-1 relations. So with that being the case you actually CAN have a valid instantiation of the model.

    Now go and tell that to your teacher xD