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

TOPIC: How does type parameterization work?

How does type parameterization work? 18 Apr 2008 15:06 #7285

Hello,

I'm new to TTCN-3 - please forgive me if this is an inappropriate or trivial
question, and let me know if it is:

I'm wondering how type parameterization works, i.e. what kind of parameters can
be passed, and where can they be used in the type definition itself? I'm
thinking array bounds, ranges and such, but can't be sure. I've seen this:

t-ort.etsi.org/view.php?id=3011

... which doesn't really answer the question directly.

Any help on this would be much appreciated!

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
The administrator has disabled public write access.

How does type parameterization work? 18 Apr 2008 23:19 #7286

Hallo Michael,

Your question is far from trivial!

The Change Request which you refer to indicates that type = parameterization is
not permitted in TTCN-3. Note that type parameterization is however permitted
in ASN.1 which can be used in TTCN-3.

Whether using ASN.1 parameterized types, imported into a TTCN-3 module = is
permitted, I'll leave to you to investigate. :-)

What you are referring to in your mail, is more appropriately referred = to as
either sub-typing, or type aliasing.

A type alias is simply a type that is given another name without placing = any
restrictions (range, value, or value list) on the referenced type.

A sub-type is a 'new' type which further restricts values allowed; that = is
range, value, or value list restrictions are placed on the new type.


Here is an example of a TTCN-3 type alias:

type integer MyInt /* ex. Of a type alias */


Here is an example of a TTCN-3 sub-type:

Note how MySmallerInt is restricted to the values 0 up to and including = 123.

type MyInt MySmallerInt ( 0 .. 123 )


Because TTCN-3 is a weakly typed language the following is possible

Var MyInt a := 1000;
Var MySmallerInt b := 1;

a := b; /* syntactically and semantically valid */

b := a; /* syntactically and semantically valid, however, */
/* this assignment will cause a run-time error as */
/* the range of MySmallerInt is violated 1000 > 123 */

There is a whole section in the standard explaining type compatibility
rules.

Actually, if you read part 1 of ES 201 873-1 (describing the TTCN-3 Core
Notation), or if you have the book, An Introduction to TTCN-3 by Colin Willcock,
et. Al) read chapter 8 TTCN-3 Data Types for a further explanation. Also refer
to section 3.1.7 Basic Data Types and 3.1.8 Subtypes of the same book for clear
explanations.

Regarding type parameterization in ASN.1, you should read either John
Larmouth's book: ASN.1 Complete, or for a more complete = explanation, read
Olivier Dubuisson's book: ASN.1 Communication between = Heterogeneous Systems.
Both ASN.1 books are freely available from

www.ossnokalva.com/


Cheers,

Claude.



Blue Cactus Consulting 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 Michael Sperber
Sent: 18 April 2008 17:07
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: How does type parameterization work?

Hello,

I'm new to TTCN-3 - please forgive me if this is an inappropriate or trivial
question, and let me know if it is:

I'm wondering how type parameterization works, i.e. what kind of parameters can
be passed, and where can they be used in the type definition itself? I'm
thinking array bounds, ranges and such, but can't be sure. I've seen this:

t-ort.etsi.org/view.php?id=3011

... which doesn't really answer the question directly.

Any help on this would be much appreciated!

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
The administrator has disabled public write access.

How does type parameterization work? 19 Apr 2008 13:05 #7287

Thanks for prompt reply!

Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:

> What you are referring to in your mail, is more appropriately referred
> to as
> either sub-typing, or type aliasing.

I'm wondering if we're talking about the same thing:

I'm looking at the BNF in the standard:

16. RecordDef ::= RecordKeyword StructDefBody 17. RecordKeyword ::=
"record" 18. StructDefBody ::= (StructTypeIdentifier
[StructDefFormalParList] | AddressKeyword)
"{" [StructFieldDef {"," StructFieldDef}] "}" 19.
StructTypeIdentifier ::= Identifier 20. StructDefFormalParList ::= "("
StructDefFormalPar {"," StructDefFor= malPar} ")"

Note rule #20: This is not a subtype restriction, as far as I can see, but
rather allows me to write stuff like this:

type record MyType(integer foo) {
...
}

I'm mainly wondering what it means. (Especially as there seems to be no
restriction to in parameters in place.)

Maybe I'm misunderstanding your remark:

> The Change Request which you refer to indicates that type
> parameterization
> is not permitted in TTCN-3. Note that type parameterization is
> however permitted in ASN.1 which can be used in TTCN-3.

What does "not permitted" mean? The Change Request seems to argue about whether
it's being used, and, if so, what it means.

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
The administrator has disabled public write access.

How does type parameterization work? 20 Apr 2008 16:58 #7288

Hi Michael,

