ATL: Atlas Transformation Language. Reference Manual

ATL: Atlas Transformation Language Reference Manual - version 0.09 - 2005 by ATLAS group LINA & INRIA Nantes Content 1 Introduction ................
Author: Guest
31 downloads 0 Views 391KB Size
ATL: Atlas Transformation Language Reference Manual - version 0.09 -

2005 by

ATLAS group LINA & INRIA Nantes

Content 1

Introduction ....................................................................................................................... 1 QVT................................................................................................................................ 1 ATL and QVT ................................................................................................................ 1 OCL................................................................................................................................ 1 Objectives and Rationale................................................................................................ 1 2 Grammar............................................................................................................................ 1 2.1 Context-Free Grammar .................................................................................................. 1 2.2 Grammar Notation.......................................................................................................... 2 3 Lexical Structure ............................................................................................................... 2 3.1 Encoding......................................................................................................................... 2 3.2 Lexical Translations ....................................................................................................... 3 3.3 Unicode Escapes ............................................................................................................ 3 3.4 Line Terminators ............................................................................................................ 3 3.5 Input Elements and Tokens ............................................................................................ 4 3.6 White Space.................................................................................................................... 4 3.7 Comments....................................................................................................................... 4 3.8 Identifiers ....................................................................................................................... 4 3.9 Keywords ....................................................................................................................... 5 3.10 Separators ....................................................................................................................... 6 3.11 Operators ........................................................................................................................ 6 3.12 Infix Operators ............................................................................................................... 6 4 Data Model........................................................................................................................ 7 4.1 OclAny ........................................................................................................................... 7 4.2 Model Elements.............................................................................................................. 7 4.3 Primitive Types .............................................................................................................. 8 4.3.1 The Boolean Type .................................................................................................. 8 4.3.2 The String Type...................................................................................................... 9 4.3.3 Numeric Types ....................................................................................................... 9 4.4 Collections.................................................................................................................... 11 4.4.1 Set......................................................................................................................... 12 4.4.2 OrderedSet............................................................................................................ 13 4.4.3 Bag ....................................................................................................................... 14 4.4.4 Sequence............................................................................................................... 15 4.4.5 Iterator Expressions.............................................................................................. 16 4.5 Tuples ........................................................................................................................... 18 4.6 Enumerations................................................................................................................ 18 5 ATL Programs................................................................................................................. 18 5.1 Modules........................................................................................................................ 18 5.1.1 Header Section ..................................................................................................... 19 5.1.2 Import Section ...................................................................................................... 19 5.2 Queries ......................................................................................................................... 19 5.3 Libraries ....................................................................................................................... 19 6 OCL Expressions............................................................................................................. 20 6.1 The If Expression ......................................................................................................... 20 1.1 1.2 1.3 1.4

6.2 The Let Expression....................................................................................................... 20 7 Helpers ............................................................................................................................ 20 8 Declarative Rules ............................................................................................................ 21 9 Imperative Constructs ..................................................................................................... 22 10 Execution Semantics ....................................................................................................... 22 I. References ....................................................................................................................... 24

ATL User Manual

1 Introduction ATL, the Atlas Transformation Language, is the ATLAS INRIA & LINA research group answer to the OMG MOF [5][6] /QVT RFP [6]. It is a model transformation language specified both as a metamodel and as a textual concrete syntax. It is a hybrid of declarative and imperative. The preferred style of transformation writing is declarative, which means simple mappings can be expressed simply. However, imperative constructs are provided so that some mappings too complex to be declaratively handled can still be specified. An ATL transformation program is composed of rules that define how source model elements are matched and navigated to create and initialize the elements of the target models.

1.1 QVT QVT is an acronym for Query, View and Transformation. This is how they are described in QVT RFP [6]: • Queries take as input a model, and select specific elements from that model. • Views are models that are derived from other models. • Transformations take as input a model and update it or create a new model.

1.2 ATL and QVT ATL supports QVT queries, QVT views and QVT transformations. Nevertheless, there are some minor differences. ATL programs perform queries and transformations. Since views are models and ATL programs take models as input and, in general, produce models as output, views are a specific case of the input or of the output of ATL programs. There are two kinds of executable ATL programs, namely modules and queries. Modules transform models to models while queries do models to text transformations. Finally, ATL supports libraries which allow defining repetitive pieces of code in one place.

