Ad/2010-08-01 Concrete Syntax for a uml action Language for Foundational uml (Alf) Second Revised Submission



Download 1.74 Mb.
Page46/62
Date28.01.2017
Size1.74 Mb.
#9041
1   ...   42   43   44   45   46   47   48   49   ...   62

17.13Link Operation Expressions


  1. A link operation expression for the operation createLink maps to a create link action for the named association with isReplaceAll=false for all ends. The value input pin of the end creation data for each end of the association is the target of an object flow from the result source element of the mapping of the corresponding argument expression. If an association end is ordered, then the insertAt input pin for that end is the target of an object flow from the result source element of the mapping of the corresponding index expression (which defaults to * if not given explicitly).

  2. A link operation expression for the operation destroyLink maps to a destroy link action for the named association. The value input pin of the end creation data for each end of the association is the target of an object flow from the result source element of the mapping of the corresponding argument expression. If an association end is unordered, the isDestroyDuplicates=true. If an association end is ordered, then isDestroyDuplicates=false and the insertAt input pin for that end is the target of an object flow from the result source element of the mapping of the corresponding index expression (which defaults to * if not given explicitly).

  3. A link operation expression for the link operation clearAssoc maps to a clear association action for the named association. The object input pin of clear association action is the target of an object flow from the result source element of the the mapping of the argument expression.

17.14Class Extent Expressions


  1. A class extent expression maps to a read extent action for the named class. The result output pin of the read extent action is the result source element for the class extent expression.

17.15Sequence Construction Expression


Collection Object Creation Expression

  1. A sequence construction expression that does not have multiplicity is mapped as an instance creation expression (see Subclause 17.12) with a constructor for the collection class given by the type name (see Subclause 11.6). The argument expression for the constructor is mapped as below for a sequence construction expression with multiplicity for the argument type of the collection class and the sequence elements from the original expression.

Sequence Element List

  1. A sequence construction expression that has multiplicity and a sequence list expression with a non-empty expression list is mapped to a structured activity node with a single output pin whose type and multiplicity, are as specified for the expression. The output pin is the result source element for the expression.

  2. Each element expression is mapped inside the structured activity node, with an object flow from its result source element to the structured activity node output pin. If there is more than one element expression, then the mapping for each element expression is wrapped in its own structured activity node and they are connected sequentially by control flows.

Sequence Range

  1. A sequence construction expression that has multiplicity and a sequence range expression is mapped to a structured activity node with the range upper and lower expressions mapped inside it. The result source elements of the upper and lower expressions are connected by object flows to input pins of a loop node in the structured activity node. The loop node also has a third input pin that has a multiplicity lower bound of 0. The output pin corresponding to this third input pin is the result source element for the sequence range expression

  2. The loop node is iterative, continually incrementing the value in its first loop variable until it reaches the value of its second loop variable. On each iteration, it appends the value of its first loop variable to the list in its third loop variable, which, at the end of the iteration, thus contains the desired sequence.

Empty Collections

  1. A sequence construction expression that has multiplicity and an empty expression list maps to a value specification action for a literal null. The result output pin of the value specification has the type given for the sequence list expression and the multiplicity [1..1]. It is the result source element for the expression.

  2. The keyword null is mapped as any[]{}.

17.16Sequence Access Expressions


  1. A sequence access expression is mapped to a call to the primitive behavior Alf::Library::PrimitiveBehaviors::SequenceFunctions::At (see Subclause 11.3.6). The result source element of the primary expression of the sequence access expression is connected by an object flow to the first argument input pin of the call behavior action. The result source element of the index expression is connected by an object flow to the second argument input pin. The result output pin of the call behavior action is the result source element for the sequence access expression.

17.17Sequence Operation Expressions


  1. A sequence operation expression is mapped as a behavior invocation expression (see Subclause 17.9) for the referent behavior, with the target primary expression as the first behavior argument. The result source element for the sequence operation expression is that of the behavior invocation expression.

17.18Sequence Reduction Expression


  1. A sequence reduction expression is mapped to a reduce action with the named behavior as the reducer. The collection input pin is the target of an object flow from the result source element of the mapping of the input expression. The result output pin of the reduce action is the result source element for the reduction expression.

17.19Sequence Expansion Expressions


  1. A sequence expansion expression maps to an expansion region with a single input expansion node. Except for the iterate operation, the expansion region has mode=parallel. For the iterate operation, the expansion region has mode=iterative.

  2. The input expansion node has the same type as the primary expression. It is the target of an object flow from the result source element of the mapping of the primary expression.

  3. The argument expression is mapped inside the expansion region. The input expansion node is connected by an object flow to a fork node within the expansion region that acts as the assigned source for references to the expansion variable within the mapping of the argument expression.

  4. The specific mapping for each kind of sequence expansion operation is further discussed in subsequent subclauses.

select and reject Expressions

  1. A select or reject expression is mapped as a sequence expansion expression (see Subclause 17.19). The expansion region from this mapping has an output expansion node of the same type as the primary expression of the sequence expansion expression. This node is the result source element for the overall sequence expansion expression.

  2. The result source element of the mapping of the argument expression is the source of the decision input flow for a decision node inside the expansion region. The decision node also has an incoming object flow from the expansion variable fork node and an outgoing object flow to the output expansion node. For a select operation, the guard on the outgoing object flow is true. For a reject operation, it is false.

collect and iterate Expressions

  1. A collect or iterate expression is mapped as a sequence expansion expression (see Subclause 17.19). The expansion region has an output expansion node of the same type as the argument expression. The result source element of the mapping of the argument expression is connected by an object flow inside the expansion region to the output expansion node.

  2. For an iterate operation, the expansion region has mode=iterative. Otherwise it has the normal mode=parallel.

forAll, exists and one Expressions

  1. A forall expression is mapped the same as a reject expression, except that the output expansion node of the expansion region is connected by an object flow to a call behavior action for the library isEmpty function. The result output pin of the call behavior action is the result source element for the forAll expression.

  2. An exists expression is mapped the same as a select expression, with the addition that, inside the expansion region, the decision node is not directly connected to the output expansion node but, rather, is connected to a fork node that is connected both to the output expansion node and to an activity final node. Further, the output expansion node of the expansion region is connected by an object flow to a call behavior action for the library notEmpty function. The result output pin of the call behavior action is the result source element for the exists expression.

NOTE. The inclusion of an activity final node within the expansion region is intended to terminate the region as soon as an element is found for which the Boolean expression is true. (Despite its name, an activity final node within a structured node such as an expansion region only terminates that structured node.)

  1. A one expression is mapped the same as a select expression, except that the output expansion node of the expansion region is connected by an object flow to a call behavior action for the library size function. The result output pin of the call behavior action is then connected by an object flow to the input pin of a test identity action whose other input pin is connected to a value specification action for the value 1. The result output pin of the test identity action is the result source element of the one expression.

isUnique Expressions

  1. An isUnique expression is mapped as a collect expression. The expansion output node of the expansion region mapped from the collect expression is connected by an object flow to a fork not which is then connect by object flows to an input expansion node and an input pin of another expansion region. The second expansion region is mapped similarly to a forAll expression, with the condition that the count of each value its sequence is 1. The result source element for the isUnique expression is the result output pin of the isEmpty call on the output of the second expansion region.


Download 1.74 Mb.

Share with your friends:
1   ...   42   43   44   45   46   47   48   49   ...   62




The database is protected by copyright ©ininet.org 2024
send message

    Main page