about summary refs log tree commit diff stats
path: root/html/032array.cc.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/032array.cc.html')
-rw-r--r--html/032array.cc.html127
1 files changed, 56 insertions, 71 deletions
diff --git a/html/032array.cc.html b/html/032array.cc.html
index 2b95ab90..c2fc903c 100644
--- a/html/032array.cc.html
+++ b/html/032array.cc.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<title>Mu - 032array.cc</title>
+<title>~/Desktop/s/mu/032array.cc</title>
 <meta name="Generator" content="Vim/7.4">
 <meta name="plugin-version" content="vim7.4_v1">
 <meta name="syntax" content="cpp">
@@ -14,12 +14,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #d0d0d0; background-
 body { font-family: monospace; color: #d0d0d0; background-color: #000000; }
 * { font-size: 1em; }
 .CommentedCode { color: #6c6c6c; }
-.SalientComment { color: #00ffff; }
 .Constant { color: #008080; }
 .Comment { color: #8080ff; }
 .Delimiter { color: #c000c0; }
 .Special { color: #ff6060; }
 .Identifier { color: #008080; }
+.SalientComment { color: #00ffff; }
 .traceContains { color: #008000; }
 -->
 </style>
@@ -40,14 +40,14 @@ body { font-family: monospace; color: #d0d0d0; background-color: #000000; }
 <span class="Comment">//: Create containers containing addresses to arrays instead.</span>
 
 <span class="Delimiter">:(scenario copy_array)</span>
-<span class="Comment"># Arrays can be copied around with a single instruction just like integers,</span>
+<span class="Comment"># Arrays can be copied around with a single instruction just like numbers,</span>
 <span class="Comment"># no matter how large they are.</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
-  <span class="Constant">5</span>:array:integer<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:array:integer
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal  <span class="Comment"># length</span>
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
+  <span class="Constant">5</span>:array:number<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:array:number
 ]
 <span class="traceContains">+run: instruction main/4</span>
 <span class="traceContains">+run: ingredient 0 is 1</span>
@@ -62,12 +62,12 @@ recipe main [
 
 <span class="Delimiter">:(scenario copy_array_indirect)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
-  <span class="Constant">5</span>:address:array:integer<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:literal
-  <span class="Constant">6</span>:array:integer<span class="Special"> &lt;- </span>copy <span class="Constant">5</span>:address:array:integer/deref
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal  <span class="Comment"># length</span>
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
+  <span class="Constant">5</span>:address:array:number<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:literal
+  <span class="Constant">6</span>:array:number<span class="Special"> &lt;- </span>copy <span class="Constant">5</span>:address:array:number/deref
 ]
 <span class="traceContains">+run: instruction main/5</span>
 <span class="traceContains">+run: ingredient 0 is 5</span>
@@ -81,11 +81,10 @@ recipe main [
 <span class="traceContains">+mem: storing 16 in location 9</span>
 
 <span class="Comment">//: disable the size mismatch check since the destination array need not be initialized</span>
-<span class="Delimiter">:(replace &quot;if (size_of(x) != data.size())&quot; following &quot;void write_memory(reagent x, vector&lt;long long int&gt; data)&quot;)</span>
-if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>types[<span class="Constant">0</span>] != Type_number[<span class="Constant">&quot;array&quot;</span>] &amp;&amp; size_of<span class="Delimiter">(</span>x<span class="Delimiter">)</span> != data<span class="Delimiter">.</span>size<span class="Delimiter">())</span>
+<span class="Delimiter">:(replace &quot;if (size_of(x) != data.size())&quot; following &quot;void write_memory(reagent x, vector&lt;double&gt; data)&quot;)</span>
+if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>types<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> != Type_number[<span class="Constant">&quot;array&quot;</span>] &amp;&amp; size_of<span class="Delimiter">(</span>x<span class="Delimiter">)</span> != data<span class="Delimiter">.</span>size<span class="Delimiter">())</span>
 <span class="Delimiter">:(after &quot;size_t size_of(const reagent&amp; r)&quot;)</span>
-  static const type_number ARRAY = Type_number[<span class="Constant">&quot;array&quot;</span>]<span class="Delimiter">;</span>
-  if <span class="Delimiter">(</span>r<span class="Delimiter">.</span>types[<span class="Constant">0</span>] == ARRAY<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+  if <span class="Delimiter">(</span>r<span class="Delimiter">.</span>types<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> == Type_number[<span class="Constant">&quot;array&quot;</span>]<span class="Delimiter">)</span> <span class="Delimiter">{</span>
     assert<span class="Delimiter">(</span>r<span class="Delimiter">.</span>types<span class="Delimiter">.</span>size<span class="Delimiter">()</span> &gt; <span class="Constant">1</span><span class="Delimiter">);</span>
     <span class="Comment">// skip the 'array' type to get at the element type</span>
     <span class="Identifier">return</span> <span class="Constant">1</span> + Memory[r<span class="Delimiter">.</span>value]*size_of<span class="Delimiter">(</span>array_element<span class="Delimiter">(</span>r<span class="Delimiter">.</span>types<span class="Delimiter">));</span>
@@ -95,33 +94,33 @@ if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>types[<span
 
 <span class="Delimiter">:(scenario index)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
-  <span class="Constant">5</span>:integer<span class="Special"> &lt;- </span>index <span class="Constant">1</span>:array:integer<span class="Delimiter">,</span> <span class="Constant">0</span>:literal
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal  <span class="Comment"># length</span>
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
+  <span class="Constant">5</span>:number<span class="Special"> &lt;- </span>index <span class="Constant">1</span>:array:number<span class="Delimiter">,</span> <span class="Constant">0</span>:literal
 ]
 <span class="traceContains">+run: instruction main/4</span>
 <span class="traceContains">+run: address to copy is 2</span>
 <span class="traceContains">+run: its type is 1</span>
 <span class="traceContains">+mem: location 2 is 14</span>
-<span class="traceContains">+run: product 0 is 14</span>
+<span class="traceContains">+run: product 0 is 5</span>
 <span class="traceContains">+mem: storing 14 in location 5</span>
 
 <span class="Delimiter">:(scenario index_direct_offset)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
-  <span class="Constant">5</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>:literal
-  <span class="Constant">6</span>:integer<span class="Special"> &lt;- </span>index <span class="Constant">1</span>:array:integer<span class="Delimiter">,</span> <span class="Constant">5</span>:integer
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal  <span class="Comment"># length</span>
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
+  <span class="Constant">5</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>:literal
+  <span class="Constant">6</span>:number<span class="Special"> &lt;- </span>index <span class="Constant">1</span>:array:number<span class="Delimiter">,</span> <span class="Constant">5</span>:number
 ]
 <span class="traceContains">+run: instruction main/5</span>
 <span class="traceContains">+run: address to copy is 2</span>
 <span class="traceContains">+run: its type is 1</span>
 <span class="traceContains">+mem: location 2 is 14</span>
-<span class="traceContains">+run: product 0 is 14</span>
+<span class="traceContains">+run: product 0 is 6</span>
 <span class="traceContains">+mem: storing 14 in location 6</span>
 
 <span class="Delimiter">:(before &quot;End Primitive Recipe Declarations&quot;)</span>
@@ -130,31 +129,24 @@ INDEX<span class="Delimiter">,</span>
 Recipe_number[<span class="Constant">&quot;index&quot;</span>] = INDEX<span class="Delimiter">;</span>
 <span class="Delimiter">:(before &quot;End Primitive Recipe Implementations&quot;)</span>
 case INDEX: <span class="Delimiter">{</span>
-  static const type_number ARRAY = Type_number[<span class="Constant">&quot;array&quot;</span>]<span class="Delimiter">;</span>
 <span class="CommentedCode">//?   if (Trace_stream) Trace_stream-&gt;dump_layer = &quot;run&quot;; //? 1</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;ingredient 0 is &quot;</span> &lt;&lt; current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">0</span>]<span class="Delimiter">.</span>to_string<span class="Delimiter">();</span>
-  reagent base = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">0</span>]<span class="Delimiter">);</span>
+  reagent base = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span>
 <span class="CommentedCode">//?   trace(&quot;run&quot;) &lt;&lt; &quot;ingredient 0 after canonize: &quot; &lt;&lt; base.to_string(); //? 1</span>
   index_t base_address = base<span class="Delimiter">.</span>value<span class="Delimiter">;</span>
-  assert<span class="Delimiter">(</span>base<span class="Delimiter">.</span>types[<span class="Constant">0</span>] == ARRAY<span class="Delimiter">);</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;ingredient 1 is &quot;</span> &lt;&lt; current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">1</span>]<span class="Delimiter">.</span>to_string<span class="Delimiter">();</span>
-  reagent offset = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">1</span>]<span class="Delimiter">);</span>
+  assert<span class="Delimiter">(</span>base<span class="Delimiter">.</span>types<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> == Type_number[<span class="Constant">&quot;array&quot;</span>]<span class="Delimiter">);</span>
+  reagent offset = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">));</span>
 <span class="CommentedCode">//?   trace(&quot;run&quot;) &lt;&lt; &quot;ingredient 1 after canonize: &quot; &lt;&lt; offset.to_string(); //? 1</span>
-  vector&lt;long long int&gt; offset_val<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>offset<span class="Delimiter">));</span>
+  vector&lt;double&gt; offset_val<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>offset<span class="Delimiter">));</span>
   vector&lt;type_number&gt; element_type = array_element<span class="Delimiter">(</span>base<span class="Delimiter">.</span>types<span class="Delimiter">);</span>
-<span class="CommentedCode">//?   trace(&quot;run&quot;) &lt;&lt; &quot;offset: &quot; &lt;&lt; offset_val[0]; //? 1</span>
+<span class="CommentedCode">//?   trace(&quot;run&quot;) &lt;&lt; &quot;offset: &quot; &lt;&lt; offset_val.at(0); //? 1</span>
 <span class="CommentedCode">//?   trace(&quot;run&quot;) &lt;&lt; &quot;size of elements: &quot; &lt;&lt; size_of(element_type); //? 1</span>
-  index_t src = base_address + <span class="Constant">1</span> + offset_val[<span class="Constant">0</span>]*size_of<span class="Delimiter">(</span>element_type<span class="Delimiter">);</span>
+  index_t src = base_address + <span class="Constant">1</span> + offset_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>*size_of<span class="Delimiter">(</span>element_type<span class="Delimiter">);</span>
   trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;address to copy is &quot;</span> &lt;&lt; src<span class="Delimiter">;</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;its type is &quot;</span> &lt;&lt; element_type[<span class="Constant">0</span>]<span class="Delimiter">;</span>
+  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;its type is &quot;</span> &lt;&lt; element_type<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span>
   reagent tmp<span class="Delimiter">;</span>
   tmp<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>src<span class="Delimiter">);</span>
   copy<span class="Delimiter">(</span>element_type<span class="Delimiter">.</span>begin<span class="Delimiter">(),</span> element_type<span class="Delimiter">.</span>end<span class="Delimiter">(),</span> inserter<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>types<span class="Delimiter">,</span> tmp<span class="Delimiter">.</span>types<span class="Delimiter">.</span>begin<span class="Delimiter">()));</span>
-<span class="CommentedCode">//?   trace(&quot;run&quot;) &lt;&lt; &quot;AAA: &quot; &lt;&lt; tmp.to_string() &lt;&lt; '\n'; //? 3</span>
-  vector&lt;long long int&gt; result<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>tmp<span class="Delimiter">));</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;product 0 is &quot;</span> &lt;&lt; result[<span class="Constant">0</span>]<span class="Delimiter">;</span>
-  write_memory<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>products[<span class="Constant">0</span>]<span class="Delimiter">,</span> result<span class="Delimiter">);</span>
-<span class="CommentedCode">//?   if (Trace_stream) Trace_stream-&gt;dump_layer = &quot;&quot;; //? 1</span>
+  products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>tmp<span class="Delimiter">));</span>
   <span class="Identifier">break</span><span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
 