1.3 OCL ATL is based on OCL [7], the Object Constraint Language. ATL supports OCL expressions (see chapter 6) and it has a type model (see chapter 4) that is very similar to the one of OCL.

1.4 Objectives and Rationale The objective of ATL is a transformation language that on the one hand is close to the standards and on the other hand very powerful and easy to use. A rich set of tools has been built for ATL development [1] under Eclipse. The Java Language Specification [3] is a good and well-known example of a language specification. For this reason, the specification in this ATL Reference Manual is based on it. It contains a similar document structure and uses the same context-free grammar.

2 Grammar To describe ATL, an EBNF-like context-free grammar has been chosen.

2.1 Context-Free Grammar Context-free grammars are a common way to describe computer languages. Context-free grammars consist of production rules. These have an abstract symbol called a nonterminal on their left-hand side. On their right hand side they have a sequence of nonterminal and terminal symbols defining the syntax of the left-hand side nonterminal.

Page 1

ATL Reference Manual

2.2 Grammar Notation Nonterminal and terminal symbols are shown in fixed width. Furthermore, nonterminal symbols are shown in italic. The declaration of the nonterminal on the right-hand side is introduced by the name of the nonterminal and followed by a semicolon. One or more alternative right-hand sides then follow on succeeding lines to define the content of the nonterminal. This example defines an if-expression: IfExpression : if ( Expression ) then Expression else Expression endif

An if-expression consists of an “if-then-else-endif” structure. The “if” is followed by a Boolean expression. The “then” and the “else” introduce each an expression. The else-part is not optional. The words “one of” introduce alternatives: BooleanLiteral : one of true false

which is shorthand for: BooleanLiteral : true false

Left-side terminals or nonterminals can be declared optional with the “opt” keyword. Input : InputElementsopt

The above means that an input may consist of input elements but an input may also be empty. If a line is too short, the content can be split on several lines. While alternatives start at the same indention, split lines have additional indention. TargetPatternElement : Identifier : MetamodelClassPath ( Assignements ) Identifier : distinctopt MetamodelClassPath foreach (Identifier in Identifier ) ( Assignements ) The definition contains two alternatives starting with the nonterminal identifier. The second left side alternative is split on two lines.

3 Lexical Structure 3.1 Encoding ATL programs are written using the Unicode character set. Except for comments, identifiers, and the contents of character and string literals, all input elements in an ATL program are formed only from ASCII characters (or Unicode escapes which result in ASCII characters). Information about the Unicode encoding standard can be found in the Unicode Standard [9]. ASCII characters are the first 128 characters of the Unicode character encoding. Page 2

ATL Reference Manual

3.2 Lexical Translations The lexical translation of an ATL program in the form of a raw Unicode character stream can be summarized in three steps: 1. A first translation step transforms the Unicode escapes in the raw stream of Unicode (in general ASCII) characters to the corresponding Unicode characters. 2. A second translation step takes the result of step 1 and translates it into a stream of input characters and line terminators. 3. A third translation step takes the result of step two and translates it into a sequence of input elements. After discarding comments and white spaces the result comprises the tokens that are the terminal symbols of the syntactic grammar.

3.3 Unicode Escapes Implementations first recognize Unicode escapes in their input, translating the ASCII characters \u followed by four hexadecimal digits to the Unicode character with the indicated hexadecimal value, and passing all other characters unchanged. This translation step results in a sequence of Unicode input characters: UnicodeInputCharacter : UnicodeEscape RawInputCharacter UnicodeEscape : \ UnicodeMarker HexDigit HexDigit HexDigit HexDigit \ any Unicode character UnicodeMarker : u UnicodeMarker u RawInputCharacter : any Unicode character but not “ HexDigit : one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F

The “\”, the “u”, and hexadecimal digits are all ASCII characters. For example, “\u2297” is the Unicode encoding of the character " " and “\n” is the encoding of the CR character (carriage return).

3.4 Line Terminators For the second lexical translation step line terminators and input characters have to be identified. This is how they are defined: LineTerminator : the ASCII LF character, also known as "newline" the ASCII CR character, also known as "return" the ASCII CR character followed by the ASCII LF character InputCharacter : UnicodeInputCharacter but not CR or LF

Page 3

ATL Reference Manual

