Home » Modeling » ATL » ATL Collection(different results come from the virtual machine)
ATL Collection [message #1021339] |
Tue, 19 March 2013 22:27 |
|
Hi,
I made a small scripts to demo. ATL to a friend. When it comes to collection types I got strange results.
Here is my script
helper def: myIntBag1: Bag(Integer) = Bag{ 5, 1, 9, 7, 3, 7};
helper def: myIntBag2: Bag(Integer) = Bag{ 8, 6, 0, 2, 4, 8};
helper def: myIntSequence1: Sequence(Integer) = Sequence{ 5, 1, 9, 7, 3, 7};
helper def: myIntSequence2: Sequence(Integer) = Sequence{ 8, 6, 0, 2, 4, 8};
helper def: myIntSet1: Set(Integer) = Set{ 5, 1, 9, 7, 3, 7};
helper def: myIntSet2: Set(Integer) = Set{ 8, 6, 0, 2, 4, 8};
helper def: myIntOrdSet1: OrderedSet(Integer) = OrderedSet{ 5, 1, 9, 7, 3, 7};
helper def: myIntOrdSet2: OrderedSet(Integer) = OrderedSet{ 8, 6, 0, 2, 4, 8};
Here are my first commands
thisModule.myIntBag1.toString().debug('Bag1');
thisModule.myIntBag2.toString().debug('Bag2');
thisModule.myIntSequence1.toString().debug('myIntSequence1');
thisModule.myIntSequence2.toString().debug('myIntSequence2');
thisModule.myIntSet1.toString().debug('myIntSet1');
thisModule.myIntSet2.toString().debug('myIntSet2');
thisModule.myIntOrdSet1.toString().debug('myIntOrdSet1');
thisModule.myIntOrdSet2.toString().debug('myIntOrdSet2');
Here is the output (what I got on the console) when I choose "EMF-specific VM"
Bag1: 'Bag {1, 3, 5, 7, 7, 9}'
Bag2: 'Bag {0, 2, 4, 6, 8, 8}'
myIntSequence1: 'Sequence {5, 1, 9, 7, 3, 7}'
myIntSequence2: 'Sequence {8, 6, 0, 2, 4, 8}'
myIntSet1: 'Set {1, 3, 5, 7, 9}'
myIntSet2: 'Set {0, 2, 4, 6, 8}'
myIntOrdSet1: 'OrderedSet {5, 1, 9, 7, 3}'
myIntOrdSet2: 'OrderedSet {8, 6, 0, 2, 4}'
Here is the output (what I got on the console) when I choose "Regular VM"
Bag1: 'Bag {5, 1, 9, 7, 3, 7}'
Bag2: 'Bag {8, 6, 0, 2, 4, 8}'
myIntSequence1: 'Sequence {5, 1, 9, 7, 3, 7}'
myIntSequence2: 'Sequence {8, 6, 0, 2, 4, 8}'
myIntSet1: 'Set {1, 3, 5, 7, 9}'
myIntSet2: 'Set {0, 2, 4, 6, 8}'
myIntOrdSet1: 'OrderedSet {5, 1, 9, 7, 3}'
myIntOrdSet2: 'OrderedSet {8, 6, 0, 2, 4}'
It seems the results does not match the ATL specification. For example: the bag is ordered in the first run, and the sequence is unordered in both runs.
I use
Eclipse Modeling Tools
Version: Juno Service Release 2
Build id: 20130225-0426
ATL 3.3.1.v201209061455
Yours,
|
|
|
Re: ATL Collection [message #1021544 is a reply to message #1021339] |
Wed, 20 March 2013 09:46 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
Looks fine to me.
A Bag is unordered so you any ordering you see is in your eyes only.
A Sequence is ordered in accordance with an sorting criterion defined by
the insertion policy of the invoking code.
Any subsequent re-interpretation by another sorting criterion is again
in your eyes only.
Regards
Ed Willink
On 19/03/2013 22:27, Mohamed Mussa wrote:
> Hi,
>
> I made a small scripts to demo. ATL to a friend. When it comes to
> collection types I got strange results.
>
> Here is my script
>
> helper def: myIntBag1: Bag(Integer) = Bag{ 5, 1, 9, 7, 3, 7};
> helper def: myIntBag2: Bag(Integer) = Bag{ 8, 6, 0, 2, 4, 8};
>
> helper def: myIntSequence1: Sequence(Integer) = Sequence{ 5, 1, 9, 7,
> 3, 7};
> helper def: myIntSequence2: Sequence(Integer) = Sequence{ 8, 6, 0, 2,
> 4, 8};
>
> helper def: myIntSet1: Set(Integer) = Set{ 5, 1, 9, 7, 3, 7};
> helper def: myIntSet2: Set(Integer) = Set{ 8, 6, 0, 2, 4, 8};
>
> helper def: myIntOrdSet1: OrderedSet(Integer) = OrderedSet{ 5, 1, 9,
> 7, 3, 7};
> helper def: myIntOrdSet2: OrderedSet(Integer) = OrderedSet{ 8, 6, 0,
> 2, 4, 8};
>
>
> Here are my first commands
>
> thisModule.myIntBag1.toString().debug('Bag1');
> thisModule.myIntBag2.toString().debug('Bag2');
> thisModule.myIntSequence1.toString().debug('myIntSequence1');
> thisModule.myIntSequence2.toString().debug('myIntSequence2');
> thisModule.myIntSet1.toString().debug('myIntSet1');
> thisModule.myIntSet2.toString().debug('myIntSet2');
> thisModule.myIntOrdSet1.toString().debug('myIntOrdSet1');
> thisModule.myIntOrdSet2.toString().debug('myIntOrdSet2');
>
>
> Here is the output (what I got on the console) when I choose
> "EMF-specific VM"
> Bag1: 'Bag {1, 3, 5, 7, 7, 9}'
> Bag2: 'Bag {0, 2, 4, 6, 8, 8}'
> myIntSequence1: 'Sequence {5, 1, 9, 7, 3, 7}'
> myIntSequence2: 'Sequence {8, 6, 0, 2, 4, 8}'
> myIntSet1: 'Set {1, 3, 5, 7, 9}'
> myIntSet2: 'Set {0, 2, 4, 6, 8}'
> myIntOrdSet1: 'OrderedSet {5, 1, 9, 7, 3}'
> myIntOrdSet2: 'OrderedSet {8, 6, 0, 2, 4}'
>
>
>
> Here is the output (what I got on the console) when I choose "Regular VM"
> Bag1: 'Bag {5, 1, 9, 7, 3, 7}'
> Bag2: 'Bag {8, 6, 0, 2, 4, 8}'
> myIntSequence1: 'Sequence {5, 1, 9, 7, 3, 7}'
> myIntSequence2: 'Sequence {8, 6, 0, 2, 4, 8}'
> myIntSet1: 'Set {1, 3, 5, 7, 9}'
> myIntSet2: 'Set {0, 2, 4, 6, 8}'
> myIntOrdSet1: 'OrderedSet {5, 1, 9, 7, 3}'
> myIntOrdSet2: 'OrderedSet {8, 6, 0, 2, 4}'
>
>
> It seems the results does not match the ATL specification. For
> example: the bag is ordered in the first run, and the sequence is
> unordered in both runs.
>
> I use
>
> Eclipse Modeling Tools
> Version: Juno Service Release 2
> Build id: 20130225-0426
> ATL 3.3.1.v201209061455
>
>
>
> Yours,
>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 26 11:38:01 GMT 2024
Powered by FUDForum. Page generated in 0.03166 seconds
|