@@ -165,26 +157,25 @@ vector&lt;type_number&gt; array_element<span class="Delimiter">(</span>const vec
 
 <span class="Delimiter">:(scenario index_address)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
-  <span class="Constant">5</span>:integer<span class="Special"> &lt;- </span>index-address <span class="Constant">1</span>:array:integer<span class="Delimiter">,</span> <span class="Constant">0</span>:literal
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal  <span class="Comment"># length</span>
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
+  <span class="Constant">5</span>:number<span class="Special"> &lt;- </span>index-address <span class="Constant">1</span>:array:number<span class="Delimiter">,</span> <span class="Constant">0</span>:literal
 ]
 <span class="traceContains">+run: instruction main/4</span>
-<span class="traceContains">+run: address to copy is 2</span>
 <span class="traceContains">+mem: storing 2 in location 5</span>
 
 <span class="SalientComment">//:: To write to elements of containers, you need their address.</span>
 
 <span class="Delimiter">:(scenario index_indirect)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
-  <span class="Constant">5</span>:address:array:integer<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:literal
-  <span class="Constant">6</span>:integer<span class="Special"> &lt;- </span>index <span class="Constant">5</span>:address:array:integer/deref<span class="Delimiter">,</span> <span class="Constant">1</span>:literal
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">3</span>:literal  <span class="Comment"># length</span>
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">14</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">15</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">16</span>:literal
+  <span class="Constant">5</span>:address:array:number<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:literal
+  <span class="Constant">6</span>:number<span class="Special"> &lt;- </span>index <span class="Constant">5</span>:address:array:number/deref<span class="Delimiter">,</span> <span class="Constant">1</span>:literal
 ]
 <span class="traceContains">+run: instruction main/5</span>
 <span class="traceContains">+mem: storing 15 in location 6</span>