3.5 Input Elements and Tokens Very important for the lexical translation are input elements, and tokens. An input element can be a white space, a comment or a token. Tokens represent the terminal symbols of the syntactic grammar (e.g. keywords, identifiers, literals and operators). Input : InputElementsopt InputElements : InputElement InputElements InputElement InputElement : WhiteSpace Comment Token Token : Identifier Keyword Literal Separator Operator

3.6 White Space A white space is defined as ASCII space, horizontal tab, form feed characters, or as line terminator. WhiteSpace : the ASCII SP character, also known as "space" the ASCII HT character, also known as "horizontal tab" the ASCII FF character, also known as "form feed" LineTerminator

3.7 Comments Comments start with two consecutive hyphens and end with the line terminator. Comment : -- CharactersInLineopt LineTerminator CharactersInLine : InputCharacter CharactersInLine InputCharacter

3.8 Identifiers Please note that OCL identifiers are defined as String and String as a chain of characters which is not restricted to specific characters. “myVariable” is a possible name for an identifier as much as “4any-thing2:)” (a mix of signs, digits and letters). Identifiers are unlimited sequences of specific Unicode characters and are defined as follows: Identifier : IdentifierChars but not Keyword, BooleanLiteral or NullLiteral “ UnicodeInputCharacters “

Page 4

ATL Reference Manual

UnicodeInputCharacters : UnicodeInputCharacter UnicodeInputCharacter UnicodeInputCharacters IdentifierChars : LetterOrDigit IdentifierChars LetterOrDigit Letter : any Unicode character between a and z or A and Z LetterOrDigit : any Letter or any Unicode character between 0 and 9

Examples of identifiers are: String myVariable MAX_VALUE isLetterOrDigit i “-“ “\n”

The usage of inverted commas allows overwriting operators: query TestOperatorDefinition = '123'."-"(2); helper context String def: "-"(i : Integer) : String = self.substring(1,self.size() - i);

Identifier declarations with chains of Unicode input characters containing none identifier characters have to be put in double inverted commas (similar rules apply to keywords). However, what has not yet been specified (and this applies only to chains of Unicode input characters containing none identifier characters and not to keywords) is that when identifiers are used (and not declared) in the program double inverted commas are not necessary. Thus the following code is also possible: query TestOperatorDefinition = '123' - 2; helper context String def: "-"(i : Integer) : String = self.substring(1,self.size() - i);

For the declaration of overloaded operators inverted commas are obligatory.

3.9 Keywords The following words are ATL keywords: Keyword : one of not module def to do let

and create context mapsTo if library

or from rule distinct then query

Page 5

xor uses using foreach else for

implies helper derived in endif

ATL Reference Manual

3.10 Separators The following nine ASCII characters are the separators (punctuators): Separator : one of ( ) .

{

}

[

]

;

,

3.11 Operators Operators can be used by the ASCII Operator: UnaryOperator BinaryOperator

The following tokens are basic operators. They are formed from ASCII characters: UnaryOperator : one of + BinaryOperator = + div

-

%

: one of > < * mod

not

= &

!= |

OperatorExpression : UnaryOperator Expression Expression . UnaryOperator () Expression BinaryOperator Expression Expression . BinaryOperator ( Expression )

The operators are listed in precedence order with the highest precedence at the top of the table: Priority of operators precedence @pre brackets, dot and arrows [] () {} . = equality = logical AND and logical OR and XOR or xor logical implies implies

3.12 Infix Operators As in OCL, ATL has allows the use of infix operators. The binary operators ‘+’, ‘-’, ‘*’. ‘/’, ‘’, ‘’ ‘=’ can be used in an expression as ordinary infix operators or in operation-like expressions.

Page 6

ATL Reference Manual The following infix operator expression: a + b

is equivalent to the operation-like expression: a.+( b )

4 Data Model ATL is a strongly typed language since every expression has a type that is known at compile time. The ATL type model is very similar to the OCL type model; in particular what concerns the primitive types, the model elements and the collection types

4.1 OclAny An important superclass of the OCL type system is OclAny from which, among others, OclModelElement, OclType, Real, Boolean and String inherit. OclAny = OclAny : Boolean Returns true if the objects are the same, otherwise false. OclAny OclAny : Boolean Returns false if the objects are the same, otherwise true. OclAny oclIsNew : Boolean Returns true if the object is newly created (i.e. didn’t exist at precondition time), otherwise false. OclAny oclIsTypeOf( OclType ) : Boolean Returns true if the object is of the OclType specified, otherwise false. OclAny oclIsKindOf( OclType ) : Boolean Returns true if the objects conforms to the OclType specified (thus also to any of its subclasses), otherwise false. OclType allInstances : Set Returns all instances of a type (that are in a given source model). OclAny oclIsUndefined : Boolean Returns true if the object is void (void is represnted by OclVoid), otherwise false.

