1f6a88aff4fbcb236ef2a75c736eab385938cfb7
[deliverable/titan.core.git] / help / info / interleave.html
1 <!--
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
7
8 Contributors:
9 Baji, Laszlo
10 Balasko, Jeno
11 Farkas, Laszlo
12 Forstner, Matyas
13 Gecse, Roland
14 Raduly, Csaba
15 Szabados, Kristof
16 Szabo, Janos Zoltan – initial implementation
17 -->
18 <html>
19 <head>
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>
23 </head>
24 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
25 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
26 <tr>
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>
28 </tr>
29 </table>
30 <table border="0" align="right" cellpadding="0" cellspacing="0">
31 <tr>
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>
36 </tr>
37 </table>
38 <p><br clear="all">
39 </p>
40 <hr>
41 <h1>interleave</h1>
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 &quot;receiving operation&quot;, which can be successful or unsuccessful (&quot;condition&quot;) 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 &quot;happen&quot;.
47 <p>Related keyword:</p>
48 <ul>
49 <li><a href="alt.html"><b><font face="Courier New" color="#003258" size="4">alt</font></b></a></li>
50 </ul>
51 <hr align="left" width="50%">
52 <div align="center">
53 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
54 <tr>
55 <td width="100%">
56 <h3 align="left"><font face="Courier New" color="#003258" size="5"><b>interleave {<br>
57 &nbsp;&nbsp;&nbsp; []</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 &nbsp;&nbsp;&nbsp; </b></font> ...<font face="Courier New" color="#003258" size="5"><b><br>
59 };</b></font> &nbsp;</h3>
60 </td>
61 </tr>
62 </table>
63 </div>
64 <ul>
65 <li>
66 <p>The <font face="Courier New" color="#003258" size="4"><b>interleave</b></font> keywords introduces the branching definition.</p>
67 </li>
68 <li>
69 <p>Each branch begins with a pair of brackets (the brackets must be empty).</p>
70 </li>
71 <li>
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>
77 </li>
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.
82 </li>
83 <li>
84 <p><b>...</b> indicates that&nbsp; 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>
85 </li>
86 </ul>
87 <hr align="left" width="50%">
88 <p>Example:
89 <p><font face="Courier New">interleave {&nbsp;<br>
90 &nbsp;&nbsp;&nbsp;[]&nbsp;L1_PCO.receive &nbsp;&nbsp;(tr_Sig1)<br>
91 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br>
92 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L1_PCO.send &nbsp;&nbsp;(t_Sig2);<br>
93 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L1_PCO.receive(tr_Sig3)<br>
94 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br>
95 &nbsp;&nbsp;&nbsp;[] L2_PCO.receive &nbsp;&nbsp;(tr_Sig4)&nbsp;<br>
96 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br>
97 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L2_PCO.send &nbsp;&nbsp;(t_Sig5);<br>
98 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L2_PCO.receive(tr_Sig6);<br>
99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;L2_PCO.send &nbsp;&nbsp;(t_Sig7)<br>
100 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br>
101 };</font>
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>
112 </body>
113 </html>
This page took 0.033585 seconds and 5 git commands to generate.