table fix

This commit is contained in:
Rachel Lambda Samuelsson 2024-07-17 18:44:37 +02:00
parent 96e99061e9
commit bfa3365255

View File

@ -76,43 +76,21 @@ data Inst
All stacks grow from right to left, that is, the left most element is at the top of the stack.
{% katexmm %}
<table>
<tr>
<th align=center colspan="3">Before</th><th align=center colspan="3">After</th>
</tr>
<tr>
<th>Control</th><th>Env</th><th>Stack</th><th>Control</th><th>Env</th><th>Stack</th>
</tr>
<tr>
<td>Const i : c</td><td>e</td><td>s</td><td>c</td><td>e</td><td>i : s</td>
</tr>
<tr>
<td>Global i : c</td><td>e</td><td>s</td><td>c</td><td>e</td><td>Globals[i] : s</td>
</tr>
<tr>
<td>Local i : c</td><td>e</td><td>s</td><td>c </td><td> e</td><td>e[i] : s</td>
</tr>
<tr>
<td>Closure n a : $c_1$ ... $c_n$ : c</td><td>e</td><td>s</td><td>c</td><td>e</td><td>Closure a {e} [$c_1$ ... $c_n$] : s</td>
</tr>
<tr>
<td>App : c</td><td>e</td><td>Closure {e'} [c'] : v : s</td><td>c'</td><td>v : e'</td><td>Closure$^0$ {e} [c] : s</td>
</tr>
<tr>
<td>App : c</td><td>e</td><td>Closure$^n$ {e'} [c'] : v : s</td><td>c</td><td>e</td><td>Closure$^{n - 1}$ {v : e'} [c'] : s</td>
</tr>
<tr>
<td>Ret : c </td><td>e</td><td>v : Closure$^0$ \{e'\} [c'] : s </td><td> c'</td><td>e' </td><td> v : s</td>
</tr>
<tr>
<td>Dup : c</td><td>e</td><td>v : s</td><td>c</td><td>e</td><td>v : v : s</td>
</tr>
<tr>
<td>Add : c </td><td>e</td><td>v : s</td><td>c</td><td>e</td><td>v + v : s</td>
</tr>
</table>
{% endkatexmm %}
<style>
th { text-align: left; }
</style>
| Before | | | After | | |
| ----------------------------------- | --- | -------------------------------- | ------- | ------ | --------------------------------------- |
| Control | Env | Stack | Control | Env | Stack |
| Const i : c | e | s | c | e | i : s |
| Global i : c | e | s | c | e | Globals\[i\] : s |
| Local i : c | e | s | c | e | e\[i\] : s |
| Closure n a : $c\_1$ ... $c\_n$ : c | e | s | c | e | Closure a {e} \[$c\_1$ ... $c\_n$\] : s |
| App : c | e | Closure {e'} \[c'\] : v : s | c' | v : e' | Closure⁰ {e} \[c\] : s |
| App : c | e | Closureⁿ {e'} \[c'\] : v : s | c | e | Closureⁿ⁻¹ {v : e'} \[c'\] : s |
| Ret : c | e | v : Closure⁰ {e'} \[c'\] : s | c' | e' | v : s |
| Dup : c | e | v : s | c | e | v : v : s |
| Add : c | e | v : s | c | e | v + v : s |
### An example