4.2 Model Elements Model Element Types are defined by the corresponding source and target metamodels. ATL has an abstraction layer that allows adapting to different metametamodels via corresponding adaptors. In ATL it is not allowed to presume the execution order (namely the order of creation of model elements of the target model) since this is a decision of the ATL implementation and a matter of optimization. This means that model elements of the target models are not allowed to be used on the right hand side of assertions. Page 7

ATL Reference Manual

OclModelElement = OclModelElement : Boolean Returns true if the model elements are the same, otherwise false. OclModelElement OclModelElement : Boolean Returns false if the model elements are the same, otherwise true.

4.3 Primitive Types The primitive types of ATL correspond to the OCL primitive types, namely to Boolean, String, Integer and Real. Integer and Real are numeric types. In OCL primitive types are only vaguely specified leaving space for different implementations (e.g. there is no precision of the limits of numeric types). The ATL language specification does not intend to be more restrictive than OCL but at the same time gives an indication about the current implementation. These are the primitive types in ATL: PrimitiveType : Boolean String NumericType

In OCL there is no numeric type. The ATL numeric type and the ATL Real correspond to OCL Real. Numeric type has only been used to facilitate the specification of ATL.

4.3.1 The Boolean Type The Boolean type has two values, true and false. A Boolean literal is defined as follows: BooleanLiteral : one of true false

Boolean has the following operations: BooleanOperation: one of and or xor not

implies

Boolean expressions determine the control flow in if-expressions. Boolean and Boolean : Boolean True if both boolean values are true, otherwise false. Boolean or Boolean : Boolean True if at least one boolean value is true, otherwise false. Boolean xor Boolean : Boolean True if exactly one boolean value is true, otherwise false. not Boolean : Boolean True if the boolean value is false, otherwise false. Boolean implies Boolean : Boolean False if the first boolean value is true and the second false, otherwise true. Page 8

ATL Reference Manual

4.3.2 The String Type Strings are chains of characters. String literals are defined as follows: StringLiteral : ' StringCharactersopt ' StringCharacters : StringCharacter StringCharacters StringCharacter StringCharacter : InputCharacter but not ' or \ EscapeSequence

The following are examples of string literals: '' '\'' 'A String' 'This is a \n' + 'two-line String'

-------

the empty String a string containing “'” a string containing 8 characters actually a string-valued constant expression, formed from two String literals

String has the following operations: StringOperation : one of concat() size() toReal()

substring()

String concat( String ) : String The concatenation of the two String values. String size() : Integer The number of characters in the String. String substring( Integer , Integer ) : String The Substring between the two Integers. String toInteger() : Integer The Integer value that is coded in the String. String toReal() : Integer The Real value that is coded in the String.

4.3.3 Numeric Types ATL has two numeric types, namely Integer and Real. NumericType : Integer Real

Numeric types have the following operations: NumericOperation : one of

Page 9

toInteger()

ATL Reference Manual * + / div() sin() cos() floor() max() min() abs() sum() mod() round()

The ATL language does not specify numeric limits. The limits depend on the implementation. The current implementation for Integer and Real is based on Java [3] and thus has the same limits as the corresponding Java types which are java.lang.Integer and java.lang.Double. NumericType * NumericType : NumericType The multiplication of two numeric values. NumericType + NumericType : NumericType The addition of two numeric values. NumericType - NumericType : NumericType The substraction of two numeric values. - NumericType : NumericType The negative numeric value. NumericType / NumericType : NumericType NumericType.div( NumericType ) : NumericType The division of two numeric values. NumericType.sin() : NumericType The sinus of a numeric value. NumericType.cos() : NumericType The cosinus of a numeric value. NumericType.floor() : NumericType The largest numeric value which is less or equal than the numeric value. NumericType.max( NumericType ) : NumericType The maximum of the two numeric values. NumericType.min( NumericType ) : NumericType The minimum of the two numeric values. NumericType.cos() : NumericType The absolute numeric value. Collection.sum(): NumericType The sum of all numeric values. NumericType.mod( NumericType ) : NumericType The result of modulo of the first numeric value with the second. NumericType.round() : Integer The Integer value that is closet to the numeric value. Halve values are rounded up. Page 10

