ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details

ID | Project | Category | View Status | Date Submitted | Last Update
0007893 | Part 01: TTCN-3 Core Language | New Feature | public | 24-01-2020 11:25 | 16-12-2020 14:55

Reporter | Jacob Wieland - Spirent |
Assigned To | Gyorgy Rethy |
Priority | normal | Severity | minor | Reproducibility | have not tried
Status | closed | Resolution | fixed |
Platform |  | OS |  | OS Version |
Product Version | 4.12.1 (published 2020-05) |
Target Version | 4.13.1 (ongoing) | Fixed in Version | 4.13.1 (ongoing) |
Clause Reference(s) | 20.2.
Source (company - Author) | Spirent - Jacob Wieland

Summary | 0007893: Allow use of non-deterministic functions in alt-statement header

Description

At the moment, inside alt-statements, no function can be invoked that is non-deterministic to preserve the alt-statement-snapshot semantics.
However, it would sometimes be convenient to allow initialization of local alt-variables by use of nondeterministic (especially time-related) functions.
As an alt-statement is needs to enter the snapshot-semantic only before the evaluation of alternatives, this would not violate the snapshot-semantic.
The evaluation would be:
1) Initialization of local-alt-variables
2) Enter snapshot
3) Evaluate alternatives
4) Leave snapshot
If the alt-statement is re-evaluated (either because of repeat or because no alternative was chosen), the whole process would be repeated, i.e. the local-alt-variables are re-initialized for every alt-cycle.

Steps To Reproduce

Consider the following use case:
We have messages that contain a timestamp in the form of a date-string.
type charstring UTCTimestamp;
And we have a functions
external function f_currentTime() return integer;
function f_convertToTimeMillis(UTCTimestamp p_timestamp) return integer { ... }
And a template (advanced matching)
template UTCTimestamp isCloseTo(integer timeMillis, int tolerance) := @dynamic {
return Math.abs(f_convertToTimeMillis(value) - timeMillis) <= tolerance
}
Now, we want to check whether the field of a message is close to a timestamp that is determined shortly before awaiting/expecting the message.
alt {
var integer currentTime := f_getCurrentTime();
[] p.receive(Message:{ ..., ts := isCloseTo(currentTime, 10) }) { ... }
...
}

Additional Information

This feature is especially useful if the alt-statement uses repeat statements (otherwise, the assignments could simply be placed before the alt-statement).
This feature would only be allowed for top-level alt-statements, not for altstep definitions. Alternatively, it could be allowed for altstep-definitions as well, but these altstep-definitions then shall only be usable for top-level invocations (not as alternative-headers in other alt-statements or altsteps).

Tags | No tags attached.
Relationships |
Attached Files | CR7893.docx (270,972) 12-08-2020 13:00 http://oldforge.etsi.org/mantis/file_download.php?file_id=3922&type=bug CR7893-2.docx (327,153) 13-08-2020 10:29 http://oldforge.etsi.org/mantis/file_download.php?file_id=3933&type=bug

Issue History
Date Modified | Username | Field | Change
24-01-2020 11:25 | Jacob Wieland - Spirent | New Issue |
10-08-2020 11:19 | Jens Grabowski | Assigned To | => Jacob Wieland - Spirent
10-08-2020 11:19 | Jens Grabowski | Status | new => assigned
10-08-2020 11:19 | Jens Grabowski | Project | TTCN-3 Change Requests => Part 01: TTCN-3 Core Language
12-08-2020 13:00 | Jacob Wieland - Spirent | File Added: CR7893.docx |
12-08-2020 13:01 | Jacob Wieland - Spirent | Note Added: 0015709 |
12-08-2020 13:01 | Jacob Wieland - Spirent | Assigned To | Jacob Wieland - Spirent => Tomas Urban
12-08-2020 13:01 | Jacob Wieland - Spirent | Status | assigned => confirmed
13-08-2020 10:29 | Tomas Urban | File Added: CR7893-2.docx |
13-08-2020 10:31 | Tomas Urban | Note Added: 0015724 |
13-08-2020 10:31 | Tomas Urban | Status | confirmed => resolved
13-08-2020 10:31 | Tomas Urban | Resolution | open => fixed
13-08-2020 10:31 | Tomas Urban | Assigned To | Tomas Urban => Gyorgy Rethy
16-12-2020 14:55 | Gyorgy Rethy | Note Added: 0015863 |
16-12-2020 14:55 | Gyorgy Rethy | Status | resolved => closed
16-12-2020 14:55 | Gyorgy Rethy | Product Version | => 4.12.1 (published 2020-05)
16-12-2020 14:55 | Gyorgy Rethy | Fixed in Version | => 4.13.1 (ongoing)
16-12-2020 14:55 | Gyorgy Rethy | Target Version | => 4.13.1 (ongoing)

Notes

(0015709)
Jacob Wieland - Spirent
12-08-2020 13:01

added propoosal, please review

(0015724)
Tomas Urban
13-08-2020 10:31

I made a single font change in the draft. Otherwise, it looks good. The proposed change resolves the issue described in this CR and is ready to be added to the next version of the core language standard.

(0015863)
Gyorgy Rethy
16-12-2020 14:55

Implemented in draft 4.12.2