Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Add prose for reduction rule of rethrow. #225

Merged
merged 4 commits into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2715,14 +2715,23 @@ Control Instructions
:math:`\RETHROW~l`
..................

.. todo::
Add prose for the |RETHROW| execution step.
1. Assert: due to :ref:`validation <valid-rethrow>`, the stack contains at least :math:`l+1` labels.

2. Let :math:`L` be the :math:`l`-th label appearing on the stack, starting from the top and counting from zero.

3. Assert: due to :ref:`validation <valid-rethrow>`, :math:`L` is a catch label, i.e., a label of the form :math:`(\LCATCH~[t^\ast])`, which is a label followed by a caught exception in an active catch clause.

4. Let :math:`\{a~\val^\ast\}` be the caught exception.

5. Push the values :math:`\val^\ast` onto the stack.

6. :ref:`Throw <exec-throwadm>` an exception with :ref:`tag address <syntax-tagaddr>` :math:`a`.

.. math::
~\\[-1ex]
\begin{array}{lclr@{\qquad}}
\CAUGHTadm\{a~\val^n\}~\XB^l[\RETHROW~l]~\END &\stepto&
\CAUGHTadm\{a~\val^n\}~\XB^l[\val^n~(\THROWadm~a)]~\END \\
\CAUGHTadm\{a~\val^\ast\}~\XB^l[\RETHROW~l]~\END &\stepto&
\CAUGHTadm\{a~\val^\ast\}~\XB^l[\val^\ast~(\THROWadm~a)]~\END \\
\end{array}


Expand Down