Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Undefined and omit values

Undefined and omit values 22 May 2008 07:42 #7328

  • Ra
  • Ra's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
Hi,



What do you think about this?



I declare the following type:



type record MyRecordType {

integer field1,

integer field2 optional,

integer field3

}



And I create a variable



var MyRecordType A:={-,omit,-};



Can you read the field2 of variable A?



var integer b:=A.field2; Is an error?



Can you read a field record value that you assignment omit value?



Thanks.



Raúl Alfonso
The administrator has disabled public write access.

Undefined and omit values 22 May 2008 08:25 #7329

Hi Raúl,

Not, because omit is not a value. A type is a set of values but none of the types has "omit" within its set. For example, for integer the standard says:
"a type with distinguished values which are the positive and negative whole numbers, including zero.".

Pls. note, omit is even not a value for record and set types, it is "just" an indicator of a missing optional field. E.g.

type record MyRec { integer f1 optional }
cons MyRec cg_myRec := omit //THIS IS ERROR
cons MyRec cg_myRec := {omit} //this is OK as omit is associated with the optional field and not with the value (the value is {f1:=omit}

BR, Gyorgy


________________________________

From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
Sent: Thursday, 22 May, 2008 9:42 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Undefined and omit values



Hi,



What do you think about this?



I declare the following type:



type record MyRecordType {

integer field1,

integer field2 optional,

integer field3

}



And I create a variable



var MyRecordType A:={-,omit,-};



Can you read the field2 of variable A?



var integer b:=A.field2; Is an error?



Can you read a field record value that you assignment omit value?



Thanks.



Raúl Alfonso
The administrator has disabled public write access.

Undefined and omit values 22 May 2008 09:48 #7330

Hi György,

I think when a newbie (and not only a newbie) goes through the
difficulties of learning the TTCN-3 standard, s/he needs to construct some
adequate mental models that are easy to remember and easy to apply in
practice.

Thinking of omit as a an extension of the value set (i.e. as a special
kind of value notation) is one such useful mental model that a person can
construct.

It's much like infinity in maths, it can be regarded as a special kind of
real number belonging to an extended set of real numbers.

If we try to present the standard to our potential users more complex than
it should be, we will lose some audience. For a commercial tool vendor
this is not the desired outcome I suppose.

Kind regards,
Alexey

