2 Copyright (c) 2000-2016 Ericsson Telecom AB
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Public License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/legal/epl-v10.html
16 Szabo, Janos Zoltan – initial implementation
20 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
21 <meta http-equiv=
"Content-Language" content=
"en-us">
22 <title>interleave
</title>
24 <body bgcolor=
"#DAD3C5" vlink=
"#0094D2" link=
"#003258">
25 <table align=
"left" border=
"0" cellspacing=
"0" cellpadding=
"0" valign=top
>
27 <td width=
105 height=
40><a href=
"https://projects.eclipse.org/projects/tools.titan"><img src=
"../images/titan_transparent.gif" border=
0 width=
105 height=
40 align=
"left" alt=
"Titan"></a></td>
30 <table border=
"0" align=
"right" cellpadding=
"0" cellspacing=
"0">
32 <td><a href=
"../titan_main.html" alt=
"contents"><img border=
"0" src=
"../images/ao.jpg" width=
"53" height=
"40"></a></td>
33 <td><a href=
"../titan_index.html" alt=
"index"><img border=
"0" src=
"../images/up.jpg" width=
"53" height=
"40"></a></td>
34 <td><a href=
"integer.html" alt=
"previous"><img border=
"0" src=
"../images/left.jpg" width=
"53" height=
"40"></a></td>
35 <td><a href=
"isbound.html" alt=
"next"><img border=
"0" src=
"../images/right.jpg" width=
"53" height=
"40"></a></td>
42 <hr align=
"left" width=
"75%">
43 <p>The statement denotes branching of test behavior due to the reception and handling of communication and/or timer events and/or the termination of parallel test components. The sequence of the
44 events does not matter. The individual alternatives (or branches) contain an event or
"receiving operation
", which can be successful or unsuccessful (
"condition
") and end by an
45 optional statement block.
46 <p>Opposed to alt statement, where only a single alternative is taken, all branches of the interleave statement must
"happen
".
47 <p>Related keyword:
</p>
49 <li><a href=
"alt.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">alt
</font></b></a></li>
51 <hr align=
"left" width=
"50%">
53 <table border=
"0" width=
"90%" bgcolor=
"#FFB599" cellpadding=
"4">
56 <h3 align=
"left"><font face=
"Courier New" color=
"#003258" size=
"5"><b>interleave {
<br>
57 []
</b></font> [
<i>condition
</i>]
<font face=
"Courier New" color=
"#003258" size=
"5"><b>{
</b></font> [
<i>statement_block
</i>]
<font face=
"Courier New" color=
"#003258" size=
"5"><b>}
<br>
58 </b></font> ...
<font face=
"Courier New" color=
"#003258" size=
"5"><b><br>
59 };
</b></font> </h3>
66 <p>The
<font face=
"Courier New" color=
"#003258" size=
"4"><b>interleave
</b></font> keywords introduces the branching definition.
</p>
69 <p>Each branch begins with a pair of brackets (the brackets must be empty).
</p>
72 <p><i>condition
</i> may be a communication or a timer event or the termination of a parallel test component. The following operations may be written here:
<a href=
"receive.html"><b><font
73 face=
"Courier New" color=
"#003258" size=
"4">receive
</font></b></a>,
<a href=
"trigger.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">trigger
</font></b></a>,
<a href=
"getcall.html"><b><font
74 face=
"Courier New" color=
"#003258" size=
"4">getcall
</font></b></a>,
<a href=
"catch.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">catch
</font></b></a>,
<a href=
"check.html"><b><font
75 face=
"Courier New" color=
"#003258" size=
"4">check
</font></b></a>,
<a href=
"timeout.html"><b><font face=
"Courier New" color=
"#003258" size=
"4">timeout
</font></b></a> and
<a href=
"done.html"><b><font
76 face=
"Courier New" color=
"#003258" size=
"4">done
</font></b></a>.
</p>
78 <li>The optional
<i>statement_block
</i> contains one or more statements separated by semicolons. When empty, the curly brackets must be written.
79 <P>The use of iterative statements (for, while, do-while, etc.) is forbidden inside the statement block.
80 <P>Neither direct altstep invocation, nor default activation are permitted.
81 <P>Function calls, which contain communication operations, shall also be avoided inside the statement block of interleave statement.
84 <p><b>...
</b> indicates that
several branches may occur in the
<font face=
"Courier New" color=
"#003258" size=
"4"><b>interleave
</b></font> body. There is no separator between them.
</p>
87 <hr align=
"left" width=
"50%">
89 <p><font face=
"Courier New">interleave {
<br>
90 []
L1_PCO.receive
(tr_Sig1)
<br>
91 {
<br>
92 L1_PCO.send
(t_Sig2);
<br>
93 L1_PCO.receive(tr_Sig3)
<br>
94 }
<br>
95 [] L2_PCO.receive
(tr_Sig4)
<br>
96 {
<br>
97 L2_PCO.send
(t_Sig5);
<br>
98 L2_PCO.receive(tr_Sig6);
<br>
99 L2_PCO.send
(t_Sig7)
<br>
100 }
<br>
102 <p>The reception events on ports L1_PCO and L2_PCO may happen in arbitrary order. The possible orderings of
<i>incoming
</i> messages are:
103 <p><code> tr_Sig1, tr_Sig3, tr_Sig4, tr_Sig6
<BR>
104 tr_Sig1, tr_Sig4, tr_Sig3, tr_Sig6
<BR>
105 tr_Sig1, tr_Sig4, tr_Sig6, tr_Sig3
<BR>
106 tr_Sig4, tr_Sig1, tr_Sig3, tr_Sig6
<BR>
107 tr_Sig4, tr_Sig1, tr_Sig6, tr_Sig3
<BR>
108 tr_Sig4, tr_Sig6, tr_Sig1, tr_Sig3
</code>
109 <hr align=
"left" width=
"25%">
110 <hr align=
"left" width=
"25%">
111 <p><a HREF=
"BNF.html#interleavedconstruct">BNF definition
</a> of
<font face=
"Courier New"> interleave
</font></p>