udpated docs

This commit is contained in:
Ashley Bao 2023-01-20 14:58:56 -05:00
parent a2570b4cde
commit af0e04a639
62 changed files with 209 additions and 123 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100 (from smallest)</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the FLOAT stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-map-vals-input"><h3>map-vals-input</h3><div class="usage"><code>(map-vals-input i)</code></div><div class="doc"><div class="markdown"><p>Returns all the input values of a map (specific helper method for bouncing-balls)</p>
</div></div></div><div class="public anchor" id="var-map-vals-output"><h3>map-vals-output</h3><div class="usage"><code>(map-vals-output i)</code></div><div class="doc"><div class="markdown"><p>Returns the output values of a map (specific helper method for bouncing-balls)</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Returns random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -6,7 +6,7 @@
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-cleanup-length"><h3>cleanup-length</h3><div class="usage"><code>(cleanup-length string len)</code></div><div class="doc"><div class="markdown"><p>Remove spaces and dashes from end of string</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-char"><h3>random-char</h3><div class="usage"><code>(random-char)</code></div><div class="doc"><div class="markdown"><p>Return visible character ERC</p>
</div></div></div><div class="public anchor" id="var-random-input"><h3>random-input</h3><div class="usage"><code>(random-input len)</code></div><div class="doc"><div class="markdown"><p>Returns random string ERCs</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the FLOAT stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-map-vals-input"><h3>map-vals-input</h3><div class="usage"><code>(map-vals-input i)</code></div><div class="doc"><div class="markdown"><p>Returns all the input values of a map</p>
</div></div></div><div class="public anchor" id="var-map-vals-output"><h3>map-vals-output</h3><div class="usage"><code>(map-vals-output i)</code></div><div class="doc"><div class="markdown"><p>Returns the output values of a map</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -4,6 +4,6 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-map-vals-input"><h3>map-vals-input</h3><div class="usage"><code>(map-vals-input i)</code></div><div class="doc"><div class="markdown"><p>Returns all the input values of a map</p>
</div></div></div><div class="public anchor" id="var-map-vals-output"><h3>map-vals-output</h3><div class="usage"><code>(map-vals-output i)</code></div><div class="doc"><div class="markdown"><p>Returns the output values of a map</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-char"><h3>random-char</h3><div class="usage"><code>(random-char)</code></div><div class="doc"><div class="markdown"><p>Random character of 0-9</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the FLOAT stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-map-vals-input"><h3>map-vals-input</h3><div class="usage"><code>(map-vals-input i)</code></div><div class="doc"><div class="markdown"><p>Returns all the input values of a map</p>
</div></div></div><div class="public anchor" id="var-map-vals-output"><h3>map-vals-output</h3><div class="usage"><code>(map-vals-output i)</code></div><div class="doc"><div class="markdown"><p>Returns the output values of a map</p>
</div></div></div><div class="public anchor" id="var-random-float"><h3>random-float</h3><div class="usage"><code>(random-float)</code></div><div class="doc"><div class="markdown"><p>Random float between -100 and 100</p>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the FLOAT stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-map-vals-input"><h3>map-vals-input</h3><div class="usage"><code>(map-vals-input i)</code></div><div class="doc"><div class="markdown"><p>Returns all the input values of a map</p>
</div></div></div><div class="public anchor" id="var-map-vals-output"><h3>map-vals-output</h3><div class="usage"><code>(map-vals-output i)</code></div><div class="doc"><div class="markdown"><p>Returns the output values of a map</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -5,6 +5,6 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the BOOLEAN stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-char"><h3>random-char</h3><div class="usage"><code>(random-char)</code></div><div class="doc"><div class="markdown"><p>Generates random character</p>
</div></div></div><div class="public anchor" id="var-random-input"><h3>random-input</h3><div class="usage"><code>(random-input len)</code></div><div class="doc"><div class="markdown"><p>Makes a Spin Words input of length len, which is just a string of words, where the words that are length 5 or greater are reversed</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -5,7 +5,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-map-vals-input"><h3>map-vals-input</h3><div class="usage"><code>(map-vals-input i)</code></div><div class="doc"><div class="markdown"><p>Returns all the input values of a map</p>
</div></div></div><div class="public anchor" id="var-map-vals-output"><h3>map-vals-output</h3><div class="usage"><code>(map-vals-output i)</code></div><div class="doc"><div class="markdown"><p>Returns the output values of a map</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>

