Re: is iterate a deterministic operation ?



Date view Thread view Subject view Author view

Mark Richters (mr@informatik.uni-bremen.de)
25 Feb 2000 16:55:51 +0100


reggio@disi.unige.it (Gianna Reggio) writes: > By looking at UML 1.3 presentation of OCl I have the impression that the > ``iterate'' construct is be nondeterministic Yes, that's true. We had a paper which also deals with this issue on the ER'98 conference: @InProceedings{Richters:1998:ER, author = "Mark Richters and Martin Gogolla", title = "On Formalizing the {UML} Object Constraint Language {OCL}", booktitle = "Proc. 17th Int. Conf. Conceptual Modeling (ER'98)", year = "1998", editor = "Tok Wang Ling and Sudha Ram and Mong Li Lee", pages = "449--464", publisher = "Springer, Berlin, LNCS 1507", isbn = "3-540-65189-6", abstract = "We present a formal semantics for the Object Constraint Language (OCL) which is part of the Unified Modeling Language (UML) -- an emerging standard language and notation for object-oriented analysis and design. In context of information systems modeling, UML class diagrams can be utilized for describing the overall structure, whereas additional integrity constraints and queries are specified with OCL expressions. By using OCL, constraints and queries can be specified in a formal yet comprehensible way. However, the OCL itself is currently defined only in an informal way. Thus the semantics of constraints is in general not precisely defined. Our approach gives precise meaning to OCL concepts and to some central aspects of UML class models. In consequence, a formal semantics facilitates verification, validation and simulation of models improving the quality of models and software design.", } > Indeed, what is the result of the following expression > > set{ 0, 1 } -> > iterate{ I; Integer; acc: Integer = 0 | > if i = 0 then 0 else i / acc} > An even simpler example is the following. What is the result of Set{'b','a','c'}->iterate(s : String; names :String = '' | names.concat(s)) The example also has the advantage of demonstrating the same effect without requiring the concept of undefined values which is a story on its own in OCL. Regards, Mark -- Mark Richters (mr@informatik.uni-bremen.de)


Date view Thread view Subject view Author view