Skip to content

Commit d7b6783

Browse files
committed
[spec] Fix rendering of Expand
1 parent 65211ab commit d7b6783

11 files changed

Lines changed: 229 additions & 291 deletions

File tree

document/core/valid/conventions.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ In addition, the following auxiliary relation denotes the *expansion* of a :ref:
167167
$${rule: Expand {Expand_use/*}}
168168
169169
$${relation-ignore: Expand Expand_use}
170-
$${definition-ignore: expanddt}
171170

172171

173172
.. index:: ! instruction type, value type, result type, instruction, local, local index

specification/wasm-3.0/1.2-syntax.types.spectec

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ def $rollrt(typeidx, rectype) : rectype hint(show $roll_(%, %)) hint(macro "r
459459
def $unrollrt(rectype) : rectype hint(show $unroll(%)) hint(macro "unrollrt")
460460
def $rolldt(typeidx, rectype) : deftype* hint(show $roll_(%)*#((%))) hint(macro "rolldt")
461461
def $unrolldt(deftype) : subtype hint(show $unroll(%)) hint(macro "unrolldt")
462-
def $expanddt(deftype) : comptype hint(show $expand(%)) hint(macro "expanddt")
463462

464463
def $rollrt(x, rectype) = REC ($subst_subtype(subtype, ((_IDX $(x + i)))^(i<n), (REC i)^(i<n)))^n
465464
-- if rectype = REC subtype^n
@@ -469,8 +468,6 @@ def $unrollrt(rectype) = REC ($subst_subtype(subtype, (REC i)^(i<n), (_DEF recty
469468
def $rolldt(x, rectype) = (_DEF (REC subtype^n) i)^(i<n) -- if $rollrt(x, rectype) = REC subtype^n
470469
def $unrolldt(_DEF rectype i) = subtype*[i] -- if $unrollrt(rectype) = REC subtype*
471470

472-
def $expanddt(deftype) = comptype -- if $unrolldt(deftype) = SUB final? typeuse* comptype
473-
474471

475472
;; Free indices
476473

specification/wasm-3.0/2.1-validation.types.spectec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ rule Instrtype_ok:
7272

7373
relation Expand: deftype ~~ comptype hint(macro "%expanddt") hint(tabular)
7474
hint(prose "The :ref:`expansion <aux-expand-deftype>` of %1 is %2") ;; TODO(3, ?): avoid hardcoding reST
75-
7675
relation Expand_use: typeuse ~~_context comptype hint(macro "%expandyy") hint(tabular)
7776
hint(prose "The :ref:`expansion <aux-expand-typeuse>` of %2 is %3") ;; TODO(3, ?): avoid hardcoding reST
7877

79-
rule Expand: deftype ~~ comptype -- if $expanddt(deftype) = comptype
78+
rule Expand: deftype ~~ comptype -- if $unrolldt(deftype) = SUB final? typeuse* comptype
8079

8180
rule Expand_use/deftype: deftype ~~_C comptype -- Expand: deftype ~~ comptype
8281
rule Expand_use/typeidx: _IDX typeidx ~~_C comptype -- Expand: C.TYPES[typeidx] ~~ comptype

specification/wasm-latest/1.2-syntax.types.spectec

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ def $rollrt(typeidx, rectype) : rectype hint(show $roll_(%, %)) hint(macro "r
459459
def $unrollrt(rectype) : rectype hint(show $unroll(%)) hint(macro "unrollrt")
460460
def $rolldt(typeidx, rectype) : deftype* hint(show $roll_(%)*#((%))) hint(macro "rolldt")
461461
def $unrolldt(deftype) : subtype hint(show $unroll(%)) hint(macro "unrolldt")
462-
def $expanddt(deftype) : comptype hint(show $expand(%)) hint(macro "expanddt")
463462

464463
def $rollrt(x, rectype) = REC ($subst_subtype(subtype, ((_IDX $(x + i)))^(i<n), (REC i)^(i<n)))^n
465464
-- if rectype = REC subtype^n
@@ -469,8 +468,6 @@ def $unrollrt(rectype) = REC ($subst_subtype(subtype, (REC i)^(i<n), (_DEF recty
469468
def $rolldt(x, rectype) = (_DEF (REC subtype^n) i)^(i<n) -- if $rollrt(x, rectype) = REC subtype^n
470469
def $unrolldt(_DEF rectype i) = subtype*[i] -- if $unrollrt(rectype) = REC subtype*
471470

472-
def $expanddt(deftype) = comptype -- if $unrolldt(deftype) = SUB final? typeuse* comptype
473-
474471

475472
;; Free indices
476473

specification/wasm-latest/2.1-validation.types.spectec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ rule Instrtype_ok:
7272

7373
relation Expand: deftype ~~ comptype hint(macro "%expanddt") hint(tabular)
7474
hint(prose "The :ref:`expansion <aux-expand-deftype>` of %1 is %2") ;; TODO(3, ?): avoid hardcoding reST
75-
7675
relation Expand_use: typeuse ~~_context comptype hint(macro "%expandyy") hint(tabular)
7776
hint(prose "The :ref:`expansion <aux-expand-typeuse>` of %2 is %3") ;; TODO(3, ?): avoid hardcoding reST
7877

79-
rule Expand: deftype ~~ comptype -- if $expanddt(deftype) = comptype
78+
rule Expand: deftype ~~ comptype -- if $unrolldt(deftype) = SUB final? typeuse* comptype
8079

8180
rule Expand_use/deftype: deftype ~~_C comptype -- Expand: deftype ~~ comptype
8281
rule Expand_use/typeidx: _IDX typeidx ~~_C comptype -- Expand: C.TYPES[typeidx] ~~ comptype

spectec/test-frontend/TEST.md

Lines changed: 56 additions & 62 deletions
Large diffs are not rendered by default.

spectec/test-latex/TEST.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3440,12 +3440,6 @@ $$
34403440
\end{array}
34413441
$$
34423442

3443-
$$
3444-
\begin{array}[t]{@{}lcl@{}l@{}}
3445-
{\mathrm{expand}}({\mathit{deftype}}) & = & {\mathit{comptype}} & \quad \mbox{if}~ {\mathrm{unroll}}({\mathit{deftype}}) = \mathsf{sub}~{\mathsf{final}^?}~{{\mathit{typeuse}}^\ast}~{\mathit{comptype}} \\
3446-
\end{array}
3447-
$$
3448-
34493443
\vspace{1ex}
34503444

34513445
\vspace{1ex}
@@ -4764,7 +4758,7 @@ $\boxed{{\mathit{typeuse}} \approx_{{\mathit{context}}} {\mathit{comptype}}}$
47644758

47654759
$$
47664760
\begin{array}[t]{@{}lrcl@{}l@{}}
4767-
{[\textsc{\scriptsize Expand}]} \quad & {\mathit{deftype}} & \approx & {\mathit{comptype}} & \quad \mbox{if}~ {\mathrm{expand}}({\mathit{deftype}}) = {\mathit{comptype}} \\
4761+
{[\textsc{\scriptsize Expand}]} \quad & {\mathit{deftype}} & \approx & {\mathit{comptype}} & \quad \mbox{if}~ {\mathrm{unroll}}({\mathit{deftype}}) = \mathsf{sub}~{\mathsf{final}^?}~{{\mathit{typeuse}}^\ast}~{\mathit{comptype}} \\
47684762
\end{array}
47694763
$$
47704764

0 commit comments

Comments
 (0)