Re: InOut Variables (Operations' Semantics)



Date view Thread view Subject view Author view Attachment view

From: Andreas Awenius (andreas.awenius@empowertec.de)
Date: Thu 27 Jan 2005 - 20:54:30 GMT


Hello all,

> Dear Percy,

> This is rather simple: For inout parameters there are no constraints,
> because they can have a value on entry, but can also be modified by the
> operation. So, there's nothing you could put in the semantics about
> them. The specific modifications that may happen are exactly what you
> would use OCL to describe.

> The attributes of a class are not inout variables, because the in/out
> kind only applies to parameters of operations. Attributes are not
> parameters.

What Percy meant is probably: "attributes can be read and modified in an OCL expression"?
If that is what he meant, the answer could be complemented with "No, because OCL expressions may not alter an objects state. They would be of kind 'in', if the kind would apply to attributes.".

Kind regards,
Andreas


> Best regards,

> Steffen

> Percy Pari Salas schrieb:

>> Dear all,
>>
>> I have a doubt about semantics of operations in OCL. In the
>> specification they said the variables of a operation are represented
>> as a set PARAMSop, and  there exist a function  kind : PARAMS ->
>> {in,out,inout,return}. They explain in the semantics that:
>> - Input parameters may not be modified,  kind(p) = in implies value(p)
>> = value(p@pre)
>> - Output parameters are undefined on entry, ...
>> But they do not mention anything about the inout variables ...
>> kind(p)=inout implies ????????
>> The question is if there is any default behaviour that must be
>> considered when nothing is explicitly writen in the OCL specification.
>> Anyone knows?
>> Also, typically the attributes of a class must be inout variables, I'm
>> right? ...
>>
>> Very thanks for your help,
>>
>>
>>  Percy Pari Salas
>> UNU-IIST Fellow
>> Macau SAR - China
>>
>>
>>
>>
>>
>> To remove yourself from this list please mail
>> puml-list-request@cs.york.ac.uk
>> with a message containing the word "unsubscribe".


> --
> Dipl.-Inf. Steffen Zschaler
> Research Assistant

> Technische Universitšt Dresden
> Department of Computer Science

> Phone +49 351 463 38555
> Fax   +49 351 463 38459
> Email Steffen.Zschaler@inf.tu-dresden.de
> WWW   http://www.inf.tu-dresden.de/~sz9





> To remove yourself from this list please mail
> puml-list-request@cs.york.ac.uk
> with a message containing the word "unsubscribe".

--
Andreas Awenius
EmPowerTec AG
Taubenweg 20
85238 Petershausen
Fon: +49 8137 80 98 81
Fax: +49 8137 80 98 82

Date view Thread view Subject view Author view Attachment view