What you write refers to proper type parameterization. But as indicated = in
the Change Request from your last email, this should have been = depracated from
the TTCN-3 BNF. If this rule is still there, then it indicates, = that they BNF
has not yet been corrected or aligned for the correction of = this feature.

Type parameterization per se, is not permitted as specification.

See below for further details.

Cheers,

Claude.


Blue Cactus Consulting 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 Michael Sperber
Sent: April 19, 2008 3:06 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: How does type parameterization work?

Thanks for prompt reply!

Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:

> What you are referring to in your mail, is more appropriately referred
> to
as
> either sub-typing, or type aliasing.

I'm wondering if we're talking about the same thing:

I'm looking at the BNF in the standard:

16. RecordDef ::= RecordKeyword StructDefBody 17. RecordKeyword ::=
"record" 18. StructDefBody ::= (StructTypeIdentifier
[StructDefFormalParList] |
AddressKeyword)
"{" [StructFieldDef {"," StructFieldDef}] "}" 19.
StructTypeIdentifier ::= Identifier 20. StructDefFormalParList ::= "("
StructDefFormalPar {","
StructDefFormalPar} ")"

Note rule #20: This is not a subtype restriction, as far as I can see, but
rather allows me to write stuff like this:

type record MyType(integer foo) {
...
}

I'm mainly wondering what it means. (Especially as there seems to be no
restriction to in parameters in place.)



Maybe I'm misunderstanding your remark:

> The Change Request which you refer to indicates that type parameterization
> is not permitted in TTCN-3. Note that type parameterization is however
> permitted in ASN.1 which can be used in TTCN-3.

What does "not permitted" mean? The Change Request seems to argue about whether
it's being used, and, if so, what it means.

[CDE] In the above, I am assuming that your type MyType contains a field whose
name is foo, and you are assigning the type integer to it. If = this is not the
case, then foo is simply a formal parameter of type integer, but = in this case
it would make no sense, since you would not define a type, but rather a template
which uses the foo variable as a formal parameter to assign a value to one of
the fields in the MyType record definition.

In any case,

type record MyType(integer foo) {
...
}

As far as I have understood the BNF and the intent of your referenced = Change
Request, the above is not legal TTCN-3.

[CDE] "not permitted" means just that. It is illegal to use type
parameterization, in the sense that the type of a field in a data
structure cannot change, based on a new type sent in as a formal
parameter.

If this is still clear as mud to you, please give me a call, and we
can talk this through. I'm assuming you are in Germany, so there
should be no time difference.


Comments from the maintenance team would be appreciated, if my
comments above are off target in my explanations. :-)



--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
The administrator has disabled public write access.

How does type parameterization work? 21 Apr 2008 06:22 #7289

Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:

> What you write refers to proper type parameterization. But as
> indicated in
> the Change Request from your last email, this should have been
> depracated
> from the TTCN-3 BNF. If this rule is still there, then it indicates,
> that
> they BNF has not yet been corrected or aligned for the correction of
> this
> feature.

That's what the change request says. However, the last note in the issue
history says:

> Ina Schieferdecker
> 12-03-2008 15:55
>
> Just realizing that value parameters to types have not yet been
> removed in the past. Hence, we rather need a discussion if to
> remove or if to add explaination what type parameterization
> means.

I'm assuming at some at the point in the past somebody must have known what it
means.

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
The administrator has disabled public write access.

How does type parameterization work? 21 Apr 2008 17:01 #7290

Hello Michael,

Let me add a few more sentences of explanation:

Currently, type parameterization is not supported by TTCN-3.

And the rules in the BNF you cited should actually have been removed = before.
This issue is planned to be resolved until the end of this year, = most
importantly bringing the text and the BNF in line again.

Best regards

Thomas

| Thomas Deiß |
| Nokia Siemens Networks Deutschland GmbH |
| Heltorferstrasse 21 |
| D-40472 Düsseldorf |
| Mobile: +49 1639842217 |
| 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 ext Michael Sperber
>Sent: Monday, 21. April 2008 08:23
>To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>Subject: Re: How does type parameterization work?
>
>Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:
>
>> What you write refers to proper type parameterization. But as
>> indicated in the Change Request from your last email, this
>should have
>> been depracated from the TTCN-3 BNF. If this rule is still there,
>> then it indicates, that they BNF has not yet been corrected
>or aligned
>> for the correction of this feature.
>
>That's what the change request says. However, the last note in the
>issue history says:
>
>> Ina Schieferdecker
>> 12-03-2008 15:55
>>
>> Just realizing that value parameters to types have not yet been
>> removed in the past. Hence, we rather need a discussion if to
>> remove or if to add explaination what type parameterization
>> means.
>
>I'm assuming at some at the point in the past somebody must have
>known what it means.
>
>--
>Cheers =8-} Mike
>Friede, Völkerverständigung und überhaupt blabla
>
The administrator has disabled public write access.

How does type parameterization work? 21 Apr 2008 22:47 #7291

