Re: OCL and constraints



Date view Thread view Subject view Author view

Hubert Baumeister (baumeist@informatik.uni-muenchen.de)
Thu, 09 Dec 1999 13:31:20 +0100


Hi Frank, > "Frank V. Castellucci" wrote: > > I don't know what has been said before on the subject as I have just joined the mailing list but I > am concerned about OCL and the lack of coverage faced in typical constraint programming. > I believe that to be "real" OCL must consider constraint propagation. > > For example (excuse the rust in OCL syntax), where ClassA has an association to ClassB: > > context ClassA: > inv: self.x = self.relationship.y > > context ClassB > inv: self.y = self.relationship.x > > what is the result when ClassA.x is assigned say 5 > > In a propagation system, if ClassB.y has not been assigned then by definition it attains the value > of 5 as well, of course invariant excepts if ClassB.y is already assigned. > let me try to give you my understanding of the situation. The name OCL (Object constraint language) may be missleading since OCL is not intended to be a "typical constraint programming language". OCL is a specification language to express properties of UML models that have to be satisfied by implementations of these models. Note that the implementations of the UML models do not depend on the existence of OCL constraints. The OCL constraints in your example are restrictions on the static object model (a snapshot) of the system. The intention is that any operation (like a method or an assignment) transforms snapshots satisfying the constraints to snapshots also satisfying the constraints. If an operation does not do this then it does not satisfy the specification given by the OCL constraints. The semantics of the operations (like the assignment) are independet of the OCL constraints, since the OCL constraints are part of the specification and not part of the implemenation. Greetings, Hubert -- Hubert Baumeister, LMU M"unchen, Institut f"ur Informatik mailto:baumeist@informatik.uni-muenchen.de http://www.informatik.uni-muenchen.de/~baumeist phone (x49-89)2178-2177 * fax -2175


Date view Thread view Subject view Author view