@@ -195,21 +186,15 @@ INDEX_ADDRESS<span class="Delimiter">,</span>
 Recipe_number[<span class="Constant">&quot;index-address&quot;</span>] = INDEX_ADDRESS<span class="Delimiter">;</span>
 <span class="Delimiter">:(before &quot;End Primitive Recipe Implementations&quot;)</span>
 case INDEX_ADDRESS: <span class="Delimiter">{</span>
-  static const type_number ARRAY = Type_number[<span class="Constant">&quot;array&quot;</span>]<span class="Delimiter">;</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;ingredient 0 is &quot;</span> &lt;&lt; current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">0</span>]<span class="Delimiter">.</span>name<span class="Delimiter">;</span>
-  reagent base = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">0</span>]<span class="Delimiter">);</span>
+  reagent base = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span>
   index_t base_address = base<span class="Delimiter">.</span>value<span class="Delimiter">;</span>
-  assert<span class="Delimiter">(</span>base<span class="Delimiter">.</span>types[<span class="Constant">0</span>] == ARRAY<span class="Delimiter">);</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;ingredient 1 is &quot;</span> &lt;&lt; current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">1</span>]<span class="Delimiter">.</span>to_string<span class="Delimiter">();</span>
-  reagent offset = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients[<span class="Constant">1</span>]<span class="Delimiter">);</span>
-  vector&lt;long long int&gt; offset_val<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>offset<span class="Delimiter">));</span>
+  assert<span class="Delimiter">(</span>base<span class="Delimiter">.</span>types<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> == Type_number[<span class="Constant">&quot;array&quot;</span>]<span class="Delimiter">);</span>
+  reagent offset = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">));</span>
+  vector&lt;double&gt; offset_val<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>offset<span class="Delimiter">));</span>
   vector&lt;type_number&gt; element_type = array_element<span class="Delimiter">(</span>base<span class="Delimiter">.</span>types<span class="Delimiter">);</span>
-  index_t src = base_address + <span class="Constant">1</span> + offset_val[<span class="Constant">0</span>]*size_of<span class="Delimiter">(</span>element_type<span class="Delimiter">);</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;address to copy is &quot;</span> &lt;&lt; src<span class="Delimiter">;</span>
-  vector&lt;long long int&gt; result<span class="Delimiter">;</span>
-  result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>src<span class="Delimiter">);</span>
-  trace<span class="Delimiter">(</span><span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; <span class="Constant">&quot;product 0 is &quot;</span> &lt;&lt; result[<span class="Constant">0</span>]<span class="Delimiter">;</span>
-  write_memory<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>products[<span class="Constant">0</span>]<span class="Delimiter">,</span> result<span class="Delimiter">);</span>
+  index_t result = base_address + <span class="Constant">1</span> + offset_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>*size_of<span class="Delimiter">(</span>element_type<span class="Delimiter">);</span>
+  products<span class="Delimiter">.</span>resize<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span>
+  products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span>result<span class="Delimiter">);</span>
   <span class="Identifier">break</span><span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
 </pre>