ATL Reference Manual

4.3.3.1 Integer An Integer is a whole number. Integer literal examples are “2” and “– 123”. Integer is the supertype of Real. Integer has the operations: IntegerOperation : one of NumericOperation

4.3.3.2 Real A Real is a number that may have a fractional part, an exponent, and a type suffix. Examples of Reals are “5e5f” and “-3.12”. Real has the operations: IntegerOperation : one of IntegerOperation

4.4 Collections Collection is the abstract superclass of Set, OrderedSet, Bag and Sequence. • • • •

Set is a collection without duplicates. Set has no order. OrderedSet is a collection without duplicates. OrderedSet has an order. Bag is a collection in which duplicates are allowed. Bag has no order. Sequence is a collection in which duplicates are allowed. Sequence has an order.

Collections contain zero to n expressions. CollectionElements : 0to1CollectionElements 2toNCollectionElements 0to1CollectionElements : Expressionopt 2toNCollectionElements : Expression , Expression Expression , 2toNCollectionElements

Collection literals are defined as follows: SetLiteral : Set { CollectionElements } OrderedSetLiteral : OrderedSet { CollectionElements } BagLiteral : Bag { CollectionElements } SequenceLiteral : Sequence { CollectionElements }

Examples of collections are: Page 11

ATL Reference Manual

Sequence{ 1, 2, 3, 4, 5, 6, 7, 8 } Sequence{ 1..(4 + 4) } Sequence{ 1..8 }

All three sequence expressions are semantically identical. Collection has the following operations: Collection.size() : Integer The number of elements in the collection. Collection.includes( Object ) : Boolean The information of whether an object is part of a collection. Collection.excludes( Object ) : Boolean The information of whether an object is not part of a collection. Collection.count( Object ) : Integer The number of times that object occurs in the collection. Collection.includesAll( Collection ) : Boolean The information of whether all objects of a given collection are part of a specific collection. Collection.excludesAll( Collection ) : Boolean The information of whether none of the objects of a given collection are part of a specific collection. Collection.isEmpty() : Boolean The information if a collection is empty. Collection.notEmpty() : Boolean The information if a collection is not empty.

4.4.1 Set Set inherits all collection operations. Additionally, set has the following set specific operations: Set.union( Set ) : Set The union of the first and the second set. Set.union( Bag ) : Bag The union of the set and the first bag. Set = Set : Boolean Tests if the sets contain the same elements and if this is true it returns true. Set.intersection( Set ) : Set The intersection of the first and the second set. Set. intersection( Bag ) : Bag Page 12

ATL Reference Manual The intersection of the set and the first bag. Set - Set : Set Returns a set with those elements of the first set that are not in the second. Set including( Object ) : Set Adds the object to the set. Set excluding( Object ) : Set Removes the object from the set. Set symmetricDifference( Set ) : Set Returns a set with all those set elements that are in exactly one of the sets (an not in both). Set count( Object ) : Integer The number of occurrences of object in the set (because of the set characteristic possible results are 0 and 1, but not a number greater than 1). Set flatten() : Set If the elements of the set are not collections the set will be returned unmodified. If the elements in the set are collections, the returned set will directly contain all elements of those collections. Set asSet() : Set Returns the set unmodified. Set asOrderedSet() : OrderedSet Casts the set to an ordered set. Set asSequence() : Sequence Casts the set to a sequence. Set asBag() : Bag Casts the set to a bag.

4.4.2 OrderedSet Ordered set inherits all collection operations. Additionally, ordered set has the following ordered set specific operations: OrderedSet append( Object ) : OrderedSet Appends the object at the end of the ordered set. OrderedSet prepend( Object ) : OrderedSet Inserts the object at the first place of the ordered set. OrderedSet insertAt( Integer, Object ) : OrderedSet Inserts the object at the place indicated by the Integer value in the ordered set. OrderedSet subOrderedSet ( Integer, Integer ) : OrderedSet All elements starting at the first Integer value and including the second Integer value. Page 13

ATL Reference Manual