Hi Thomas,

Thanks for the confirmation. This is exactly what I have indicated to = Mike.

Cheers,

Claude.


Blue Cactus Consulting 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 Thomas Deiss
Sent: April 21, 2008 7:02 PM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: How does type parameterization work?

Hello Michael,

Let me add a few more sentences of explanation:

Currently, type parameterization is not supported by TTCN-3.

And the rules in the BNF you cited should actually have been removed = before.
This issue is planned to be resolved until the end of this year, most
importantly bringing the text and the BNF in line again.

Best regards

Thomas

| Thomas Deiß |
| Nokia Siemens Networks Deutschland GmbH |
| Heltorferstrasse 21 |
| D-40472 Düsseldorf |
| Mobile: +49 1639842217 |
| 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 ext Michael Sperber
>Sent: Monday, 21. April 2008 08:23
>To: This email address is being protected from spambots. You need JavaScript enabled to view it.
>Subject: Re: How does type parameterization work?
>
>Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:
>
>> What you write refers to proper type parameterization. But as
>> indicated in the Change Request from your last email, this
>should have
>> been depracated from the TTCN-3 BNF. If this rule is still there,
>> then it indicates, that they BNF has not yet been corrected
>or aligned
>> for the correction of this feature.
>
>That's what the change request says. However, the last note in the
>issue history says:
>
>> Ina Schieferdecker
>> 12-03-2008 15:55
>>
>> Just realizing that value parameters to types have not yet been
>> removed in the past. Hence, we rather need a discussion if to
>> remove or if to add explaination what type parameterization
>> means.
>
>I'm assuming at some at the point in the past somebody must have
>known what it means.
>
>--
>Cheers =8-} Mike
>Friede, Völkerverständigung und überhaupt blabla
>
The administrator has disabled public write access.

How does type parameterization work? 25 Apr 2008 22:32 #7292

Exactly ... in former times, type parameterization was part of TTCN-3 = ... it
was then removed only half way ... the discussion is ongoing in = the TTCN-3 STF
at ETSI, but if there are pros or cons please let all of = us know.

Cheers, Ina


>
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 Michael Sperber
> Sent: Monday, April 21, 2008 8:23 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: How does type parameterization work?
>
> Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:
>
> > What you write refers to proper type parameterization. But
> as indicated in
> > the Change Request from your last email, this should have
> been depracated
> > from the TTCN-3 BNF. If this rule is still there, then it
> indicates, that
> > they BNF has not yet been corrected or aligned for the
> correction of this
> > feature.
>
> That's what the change request says. However, the last note in the
>issue history says:
>
> > Ina Schieferdecker
> > 12-03-2008 15:55
> >
> > Just realizing that value parameters to types have not yet been
> > removed in the past. Hence, we rather need a discussion if to
> > remove or if to add explaination what type parameterization
> > means.
>
> I'm assuming at some at the point in the past somebody must have known
>what it means.
>
> --
> Cheers =8-} Mike
> Friede, Völkerverständigung und überhaupt blabla
>
The administrator has disabled public write access.

How does type parameterization work? 26 Apr 2008 22:00 #7293

Hi Ina,

For simplicity's sake, if TTCN-3 should fully support proper type
parameterization, one should strongly consider adopting what is done in ASN.1.

Cheers,

Claude.


Blue Cactus Consulting 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 Schieferdecker, Ina
Sent: April 26, 2008 12:32 AM
To: This email address is being protected from spambots. You need JavaScript enabled to view it.
Subject: Re: How does type parameterization work?

Exactly ... in former times, type parameterization was part of TTCN-3 = ... it
was then removed only half way ... the discussion is ongoing in the TTCN-3
STF at ETSI, but if there are pros or cons please let all of us know.

Cheers, Ina


>
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 Michael Sperber
> Sent: Monday, April 21, 2008 8:23 AM
> To: This email address is being protected from spambots. You need JavaScript enabled to view it.
> Subject: Re: How does type parameterization work?
>
> Claude Desroches <This email address is being protected from spambots. You need JavaScript enabled to view it.> writes:
>
> > What you write refers to proper type parameterization. But
> as indicated in
> > the Change Request from your last email, this should have
> been depracated
> > from the TTCN-3 BNF. If this rule is still there, then it
> indicates, that
> > they BNF has not yet been corrected or aligned for the
> correction of this
> > feature.
>
> That's what the change request says. However, the last note in the
>issue history says:
>
> > Ina Schieferdecker
> > 12-03-2008 15:55
> >
> > Just realizing that value parameters to types have not yet been
> > removed in the past. Hence, we rather need a discussion if to
> > remove or if to add explaination what type parameterization
> > means.
>
> I'm assuming at some at the point in the past somebody must have known
>what it means.
>
> --
> Cheers =8-} Mike
> Friede, Völkerverständigung und überhaupt blabla
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin