ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0003383Part 01: TTCN-3 Core LanguageClarificationpublic16-05-2008 10:2909-12-2008 14:33
Thomas Deiß 
Ina Schieferdecker 
normalminorN/A
closedfixed 
v3.3.2 (published 2008-04) 
v4.1.1 (published 2009-06)v4.1.1 (published 2009-06) 
7, 16.1.1, 16.2.1,
Nokia Siemens Networks, Thomas Deiß
0003383: Order of assignments of fields
Part 1 does not define the order of assignments of fields or elements of structured types. Consider the following example:
module assign {
  type record t {
    integer a,
    integer b
  }
  
  control {
    var t x;
    
    x := {2, 3};
    x := { a := 4, b := x.a }
    log(x.b);
    
    x := {2, 3};
    x := {4, x.a};
    log(x.b);
  }
}

Part 1 leaves it open in which order the individual fields are processed. I suggest to add a statement to clause 7 that operands in expressions, including fields in structured types are evaluated from left to right.

A similar sentence should be added to the invocation of functions or altsteps: Actual parameters are evaluated from left to right.

Part 4 does not resolve this issue either.
No tags attached.
related to 0004155closed Ina Schieferdecker Clarification on the order of assignments 
doc CR3383_OrderOfAssignments.doc (110,592) 27-11-2008 14:29
http://oldforge.etsi.org/mantis/file_download.php?file_id=1817&type=bug
doc CR3383_OrderOfAssignments_02.doc (114,688) 28-11-2008 08:19
http://oldforge.etsi.org/mantis/file_download.php?file_id=1827&type=bug
doc CR3383_InoutParameterization.doc (24,576) 28-11-2008 10:57
http://oldforge.etsi.org/mantis/file_download.php?file_id=1834&type=bug
Issue History
16-05-2008 10:29Thomas DeißNew Issue
16-05-2008 10:29Thomas DeißStatusnew => assigned
16-05-2008 10:29Thomas DeißAssigned To => Ina Schieferdecker
16-05-2008 10:29Thomas DeißClause Reference(s) => 7, 16.1.1, 16.2.1,
16-05-2008 10:29Thomas DeißSource (company - Author) => Nokia Siemens Networks, Thomas Deiß
17-08-2008 09:34Ina SchieferdeckerTarget Version => Edition 4.1.1 (not yet published)
29-08-2008 04:30Thomas DeißNote Added: 0006647
18-09-2008 04:16Thomas DeißRelationship addedrelated to 0004155
27-11-2008 10:35Ina SchieferdeckerFile Added: CR3383_OrderOfAssignments.doc
27-11-2008 10:36Ina SchieferdeckerNote Added: 0007468
27-11-2008 10:36Ina SchieferdeckerAssigned ToIna Schieferdecker => Thomas Deiß
27-11-2008 10:36Ina SchieferdeckerResolutionopen => fixed
27-11-2008 14:28Ina SchieferdeckerFile Deleted: CR3383_OrderOfAssignments.doc
27-11-2008 14:29Ina SchieferdeckerFile Added: CR3383_OrderOfAssignments.doc
28-11-2008 08:19Thomas DeißFile Added: CR3383_OrderOfAssignments_02.doc
28-11-2008 08:20Thomas DeißNote Added: 0007491
28-11-2008 08:20Thomas DeißAssigned ToThomas Deiß => Ina Schieferdecker
28-11-2008 10:57Ina SchieferdeckerFile Added: CR3383_InoutParameterization.doc
09-12-2008 14:33Ina SchieferdeckerStatusassigned => resolved
09-12-2008 14:33Ina SchieferdeckerFixed in Version => Edition 4.1.1 (not yet published)
09-12-2008 14:33Ina SchieferdeckerStatusresolved => closed

Notes
(0006647)
Thomas Deiß   
29-08-2008 04:30   
It should be further clarified whether expressions on the left hand side of an assignment are evaluated before or after those on the right hand side. Also the precedence of . and [] in comparison to the other operators is unclear.

In the subsequent example it is actually quite unclear, what the result would be.

module evaluation {
  function inc(inout integer n) return integer {
    n := n + 1
    return n
  }
  
  control {
    var integer i := -1
    var integer a[8] := {3, 6, 4, 9, 13, 0, 23, 66}
    
    a[inc(i)] := a[inc(a[inc(i)])] + (a[inc(i)] - a[inc(i)])

    // a[0] := a[7] + (a[2] - a[3])
    // a is now {3, 7, 4, 9, 13, 0, 23, 66}
    // a[0] := 66 + (4 - 9)
    // a[0] := 61
  }
}
(0007468)
Ina Schieferdecker   
27-11-2008 10:36   
please check
(0007491)
Thomas Deiß   
28-11-2008 08:20   
editorial corrections