OrderedSet at( Integer ) : Object Returns the object at the position indicated by the Integer value in the ordered set. OrderedSet indexOf( Object ) : Integer Returns the position of the object in the ordered set. OrderedSet first( Integer ) : Object Returns the first object of the ordered set. OrderedSet last( Integer ) : Object Returns the last object of the ordered set.

4.4.3 Bag Bag inherits all collection operations. Additionally, bag has the following bag specific operations: Bag.union( Bag ) : Bag The union of the first and the second bag. Bag.union( Set ) : Bag The union of the set and the first bag. Bag = Bag : Boolean Tests if the bags contain the same elements the same number of times and if this is true, it returns true. Bag.intersection( Bag ) : Bag The intersection of the first and the second bag. Bag. intersection( Set ) : Set The intersection of the bag and the first set. Bag including( Object ) : Bag Adds the object to the bag. Bag excluding( Object ) : Bag Removes all occurrences of the given object from the bag. Bag count( Object ) : Integer The number of occurrences of object in the bag. Bag flatten() : Bag If the elements of the bag are not collections the bag will be returned unmodified. If the elements in the bag are collections, the returned bag will directly contain all elements of those collections. Bag asSet() : Set Casts the bag to a set. This removes all duplicates.

Page 14

ATL Reference Manual Bag asOrderedSet() : Sequence Casts the bag to an ordered set (undefined order). This removes all duplicates. Bag asSequence() : Sequence Casts the bag to a sequence (undefined order). Bag asBag() : Bag Returns the bag unmodified.

4.4.4 Sequence Sequence inherits all collection operations. Additionally, sequence has the following sequence specific operations: Sequence count( Object ) : Integer The number of occurrences of object in the Sequence. Sequence = Sequence : Boolean Tests if the sequences contain the same elements in the same order and if this is true, it returns true. Sequence.union( Sequence ) : Sequence Appends the second sequence to the first sequence. Sequence flatten() : Sequence If the elements of the sequence are not collections the sequence will be returned unmodified. If the elements in the sequence are collections, the returned sequence will directly contain all elements of those collections. Sequence append( Object ) : Sequence Appends the object at the end of the sequence. Sequence prepend( Object ) : Sequence Inserts the object at the first place of the sequence. Sequence insertAt( Integer, Object ) : Sequence Inserts the object at the place indicated by the Integer value in the sequence. Sequence subSequence ( Integer, Integer ) : Sequence All elements starting at the first Integer value and including the second Integer value. Sequence at( Integer ) : Object Returns the object at the position indicated by the Integer value in the sequence. Sequence indexOf( Object ) : Integer Returns the position of the object in the sequence. Sequence first( Integer ) : Object Returns the first object of the sequence. Sequence last( Integer ) : Object Page 15

ATL Reference Manual Returns the last object of the sequence. Sequence including( Object ) : Sequence Adds the object to the sequence. Sequence excluding( Object ) : Sequence Removes all occurrences of the given object from the sequence. Sequence asSet() : Set Casts the sequence to a set. This removes all duplicates. Sequence asOrderedSet() : Sequence Casts the sequence to an ordered set. This removes all duplicates. Sequence asSequence() : Sequence Returns the sequence unmodified. Sequence asBag() : Bag Casts the sequence to a bag.

4.4.5 Iterator Expressions ATL supports OCL iterator expressions. Iterator expressions consist of a source, a body, iterator(s), and a result.

4.4.5.1 Collection There is a rich set of iterator expressions defined on collection. exists If body evaluates to true for at least one element in the source collection, the exists expression returns true, otherwise false. forAll If body evaluates to true for at all elements in the source collection, the forAll expression returns true, otherwise false. isUnique If body expression evaluates for each element in the source collection a different value, the isUnique expression returns true, otherwise false. any Returns any element in the source collection for which body evaluates to true. one If body evaluates to true for exactly one element in the source collection, the one expression returns true, otherwise false. collect The collect expression returns the collection of elements which results from applying body to every member of the source set. The result is flattened. Page 16

ATL Reference Manual

4.4.5.2 Set Set allows the iterator expressions defined on collection and additionally it defined some set specific ones. select The subset of set for which the body evaluates to true. reject The subset of set for which the body evaluates to false. collectNested Returns the bag of elements which results from applying body to every member of the source set. sortedBy Returns the Set as an ordered set, lower values go first. The elements of the set must be comparable with” size() = 0 )->first() in g; } to out : DXF2!Point ( name