> Hi Raúl,
>
> Not, because omit is not a value. A type is a set of values but none of
> the types has "omit" within its set. For example, for integer the standard
> says:
> "a type with distinguished values which are the positive and negative
> whole numbers, including zero.".
>
> Pls. note, omit is even not a value for record and set types, it is "just"
> an indicator of a missing optional field. E.g.
>
> type record MyRec { integer f1 optional }
> cons MyRec cg_myRec := omit //THIS IS ERROR
> cons MyRec cg_myRec := {omit} //this is OK as omit is associated with the
> optional field and not with the value (the value is {f1:=omit}
>
> BR, Gyorgy
>
>
> ________________________________
>
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
> Sent: Thursday, 22 May, 2008 9:42 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Undefined and omit values
>
>
>
> Hi,
>
>
>
> What do you think about this?
>
>
>
> I declare the following type:
>
>
>
> type record MyRecordType {
>
> integer field1,
>
> integer field2 optional,
>
> integer field3
>
> }
>
>
>
> And I create a variable
>
>
>
> var MyRecordType A:={-,omit,-};
>
>
>
> Can you read the field2 of variable A?
>
>
>
> var integer b:=A.field2; Is an error?
>
>
>
> Can you read a field record value that you assignment omit value?
>
>
>
> Thanks.
>
>
>
> Raúl Alfonso
>
>
>
>
>
>
>
>
The administrator has disabled public write access.

Undefined and omit values 22 May 2008 10:23 #7331

Dear Alexey,

I don't think that saying incorrect information (even for dedactic purposes) can help in better understanding and/or using the language.

"Thinking of omit as a an extension of the value set (i.e. as a special kind of value notation)" -> saying this is technically incorrect and would mislead the reader. In this case one would have to start listing where this cannot be used and would have to list everything except record and set fields (pls. note, the question and the example was about VALUES and not matching mechanisms!).

Re-reading my earlier mail I cannot see my explanation to be over-complicated.

One can write, this:
const integer cg_int1 := 5;

and cannot write this, this is not a valid value notation:
const integer cg_int2 := omit;

but cannot even write this, also semantically incorrect:
type record of integer RoI:
...
var RoI v_roi := {1,2,omit,4};

I do not think that this is difficult to understand.

Of course, it would easier to understand the language if the bnf also has taken dedactic aspects into account. But is does not, and far not all constructs are valid TTCN-3 code that is allowed to be written by the bnf. I think this is more difficult to understand than my explanation.

BR, Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Alexey
> Mednonogov
> Sent: Thursday, 22 May, 2008 11:49 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Undefined and omit values
>
> Hi György,
>
> I think when a newbie (and not only a newbie) goes through
> the difficulties of learning the TTCN-3 standard, s/he needs
> to construct some adequate mental models that are easy to
> remember and easy to apply in practice.
>
> Thinking of omit as a an extension of the value set (i.e. as
> a special kind of value notation) is one such useful mental
> model that a person can construct.
>
> It's much like infinity in maths, it can be regarded as a
> special kind of real number belonging to an extended set of
> real numbers.
>
> If we try to present the standard to our potential users more
> complex than it should be, we will lose some audience. For a
> commercial tool vendor this is not the desired outcome I suppose.
>
> Kind regards,
> Alexey
>
> > Hi Raúl,
> >
> > Not, because omit is not a value. A type is a set of values
> but none
> > of the types has "omit" within its set. For example, for
> integer the
> > standard
> > says:
> > "a type with distinguished values which are the positive
> and negative
> > whole numbers, including zero.".
> >
> > Pls. note, omit is even not a value for record and set
> types, it is "just"
> > an indicator of a missing optional field. E.g.
> >
> > type record MyRec { integer f1 optional } cons MyRec
> cg_myRec := omit
> > //THIS IS ERROR cons MyRec cg_myRec := {omit} //this is OK
> as omit is
> > associated with the optional field and not with the value
> (the value
> > is {f1:=omit}
> >
> > BR, Gyorgy
> >
> >
> > ________________________________
> >
> > From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only
> > [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
> > Sent: Thursday, 22 May, 2008 9:42 AM
> > To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> > Subject: Undefined and omit values
> >
> >
> >
> > Hi,
> >
> >
> >
> > What do you think about this?
> >
> >
> >
> > I declare the following type:
> >
> >
> >
> > type record MyRecordType {
> >
> > integer field1,
> >
> > integer field2 optional,
> >
> > integer field3
> >
> > }
> >
> >
> >
> > And I create a variable
> >
> >
> >
> > var MyRecordType A:={-,omit,-};
> >
> >
> >
> > Can you read the field2 of variable A?
> >
> >
> >
> > var integer b:=A.field2; Is an error?
> >
> >
> >
> > Can you read a field record value that you assignment
> omit value?
> >
> >
> >
> > Thanks.
> >
> >
> >
> > Raúl Alfonso
> >
> >
> >
> >
> >
> >
> >
> >
>
The administrator has disabled public write access.

Undefined and omit values 22 May 2008 10:43 #7332

Dear György,

I understand your point.

I am not questioning correctness, validity or appropriateness of what you
say.

There is a clear boundary between values and matching mechanisms in
TTCN-3. Omit can participate in sending of messages together with regular
values.

I also understand there are users out there who need to write their test
suites and who would not probably bother to read our fine-print academic
discussions of this kind.

If we fail to explain them what TTCN-3 is in a "TTCN-3 for dummies in 24
hours" fashion, they will switch to another technology and we will lose a
case.

I understand that a viewpoint of a commercial tool vendor may differ from
the viewpoint of another tool producer with limited tool distribution and
tool availability (please correct me if I am ill-informed). I see this
diversity of opinions in a very positive light.

Kind regards,
Alexey

> Dear Alexey,
>
> I don't think that saying incorrect information (even for dedactic
> purposes) can help in better understanding and/or using the language.
>
> "Thinking of omit as a an extension of the value set (i.e. as a special
> kind of value notation)" -> saying this is technically incorrect and would
> mislead the reader. In this case one would have to start listing where
> this cannot be used and would have to list everything except record and
> set fields (pls. note, the question and the example was about VALUES and
> not matching mechanisms!).
>
> Re-reading my earlier mail I cannot see my explanation to be
> over-complicated.
>
> One can write, this:
> const integer cg_int1 := 5;
>
> and cannot write this, this is not a valid value notation:
> const integer cg_int2 := omit;
>
> but cannot even write this, also semantically incorrect:
> type record of integer RoI:
> ...
> var RoI v_roi := {1,2,omit,4};
>
> I do not think that this is difficult to understand.
>
> Of course, it would easier to understand the language if the bnf also has
> taken dedactic aspects into account. But is does not, and far not all
> constructs are valid TTCN-3 code that is allowed to be written by the bnf.
> I think this is more difficult to understand than my explanation.
>
> BR, Gyorgy
>
>>
Original Message
>> From: active_ttcn3 : mts stf133 ttcn version 3 - active
>> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Alexey
>> Mednonogov
>> Sent: Thursday, 22 May, 2008 11:49 AM
>> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>> Subject: Re: Undefined and omit values
>>
>> Hi György,
>>
>> I think when a newbie (and not only a newbie) goes through
>> the difficulties of learning the TTCN-3 standard, s/he needs
>> to construct some adequate mental models that are easy to
>> remember and easy to apply in practice.
>>
>> Thinking of omit as a an extension of the value set (i.e. as
>> a special kind of value notation) is one such useful mental
>> model that a person can construct.
>>
>> It's much like infinity in maths, it can be regarded as a
>> special kind of real number belonging to an extended set of
>> real numbers.
>>
>> If we try to present the standard to our potential users more
>> complex than it should be, we will lose some audience. For a
>> commercial tool vendor this is not the desired outcome I suppose.
>>
>> Kind regards,
>> Alexey
>>
>> > Hi Raúl,
>> >
>> > Not, because omit is not a value. A type is a set of values
>> but none
>> > of the types has "omit" within its set. For example, for
>> integer the
>> > standard
>> > says:
>> > "a type with distinguished values which are the positive
>> and negative
>> > whole numbers, including zero.".
>> >
>> > Pls. note, omit is even not a value for record and set
>> types, it is "just"
>> > an indicator of a missing optional field. E.g.
>> >
>> > type record MyRec { integer f1 optional } cons MyRec
>> cg_myRec := omit
>> > //THIS IS ERROR cons MyRec cg_myRec := {omit} //this is OK
>> as omit is
>> > associated with the optional field and not with the value
>> (the value
>> > is {f1:=omit}
>> >
>> > BR, Gyorgy
>> >
>> >
>> > ________________________________
>> >
>> > From: active_ttcn3 : mts stf133 ttcn version 3 - active
>> members only
>> > [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
>> > Sent: Thursday, 22 May, 2008 9:42 AM
>> > To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>> > Subject: Undefined and omit values
>> >
>> >
>> >
>> > Hi,
>> >
>> >
>> >
>> > What do you think about this?
>> >
>> >
>> >
>> > I declare the following type:
>> >
>> >
>> >
>> > type record MyRecordType {
>> >
>> > integer field1,
>> >
>> > integer field2 optional,
>> >
>> > integer field3
>> >
>> > }
>> >
>> >
>> >
>> > And I create a variable
>> >
>> >
>> >
>> > var MyRecordType A:={-,omit,-};
>> >
>> >
>> >
>> > Can you read the field2 of variable A?
>> >
>> >
>> >
>> > var integer b:=A.field2; Is an error?
>> >
>> >
>> >
>> > Can you read a field record value that you assignment
>> omit value?
>> >
>> >
>> >
>> > Thanks.
>> >
>> >
>> >
>> > Raúl Alfonso
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>
>
The administrator has disabled public write access.

Undefined and omit values 22 May 2008 15:48 #7333

  • Ra
  • Ra's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
Hi György and Alexey,

Thank you for your answers, but I have some doubts about this. What do you
think about the following examples?

type record MyRecordType {
integer field1,
integer field2 optional,
integer field3
}

var MyRecordType A:={2,-,3} -> The second field is undefined not omitted.
var MyRecordType B; -> B is undefined.
var MyRecordType C:={2,omit,3} -> The second field is omitted so the second
field is undefined.
Var MyRecordType D:={2,3,3}
B:=A; -> The second field of B is undefined, is omitted or is this an
error?.
A == C -> This is true, false or an error (because A.field1 is undefined).
B:=C; -> The second field of C is omitted so the second field of B is
undefined (and omitted) or is this an error because the second field of C is
undefined?
D:=A; -> D.field2 is undefined o is this an error?

Thanks.

Raúl Alfonso
Metodos Y Tecnología (MTP)
Paseo de la Castellana 182, 10th Floor
28046 Madrid, Spain



Mensaje original
De: active_ttcn3 : mts stf133 ttcn version 3 - active members only
[This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Alexey Mednonogov
Enviado el: jueves, 22 de mayo de 2008 11:49
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Undefined and omit values

Hi György,

I think when a newbie (and not only a newbie) goes through the
difficulties of learning the TTCN-3 standard, s/he needs to construct some
adequate mental models that are easy to remember and easy to apply in
practice.

Thinking of omit as a an extension of the value set (i.e. as a special
kind of value notation) is one such useful mental model that a person can
construct.

It's much like infinity in maths, it can be regarded as a special kind of
real number belonging to an extended set of real numbers.

If we try to present the standard to our potential users more complex than
it should be, we will lose some audience. For a commercial tool vendor
this is not the desired outcome I suppose.

Kind regards,
Alexey

> Hi Raúl,
>
> Not, because omit is not a value. A type is a set of values but none of
> the types has "omit" within its set. For example, for integer the standard
> says:
> "a type with distinguished values which are the positive and negative
> whole numbers, including zero.".
>
> Pls. note, omit is even not a value for record and set types, it is "just"
> an indicator of a missing optional field. E.g.
>
> type record MyRec { integer f1 optional }
> cons MyRec cg_myRec := omit //THIS IS ERROR
> cons MyRec cg_myRec := {omit} //this is OK as omit is associated with the
> optional field and not with the value (the value is {f1:=omit}
>
> BR, Gyorgy
>
>
> ________________________________
>
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
> Sent: Thursday, 22 May, 2008 9:42 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Undefined and omit values
>
>
>
> Hi,
>
>
>
> What do you think about this?
>
>
>
> I declare the following type:
>
>
>
> type record MyRecordType {
>
> integer field1,
>
> integer field2 optional,
>
> integer field3
>
> }
>
>
>
> And I create a variable
>
>
>
> var MyRecordType A:={-,omit,-};
>
>
>
> Can you read the field2 of variable A?
>
>
>
> var integer b:=A.field2; Is an error?
>
>
>
> Can you read a field record value that you assignment omit value?
>
>
>
> Thanks.
>
>
>
> Raúl Alfonso
>
>
>
>
>
>
>
>
The administrator has disabled public write access.

Undefined and omit values 22 May 2008 21:54 #7334

Hi Raúl,

See comments below.

Cheers,

Claude.


BluKaktus Communication phone: +49 (0)30 9606 7985
Edinburger Str. 39 fax: +49 (0)30 9606 7987
13349 Berlin mobile: +49 (0)174 701 6792
Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it.

-
Thank you for your answers, but I have some doubts about this. What do you
think about the following examples?

type record MyRecordType {
integer field1,
integer field2 optional,
integer field3
}

var MyRecordType A:={2,-,3} -> The second field is undefined not omitted.

> The second field actually keeps any previous value assigned to it, so you
have to be careful. If this is the first assignment, then you are correct.
Otherwise field2 would keep any value it had before.

var MyRecordType B; -> B is undefined.

> B is declared, but has no values assigned to it. Elements of B may or may
not have values assigned to them depending on the tool implementation.


var MyRecordType C:={2,omit,3} -> The second field is omitted so the second
field is undefined.

> Actually omit is not a value in the strict sense of being a value of a
set, as explained earlier by Gyorgy. In the above case, it is more correct
to state that field2 is not present. The value which field2 may or may not
have is irrelevant since it is not present.

Var MyRecordType D:={2,3,3}
B:=A; -> The second field of B is undefined, is omitted or is this an
error?.

> B takes on all the values of A. The value of field2 in A is '-', which
means, that field2 of B takes on this same value, '-', which is undefined.

A == C -> This is true, false or an error (because A.field1 is undefined).
B:=C; -> The second field of C is omitted so the second field of B is
undefined (and omitted) or is this an error because the second field of C is
undefined?

> A.field1 == C.field1 == 2
> A.field2 != C.field2 since '-' and omit have different semantics.
> A.field3 == C.field3 == 3

A != C since '-' and omit have different semantics. Omit = field not
present. '-' = value undefined or retains previous value assigned if any.
A value is present, but you don't know what it is....


D:=A; -> D.field2 is undefined o is this an error?

> D.field1 = 2
> D.field2 = '-' so undefined.
> D.field3 = 3

For a better understanding of what the '-' (dash) 6.2 Structured types and
values, especially example 4 of ES 201-873-1.

Another question one might raise, is: Is the dash a matching mechanism?
Yes or no? If yes, then why can it me used in variable assignment. Further,
is it legal TTCN-3 to use the 'omit' keyword in a constant or variable
assignment? Since my current understanding is that matching mechanism are
only permitted for template variables. Please clarify.


>
The administrator has disabled public write access.

Undefined and omit values 23 May 2008 07:10 #7335

Hi Raúl,

Pls. see my comemnts below. I hope this makes things more clear.

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl
> Alfonso Quintana
> Sent: Thursday, 22 May, 2008 5:48 PM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Undefined and omit values
>
> Hi György and Alexey,
>
> Thank you for your answers, but I have some doubts about
> this. What do you think about the following examples?
>
> type record MyRecordType {
> integer field1,
> integer field2 optional,
> integer field3
> }
>
> var MyRecordType A:={2,-,3} -> The second field is undefined
> not omitted.
[Gyorgy] Correct.


> var MyRecordType B; -> B is undefined.
[Gyorgy] Correct.

> var MyRecordType C:={2,omit,3} -> The second field is omitted
> so the second field is undefined.

[Gyorgy] NOT correct. The second field is defined. It is a missing optional field. BUT omit still not a value here! "omit" is NOT the value of integer (the type of field2 - once field 2 is missing) but the property of the optional record field. Omitting an optional field is legal, and does essentially differ from a field being undefined. With omit you specify the omission, so the state of field2 is defined. Undefined is simply undefined, you say nothing about the state of the field. C is a perfectly legal value of MyRecordType (even if you did not provide a specific value for field 2 but decided to leave it out from C).


> Var MyRecordType D:={2,3,3}
> B:=A; -> The second field of B is undefined, is omitted or is
> this an error?.

[Gyorgy] This is an error (A is only partially initialized).

> A == C -> This is true, false or an error (because A.field1
> is undefined).

[Gyorgy] This is an error (A is only partially initialized because A.field2 is undefined).


> B:=C; -> The second field of C is omitted so the second field
> of B is undefined (and omitted) or is this an error because
> the second field of C is undefined?

[Gyorgy] This is perfectly legal. C, as a whole is completely initialized. From now on B also becomes completely initialized. Even in the case
B := {1,-,1}
it remains completely initialized, because here field2 is simply not changed; (in fact at its declaration A.field2 also stayed unchanged, just it was undefined before, thus remained undefined after).

> D:=A; -> D.field2 is undefined o is this an error?

[Gyorgy] This is an error (A is only partially initialized).

>
> Thanks.
>
> Raúl Alfonso
> Metodos Y Tecnología (MTP)
> Paseo de la Castellana 182, 10th Floor
> 28046 Madrid, Spain
>
>
>
>
Mensaje original
> De: active_ttcn3 : mts stf133 ttcn version 3 - active members
> only [This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Alexey
> Mednonogov Enviado el: jueves, 22 de mayo de 2008 11:49
> Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Asunto: Re: Undefined and omit values
>
> Hi György,
>
> I think when a newbie (and not only a newbie) goes through
> the difficulties of learning the TTCN-3 standard, s/he needs
> to construct some adequate mental models that are easy to
> remember and easy to apply in practice.
>
> Thinking of omit as a an extension of the value set (i.e. as
> a special kind of value notation) is one such useful mental
> model that a person can construct.
>
> It's much like infinity in maths, it can be regarded as a
> special kind of real number belonging to an extended set of
> real numbers.
>
> If we try to present the standard to our potential users more
> complex than it should be, we will lose some audience. For a
> commercial tool vendor this is not the desired outcome I suppose.
>
> Kind regards,
> Alexey
>
> > Hi Raúl,
> >
> > Not, because omit is not a value. A type is a set of values
> but none
> > of the types has "omit" within its set. For example, for
> integer the
> > standard
> > says:
> > "a type with distinguished values which are the positive
> and negative
> > whole numbers, including zero.".
> >
> > Pls. note, omit is even not a value for record and set
> types, it is "just"
> > an indicator of a missing optional field. E.g.
> >
> > type record MyRec { integer f1 optional } cons MyRec
> cg_myRec := omit
> > //THIS IS ERROR cons MyRec cg_myRec := {omit} //this is OK
> as omit is
> > associated with the optional field and not with the value
> (the value
> > is {f1:=omit}
> >
> > BR, Gyorgy
> >
> >
> > ________________________________
> >
> > From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only
> > [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
> > Sent: Thursday, 22 May, 2008 9:42 AM
> > To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> > Subject: Undefined and omit values
> >
> >
> >
> > Hi,
> >
> >
> >
> > What do you think about this?
> >
> >
> >
> > I declare the following type:
> >
> >
> >
> > type record MyRecordType {
> >
> > integer field1,
> >
> > integer field2 optional,
> >
> > integer field3
> >
> > }
> >
> >
> >
> > And I create a variable
> >
> >
> >
> > var MyRecordType A:={-,omit,-};
> >
> >
> >
> > Can you read the field2 of variable A?
> >
> >
> >
> > var integer b:=A.field2; Is an error?
> >
> >
> >
> > Can you read a field record value that you assignment
> omit value?
> >
> >
> >
> > Thanks.
> >
> >
> >
> > Raúl Alfonso
> >
> >
> >
> >
> >
> >
> >
> >
>
The administrator has disabled public write access.

Undefined and omit values 23 May 2008 07:27 #7336

Hi Claude,

there are some errors in your response.

"Elements of B may or may not have values assigned to them depending on the tool implementation."
[Gyorgy]
-> any tool assigning any value to any field of B implicitly is simply not conforming with the TTCN-3 standard.

"B takes on all the values of A. The value of field2 in A is '-', which means, that field2 of B takes on this same value, '-', which is undefined."
[Gyorgy] NOT CORRECT!
-> true only if the field or value is completely initialized. In this case A.field2 is uninitialized, so this operation shall cause an error. See $11.1 item d):
"d) Use of uninitialized or not completely initialized value variables at other places than the left hand side of assignments or as actual parameters passed to out formal parameters shall cause an error."

The rest se in my previous mail.

BR, Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude
> Desroches
> Sent: Thursday, 22 May, 2008 11:54 PM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Undefined and omit values
>
> Hi Raúl,
>
> See comments below.
>
> Cheers,
>
> Claude.
>
>
> BluKaktus Communication phone: +49 (0)30 9606 7985
> Edinburger Str. 39 fax: +49 (0)30 9606 7987
> 13349 Berlin mobile: +49 (0)174 701 6792
> Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it.
>
>
>
> -
> Thank you for your answers, but I have some doubts about
> this. What do you think about the following examples?
>
> type record MyRecordType {
> integer field1,
> integer field2 optional,
> integer field3
> }
>
> var MyRecordType A:={2,-,3} -> The second field is undefined
> not omitted.
>
> > The second field actually keeps any previous value assigned
> to it, so
> > you
> have to be careful. If this is the first assignment, then
> you are correct.
> Otherwise field2 would keep any value it had before.
>
> var MyRecordType B; -> B is undefined.
>
> > B is declared, but has no values assigned to it. Elements
> of B may or
> > may
> not have values assigned to them depending on the tool
> implementation.
>
>
> var MyRecordType C:={2,omit,3} -> The second field is omitted
> so the second field is undefined.
>
> > Actually omit is not a value in the strict sense of being
> a value of
> > a
> set, as explained earlier by Gyorgy. In the above case, it
> is more correct to state that field2 is not present. The
> value which field2 may or may not have is irrelevant since it
> is not present.
>
> Var MyRecordType D:={2,3,3}
> B:=A; -> The second field of B is undefined, is omitted or is
> this an error?.
>
> > B takes on all the values of A. The value of field2 in A is '-',
> > which
> means, that field2 of B takes on this same value, '-', which
> is undefined.
>
> A == C -> This is true, false or an error (because A.field1
> is undefined).
> B:=C; -> The second field of C is omitted so the second field
> of B is undefined (and omitted) or is this an error because
> the second field of C is undefined?
>
> > A.field1 == C.field1 == 2
> > A.field2 != C.field2 since '-' and omit have different semantics.
> > A.field3 == C.field3 == 3
>
> A != C since '-' and omit have different semantics. Omit =
> field not present. '-' = value undefined or retains previous
> value assigned if any.
> A value is present, but you don't know what it is....
>
>
> D:=A; -> D.field2 is undefined o is this an error?
>
> > D.field1 = 2
> > D.field2 = '-' so undefined.
> > D.field3 = 3
>
> For a better understanding of what the '-' (dash) 6.2
> Structured types and
> values, especially example 4 of ES 201-873-1.
>
> Another question one might raise, is: Is the dash a
> matching mechanism?
> Yes or no? If yes, then why can it me used in variable
> assignment. Further, is it legal TTCN-3 to use the 'omit'
> keyword in a constant or variable assignment? Since my
> current understanding is that matching mechanism are only
> permitted for template variables. Please clarify.
>
>
> >
>
The administrator has disabled public write access.

Undefined and omit values 23 May 2008 07:43 #7337

Hi Gyorgy,

Thanks for the clarifications. See below.
Cheers,

Claude.

BluKaktus Communication phone: +49 (0)30 9606 7985
Edinburger Str. 39 fax: +49 (0)30 9606 7987
13349 Berlin mobile: +49 (0)174 701 6792
Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it.

Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
[This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy
Sent: May 23, 2008 9:27 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Undefined and omit values

Hi Claude,

there are some errors in your response.

"Elements of B may or may not have values assigned to them depending on the
tool implementation."
[Gyorgy]
-> any tool assigning any value to any field of B implicitly is simply not
conforming with the TTCN-3 standard.

Cde What I meant was that the value in case of '-' is undefined. A tool
May allocate storage for a particular field, however, the bits which
Are located in the memory allocated for this field may have been
Initialized to zero, or not, and thus the value is undefined. This is
Or can be tool, and or compiler dependent.


"B takes on all the values of A. The value of field2 in A is '-', which
means, that field2 of B takes on this same value, '-', which is undefined."
[Gyorgy] NOT CORRECT!
-> true only if the field or value is completely initialized. In this case
A.field2 is uninitialized, so this operation shall cause an error. See $11.1
item d):
"d) Use of uninitialized or not completely initialized value variables
at other places than the left hand side of assignments or as actual
parameters passed to out formal parameters shall cause an error."

Cde: Just to clarify for the others: If field2 of A is assigned a value,
then field1 and/or field3 of A are assigned new values, then assigned to B,
then the assignment B:= A is valid since A is now completely initialized.


Cde: Thanks for pointing this out. I knew I should have had a closer look
at the standard before responding so late in the evening... :-)
So assigning a variable where the rhs has a '-' in its value causes a
run-time error.



The rest se in my previous mail.

BR, Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude
> Desroches
> Sent: Thursday, 22 May, 2008 11:54 PM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Undefined and omit values
>
> Hi Raúl,
>
> See comments below.
>
> Cheers,
>
> Claude.
>
>
> BluKaktus Communication phone: +49 (0)30 9606 7985
> Edinburger Str. 39 fax: +49 (0)30 9606 7987
> 13349 Berlin mobile: +49 (0)174 701 6792
> Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it.
>
>
>
> -
> Thank you for your answers, but I have some doubts about
> this. What do you think about the following examples?
>
> type record MyRecordType {
> integer field1,
> integer field2 optional,
> integer field3
> }
>
> var MyRecordType A:={2,-,3} -> The second field is undefined
> not omitted.
>
> > The second field actually keeps any previous value assigned
> to it, so
> > you
> have to be careful. If this is the first assignment, then
> you are correct.
> Otherwise field2 would keep any value it had before.
>
> var MyRecordType B; -> B is undefined.
>
> > B is declared, but has no values assigned to it. Elements
> of B may or
> > may
> not have values assigned to them depending on the tool
> implementation.
>
>
> var MyRecordType C:={2,omit,3} -> The second field is omitted
> so the second field is undefined.
>
> > Actually omit is not a value in the strict sense of being
> a value of
> > a
> set, as explained earlier by Gyorgy. In the above case, it
> is more correct to state that field2 is not present. The
> value which field2 may or may not have is irrelevant since it
> is not present.
>
> Var MyRecordType D:={2,3,3}
> B:=A; -> The second field of B is undefined, is omitted or is
> this an error?.
>
> > B takes on all the values of A. The value of field2 in A is '-',
> > which
> means, that field2 of B takes on this same value, '-', which
> is undefined.
>
> A == C -> This is true, false or an error (because A.field1
> is undefined).
> B:=C; -> The second field of C is omitted so the second field
> of B is undefined (and omitted) or is this an error because
> the second field of C is undefined?
>
> > A.field1 == C.field1 == 2
> > A.field2 != C.field2 since '-' and omit have different semantics.
> > A.field3 == C.field3 == 3
>
> A != C since '-' and omit have different semantics. Omit =
> field not present. '-' = value undefined or retains previous
> value assigned if any.
> A value is present, but you don't know what it is....
>
>
> D:=A; -> D.field2 is undefined o is this an error?
>
> > D.field1 = 2
> > D.field2 = '-' so undefined.
> > D.field3 = 3
>
> For a better understanding of what the '-' (dash) 6.2
> Structured types and
> values, especially example 4 of ES 201-873-1.
>
> Another question one might raise, is: Is the dash a
> matching mechanism?
> Yes or no? If yes, then why can it me used in variable
> assignment. Further, is it legal TTCN-3 to use the 'omit'
> keyword in a constant or variable assignment? Since my
> current understanding is that matching mechanism are only
> permitted for template variables. Please clarify.
>
>
> >
>
The administrator has disabled public write access.

Undefined and omit values 23 May 2008 08:35 #7338

  • G
  • G's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 0
Hi, Raul,

Here are my answers as comments:
type record MyRecordType {
integer field1,
integer field2 optional,
integer field3
}
var MyRecordType A:={2,-,3} /* A is partially defined: the second field is undefined*/
var MyRecordType B; -> /*B is undefined.*/
var MyRecordType C:={2,omit,3} /*C is fully defined, its second field is not present */
var MyRecordType D:={2,3,3}/*D is fully defined, the second field is present and has the value "3" */
B:=A; /*Dynamic test case error, using a partially defined RHS*/
A == C /*Dynamic test case error, comparing with a partially defined variable*/
B:=C; /*Perfectly valid, B is fully defined, its second field is not present */ */
D:=A; /*[Gabor]: Dynamic test case error, using a partially defined RHS*/

BR, Gabor

Gábor Ziegler M.Sc.E.E., dr.univ
Senior Specialist, Generic Technologies Test & Verification
Test Competence Center
Ericsson Hungary Ltd.
Research & Development
Budapest, XI. Irinyi. J. u. 4-20.
www.ericsson.com Office: +36 1 437 7361
Fax: +36 1 439 5176
Mobile: +30 30 219 9805
Email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Ericsson Magyarország Kft., Székhely: Budapest, Laborc u.1. Nyilvántartó cégbíróság: Fővárosi Bíróság. Cégjegyzékszám: 01-09-070937

This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption, interception, unauthorized amendment, tampering and viruses, and we only send and receive emails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof.




Original Message
From: active_ttcn3 : mts stf133 ttcn version 3 - active members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
Sent: Thursday, May 22, 2008 5:48 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: Undefined and omit values

Hi György and Alexey,

Thank you for your answers, but I have some doubts about this. What do you
think about the following examples?


var MyRecordType A:={2,-,3} -> The second field is undefined not omitted.
var MyRecordType B; -> B is undefined.
var MyRecordType C:={2,omit,3} -> The second field is omitted so the second
field is undefined.
Var MyRecordType D:={2,3,3}
B:=A; -> The second field of B is undefined, is omitted or is this an
error?.
A == C -> This is true, false or an error (because A.field1 is undefined).
B:=C; -> The second field of C is omitted so the second field of B is
undefined (and omitted) or is this an error because the second field of C is
undefined?
D:=A; -> D.field2 is undefined o is this an error?

Thanks.

Raúl Alfonso
Metodos Y Tecnología (MTP)
Paseo de la Castellana 182, 10th Floor
28046 Madrid, Spain



Mensaje original
De: active_ttcn3 : mts stf133 ttcn version 3 - active members only
[This email address is being protected from spambots. You need JavaScript enabled to view it.] En nombre de Alexey Mednonogov
Enviado el: jueves, 22 de mayo de 2008 11:49
Para: This email address is being protected from spambots. You need JavaScript enabled to view it.
Asunto: Re: Undefined and omit values

Hi György,

I think when a newbie (and not only a newbie) goes through the
difficulties of learning the TTCN-3 standard, s/he needs to construct some
adequate mental models that are easy to remember and easy to apply in
practice.

Thinking of omit as a an extension of the value set (i.e. as a special
kind of value notation) is one such useful mental model that a person can
construct.

It's much like infinity in maths, it can be regarded as a special kind of
real number belonging to an extended set of real numbers.

If we try to present the standard to our potential users more complex than
it should be, we will lose some audience. For a commercial tool vendor
this is not the desired outcome I suppose.

Kind regards,
Alexey

> Hi Raúl,
>
> Not, because omit is not a value. A type is a set of values but none of
> the types has "omit" within its set. For example, for integer the standard
> says:
> "a type with distinguished values which are the positive and negative
> whole numbers, including zero.".
>
> Pls. note, omit is even not a value for record and set types, it is "just"
> an indicator of a missing optional field. E.g.
>
> type record MyRec { integer f1 optional }
> cons MyRec cg_myRec := omit //THIS IS ERROR
> cons MyRec cg_myRec := {omit} //this is OK as omit is associated with the
> optional field and not with the value (the value is {f1:=omit}
>
> BR, Gyorgy
>
>
> ________________________________
>
> From: active_ttcn3 : mts stf133 ttcn version 3 - active members only
> [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Raúl Alfonso Quintana
> Sent: Thursday, 22 May, 2008 9:42 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Undefined and omit values
>
>
>
> Hi,
>
>
>
> What do you think about this?
>
>
>
> I declare the following type:
>
>
>
> type record MyRecordType {
>
> integer field1,
>
> integer field2 optional,
>
> integer field3
>
> }
>
>
>
> And I create a variable
>
>
>
> var MyRecordType A:={-,omit,-};
>
>
>
> Can you read the field2 of variable A?
>
>
>
> var integer b:=A.field2; Is an error?
>
>
>
> Can you read a field record value that you assignment omit value?
>
>
>
> Thanks.
>
>
>
> Raúl Alfonso
>
>
>
>
>
>
>
>
The administrator has disabled public write access.

Undefined and omit values 23 May 2008 08:41 #7339

  • G
  • G's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
  • Karma: 0
Hi, Claude

Cde: Thanks for pointing this out. I knew I should have had a closer look
at the standard before responding so late in the evening... :-)
So assigning a variable where the rhs has a '-' in its value causes a
run-time error.

Gabor: Not quite true. The operator "-" is the "skip" operator. Its meaning: the respective record-field, or function argument is "not specified here", that is, "leave the thing 'as is' for now".

If the record field has been defined/initialized previously, then it remain as such. If it has not been initialized/defined so far, then it remain as such.

Raoul's questions are partly under-defined: since the code was just a code fragment. Obviusly, Gyorgy and me has considered the "text-order" of the assigments in the question as "immediate execution sequence".

BR,

Gabor
The administrator has disabled public write access.

Undefined and omit values 23 May 2008 09:11 #7340

Hi,

there are still one point I have to correct.
"So assigning a variable where the rhs has a '-' in its value causes a run-time error."

[Gyorgy] It has no direct relation to dash. Dash is not a value either (except "-" for charstrings :)); it just a notation at ASSIGNMENTS showing the the previous value is not changed. B:=A; causes an error simply because dash was used when initializing A.field2 at its *declaration* (so, it is cristal clear that A.field2 is undefined) and A is on the RHS.

Claude, I have a feeling that your comments are more confusing Raúl than making things clear.

BR, Gyorgy

>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude
> Desroches
> Sent: Friday, 23 May, 2008 9:43 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Undefined and omit values
>
> Hi Gyorgy,
>
> Thanks for the clarifications. See below.
> Cheers,
>
> Claude.
>
> BluKaktus Communication phone: +49 (0)30 9606 7985
> Edinburger Str. 39 fax: +49 (0)30 9606 7987
> 13349 Berlin mobile: +49 (0)174 701 6792
> Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it.
>
>
Original Message
> From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of György Réthy
> Sent: May 23, 2008 9:27 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: Undefined and omit values
>
> Hi Claude,
>
> there are some errors in your response.
>
> "Elements of B may or may not have values assigned to them
> depending on the tool implementation."
> [Gyorgy]
> -> any tool assigning any value to any field of B implicitly
> is simply
> -> not
> conforming with the TTCN-3 standard.
>
> Cde What I meant was that the value in case of '-' is
> undefined. A tool
> May allocate storage for a particular field, however,
> the bits which
> Are located in the memory allocated for this field may have been
> Initialized to zero, or not, and thus the value is
> undefined. This is
> Or can be tool, and or compiler dependent.
>
>
> "B takes on all the values of A. The value of field2 in A is
> '-', which means, that field2 of B takes on this same value,
> '-', which is undefined."
> [Gyorgy] NOT CORRECT!
> -> true only if the field or value is completely
> initialized. In this case
> A.field2 is uninitialized, so this operation shall cause an
> error. See $11.1 item d):
> "d) Use of uninitialized or not completely initialized
> value variables
> at other places than the left hand side of assignments or as
> actual parameters passed to out formal parameters shall cause
> an error."
>
> Cde: Just to clarify for the others: If field2 of A is
> assigned a value, then field1 and/or field3 of A are assigned
> new values, then assigned to B, then the assignment B:= A is
> valid since A is now completely initialized.
>
>
> Cde: Thanks for pointing this out. I knew I should have had
> a closer look at the standard before responding so late in
> the evening... :-) So assigning a variable where the rhs has
> a '-' in its value causes a run-time error.
>
>
>
> The rest se in my previous mail.
>
> BR, Gyorgy
>
> >
Original Message
> > From: active_ttcn3 : mts stf133 ttcn version 3 - active
> members only
> > [This email address is being protected from spambots. You need JavaScript enabled to view it.] On Behalf Of Claude Desroches
> > Sent: Thursday, 22 May, 2008 11:54 PM
> > To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> > Subject: Re: Undefined and omit values
> >
> > Hi Raúl,
> >
> > See comments below.
> >
> > Cheers,
> >
> > Claude.
> >
> >
> > BluKaktus Communication phone: +49 (0)30 9606 7985
> > Edinburger Str. 39 fax: +49 (0)30 9606 7987
> > 13349 Berlin mobile: +49 (0)174 701 6792
> > Germany email: This email address is being protected from spambots. You need JavaScript enabled to view it.
> >
> >
> >
> > -
> > Thank you for your answers, but I have some doubts about
> this. What do
> > you think about the following examples?
> >
> > type record MyRecordType {
> > integer field1,
> > integer field2 optional,
> > integer field3
> > }
> >
> > var MyRecordType A:={2,-,3} -> The second field is undefined not
> > omitted.
> >
> > > The second field actually keeps any previous value assigned
> > to it, so
> > > you
> > have to be careful. If this is the first assignment, then you are
> > correct.
> > Otherwise field2 would keep any value it had before.
> >
> > var MyRecordType B; -> B is undefined.
> >
> > > B is declared, but has no values assigned to it. Elements
> > of B may or
> > > may
> > not have values assigned to them depending on the tool
> implementation.
> >
> >
> > var MyRecordType C:={2,omit,3} -> The second field is
> omitted so the
> > second field is undefined.
> >
> > > Actually omit is not a value in the strict sense of being
> > a value of
> > > a
> > set, as explained earlier by Gyorgy. In the above case, it is more
> > correct to state that field2 is not present. The value which field2
> > may or may not have is irrelevant since it is not present.
> >
> > Var MyRecordType D:={2,3,3}
> > B:=A; -> The second field of B is undefined, is omitted or
> is this an
> > error?.
> >
> > > B takes on all the values of A. The value of field2 in A is '-',
> > > which
> > means, that field2 of B takes on this same value, '-', which is
> > undefined.
> >
> > A == C -> This is true, false or an error (because A.field1 is
> > undefined).
> > B:=C; -> The second field of C is omitted so the second
> field of B is
> > undefined (and omitted) or is this an error because the
> second field
> > of C is undefined?
> >
> > > A.field1 == C.field1 == 2
> > > A.field2 != C.field2 since '-' and omit have different semantics.
> > > A.field3 == C.field3 == 3
> >
> > A != C since '-' and omit have different semantics. Omit
> = field not
> > present. '-' = value undefined or retains previous value
> assigned if
> > any.
> > A value is present, but you don't know what it is....
> >
> >
> > D:=A; -> D.field2 is undefined o is this an error?
> >
> > > D.field1 = 2
> > > D.field2 = '-' so undefined.
> > > D.field3 = 3
> >
> > For a better understanding of what the '-' (dash) 6.2
> > Structured types and
> > values, especially example 4 of ES 201-873-1.
> >
> > Another question one might raise, is: Is the dash a
> > matching mechanism?
> > Yes or no? If yes, then why can it me used in variable assignment.
> > Further, is it legal TTCN-3 to use the 'omit'
> > keyword in a constant or variable assignment? Since my current
> > understanding is that matching mechanism are only permitted for
> > template variables. Please clarify.
> >
> >
> > >
> >
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin