Skip to content

Commit 606931a

Browse files
committed
Backport value subsumption
1 parent c3fb2ad commit 606931a

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

document/core/exec/values.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ The following auxiliary typing rules specify this typing relation relative to a
8383
S \vdashval \REFEXTERNADDR~a : (\REF~\EXTERN)
8484
}
8585
86+
Subsumption
87+
...........
88+
89+
* The value must be valid with some value type :math:`t`.
90+
91+
* The value type :math:`t` :ref:`matches <match-valtype>` another :ref:`valid <valid-valtype>` type :math:`t'`.
92+
93+
* Then the value is valid with type :math:`t'`.
94+
95+
.. math::
96+
\frac{
97+
S \vdashval \val : t
98+
\qquad
99+
\vdashvaltype t' \ok
100+
\qquad
101+
\vdashvaltypematch t \matchesvaltype t'
102+
}{
103+
S \vdashval \val : t'
104+
}
105+
86106
87107
88108
.. index:: external value, external type, validation, import, store

document/core/valid/matching.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ A :ref:`heap type <syntax-heaptype>` :math:`\heaptype_1` matches a :ref:`heap ty
5454

5555
* Either both :math:`\heaptype_1` and :math:`\heaptype_2` are the same.
5656

57-
* Or :math:`\heaptype_1` is a :ref:`function type <syntax-functype>` and :math:`\heaptype_2` is :math:`FUNC`.
57+
* Or :math:`\heaptype_1` is a :ref:`function type <syntax-functype>` and :math:`\heaptype_2` is :math:`\FUNC`.
5858

5959
* Or :math:`\heaptype_1` is a :ref:`function type <syntax-functype>` :math:`\functype_1` and :math:`\heaptype_2` is a :ref:`function type <syntax-functype>` :math:`\functype_2`, and :math:`\functype_1` :ref:`matches <match-functype>` :math:`\functype_2`.
6060

0 commit comments

Comments
 (0)