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

Commit 24440ac

Browse files
ioannadrossberg
andauthored
Adds validation for exception results. (#254)
Co-authored-by: Andreas Rossberg <[email protected]>
1 parent fea1ca1 commit 24440ac

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

document/core/appendix/properties.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,27 @@ Results
5858
S \vdashresult \TRAP : [t^\ast]
5959
}
6060
61-
.. todo::
62-
Add validation for exception results.
61+
62+
:ref:`Results <syntax-result>` :math:`\val^\ast~(\THROWadm~\tagaddr)`
63+
.....................................................................
64+
65+
* The :ref:`external tag value <syntax-externval>` :math:`\EVTAG~\tagaddr` must be :ref:`valid <valid-externval-tag>` with :ref:`external tag type <syntax-externtype>` :math:`\ETTAG~[t^\ast]\to[]`.
66+
67+
* For each :ref:`value <syntax-val>` :math:`\val_i` in :math:`\val^\ast` and corresponding :ref:`value type <syntax-valtype>` :math:`t_i` in :math:`t_i`:
68+
69+
* The value :math:`\val_i` must be :ref:`valid <valid-val>` with :ref:`value type <syntax-valtype>` :math:`t_i`.
70+
71+
* Then the result is valid with :ref:`result type <syntax-resulttype>` :math:`[{t'}^\ast]`, for any sequence :math:`{t'}^\ast` of :ref:`value types <syntax-valtype>`.
72+
73+
74+
.. math::
75+
\frac{
76+
S \vdashexternval \EVTAG~\tagaddr : \ETTAG~[t^\ast] \to []
77+
\qquad
78+
(S \vdashval \val : t)^\ast
79+
}{
80+
S \vdashresult \val^\ast~(\THROWadm~\tagaddr) : [{t'}^\ast]
81+
}
6382
6483
6584
.. _module-context:

0 commit comments

Comments
 (0)