View File

@ -4,7 +4,7 @@
<p>Source: <a href="https://arxiv.org/pdf/2106.06086.pdf">https://arxiv.org/pdf/2106.06086.pdf</a></p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the STRING stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-random-int"><h3>random-int</h3><div class="usage"><code>(random-int)</code></div><div class="doc"><div class="markdown"><p>Random integer between -100 and 100</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Data taken from <a href="https://zenodo.org/record/5084812">https://zenodo.org/record/5084812</a></p>
</div></div></div></div></body></html>

View File

@ -4,7 +4,7 @@
<p>Given inputs and outputs, find the target function.</p>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual. The error is the absolute deviation between the target output value and the programs selected behavior, or 1000000 if no behavior is produced. The behavior is here defined as the final top item on the INTEGER stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>
</div></div></div><div class="public anchor" id="var-train-and-test-data"><h3>train-and-test-data</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Training data: Inputs and outputs with -10 &lt;= x &lt; 11</p>
<p>Test data: Inputs and outputs of -20 &lt;= x &lt; -10 and 11 &lt;= x &lt; 21</p>
</div></div></div></div></body></html>

View File

@ -7,7 +7,6 @@
doi: 10.1109/TSE.2015.2454513
</code></pre>
<p>This problem file defines the following problem: takes as input four ints, computes the smallest, and prints to the screen the smallest input.</p>
<pre><code></code></pre>
</div></div><div class="public anchor" id="var--main"><h3>-main</h3><div class="usage"><code>(-main &amp; args)</code></div><div class="doc"><div class="markdown"><p>Runs propel-gp, giving it a map of arguments.</p>
</div></div></div><div class="public anchor" id="var-error-function"><h3>error-function</h3><div class="usage"><code>(error-function argmap data individual)</code></div><div class="doc"><div class="markdown"><p>Finds the behaviors and errors of an individual: Error is 0 if the value and the programs selected behavior match, or 1 if they differ. The behavior is here defined as the final top item on the PRINT stack.</p>
</div></div></div><div class="public anchor" id="var-instructions"><h3>instructions</h3><div class="usage"></div><div class="doc"><div class="markdown"><p>Stack-specific instructions, input instructions, close, and constants</p>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,5 @@
(ns propeller.gp
"Main genetic programming loop."
(:require [clojure.string]
[clojure.pprint]
[propeller.genome :as genome]

View File

@ -24,7 +24,7 @@
[] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -33,7 +33,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(get i :output1))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -24,7 +24,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-int "Returns random integer between -100 and 100" [] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -57,7 +57,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(word-generator))))))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -31,7 +31,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(get i :output1))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -20,7 +20,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(def train-and-test-data "Data taken from https://zenodo.org/record/5084812" (psb2/fetch-examples "data" "fizz-buzz" 200 2000))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -24,7 +24,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -31,7 +31,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(get i :output1))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -26,7 +26,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -22,7 +22,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -23,7 +23,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-char "Random character of 0-9" [] (rand-nth '(\0 \1 \2 \3 \4 \5 \6 \7 \8 \9)))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -33,7 +33,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(get i :output1))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -34,7 +34,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(get i :output1))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -20,7 +20,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(def train-and-test-data "Data taken from https://zenodo.org/record/5084812" (psb2/fetch-examples "data" "solve-boolean" 200 2000))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -51,7 +51,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(apply str (butlast words)))))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -23,7 +23,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -32,7 +32,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(vals (select-keys i [:output1])))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -26,7 +26,7 @@ Source: https://arxiv.org/pdf/2106.06086.pdf"
(defn random-int "Random integer between -100 and 100" [] (- (rand-int 201) 100))
(def instructions
"stack-specific instructions, input instructions, close, and constants"
"Stack-specific instructions, input instructions, close, and constants"
(utils/not-lazy
(concat
;;; stack-specific instructions

View File

@ -6,8 +6,7 @@
doi: 10.1109/TSE.2015.2454513
This problem file defines the following problem:
takes as input four ints, computes the smallest, and prints to the screen the smallest input.
```"
takes as input four ints, computes the smallest, and prints to the screen the smallest input."
(:require [propeller.genome :as genome]
[propeller.push.interpreter :as interpreter]
[propeller.push.state :as state]

View File

@ -16,6 +16,8 @@
;; Duplicates the top item of the stack. Does not pop its argument (since that
;; would negate the effect of the duplication)
(def _dup
"Duplicates the top item of the stack. Does not pop its argument
(since that would negate the effect of the duplication)"
^{:stacks #{}
:name "_dup"}
(fn [stack state]
@ -31,6 +33,12 @@
;; of n are treated as 0. The final number of items on the stack is limited to
;; globals/max-stack-items.
(def _dup_times
"Duplicates n copies of the top item (i.e leaves n copies there). Does not pop
its argument (since that would negate the effect of the duplication). The
number n is determined by the top INTEGER. For n = 0, equivalent to POP.
For n = 1, equivalent to NOOP. For n = 2, equivalent to DUP. Negative values
of n are treated as 0. The final number of items on the stack is limited to
globals/max-stack-items."
^{:stacks #{:integer}
:name "_dup_times"}
(fn [stack state]
@ -54,6 +62,10 @@
;; fewer than n items are on the stack, the entire stack will be duplicated.
;; The final number of items on the stack is limited to globals/max-stack-items.
(def _dup_items
"Duplicates the top n items on the stack, one time each. The number n is
determined by the top INTEGER. If n <= 0, no items will be duplicated. If
fewer than n items are on the stack, the entire stack will be duplicated.
The final number of items on the stack is limited to globals/max-stack-items."
^{:stacks #{:integer}
:name "_dup_items"}
(fn [stack state]
@ -67,6 +79,7 @@
;; Pushes TRUE onto the BOOLEAN stack if the stack is empty. Otherwise FALSE
(def _empty
"Pushes TRUE onto the BOOLEAN stack if the stack is empty. Otherwise FALSE"
^{:stacks #{:boolean}
:name "_empty"}
(fn [stack state]
@ -75,6 +88,7 @@
;; Pushes TRUE onto the BOOLEAN stack if the top two items are equal.
;; Otherwise FALSE
(def _eq
"Pushes TRUE onto the BOOLEAN stack if the top two items are equal. Otherwise FALSE"
^{:stacks #{:boolean}
:name "_eq"}
(fn [stack state]
@ -82,6 +96,7 @@
;; Empties the given stack
(def _flush
"Empties the given stack"
^{:stacks #{}
:name "_flush"}
(fn [stack state]
@ -89,6 +104,7 @@
;; Pops the given stack
(def _pop
"Pops the given stack"
^{:stacks #{}
:name "_pop"}
(fn [stack state]
@ -97,6 +113,8 @@
;; Rotates the top three items on the stack (i.e. pulls the third item out and
;; pushes it on top). Equivalent to (yank state stack-type 2)
(def _rot
"Rotates the top three items on the stack (i.e. pulls the third item out and
pushes it on top). Equivalent to (yank state stack-type 2)"
^{:stacks #{}
:name "_rot"}
(fn [stack state]
@ -110,6 +128,8 @@
;; Inserts the top item deeper into the stack, using the top INTEGER to
;; determine how deep
(def _shove
"Inserts the top item deeper into the stack, using the top INTEGER to
determine how deep"
^{:stacks #{:integer}
:name "_shove"}
(fn [stack state]
@ -130,6 +150,7 @@
;; Pushes the given stack's depth onto the INTEGER stack
(def _stack_depth
"Pushes the given stack's depth onto the INTEGER stack"
^{:stacks #{:integer}
:name "_stack_depth"}
(fn [stack state]
@ -138,6 +159,7 @@
;; Swaps the top two items on the stack
(def _swap
"Swaps the top two items on the stack"
^{:stacks #{}
:name "_swap"}
(fn [stack state]
@ -150,6 +172,8 @@
;; Pushes an indexed item from deep in the stack, removing it. The top INTEGER
;; is used to determine how deep to yank from
(def _yank
"Pushes an indexed item from deep in the stack, removing it. The top INTEGER
is used to determine how deep to yank from"
^{:stacks #{:integer}
:name "_yank"}
(fn [stack state]
@ -171,6 +195,8 @@
;; Pushes a copy of an indexed item from deep in the stack, without removing it.
;; The top INTEGER is used to determine how deep to yankdup from
(def _yank_dup
"Pushes a copy of an indexed item from deep in the stack, without removing it.
The top INTEGER is used to determine how deep to yankdup from"
^{:stacks #{:integer}
:name "_yank_dup"}
(fn [stack state]
@ -189,6 +215,8 @@
;; Pushes a copy of an indexed item from deep in the stack, without removing it.
;; The top INTEGER is used to determine the index from the BOTTOM of the stack.
(def _deep_dup
"Pushes a copy of an indexed item from deep in the stack, without removing it.
The top INTEGER is used to determine the index from the BOTTOM of the stack."
^{:stacks #{:integer}
:name "_deep_dup"}
(fn [stack state]

View File

@ -1,5 +1,5 @@
(ns propeller.push.instructions.string
"STRING Instructions"
"STRING Instructions, created with `propeller.push.instructions/def-instruction`"
(:require [clojure.string :as string]
[propeller.push.state :as state]
[propeller.push.instructions :refer [def-instruction

View File

@ -15,6 +15,7 @@
;; Pushes the butlast of the top item
(def _butlast
"Pushes the butlast of the top item"
^{:stacks #{}
:name "_butlast"}
(fn [stack state]
@ -22,6 +23,7 @@
;; Concats and pushes the top two vectors of the stack
(def _concat
"Concats and pushes the top two vectors of the stack"
^{:stacks #{}
:name "_concat"}
(fn [stack state]
@ -30,6 +32,8 @@
;; Conj's the top item of the appropriately-typed literal stack onto the vector
;; stack (e.g. pop the top INTEGER and conj it onto the top VECTOR_INTEGER)
(def _conj
"Conj's the top item of the appropriately-typed literal stack onto the vector
stack (e.g. pop the top INTEGER and conj it onto the top VECTOR_INTEGER)"
^{:stacks #{:elem}
:name "_conj"}
(fn [stack state]
@ -40,6 +44,9 @@
;; contains the top element of the appropriately-typed literal stack. Otherwise,
;; pushes FALSE
(def _contains
"Pushes TRUE onto the BOOLEAN stack if the top element of the vector stack
contains the top element of the appropriately-typed literal stack. Otherwise,
pushes FALSE"
^{:stacks #{:boolean}
:name "_contains"}
(fn [stack state]
@ -49,6 +56,8 @@
;; Pushes TRUE onto the BOOLEAN stack if the top element is an empty vector.
;; Otherwise, pushes FALSE
(def _emptyvector
"Pushes TRUE onto the BOOLEAN stack if the top element is an empty vector.
Otherwise, pushes FALSE"
^{:stacks #{:boolean}
:name "_emptyvector"}
(fn [stack state]
@ -58,6 +67,9 @@
;; appropriately-typed literal stack. If the vector is empty, return
;; :ignore-instruction so that nothing is changed on the stacks.
(def _first
"Pushes the first item of the top element of the vector stack onto the
appropriately-typed literal stack. If the vector is empty, return
:ignore-instruction so that nothing is changed on the stacks."
^{:stacks #{:elem}
:name "_first"}
(fn [stack state]
@ -70,6 +82,8 @@
;; Pushes onto the INTEGER stack the index of the top element of the
;; appropriately-typed literal stack within the top element of the vector stack
(def _indexof
"Pushes onto the INTEGER stack the index of the top element of the
appropriately-typed literal stack within the top element of the vector stack"
^{:stacks #{:elem :integer}
:name "_indexof"}
(fn [stack state]
@ -78,6 +92,7 @@
;; Iterates over the vector using the code on the exec stack
(def _iterate
"Iterates over the vector using the code on the exec stack"
^{:stacks #{:elem :integer}
:name "_iterate"}
(fn [stack state]
@ -104,6 +119,8 @@
;; Pushes the last item of the top element of the vector stack onto the
;; approrpiately-typed literal stack
(def _last
"Pushes the last item of the top element of the vector stack onto the
appropriately-typed literal stack"
^{:stacks #{:elem}
:name "_last"}
(fn [stack state]
@ -116,6 +133,7 @@
;; Pushes the length of the top item onto the INTEGER stack
(def _length
"Pushes the length of the top item onto the INTEGER stack"
^{:stacks #{:integer}
:name "_length"}
(fn [stack state]
@ -125,6 +143,9 @@
;; approrpiately-typed literal stack, where N is taken from the INTEGER stack.
;; To insure the index is within bounds, N is taken mod the vector length
(def _nth
"Pushes the Nth item of the top element of the vector stack onto the
appropriately-typed literal stack, where N is taken from the INTEGER stack.
To insure the index is within bounds, N is taken mod the vector length"
^{:stacks #{:elem :integer}
:name "_nth"}
(fn [stack state]
@ -140,6 +161,9 @@
;; the appropriately-typed literal stack within the top element of the vector
;; stack
(def _occurrencesof
"Pushes onto the INTEGER stack the number of occurrences of the top element of
the appropriately-typed literal stack within the top element of the vector
stack"
^{:stacks #{:elem :integer}
:name "_occurrencesof"}
(fn [stack state]
@ -151,6 +175,7 @@
;; Pushes every item of the top element onto the appropriately-typed stack
(def _pushall
"Pushes every item of the top element onto the appropriately-typed stack"
^{:stacks #{:elem}
:name "_pushall"}
(fn [stack state]
@ -164,6 +189,8 @@
;; Removes all occurrences of the top element of the appropriately-typed literal
;; stack from the first element of the vector stack
(def _remove
"Removes all occurrences of the top element of the appropriately-typed literal
stack from the first element of the vector stack"
^{:stacks #{:elem}
:name "_remove"}
(fn [stack state]
@ -177,6 +204,9 @@
;; literal stack with the top element of the appropriately-typed literal stack
;; within the top item of the vector stack
(def _replace
"Replaces all occurrences of the second element of the appropriately-typed
literal stack with the top element of the appropriately-typed literal stack
within the top item of the vector stack"
^{:stacks #{:elem}
:name "_replace"}
(fn [stack state]
@ -191,6 +221,9 @@
;; literal stack with the top element of the appropriately-typed literal stack
;; within the top item of the vector stack
(def _replacefirst
"Replaces the first occurrence of the second element of the appropriately-typed
literal stack with the top element of the appropriately-typed literal stack
within the top item of the vector stack"
^{:stacks #{:elem}
:name "_replacefirst"}
(fn [stack state]
@ -206,6 +239,7 @@
;; Pushes the rest of the top item
(def _rest
"Pushes the rest of the top item"
^{:stacks #{}
:name "_rest"}
(fn [stack state]
@ -213,6 +247,7 @@
;; Pushes the reverse of the top item
(def _reverse
"Pushes the reverse of the top item"
^{:stacks #{}
:name "_reverse"}
(fn [stack state]
@ -222,6 +257,9 @@
;; with the top item from the appropriately-typed literal stack. To insure the
;; index is within bounds, N is taken mod the vector length
(def _set
"Replaces in the top vector the item at index N (taken from the INTEGER stack)
with the top item from the appropriately-typed literal stack. To insure the
index is within bounds, N is taken mod the vector length"
^{:stacks #{:elem :integer}
:name "_set"}
(fn [stack state]
@ -237,6 +275,8 @@
;; Pushes a subvector of the top item, with start and end indices determined by
;; the second and top items of the INTEGER stack respectively
(def _subvec
"Pushes a subvector of the top item, with start and end indices determined by
the second and top items of the INTEGER stack respectively"
^{:stacks #{:integer}
:name "_subvec"}
(fn [stack state]
@ -251,6 +291,8 @@
;; Pushes the first N items of the top element, where N is taken from the top of
;; the INTEGER stack
(def _take
"Pushes the first N items of the top element, where N is taken from the top of
the INTEGER stack"
^{:stacks #{:integer}
:name "_take"}
(fn [stack state]

View File

@ -1,4 +1,5 @@
(ns propeller.push.interpreter
"Interprets Push programs."
(:require [propeller.push.instructions :as instructions]
[propeller.push.state :as state]
[propeller.push.instructions.input-output :as io]))

View File

@ -3,7 +3,7 @@
#?(:cljs [goog.string :as gstring])))
;; Empty push state - all available stacks are empty
(defonce empty-state {:boolean '()
(defonce ^:no-doc empty-state {:boolean '()
:char '()
:code '()
:exec '()
@ -19,16 +19,16 @@
:vector_string '()})
;; All stack types available in a Push state
(defonce stacks (set (keys empty-state)))
(defonce ^:no-doc stacks (set (keys empty-state)))
;; All vector stack types available in a Push state, with their corresponding
;; element types
(defonce vec-stacks {:vector_boolean :boolean
(defonce ^:no-doc vec-stacks {:vector_boolean :boolean
:vector_float :float
:vector_integer :integer
:vector_string :string})
(defonce stack-limiter {:exec l/limit-code
(defonce ^:no-doc stack-limiter {:exec l/limit-code
:code l/limit-code
:integer #(long (l/limit-number %))
:float l/limit-number
@ -45,16 +45,19 @@
;; Returns true if the stack is empty
(defn empty-stack?
"Returns true if the stack is empty"
[state stack]
(empty? (get state stack)))
;; Returns the stack size
(defn stack-size
"Returns the stack size"
[state stack]
(count (get state stack)))
;; Returns the top item on the stack
(defn peek-stack
"Returns the top item on the stack"
[state stack]
(if (empty? (get state stack))
:no-stack-item
@ -63,22 +66,28 @@
;; Returns the top n items on the stack, as a chunk. If there are less than n
;; items on the stack, returns the entire stack
(defn peek-stack-many
"Returns the top n items on the stack, as a chunk. If there are less than n
items on the stack, returns the entire stack"
[state stack n]
(take n (get state stack)))
;; Removes the top item of stack
(defn pop-stack
"Removes the top item of stack"
[state stack]
(update state stack rest))
;; Pops the top n items of the stack. If there are less than n items on the
;; stack, pops the entire stack
(defn pop-stack-many
"Pops the top n items of the stack. If there are less than n items on the
stack, pops the entire stack"
[state stack n]
(update state stack #(drop n %)))
;; Pushes an item onto the stack
(defn push-to-stack
"Pushes an item onto the stack"
[state stack item]
(if (or (nil? item)
(>= (stack-size state stack) l/max-stack-items))
@ -89,6 +98,8 @@
;; Pushes a collection of items onto the stack, as a chunk (i.e. leaving them in
;; the order they are in)
(defn push-to-stack-many
"Pushes a collection of items onto the stack, as a chunk (i.e. leaving them in
the order they are in)"
[state stack items]
(let [items (if (coll? items) items (list items))
items-no-nil (filter #(not (nil? %)) items)
@ -102,6 +113,11 @@
;; popped from the stacks. If there aren't enough args on the stacks, returns
;; :not-enough-args without popping anything
(defn get-args-from-stacks
"Takes a state and a collection of stacks to take args from. If there are
enough args on each of the desired stacks, returns a map with keys
{:state :args}, where :state is the new state and :args is a list of args
popped from the stacks. If there aren't enough args on the stacks, returns
:not-enough-args without popping anything"
[state stacks]
(loop [state state
stacks (reverse stacks)
@ -118,6 +134,7 @@
;; Pretty-print a Push state, for logging or debugging purposes
(defn print-state
"Pretty-print a Push state, for logging or debugging purposes"
[state]
(doseq [stack (keys empty-state)]
#?(:clj (printf "%-15s = " stack)

View File

@ -1,6 +1,7 @@
(ns propeller.tools.calculus)
(ns propeller.tools.calculus
"Functions for calculus operations")
(defonce ^:const dx 0.0001)
(defonce ^{:no-doc true :const true} dx 0.0001)
(defn deriv
"Returns the derivative of f evaluated at c. If called with only one argument,

View File

@ -1,4 +1,5 @@
(ns propeller.tools.character)
(ns propeller.tools.character
"Functions for CHARs")
(defn get-ascii
"Gets the ASCII code of a char"

View File

@ -1,4 +1,5 @@
(ns propeller.tools.distributions
"Functions to calculate distribution."
(:require [propeller.tools.calculus :as calculus]
[propeller.tools.math :as math]))

View File

@ -1,9 +1,10 @@
(ns propeller.tools.math)
(ns propeller.tools.math
"Math functions.")
(defonce ^:no-doc PI #?(:clj Math/PI
(defonce ^{:no-doc true :const true} PI #?(:clj Math/PI
:cljs js/Math.PI))
(defonce ^:no-doc E #?(:clj Math/E
(defonce ^{:no-doc true :const true} E #?(:clj Math/E
:cljs js/Math.PI))
(defn mean
@ -39,9 +40,10 @@
[x]
(if (neg? x) (- x) x))
(defn approx= [x y epsilon]
(defn approx=
"Returns true if the absolute difference between x and y is less than or
equal to some specified error level, epsilon."
[x y epsilon]
(<= (abs (- y x)) epsilon))
(defn ceil

View File

@ -1,4 +1,5 @@
(ns propeller.tools.metrics
"Functions to measure things."
(:require [propeller.tools.math :as math]))
(defn mean