Refactoring of process classes in faustexp.ml.
[Faustine.git] / documentation / code_VALInterpreter.interpreter_rec.html
1 <html><head>
2 <link rel="stylesheet" href="style.css" type="text/css">
3 <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
4 <link rel="Start" href="index.html">
5 <link title="Index of types" rel=Appendix href="index_types.html">
6 <link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
7 <link title="Index of values" rel=Appendix href="index_values.html">
8 <link title="Index of modules" rel=Appendix href="index_modules.html">
9 <link title="Types" rel="Chapter" href="Types.html">
10 <link title="Value" rel="Chapter" href="Value.html">
11 <link title="Signal" rel="Chapter" href="Signal.html">
12 <link title="Faustexp" rel="Chapter" href="Faustexp.html">
13 <link title="Interpreter" rel="Chapter" href="Interpreter.html">
14 <link title="Main" rel="Chapter" href="Main.html"><title>Interpreter.interpreter_rec</title>
15 </head>
16 <body>
17 <code class="code"><span class="keyword">let</span>&nbsp;<span class="keyword">rec</span>&nbsp;interpreter_rec&nbsp;exp_faust&nbsp;dimension_tree&nbsp;input_beam&nbsp;=&nbsp;<br>
18 <br>
19 <br>
20 </code><table><tr><td></td><td><span class="comment">(** val interpret_par : faust_exp -&gt; faust_exp -&gt; beam -&gt; beam,
21 interprets par(e1, e2) with input beam, produces output beam.*)</span></td></tr></table><code class="code"><br>
22 <span class="keyword">let</span>&nbsp;interpret_par&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;e1&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;e2&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;dimension_tree&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;input_beam&nbsp;<span class="keywordsign">-&gt;</span><br>
23 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;n&nbsp;=&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
24 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree1&nbsp;=&nbsp;subtree_left&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
25 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree2&nbsp;=&nbsp;subtree_right&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
26 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d1&nbsp;=&nbsp;get_root&nbsp;subtree1&nbsp;<span class="keyword">in</span><br>
27 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d2&nbsp;=&nbsp;get_root&nbsp;subtree2&nbsp;<span class="keyword">in</span><br>
28 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;n&nbsp;=&nbsp;(fst&nbsp;d1)&nbsp;+&nbsp;(fst&nbsp;d2)&nbsp;<span class="keyword">then</span>&nbsp;<br>
29 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
30 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;input_beam1&nbsp;=&nbsp;sublist&nbsp;input_beam&nbsp;0&nbsp;(fst&nbsp;d1)&nbsp;<span class="keyword">in</span><br>
31 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;input_beam2&nbsp;=&nbsp;sublist&nbsp;input_beam&nbsp;(fst&nbsp;d1)&nbsp;(fst&nbsp;d2)&nbsp;<span class="keyword">in</span><br>
32 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;output_beam1&nbsp;=&nbsp;interpreter_rec&nbsp;e1&nbsp;subtree1&nbsp;input_beam1&nbsp;<span class="keyword">in</span><br>
33 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;output_beam2&nbsp;=&nbsp;interpreter_rec&nbsp;e2&nbsp;subtree2&nbsp;input_beam2&nbsp;<span class="keyword">in</span><br>
34 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;<span class="constructor">List</span>.length&nbsp;output_beam1&nbsp;=&nbsp;snd&nbsp;d1&nbsp;<span class="keywordsign">&amp;&amp;</span>&nbsp;<span class="constructor">List</span>.length&nbsp;output_beam2&nbsp;=&nbsp;snd&nbsp;d2&nbsp;<br>
35 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;(output_beam1&nbsp;@&nbsp;output_beam2)&nbsp;<br>
36 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Par"</span>)<br>
37 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
38 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Par"</span>)&nbsp;<span class="keyword">in</span><br>
39 <br>
40 <br>
41 </code><table><tr><td></td><td><span class="comment">(** val interpret_seq : faust_exp -&gt; faust_exp -&gt; beam -&gt; beam,
42 interprets seq(e1, e2) with input beam, produces output beam.*)</span></td></tr></table><code class="code"><br>
43 <span class="keyword">let</span>&nbsp;interpret_seq&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;e1&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;e2&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;dimension_tree&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;input_beam&nbsp;<span class="keywordsign">-&gt;</span><br>
44 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;n&nbsp;=&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
45 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree1&nbsp;=&nbsp;subtree_left&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
46 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree2&nbsp;=&nbsp;subtree_right&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
47 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d1&nbsp;=&nbsp;get_root&nbsp;subtree1&nbsp;<span class="keyword">in</span><br>
48 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d2&nbsp;=&nbsp;get_root&nbsp;subtree2&nbsp;<span class="keyword">in</span><br>
49 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;n&nbsp;=&nbsp;fst&nbsp;d1&nbsp;<span class="keyword">then</span><br>
50 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
51 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;output_beam1&nbsp;=&nbsp;interpreter_rec&nbsp;e1&nbsp;subtree1&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
52 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;<span class="constructor">List</span>.length&nbsp;output_beam1&nbsp;=&nbsp;fst&nbsp;d2&nbsp;<br>
53 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;interpreter_rec&nbsp;e2&nbsp;subtree2&nbsp;output_beam1<br>
54 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Seq"</span>)<br>
55 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
56 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Seq"</span>)&nbsp;<span class="keyword">in</span><br>
57 <br>
58 <br>
59 </code><table><tr><td></td><td><span class="comment">(** val interpret_split : faust_exp -&gt; faust_exp -&gt; beam -&gt; beam,
60 interprets split(e1, e2) with input beam, produces output beam.*)</span></td></tr></table><code class="code"><br>
61 <span class="keyword">let</span>&nbsp;interpret_split&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;e1&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;e2&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;dimension_tree&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;input_beam&nbsp;<span class="keywordsign">-&gt;</span><br>
62 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;n&nbsp;=&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
63 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree1&nbsp;=&nbsp;subtree_left&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
64 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree2&nbsp;=&nbsp;subtree_right&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
65 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d1&nbsp;=&nbsp;get_root&nbsp;subtree1&nbsp;<span class="keyword">in</span><br>
66 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d2&nbsp;=&nbsp;get_root&nbsp;subtree2&nbsp;<span class="keyword">in</span><br>
67 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;n&nbsp;=&nbsp;fst&nbsp;d1&nbsp;<span class="keyword">then</span><br>
68 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
69 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;output_beam1&nbsp;=&nbsp;interpreter_rec&nbsp;e1&nbsp;subtree1&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
70 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;ref_output_beam1&nbsp;=&nbsp;ref&nbsp;(beam_add_one_memory&nbsp;output_beam1)&nbsp;<span class="keyword">in</span><br>
71 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;input_beam2&nbsp;=&nbsp;<span class="constructor">List</span>.concat&nbsp;<br>
72 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span class="constructor">Array</span>.to_list&nbsp;(<span class="constructor">Array</span>.make&nbsp;((fst&nbsp;d2)/(<span class="constructor">List</span>.length&nbsp;output_beam1))&nbsp;!ref_output_beam1))&nbsp;<br>
73 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">in</span><br>
74 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam2&nbsp;=&nbsp;fst&nbsp;d2<br>
75 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;interpreter_rec&nbsp;e2&nbsp;subtree2&nbsp;input_beam2<br>
76 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Split"</span>)<br>
77 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
78 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Split"</span>)&nbsp;<span class="keyword">in</span><br>
79 <br>
80 <br>
81 </code><table><tr><td></td><td><span class="comment">(** val interpret_merge : faust_exp -&gt; faust_exp -&gt; beam -&gt; beam,
82 interprets merge(e1, e2) with input beam, produces output beam.*)</span></td></tr></table><code class="code"><br>
83 <span class="keyword">let</span>&nbsp;interpret_merge&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;e1&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;e2&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;dimension_tree&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;input_beam&nbsp;<span class="keywordsign">-&gt;</span><br>
84 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;n&nbsp;=&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
85 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree1&nbsp;=&nbsp;subtree_left&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
86 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree2&nbsp;=&nbsp;subtree_right&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
87 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d1&nbsp;=&nbsp;get_root&nbsp;subtree1&nbsp;<span class="keyword">in</span><br>
88 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d2&nbsp;=&nbsp;get_root&nbsp;subtree2&nbsp;<span class="keyword">in</span><br>
89 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;n&nbsp;=&nbsp;fst&nbsp;d1&nbsp;<span class="keyword">then</span><br>
90 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
91 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;output_beam1&nbsp;=&nbsp;interpreter_rec&nbsp;e1&nbsp;subtree1&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
92 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;input_beam2&nbsp;=&nbsp;<br>
93 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
94 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;fois&nbsp;=&nbsp;(snd&nbsp;d1)/(fst&nbsp;d2)&nbsp;<span class="keyword">in</span><br>
95 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;ref_beam&nbsp;=&nbsp;ref&nbsp;(sublist&nbsp;output_beam1&nbsp;0&nbsp;(fst&nbsp;d2))&nbsp;<span class="keyword">in</span><br>
96 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">for</span>&nbsp;i&nbsp;=&nbsp;1&nbsp;<span class="keyword">to</span>&nbsp;fois&nbsp;-&nbsp;1&nbsp;<span class="keyword">do</span><br>
97 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;temp_beam&nbsp;=&nbsp;sublist&nbsp;output_beam1&nbsp;(i*(fst&nbsp;d2))&nbsp;(fst&nbsp;d2)&nbsp;<span class="keyword">in</span><br>
98 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ref_beam&nbsp;:=&nbsp;<span class="constructor">List</span>.map2&nbsp;signal_add&nbsp;(!ref_beam)&nbsp;temp_beam;<br>
99 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">done</span>;<br>
100 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!ref_beam<br>
101 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
102 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">in</span><br>
103 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam2&nbsp;=&nbsp;fst&nbsp;d2<br>
104 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">then</span>&nbsp;interpreter_rec&nbsp;e2&nbsp;subtree2&nbsp;input_beam2<br>
105 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Merge"</span>)<br>
106 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
107 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Merge"</span>)&nbsp;<span class="keyword">in</span><br>
108 <br>
109 <br>
110 </code><table><tr><td></td><td><span class="comment">(** val interpret_rec : faust_exp -&gt; faust_exp -&gt; beam -&gt; beam,
111 interprets rec(e1, e2) with input beam, produces output beam.*)</span></td></tr></table><code class="code"><br>
112 <span class="keyword">let</span>&nbsp;interpret_rec&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;e1&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;e2&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;dimension_tree&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;input_beam&nbsp;<span class="keywordsign">-&gt;</span><br>
113 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;n&nbsp;=&nbsp;<span class="constructor">List</span>.length&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
114 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree1&nbsp;=&nbsp;subtree_left&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
115 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;subtree2&nbsp;=&nbsp;subtree_right&nbsp;dimension_tree&nbsp;<span class="keyword">in</span><br>
116 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d1&nbsp;=&nbsp;get_root&nbsp;subtree1&nbsp;<span class="keyword">in</span><br>
117 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;d2&nbsp;=&nbsp;get_root&nbsp;subtree2&nbsp;<span class="keyword">in</span><br>
118 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;n&nbsp;=&nbsp;(fst&nbsp;d1)&nbsp;-&nbsp;(snd&nbsp;d2)&nbsp;<span class="keyword">then</span><br>
119 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br>
120 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;aux1&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;f&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;f&nbsp;t&nbsp;<span class="keyword">in</span><br>
121 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;aux2&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;beam_fun&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;i&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">List</span>.nth&nbsp;(snd&nbsp;(beam_fun&nbsp;t))&nbsp;i&nbsp;<span class="keyword">in</span><br>
122 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;aux3&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;beam_fun&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="constructor">List</span>.map&nbsp;<br>
123 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(aux2&nbsp;beam_fun)&nbsp;<br>
124 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span class="constructor">Array</span>.to_list&nbsp;(<span class="constructor">Array</span>.init&nbsp;(snd&nbsp;d1)&nbsp;(<span class="keyword">fun</span>&nbsp;n&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;n)))&nbsp;<br>
125 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">in</span><br>
126 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;make_signal&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;rate&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;f&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;(rate,&nbsp;f)&nbsp;<span class="keyword">in</span><br>
127 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;delay_int&nbsp;=&nbsp;1&nbsp;+&nbsp;delay&nbsp;e2&nbsp;+&nbsp;delay&nbsp;e1&nbsp;<span class="keyword">in</span><br>
128 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;memory_hashtbl&nbsp;=&nbsp;<span class="constructor">Hashtbl</span>.create&nbsp;delay_int&nbsp;<span class="keyword">in</span><br>
129 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;rate_list&nbsp;=&nbsp;ref&nbsp;(<span class="constructor">Array</span>.to_list&nbsp;(<span class="constructor">Array</span>.make&nbsp;(snd&nbsp;d1)&nbsp;0))&nbsp;<span class="keyword">in</span><br>
130 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;<span class="keyword">rec</span>&nbsp;output_beam_fun&nbsp;=&nbsp;<span class="keyword">fun</span>&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span><br>
131 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span>&nbsp;t&nbsp;&lt;&nbsp;0&nbsp;<span class="keyword">then</span><br>
132 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;init_rate_list&nbsp;=&nbsp;<span class="constructor">Array</span>.to_list&nbsp;(<span class="constructor">Array</span>.make&nbsp;(snd&nbsp;d1)&nbsp;0)&nbsp;<span class="keyword">in</span><br>
133 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;value_list&nbsp;=&nbsp;<span class="constructor">Array</span>.to_list&nbsp;(<span class="constructor">Array</span>.make&nbsp;(snd&nbsp;d1)&nbsp;<span class="constructor">Zero</span>)&nbsp;<span class="keyword">in</span><br>
134 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(init_rate_list,&nbsp;value_list)<br>
135 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;<span class="keyword">if</span>&nbsp;<span class="constructor">Hashtbl</span>.mem&nbsp;memory_hashtbl&nbsp;t&nbsp;<span class="keyword">then</span>&nbsp;<br>
136 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(!rate_list,&nbsp;<span class="constructor">Hashtbl</span>.find&nbsp;memory_hashtbl&nbsp;t)<br>
137 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
138 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;mid_output_fun_list1&nbsp;=&nbsp;aux3&nbsp;output_beam_fun&nbsp;<span class="keyword">in</span>&nbsp;<span class="comment">(*&nbsp;danger!&nbsp;*)</span><br>
139 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;b_input_fun_list&nbsp;=&nbsp;<span class="constructor">List</span>.map&nbsp;<br>
140 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span class="keyword">fun</span>&nbsp;s&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;<span class="keyword">fun</span>&nbsp;t&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;s&nbsp;(t&nbsp;-&nbsp;1))&nbsp;<br>
141 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sublist&nbsp;mid_output_fun_list1&nbsp;0&nbsp;(fst&nbsp;d2))&nbsp;<br>
142 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">in</span><br>
143 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;b_input_beam&nbsp;=&nbsp;<span class="constructor">List</span>.map2&nbsp;make_signal&nbsp;!rate_list&nbsp;b_input_fun_list&nbsp;<span class="keyword">in</span><br>
144 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;b_output_beam&nbsp;=&nbsp;(interpreter_rec&nbsp;e2&nbsp;subtree2&nbsp;b_input_beam)&nbsp;<span class="keyword">in</span><br>
145 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;a_input_beam&nbsp;=&nbsp;b_output_beam&nbsp;@&nbsp;input_beam&nbsp;<span class="keyword">in</span><br>
146 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;mid_output_beam2&nbsp;=&nbsp;interpreter_rec&nbsp;e1&nbsp;subtree1&nbsp;a_input_beam&nbsp;<span class="keyword">in</span><br>
147 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;mid_output_rate_list&nbsp;=&nbsp;<span class="constructor">List</span>.map&nbsp;fst&nbsp;mid_output_beam2&nbsp;<span class="keyword">in</span><br>
148 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;mid_output_value_list&nbsp;=&nbsp;<span class="constructor">List</span>.map&nbsp;(aux1&nbsp;t)&nbsp;(<span class="constructor">List</span>.map&nbsp;snd&nbsp;mid_output_beam2)&nbsp;<span class="keyword">in</span><br>
149 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;()&nbsp;=&nbsp;(rate_list&nbsp;:=&nbsp;mid_output_rate_list)&nbsp;<span class="keyword">in</span><br>
150 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;mid_output_value_list_for_stock&nbsp;=&nbsp;v_list_memory&nbsp;mid_output_value_list&nbsp;<span class="keyword">in</span><br>
151 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;()&nbsp;=&nbsp;<span class="constructor">Hashtbl</span>.add&nbsp;memory_hashtbl&nbsp;t&nbsp;mid_output_value_list_for_stock&nbsp;<span class="keyword">in</span><br>
152 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;()&nbsp;=&nbsp;<span class="constructor">Hashtbl</span>.remove&nbsp;memory_hashtbl&nbsp;(t&nbsp;-&nbsp;delay_int)&nbsp;<span class="keyword">in</span><br>
153 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(mid_output_rate_list,&nbsp;mid_output_value_list_for_stock)<br>
154 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">in</span><br>
155 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">let</span>&nbsp;output_beam&nbsp;=&nbsp;<span class="constructor">List</span>.map2&nbsp;make_signal&nbsp;!rate_list&nbsp;(aux3&nbsp;output_beam_fun)&nbsp;<span class="keyword">in</span><br>
156 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output_beam<br>
157 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>
158 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span>&nbsp;raise&nbsp;(<span class="constructor">Evaluation_Error</span>&nbsp;<span class="string">"Rec1"</span>)&nbsp;<span class="keyword">in</span><br>
159 <br>
160 <br>
161 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><span class="comment">(** Call for previous functions *)</span></td></tr></table><code class="code"><br>
162 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">match</span>&nbsp;exp_faust&nbsp;<span class="keyword">with</span><br>
163 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Const</span>&nbsp;v&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_const&nbsp;v&nbsp;input_beam<br>
164 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Ident</span>&nbsp;s&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_ident&nbsp;s&nbsp;input_beam<br>
165 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Par</span>&nbsp;(e1,&nbsp;e2)&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_par&nbsp;e1&nbsp;e2&nbsp;dimension_tree&nbsp;input_beam<br>
166 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Seq</span>&nbsp;(e1,&nbsp;e2)&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_seq&nbsp;e1&nbsp;e2&nbsp;dimension_tree&nbsp;input_beam<br>
167 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Split</span>&nbsp;(e1,&nbsp;e2)&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_split&nbsp;e1&nbsp;e2&nbsp;dimension_tree&nbsp;input_beam<br>
168 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Merge</span>&nbsp;(e1,&nbsp;e2)&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_merge&nbsp;e1&nbsp;e2&nbsp;dimension_tree&nbsp;input_beam<br>
169 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keywordsign">|</span><span class="constructor">Rec</span>&nbsp;(e1,&nbsp;e2)&nbsp;<span class="keywordsign">-&gt;</span>&nbsp;interpret_rec&nbsp;e1&nbsp;e2&nbsp;dimension_tree&nbsp;input_beam</code></body></html>