Welcome,
Guest
|
|
TOPIC: Simple TTCN-3 standard questions
Simple TTCN-3 standard questions 11 May 2004 14:02 #6660
|
Hi,
I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 11 May 2004 14:52 #6661
|
Hi Staffan,
It was a while since I was into this but I reckon I could answer your questions, I am sure others will recfy me if I am wrong, they always do...;-) My answer on your first question is; it depends on the type definition of your record type (subtype for element b in this case). Elements in TTCN-3 can be optional and if you have that defined they are either present or not. If you haven't defined the element as optional then your construction is illegal. For your second question my answer would be generally yes. If the type is a set of-type the ordering of values is insignificant. Flavours of matching mechanisms are defined in the TTCN-3 standard section B. Of interest could be for instance sections B.1.2.6 and B.1.2.7 (superset and subset) which relates to this question. BR /Stefan Stefan Olofsson Tools & Methods Application SW Verification Nya Vattentornet SE-221 83 LUND, Sweden phone: +46 46 19 3256 mobile: +46 703 11 3256 e-mail: 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 Staffan Grundberg (LI/EAB) Sent: tisdag den 11 maj 2004 16:02 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Simple TTCN-3 standard questions Hi, I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 11 May 2004 15:15 #6662
|
Hang on a minute...
I assume you have a type defined like this type record rec1 { integer a, integer b } Right? In that case, TemplateA is valid, it's a completely defined value and thus the template can be used for both sending and receiving values of type rec1. TemplateB is also OK, but can only be used for matching of received objects (messages) since the template does not fully define the value. TemplateC is illegal, a template must define values and/or matching rules "for each and every field defined in the appropriate type" (regardless of optionality), see paragraph 14.0. About your array permutation question, no, I'm not aware of any such matching mechanisms, you should investigate what can be done with 'set of' type values for this purpose. Good luck. /Johan Original Message From: Olofsson C, Stefan [This email address is being protected from spambots. You need JavaScript enabled to view it.] Sent: den 11 maj 2004 16:53 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hi Staffan, It was a while since I was into this but I reckon I could answer your questions, I am sure others will recfy me if I am wrong, they always do...;-) My answer on your first question is; it depends on the type definition of your record type (subtype for element b in this case). Elements in TTCN-3 can be optional and if you have that defined they are either present or not. If you haven't defined the element as optional then your construction is illegal. For your second question my answer would be generally yes. If the type is a set of-type the ordering of values is insignificant. Flavours of matching mechanisms are defined in the TTCN-3 standard section B. Of interest could be for instance sections B.1.2.6 and B.1.2.7 (superset and subset) which relates to this question. BR /Stefan Stefan Olofsson Tools & Methods Application SW Verification Nya Vattentornet SE-221 83 LUND, Sweden phone: +46 46 19 3256 mobile: +46 703 11 3256 e-mail: 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 Staffan Grundberg (LI/EAB) Sent: tisdag den 11 maj 2004 16:02 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Simple TTCN-3 standard questions Hi, I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 11 May 2004 15:23 #6663
|
fyi 'permutation' is a new matching mechanism defined in the mock-up of
the next version of the standard. Not much use if you need it now, but it is coming! Original Message From: Olofsson C, Stefan [This email address is being protected from spambots. You need JavaScript enabled to view it.] Sent: 11 May 2004 16:53 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hi Staffan, It was a while since I was into this but I reckon I could answer your questions, I am sure others will recfy me if I am wrong, they always do...;-) My answer on your first question is; it depends on the type definition of your record type (subtype for element b in this case). Elements in TTCN-3 can be optional and if you have that defined they are either present or not. If you haven't defined the element as optional then your construction is illegal. For your second question my answer would be generally yes. If the type is a set of-type the ordering of values is insignificant. Flavours of matching mechanisms are defined in the TTCN-3 standard section B. Of interest could be for instance sections B.1.2.6 and B.1.2.7 (superset and subset) which relates to this question. BR /Stefan Stefan Olofsson Tools & Methods Application SW Verification Nya Vattentornet SE-221 83 LUND, Sweden phone: +46 46 19 3256 mobile: +46 703 11 3256 e-mail: 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 Staffan Grundberg (LI/EAB) Sent: tisdag den 11 maj 2004 16:02 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Simple TTCN-3 standard questions Hi, I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 11 May 2004 15:32 #6664
|
Hi Staffan,
Did you actually mean that templateB modifies templateA and templateC modifies templateC? Then you should have written something like: template SIGNAL1 templateB modifies templateA := { ... }; template SIGNAL1 templateC modifies templateB := { ... }; Assuming that this was what you actually meant: In templateB you modify the whole value of rec1 altogether, so its new value in templateB is now '?', previous value in templateA has now no significance for templateB. If you derive templateC from templateB, then you modify exactly this '?' value (matching mechanism) defined in templateB, not anything previously defined in templateA. Therefore, correct value notation for templateC in strict compliance with the TTCN-3 standard shall be as follows: template SIGNAL1 templateC modifies templateB := { rec1 := { a := 3, b := omit } }; You might have probably thought that the resulting value of rec1 in templateC in your example would have been {a := 3, b := 3}, but that would have been the case if you derived templateC directly from templateA. Concerning you question whether derivation from a question mark (?) value is allowed: I do not recollect any clause in the standard that explicitly prohibits this, so that means that this shall be allowed. Hope this helps, Alexey Mednonogov Software Engineer OpenTTCN Oy www.openttcn.com/ Staffan Grundberg (LI/EAB) wrote: > Hi, > > I have two question regarding the TTCN-3 standard. > > If I have a nested structured template. i.e.: > > template SIGNAL1 templateA > { > rec1:= > { > a:=32, > b:=3 > } > } > > > and i define another template: > > template SIGNAL1 templateB > { > rec1:= ? > } > > can i then use this: > > template SIGNAL1 templateC > { > rec1 := > { > a := 3 > } > } > > That is do the TTCN-3 standard specify if the situation, where a > modified template specifies fields in an record that was only defined > as "?" in the parent template, is allowed? > > The second question is: > Can or will TTCN-3 support a matching mechanism that can match a array > (record) to any permutation of say {1, 2, 3} > > > Thanks in advance > Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 12 May 2004 06:33 #6665
|
Hej Johan!
I assumed that the real question was on templateC since the other two templates were self-explanatory IMHO but as Alexey notices we have maybe not addressed Staffan's question with our answers Johan... Anyway I didn't remember (now I do but only after reading your hint/reference;-)) that the values need to be present or explicitly omitted if optional. Mea culpa /Stefan 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 Johan Nordin Sent: tisdag den 11 maj 2004 17:15 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hang on a minute... I assume you have a type defined like this type record rec1 { integer a, integer b } Right? In that case, TemplateA is valid, it's a completely defined value and thus the template can be used for both sending and receiving values of type rec1. TemplateB is also OK, but can only be used for matching of received objects (messages) since the template does not fully define the value. TemplateC is illegal, a template must define values and/or matching rules "for each and every field defined in the appropriate type" (regardless of optionality), see paragraph 14.0. About your array permutation question, no, I'm not aware of any such matching mechanisms, you should investigate what can be done with 'set of' type values for this purpose. Good luck. /Johan Original Message From: Olofsson C, Stefan [This email address is being protected from spambots. You need JavaScript enabled to view it.] Sent: den 11 maj 2004 16:53 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hi Staffan, It was a while since I was into this but I reckon I could answer your questions, I am sure others will recfy me if I am wrong, they always do...;-) My answer on your first question is; it depends on the type definition of your record type (subtype for element b in this case). Elements in TTCN-3 can be optional and if you have that defined they are either present or not. If you haven't defined the element as optional then your construction is illegal. For your second question my answer would be generally yes. If the type is a set of-type the ordering of values is insignificant. Flavours of matching mechanisms are defined in the TTCN-3 standard section B. Of interest could be for instance sections B.1.2.6 and B.1.2.7 (superset and subset) which relates to this question. BR /Stefan Stefan Olofsson Tools & Methods Application SW Verification Nya Vattentornet SE-221 83 LUND, Sweden phone: +46 46 19 3256 mobile: +46 703 11 3256 e-mail: 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 Staffan Grundberg (LI/EAB) Sent: tisdag den 11 maj 2004 16:02 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Simple TTCN-3 standard questions Hi, I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 12 May 2004 06:35 #6666
|
Hi,
maybe you already answered my question but here is what i really meant: type record SIGNAL1 { REC1 rec1 } type record REC1 { integer a, integer b } template SIGNAL1 templateB := { rec1:= ? } template SIGNAL1 templateC modifies templateB := { rec1 := { a := 3 } } Will templateC have these values for a and b a := 3, b := ? Thanks again. Staffan Grundberg 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: den 11 maj 2004 17:33 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hi Staffan, Did you actually mean that templateB modifies templateA and templateC modifies templateC? Then you should have written something like: template SIGNAL1 templateB modifies templateA := { ... }; template SIGNAL1 templateC modifies templateB := { ... }; Assuming that this was what you actually meant: In templateB you modify the whole value of rec1 altogether, so its new value in templateB is now '?', previous value in templateA has now no significance for templateB. If you derive templateC from templateB, then you modify exactly this '?' value (matching mechanism) defined in templateB, not anything previously defined in templateA. Therefore, correct value notation for templateC in strict compliance with the TTCN-3 standard shall be as follows: template SIGNAL1 templateC modifies templateB := { rec1 := { a := 3, b := omit } }; You might have probably thought that the resulting value of rec1 in templateC in your example would have been {a := 3, b := 3}, but that would have been the case if you derived templateC directly from templateA. Concerning you question whether derivation from a question mark (?) value is allowed: I do not recollect any clause in the standard that explicitly prohibits this, so that means that this shall be allowed. Hope this helps, Alexey Mednonogov Software Engineer OpenTTCN Oy www.openttcn.com/ Staffan Grundberg (LI/EAB) wrote: Hi, I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 12 May 2004 07:28 #6667
|
Hello again, Staffan.
OK, now the question is more clear. The answer is Yes, see the last sentence in the third section of paragraph 14.6.0. Cheers, /Johan Original Message From: Staffan Grundberg (LI/EAB) [This email address is being protected from spambots. You need JavaScript enabled to view it.] Sent: den 12 maj 2004 08:36 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hi, maybe you already answered my question but here is what i really meant: type record SIGNAL1 { REC1 rec1 } type record REC1 { integer a, integer b } template SIGNAL1 templateB := { rec1:= ? } template SIGNAL1 templateC modifies templateB := { rec1 := { a := 3 } } Will templateC have these values for a and b a := 3, b := ? Thanks again. Staffan Grundberg 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: den 11 maj 2004 17:33 To: This email address is being protected from spambots. You need JavaScript enabled to view it. Subject: Re: Simple TTCN-3 standard questions Hi Staffan, Did you actually mean that templateB modifies templateA and templateC modifies templateC? Then you should have written something like: template SIGNAL1 templateB modifies templateA := { ... }; template SIGNAL1 templateC modifies templateB := { ... }; Assuming that this was what you actually meant: In templateB you modify the whole value of rec1 altogether, so its new value in templateB is now '?', previous value in templateA has now no significance for templateB. If you derive templateC from templateB, then you modify exactly this '?' value (matching mechanism) defined in templateB, not anything previously defined in templateA. Therefore, correct value notation for templateC in strict compliance with the TTCN-3 standard shall be as follows: template SIGNAL1 templateC modifies templateB := { rec1 := { a := 3, b := omit } }; You might have probably thought that the resulting value of rec1 in templateC in your example would have been {a := 3, b := 3}, but that would have been the case if you derived templateC directly from templateA. Concerning you question whether derivation from a question mark (?) value is allowed: I do not recollect any clause in the standard that explicitly prohibits this, so that means that this shall be allowed. Hope this helps, Alexey Mednonogov Software Engineer OpenTTCN Oy www.openttcn.com/ Staffan Grundberg (LI/EAB) wrote: Hi, I have two question regarding the TTCN-3 standard. If I have a nested structured template. i.e.: template SIGNAL1 templateA { rec1:= { a:=32, b:=3 } } and i define another template: template SIGNAL1 templateB { rec1:= ? } can i then use this: template SIGNAL1 templateC { rec1 := { a := 3 } } That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? The second question is: Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} Thanks in advance Staffan Grundberg |
The administrator has disabled public write access.
|
Simple TTCN-3 standard questions 12 May 2004 07:54 #6668
|
Staffan,
Think of it that way: Correct, TTCN-3 standard does not tell it explicitly what should happen in this case, nor it defines any complex rules for derivation from omit, *, ?, complement etc. etc. defined as values of nested record fields (as in your example). Trying to read between lines in the standard, an assumption can be made that all such matching mechanisms shall be treated as indivisible values from the point of view of derivation, i.e. such values can be modified only as a whole altogether. I am therefore aware of at least one tool where you can't write templateC like in your modified example (hoping to get { a := 3, b := ? }), and you can't do that for a good reason (being able to do so would probably require introduction of complex, hard-to-memorize and hard-to-keep-consistent rules). Counter example why such derivation is tricky: type record REC1 { integer a, integer b optional } template SIGNAL1 templateB := { rec1:= ? } This is then equivalent to writing: template SIGNAL1 templateB_equiv := { rec1 := { a := ?, b := * } } Now if we derive templateC from templateB in the way as you proposed, would we then get { a := 3, b := ? } or { a := 3, b := * }? And if so, is it intuitively appealing? Note that this is only one example that came to my mind immediately, and if we examine the problem more broadly (taking into account all possible combinations of *, ?, omit, other matching mechanisms etc.), this could get unmanageable. To sum up, I agree that this is a grey area in the standard. For example Johan has correctly referenced clause 14.6.0, however in my opinion this reference would have had more value if the standard had specified somewhere explicitly that rec1 := ? is equivalent to rec1 := { a := ?, b := ? } and if it had introduced similar well-defined equivalence rules for all matching mechanisms concerning records. Hope this helps, Alexey Mednonogov Software Engineer OpenTTCN Oy www.openttcn.com/ Staffan Grundberg (LI/EAB) wrote: >Hi, > >maybe you already answered my question but here is what i really meant: > >type record SIGNAL1 >{ > REC1 rec1 >} > >type record REC1 >{ > integer a, > integer b >} > >template SIGNAL1 templateB := >{ > rec1:= ? >} > >template SIGNAL1 templateC modifies templateB := >{ > rec1 := > { > a := 3 > } >} > >Will templateC have these values for a and b > a := 3, > b := ? > >Thanks again. > >Staffan Grundberg > > > 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: den 11 maj 2004 17:33 >To: This email address is being protected from spambots. You need JavaScript enabled to view it. >Subject: Re: Simple TTCN-3 standard questions > > >Hi Staffan, > >Did you actually mean that templateB modifies templateA and >templateC modifies templateC? Then you should have written >something like: > >template SIGNAL1 templateB modifies templateA := { ... }; >template SIGNAL1 templateC modifies templateB := { ... }; > >Assuming that this was what you actually meant: > >In templateB you modify the whole value of rec1 altogether, >so its new value in templateB is now '?', previous value in >templateA has now no significance for templateB. > >If you derive templateC from templateB, then you modify >exactly this '?' value (matching mechanism) defined in >templateB, not anything previously defined in templateA. > >Therefore, correct value notation for templateC in strict >compliance with the TTCN-3 standard shall be as follows: > >template SIGNAL1 templateC modifies templateB := >{ > rec1 := > { > a := 3, > b := omit > } >}; > >You might have probably thought that the resulting value of rec1 >in templateC in your example would have been {a := 3, b := 3}, but >that would have been the case if you derived templateC directly >from templateA. > >Concerning you question whether derivation from a question mark (?) >value is allowed: I do not recollect any clause in the standard that >explicitly prohibits this, so that means that this shall be allowed. > >Hope this helps, >Alexey Mednonogov > >Software Engineer >OpenTTCN Oy >www.openttcn.com/ > >Staffan Grundberg (LI/EAB) wrote: > >Hi, > >I have two question regarding the TTCN-3 standard. > >If I have a nested structured template. i.e.: > >template SIGNAL1 templateA >{ > rec1:= > { > a:=32, > b:=3 > } >} > > >and i define another template: > >template SIGNAL1 templateB >{ > rec1:= ? >} > >can i then use this: > >template SIGNAL1 templateC >{ > rec1 := > { > a := 3 > } >} > >That is do the TTCN-3 standard specify if the situation, where a modified template specifies fields in an record that was only defined as "?" in the parent template, is allowed? > >The second question is: >Can or will TTCN-3 support a matching mechanism that can match a array (record) to any permutation of say {1, 2, 3} > > >Thanks in advance >Staffan Grundberg > > |
The administrator has disabled public write access.
|
|