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

Commit 7eb232b

Browse files
ioannadrossberg
andauthored
Add prose for typing rule of CATCHadm (#228)
Fixes related .. todo:: section. Also - adjusted notation to match the one in the [formal overview document](https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions-formal-overview.md). - Addressed review comment, switching instr_1 and instr_2 - Apply suggestions from code review Co-authored-by: Andreas Rossberg <[email protected]>
1 parent 0062d05 commit 7eb232b

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

document/core/appendix/properties.rst

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -605,21 +605,38 @@ To that end, all previous typing judgements :math:`C \vdash \X{prop}` are genera
605605
606606
.. index:: catch, throw context
607607

608-
:math:`\CATCHadm\{\tagaddr^?~\instr'^\ast\}^\ast~\instr^\ast~\END`
609-
..................................................................
608+
:math:`\CATCHadm\{\tagaddr^?~\instr_1^\ast\}^\ast~\instr_2^\ast~\END`
609+
.....................................................................
610610

611-
.. todo::
612-
Add prose.
611+
* Let :math:`C'` be the same :ref:`context <context>` as :math:`C`, but with the :ref:`label type <syntax-labeltype>` :math:`[t_2^\ast]` prepended to the |CLABELS| vector.
612+
613+
* Under context :math:`C'`,
614+
the instruction sequence :math:`\instr_2^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[] \to [t_2^\ast]`.
615+
616+
* Let :math:`C''` be the same :ref:`context <context>` as :math:`C`, but with the :ref:`label type <syntax-labeltype>` :math:`(\LCATCH~[t_2^\ast])` prepended to the |CLABELS| vector.
617+
618+
* Under context :math:`C''`,
619+
for every :math:`\tagaddr^?` and associated instruction sequence :math:`\instr_1^\ast`:
620+
621+
* If :math:`\tagaddr^? = \epsilon`, then :math:`\instr_1^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[] \to [t_2^\ast]`.
622+
623+
* Else:
624+
625+
* The :ref:`external tag value <syntax-externval>` :math:`\EVTAG~\tagaddr` must be :ref:`valid <valid-externval-tag>` with some :ref:`external tag type <syntax-externtype>` :math:`\ETTAG~[t_1^\ast] \to []`.
626+
627+
* The instruction sequence :math:`\instr_1^\ast` must be :ref:`valid <valid-instr-seq>` with type :math:`[t_1^\ast] \to [t_2^\ast]`.
628+
629+
* Then the compound instruction is valid under context :math:`C'` with type :math:`[] \to [t_2^\ast]`.
613630

614631
.. math::
615632
\frac{
616633
\begin{array}{@{}c@{}}
617-
((S \vdashexternval \EVTAG~\tagaddr : \ETTAG~[t'^\ast]\to[])^? \\
618-
~~S; C,\CLABELS\,(\LCATCH~[t^\ast]) \vdashinstrseq \instr'^\ast : [(t'^\ast)^?] \to [t^\ast])^\ast \\
619-
S; C,\CLABELS\,[t^\ast] \vdashinstrseq \instr^\ast : [] \to [t^\ast] \\
634+
((S \vdashexternval \EVTAG~\tagaddr : \ETTAG~[t_1^\ast]\to[])^? \\
635+
~~S; C,\CLABELS\,(\LCATCH~[t_2^\ast]) \vdashinstrseq \instr_1^\ast : [(t_1^\ast)^?] \to [t_2^\ast])^\ast \\
636+
S; C,\CLABELS\,[t_2^\ast] \vdashinstrseq \instr_2^\ast : [] \to [t_2^\ast] \\
620637
\end{array}
621638
}{
622-
S; C,\CLABELS\,[t^\ast] \vdashadmininstr \CATCHadm\{\tagaddr^?~{\instr'}^\ast\}^\ast~\instr^\ast~\END : [] \to [t^\ast]
639+
S; C,\CLABELS\,[t_2^\ast] \vdashadmininstr \CATCHadm\{\tagaddr^?~{\instr_1}^\ast\}^\ast~\instr_2^\ast~\END : [] \to [t_2^\ast]
623640
}
624641
625642

0 commit comments

Comments
 (0)