Skip to content

Commit

Permalink
Add back lost text rule
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg committed Nov 7, 2024
1 parent 0d9b985 commit d793168
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions document/core/syntax/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ The *minimum* of two address types is defined as the address type whose :ref:`bi

.. math::
\begin{array}{llll}
\atmin(\X{at}_1, \X{at}_2) &=& \X{at}_1 & (\iff |\X{at}_1| \leq |\X{at}_2|) \\
\atmin(\X{at}_1, \X{at}_2) &=& \X{at}_2 & (\otherwise) \\
\addrtypemin(\X{at}_1, \X{at}_2) &=& \X{at}_1 & (\iff |\X{at}_1| \leq |\X{at}_2|) \\
\addrtypemin(\X{at}_1, \X{at}_2) &=& \X{at}_2 & (\otherwise) \\
\end{array}
Expand Down
11 changes: 11 additions & 0 deletions document/core/text/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,17 @@ A table's initialization :ref:`expression <text-expr>` can be omitted, in which
An :ref:`element segment <text-elem>` can be given inline with a table definition, in which case its offset is :math:`0` and the :ref:`limits <text-limits>` of the :ref:`table type <text-tabletype>` are inferred from the length of the given segment:

.. math::
\begin{array}{llclll}
\production{module field} &
\text{(}~\text{table}~~\Tid^?~~\Taddrtype^?~~\Treftype~~\text{(}~\text{elem}~~\expr^n{:}\Tvec(\Telemexpr)~\text{)}~\text{)} \quad\equiv \\ & \qquad
\text{(}~\text{table}~~\Tid'~~\Taddrtype^?~~n~~n~~\Treftype~\text{)} \\ & \qquad
\text{(}~\text{elem}~~\text{(}~\text{table}~~\Tid'~\text{)}~~\text{(}~\Taddrtype'\text{.const}~~\text{0}~\text{)}~~\Treftype~~\Tvec(\Telemexpr)~\text{)}
\\ & \qquad\qquad
(\iff \Tid^? \neq \epsilon \wedge \Tid' = \Tid^? \vee \Tid^? = \epsilon \wedge \Tid' \idfresh, \\ & \qquad\qquad
\iff \Taddrtype? \neq \epsilon \wedge \Taddrtype' = \Taddrtype^? \vee \Taddrtype^? = \epsilon \wedge \Taddrtype' = \text{i32}) \\
\end{array}
.. math::
\begin{array}{llclll}
\production{module field} &
Expand Down
2 changes: 1 addition & 1 deletion document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@

.. Types, meta functions

.. |addrtypemin| mathdef:: \xref{syntax/types}{aux-addrtype-min}{\F{min}}
.. |reftypediff| mathdef:: \xref{valid/conventions}{aux-reftypediff}{\setminus}

.. |rollrt| mathdef:: \xref{valid/conventions}{aux-roll-rectype}{\F{roll}}
Expand All @@ -311,7 +312,6 @@
.. |unrollht| mathdef:: \xref{appendix/properties}{aux-unroll-heaptype}{\F{unroll}}

.. |unpacktype| mathdef:: \xref{syntax/types}{aux-unpacktype}{\F{unpack}}
.. |atmin| mathdef:: \xref{syntax/types}{aux-addrtype-min}{\F{atmin}}

.. |etfuncs| mathdef:: \xref{syntax/types}{syntax-externtype}{\F{funcs}}
.. |ettables| mathdef:: \xref{syntax/types}{syntax-externtype}{\F{tables}}
Expand Down
4 changes: 2 additions & 2 deletions document/core/valid/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ Table Instructions
\qquad
C \vdashreftypematch t_2 \matchesvaltype t_1
}{
C \vdashinstr \TABLECOPY~x~y : [\X{at}_1~\X{at}_2~\atmin(\X{at}_1, \X{at}_2)] \to []
C \vdashinstr \TABLECOPY~x~y : [\X{at}_1~\X{at}_2~\addrtypemin(\X{at}_1, \X{at}_2)] \to []
}
Expand Down Expand Up @@ -1898,7 +1898,7 @@ Memory Instructions
\qquad
C.\CMEMS[y] = \X{at}_y~\limits_y
}{
C \vdashinstr \MEMORYCOPY~x~y : [\X{at}_x~\X{at}_y~\atmin(\X{at}_x, \X{at}_y)] \to []
C \vdashinstr \MEMORYCOPY~x~y : [\X{at}_x~\X{at}_y~\addrtypemin(\X{at}_x, \X{at}_y)] \to []
}
Expand Down

0 comments on commit d793168

Please sign in to comment.