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

TOPIC: Superset matching operation

Superset matching operation 14 Feb 2003 11:43 #6394

Hi all,

when converting code form TTCN-2 to TTCN-3 I came across the superset operation.
It looks to me that its semantics have been changed in TTCN-3 .. am I right or is this just a TTCN-3 tool bug?
If so - has this happened intentionally?

The difference is that in TTCN-2 you could use AnyValue and AnyValueOrNone matching symbols within this operation
whereas in TTCN-3 this does not seem to be possible. The TTCN-3 BNF seems to be pretty interpretive on this issue.

Ex.:

type set of MyStruct MyStruct_List;

type record MyStruct {
charstring a,
integer b
}

template MyStruct_List myRecvTemplate := {

superset( {"elvis lives forever", ? } ) // this used to be a legal statement

}

Any comments would be appreciated.

Moikka,

stephan
The administrator has disabled public write access.

Superset matching operation 14 Feb 2003 14:17 #6395

Dear Stephan,

beside the fact that I believe that the example you gave is a little bit
buggy, I could not found the interpretive issue in the BNF you mentioned.

According to the BNF superset always reduces to SingleConstExpressions
or CompoundConstExpression. There is no place for wildcards.

So to answer your question, yes you can not use wildcard matching
symbols there.

Regards,

Theo

PS: No idea whether the semantic change was intentionally.

PS: The corrected example should be
type set of MyStruct MyStruct_List;
type record MyStruct { charstring a, integer b }

template MyStruct_List myRecvTemplate := superset( {a := "elvis lives
forever", b:= ? } ) ;

The first pair of braces war wrong, and you have to use the
fieldname/value notation.


Dr. Schulz Stephan schrieb:
> Hi all,
>
> when converting code form TTCN-2 to TTCN-3 I came across the superset
> operation. It looks to me that its semantics have been changed in
> TTCN-3 .. am I right or is this just a TTCN-3 tool bug? If so - has
> this happened intentionally?
>
> The difference is that in TTCN-2 you could use AnyValue and
> AnyValueOrNone matching symbols within this operation whereas in
> TTCN-3 this does not seem to be possible. The TTCN-3 BNF seems to be
> pretty interpretive on this issue.
>
> Ex.:
>
> type set of MyStruct MyStruct_List;
>
> type record MyStruct { charstring a, integer b }
>
> template MyStruct_List myRecvTemplate := {
>
> superset( {"elvis lives forever", ? } ) // this used to be a legal
> statement
>
> }
>
> Any comments would be appreciated.
>
> Moikka,
>
> stephan
>


--
Theofanis Vassiliou-Gioles Testing Technologies IST
Oranienburger Str. 65 The TTCN-3 Company
10117 Berlin, Germany phone +49 30 726 19 19 0
This email address is being protected from spambots. You need JavaScript enabled to view it. DDI +49 30 726 19 19 12
www.testingtech.de fax +49 30 726 19 19 20
The administrator has disabled public write access.

Superset matching operation 17 Feb 2003 05:45 #6396

Hi

> Dear Stephan,
>
> beside the fact that I believe that the example you gave is a
> little bit

You may find this surprising but with some tools out in the market today this actually analyzed successfully :)

> buggy, I could not found the interpretive issue in the BNF
> you mentioned.

OK - I am not a TTCN-3 BNF expert .. neither a TTCN-3 parser implementor .. but I was looking at the below lines:

550. ConstantExpression ::= SingleConstExpression | CompoundConstExpression
551. SingleConstExpression ::= SingleExpression
/* STATIC SEMANTICS - SingleConstExpression shall not contain Variables or Module parameters and
shall resolve to a constant Value at compile time */

And it was this semantics comment which I was a little blurry to me. When I first read this I was tempted of think of matching characters as being a short hand notation of a value list - which sounded to me as also being constant at compile time.

> According to the BNF superset always reduces to SingleConstExpressions
> or CompoundConstExpression. There is no place for wildcards.
>
> So to answer your question, yes you can not use wildcard matching
> symbols there.

Alright - then why this departure in TTCN-3 from original TTCN-2 semantics?

In the TTCN-2 BNF the superset is defined as

575 superset ::= "(" ConstraintValue&Attributes ")"
.... tada ..

563 ConstraintValue ::= ConstraintExpression | MatychingSymbol | ConsRef


According to my understanding of the language the superset operation is meant to be used in matching .. so I Have to say that it sounds quite counterintuitive - at least to me - that this operation "forbids" the use of matching characters (in TTCN-3).

Moikka,

stephan


>
> Regards,
>
> Theo
>
> PS: No idea whether the semantic change was intentionally.
>
> PS: The corrected example should be
> type set of MyStruct MyStruct_List;
> type record MyStruct { charstring a, integer b }
>
> template MyStruct_List myRecvTemplate := superset( {a := "elvis lives
> forever", b:= ? } ) ;
>
> The first pair of braces war wrong, and you have to use the
> fieldname/value notation.
>
>
> Dr. Schulz Stephan schrieb:
> > Hi all,
> >
> > when converting code form TTCN-2 to TTCN-3 I came across
> the superset
> > operation. It looks to me that its semantics have been changed in
> > TTCN-3 .. am I right or is this just a TTCN-3 tool bug? If so - has
> > this happened intentionally?
> >
> > The difference is that in TTCN-2 you could use AnyValue and
> > AnyValueOrNone matching symbols within this operation whereas in
> > TTCN-3 this does not seem to be possible. The TTCN-3 BNF
> seems to be
> > pretty interpretive on this issue.
> >
> > Ex.:
> >
> > type set of MyStruct MyStruct_List;
> >
> > type record MyStruct { charstring a, integer b }
> >
> > template MyStruct_List myRecvTemplate := {
> >
> > superset( {"elvis lives forever", ? } ) // this used to be a legal
> > statement
> >
> > }
> >
> > Any comments would be appreciated.
> >
> > Moikka,
> >
> > stephan
> >
>
>
> --
>
> Theofanis Vassiliou-Gioles Testing Technologies IST
> Oranienburger Str. 65 The TTCN-3 Company
> 10117 Berlin, Germany phone +49 30 726 19 19 0
> This email address is being protected from spambots. You need JavaScript enabled to view it. DDI +49 30 726 19 19 12
> www.testingtech.de fax +49 30 726 19 19 20
>
The administrator has disabled public write access.
  • Page:
  • 1

FacebookTwitterGoogle BookmarksRedditNewsvineTechnoratiLinkedin