| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
on |
| 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 "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> |
| 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 |
[]</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> |
| 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 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 { <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> |
| 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> |