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

Commit 9fdb00b

Browse files
authored
Add prose for typing rule of try-delegate. (#237)
- Also slightly adjusted notation to match the formal overview. - Addressed review comments.
1 parent 7150909 commit 9fdb00b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

document/core/valid/instructions.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,20 +1415,29 @@ Control Instructions
14151415
:math:`\TRY~\blocktype~\instr^\ast~\DELEGATE~l`
14161416
...............................................
14171417

1418-
.. todo::
1419-
Add prose.
1418+
* The label :math:`C.\CLABELS[l]` must be defined in the context.
1419+
1420+
* The :ref:`block type <syntax-blocktype>` must be :ref:`valid <valid-blocktype>` as some :ref:`function type <syntax-functype>` :math:`[t_1^\ast] \to [t_2^\ast]`.
1421+
1422+
* Let :math:`C'` be the same :ref:`context <context>` as :math:`C`, but with the :ref:`result type <syntax-resulttype>` :math:`[t_2^\ast]` prepended to the |CLABELS| vector.
1423+
1424+
* Under context :math:`C'`,
1425+
the instruction sequence :math:`\instr^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[t_1^\ast] \to [t_2^\ast]`.
14201426

14211427
.. math::
14221428
\frac{
14231429
C \vdashblocktype \blocktype : [t_1^\ast] \to [t_2^\ast]
14241430
\qquad
14251431
C,\CLABELS\,[t_2^\ast] \vdashinstrseq \instr^\ast : [t_1^\ast]\to[t_2^\ast]
14261432
\qquad
1427-
C.\CLABELS[l] = [t^\ast]
1433+
C.\CLABELS[l] = [t_0^\ast]
14281434
}{
14291435
C \vdashinstrseq \TRY~\blocktype~\instr^\ast~\DELEGATE~l : [t_1^\ast]\to[t_2^\ast]
14301436
}
14311437
1438+
.. note::
1439+
The :ref:`label index <syntax-labelidx>` space in the :ref:`context <context>` :math:`C` contains the most recent label first, so that :math:`C.\CLABELS[l]` performs a relative lookup as expected.
1440+
14321441

14331442
.. _valid-throw:
14341443

0 commit comments

Comments
 (0)