Types

Various entities in WebAssembly are classified by types. Types are checked during validation, instantiation, and possibly execution.

Number Types

Number types classify numeric values.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-numtype}{\mathit{numtype}}} & ::= & \href{../syntax/types.html#syntax-numtype}{\mathsf{i\scriptstyle32}} ~|~ \href{../syntax/types.html#syntax-numtype}{\mathsf{i\scriptstyle64}} ~|~ \href{../syntax/types.html#syntax-numtype}{\mathsf{f\scriptstyle32}} ~|~ \href{../syntax/types.html#syntax-numtype}{\mathsf{f\scriptstyle64}} \\ \end{array}\end{split}\]

The types \(\mathsf{i{\scriptstyle 32}}\) and \(\mathsf{i{\scriptstyle 64}}\) classify 32 and 64 bit integers, respectively. Integers are not inherently signed or unsigned, their interpretation is determined by individual operations.

The types \(\mathsf{f{\scriptstyle 32}}\) and \(\mathsf{f{\scriptstyle 64}}\) classify 32 and 64 bit floating-point data, respectively. They correspond to the respective binary floating-point representations, also known as single and double precision, as defined by the IEEE 754 standard (Section 3.3).

Number types are transparent, meaning that their bit patterns can be observed. Values of number type can be stored in memories.

Conventions

  • The notation \({|t|}\) denotes the bit width of a number type \(t\). That is, \({|\mathsf{i{\scriptstyle 32}}|} = {|\mathsf{f{\scriptstyle 32}}|} = 32\) and \({|\mathsf{i{\scriptstyle 64}}|} = {|\mathsf{f{\scriptstyle 64}}|} = 64\).

Vector Types

Vector types classify vectors of numeric values processed by vector instructions (also known as SIMD instructions, single instruction multiple data).

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-vectype}{\mathit{vectype}}} & ::= & \href{../syntax/types.html#syntax-vectype}{\mathsf{v\scriptstyle128}} \\ \end{array}\end{split}\]

The type \(\mathsf{v{\scriptstyle 128}}\) corresponds to a 128 bit vector of packed integer or floating-point data. The packed data can be interpreted as signed or unsigned integers, single or double precision floating-point values, or a single 128 bit type. The interpretation is determined by individual operations.

Vector types, like number types are transparent, meaning that their bit patterns can be observed. Values of vector type can be stored in memories.

Conventions

  • The notation \({|t|}\) for bit width extends to vector types as well, that is, \({|\mathsf{v{\scriptstyle 128}}|} = 128\).

Heap Types

Heap types classify objects in the runtime store. There are three disjoint hierarchies of heap types:

  • function types classify functions,

  • aggregate types classify dynamically allocated managed data, such as structures, arrays, or unboxed scalars,

  • external types classify external references possibly owned by the embedder.

The values from the latter two hierarchies are interconvertible by ways of the \(\href{../syntax/instructions.html#syntax-instr-extern}{\mathsf{extern{.}convert\_any}}\) and \(\href{../syntax/instructions.html#syntax-instr-extern}{\mathsf{any{.}convert\_extern}}\) instructions. That is, both type hierarchies are inhabited by an isomorphic set of values, but may have different, incompatible representations in practice.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-absheaptype}{\mathit{absheaptype}}} & ::= & \href{../syntax/types.html#syntax-heaptype}{\mathsf{any}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{eq}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{i\scriptstyle31}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{struct}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{array}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{none}} \\ & & | & \href{../syntax/types.html#syntax-heaptype}{\mathsf{func}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{nofunc}} \\ & & | & \href{../syntax/types.html#syntax-heaptype}{\mathsf{exn}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{noexn}} \\ & & | & \href{../syntax/types.html#syntax-heaptype}{\mathsf{extern}} ~|~ \href{../syntax/types.html#syntax-heaptype}{\mathsf{noextern}} \\ & & | & \dots \\ & {\href{../syntax/types.html#syntax-heaptype}{\mathit{heaptype}}} & ::= & {\href{../syntax/types.html#syntax-absheaptype}{\mathit{absheaptype}}} ~|~ {\href{../syntax/types.html#syntax-typeuse}{\mathit{typeuse}}} \\ & {\href{../syntax/types.html#syntax-typeuse}{\mathit{typeuse}}} & ::= & {\href{../syntax/modules.html#syntax-typeidx}{\mathit{typeidx}}} ~|~ \dots \\ \end{array}\end{split}\]

A heap type is either abstract or concrete. A concrete heap type consists of a type use, which is a type index. It classifies an object of the respective type defined in a module. Abstract types are denoted by individual keywords.

The type \(\mathsf{func}\) denotes the common supertype of all function types, regardless of their concrete definition. Dually, the type \(\mathsf{nofunc}\) denotes the common subtype of all function types, regardless of their concrete definition. This type has no values.

The type \(\mathsf{exn}\) denotes the common supertype of all exception references. This type has no concrete subtypes. Dually, the type \(\mathsf{noexn}\) denotes the common subtype of all forms of exception references. This type has no values.

The type \(\mathsf{extern}\) denotes the common supertype of all external references received through the embedder. This type has no concrete subtypes. Dually, the type \(\mathsf{noextern}\) denotes the common subtype of all forms of external references. This type has no values.

The type \(\mathsf{any}\) denotes the common supertype of all aggregate types, as well as possibly abstract values produced by internalizing an external reference of type \(\mathsf{extern}\). Dually, the type \(\mathsf{none}\) denotes the common subtype of all forms of aggregate types. This type has no values.

The type \(\mathsf{eqt}\) is a subtype of \(\mathsf{any}\) that includes all types for which references can be compared, i.e., aggregate values and \(\mathsf{i{\scriptstyle 31}}\).

The types \(\mathsf{struct}\) and \(\mathsf{array}\) denote the common supertypes of all structure and array aggregates, respectively.

The type \(\mathsf{i{\scriptstyle 31}}\) denotes unboxed scalars, that is, integers injected into references. Their observable value range is limited to 31 bits.

Note

An \(\mathsf{i{\scriptstyle 31}}\) value is not actually allocated in the store, but represented in a way that allows them to be mixed with actual references into the store without ambiguity. Engines need to perform some form of pointer tagging to achieve this, which is why one bit is reserved.

Although the types \(\mathsf{none}\), \(\mathsf{nofunc}\), \(\mathsf{noexn}\), and \(\mathsf{noextern}\) are not inhabited by any values, they can be used to form the types of all null references in their respective hierarchy. For example, \((\mathsf{ref}~\mathsf{null}~\mathsf{nofunc})\) is the generic type of a null reference compatible with all function reference types.

The syntax of abstract heap types and type uses is extended with additional forms for the purpose of specifying validation and execution.

Reference Types

Reference types classify values that are first-class references to objects in the runtime store.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-reftype}{\mathit{reftype}}} & ::= & \href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~{\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}^?}~{\href{../syntax/types.html#syntax-heaptype}{\mathit{heaptype}}} \\ \end{array}\end{split}\]

A reference type is characterised by the heap type it points to.

In addition, a reference type of the form \(\mathsf{ref}~\mathsf{null}~{\mathit{ht}}\) is nullable, meaning that it can either be a proper reference to \({\mathit{ht}}\) or null. Other references are non-null.

Reference types are opaque, meaning that neither their size nor their bit pattern can be observed. Values of reference type can be stored in tables.

Conventions

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{anyref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{any}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{eqref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{eq}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{i{\scriptstyle31}ref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{i\scriptstyle31}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{structref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{struct}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{arrayref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{array}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{funcref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{func}})\).

  • The reference type \({\mathrm{EXNREF}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{exn}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{externref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{extern}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{nullref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{none}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{nullfuncref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{nofunc}})\).

  • The reference type \({\mathrm{NULLEXNREF}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{noexn}})\).

  • The reference type \(\href{../syntax/types.html#syntax-reftype}{\mathsf{nullexternref}}\) is an abbreviation for \((\href{../syntax/types.html#syntax-reftype}{\mathsf{ref}}~\href{../syntax/types.html#syntax-reftype}{\mathsf{null}}~\href{../syntax/types.html#syntax-heaptype}{\mathsf{noextern}})\).

Value Types

Value types classify the individual values that WebAssembly code can compute with and the values that a variable accepts. They are either number types, vector types, or reference types.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-consttype}{\mathit{consttype}}} & ::= & {\href{../syntax/types.html#syntax-numtype}{\mathit{numtype}}} ~|~ {\href{../syntax/types.html#syntax-vectype}{\mathit{vectype}}} \\ & {\href{../syntax/types.html#syntax-valtype}{\mathit{valtype}}} & ::= & {\href{../syntax/types.html#syntax-numtype}{\mathit{numtype}}} ~|~ {\href{../syntax/types.html#syntax-vectype}{\mathit{vectype}}} ~|~ {\href{../syntax/types.html#syntax-reftype}{\mathit{reftype}}} ~|~ \dots \\ \end{array}\end{split}\]

The syntax of value types is extended with additional forms for the purpose of specifying validation.

Conventions

  • The meta variable \(t\) ranges over value types or subclasses thereof where clear from context.

Result Types

Result types classify the result of executing instructions or functions, which is a sequence of values, written with brackets.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-resulttype}{\mathit{resulttype}}} & ::= & {\href{../syntax/conventions.html#syntax-list}{\mathit{list}}}({\href{../syntax/types.html#syntax-valtype}{\mathit{valtype}}}) \\ \end{array}\end{split}\]

Function Types

Function types classify the signature of functions, mapping a list of parameters to a list of results. They are also used to classify the inputs and outputs of instructions.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-functype}{\mathit{functype}}} & ::= & {\href{../syntax/types.html#syntax-resulttype}{\mathit{resulttype}}} \href{../syntax/types.html#syntax-functype}{\rightarrow} {\href{../syntax/types.html#syntax-resulttype}{\mathit{resulttype}}} \\ \end{array}\end{split}\]

Aggregate Types

Aggregate types describe compound objects consisting of multiple values. These are either structures or arrays, which both consist of a list of possibly mutable and possibly packed fields. Structures are heterogeneous, but require static indexing, while arrays need to be homogeneous, but allow dynamic indexing.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-structtype}{\mathit{structtype}}} & ::= & {\href{../syntax/conventions.html#syntax-list}{\mathit{list}}}({\href{../syntax/types.html#syntax-fieldtype}{\mathit{fieldtype}}}) \\ & {\href{../syntax/types.html#syntax-arraytype}{\mathit{arraytype}}} & ::= & {\href{../syntax/types.html#syntax-fieldtype}{\mathit{fieldtype}}} \\ & {\href{../syntax/types.html#syntax-fieldtype}{\mathit{fieldtype}}} & ::= & {\href{../syntax/types.html#syntax-mut}{\mathsf{mut}}^?}~{\href{../syntax/types.html#syntax-storagetype}{\mathit{storagetype}}} \\ & {\href{../syntax/types.html#syntax-storagetype}{\mathit{storagetype}}} & ::= & {\href{../syntax/types.html#syntax-valtype}{\mathit{valtype}}} ~|~ {\href{../syntax/types.html#syntax-packtype}{\mathit{packtype}}} \\ & {\href{../syntax/types.html#syntax-packtype}{\mathit{packtype}}} & ::= & \href{../syntax/types.html#syntax-storagetype}{\mathsf{i\scriptstyle8}} ~|~ \href{../syntax/types.html#syntax-storagetype}{\mathsf{i\scriptstyle16}} \\ \end{array}\end{split}\]

Conventions

  • The notation \({|t|}\) for bit width extends to packed types as well, that is, \({|\mathsf{i{\scriptstyle 8}}|} = 8\) and \({|\mathsf{i{\scriptstyle 16}}|} = 16\).

  • The auxiliary function \(\href{../syntax/types.html#aux-unpack}{\mathrm{unpack}}\) maps a storage type to the value type obtained when accessing a field:

    \[\begin{split}\begin{array}{lll} \href{../syntax/types.html#aux-unpack}{\mathrm{unpack}}(\href{../syntax/types.html#syntax-valtype}{\mathit{valtype}}) &=& \href{../syntax/types.html#syntax-valtype}{\mathit{valtype}} \\ \href{../syntax/types.html#aux-unpack}{\mathrm{unpack}}(\href{../syntax/types.html#syntax-packtype}{\mathit{packtype}}) &=& \href{../syntax/types.html#syntax-numtype}{\mathsf{i\scriptstyle32}} \\ \end{array}\end{split}\]

Composite Types

Composite types are all types composed from simpler types, including function types and aggregate types.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-comptype}{\mathit{comptype}}} & ::= & \href{../syntax/types.html#syntax-comptype}{\mathsf{struct}}~{\href{../syntax/types.html#syntax-structtype}{\mathit{structtype}}} \\ & & | & \href{../syntax/types.html#syntax-comptype}{\mathsf{array}}~{\href{../syntax/types.html#syntax-arraytype}{\mathit{arraytype}}} \\ & & | & \href{../syntax/types.html#syntax-comptype}{\mathsf{func}}~{\href{../syntax/types.html#syntax-functype}{\mathit{functype}}} \\ \end{array}\end{split}\]

Recursive Types

Recursive types denote a group of mutually recursive composite types, each of which can optionally declare a list of type indices of supertypes that it matches. Each type can also be declared final, preventing further subtyping.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-rectype}{\mathit{rectype}}} & ::= & \href{../syntax/types.html#syntax-rectype}{\mathsf{rec}}~{\href{../syntax/conventions.html#syntax-list}{\mathit{list}}}({\href{../syntax/types.html#syntax-subtype}{\mathit{subtype}}}) \\ & {\href{../syntax/types.html#syntax-subtype}{\mathit{subtype}}} & ::= & \href{../syntax/types.html#syntax-subtype}{\mathsf{sub}}~{\href{../syntax/types.html#syntax-subtype}{\mathsf{final}}^?}~{{\href{../syntax/types.html#syntax-typeuse}{\mathit{typeuse}}}^\ast}~{\href{../syntax/types.html#syntax-comptype}{\mathit{comptype}}} \\ \end{array}\end{split}\]

In a module, each member of a recursive type is assigned a separate type index.

Limits

Limits classify the size range of resizeable storage associated with memory types and table types.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-limits}{\mathit{limits}}} & ::= & {}[ {\href{../syntax/values.html#syntax-int}{\mathit{u\scriptstyle\kern-0.1em32}}} \href{../syntax/types.html#syntax-limits}{\,{..}\,} {\href{../syntax/values.html#syntax-int}{\mathit{u\scriptstyle\kern-0.1em32}}} ] \\ \end{array}\end{split}\]

Memory Types

Memory types classify linear memories and their size range.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-memtype}{\mathit{memtype}}} & ::= & {\href{../syntax/types.html#syntax-limits}{\mathit{limits}}}~\href{../syntax/types.html#syntax-memtype}{\mathsf{page}} \\ \end{array}\end{split}\]

The limits constrain the minimum and optionally the maximum size of a memory. The limits are given in units of page size.

Table Types

Table types classify tables over elements of reference type within a size range.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-tabletype}{\mathit{tabletype}}} & ::= & {\href{../syntax/types.html#syntax-limits}{\mathit{limits}}}~{\href{../syntax/types.html#syntax-reftype}{\mathit{reftype}}} \\ \end{array}\end{split}\]

Like memories, tables are constrained by limits for their minimum and optionally maximum size. The limits are given in numbers of entries.

Global Types

Global types classify global variables, which hold a value and can either be mutable or immutable.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-globaltype}{\mathit{globaltype}}} & ::= & {\href{../syntax/types.html#syntax-mut}{\mathsf{mut}}^?}~{\href{../syntax/types.html#syntax-valtype}{\mathit{valtype}}} \\ \end{array}\end{split}\]

Element Types

Element types classify element segments by a reference type of its elements.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-elemtype}{\mathit{elemtype}}} & ::= & {\href{../syntax/types.html#syntax-reftype}{\mathit{reftype}}} \\ \end{array}\end{split}\]

Data Types

Data types classify data segments. Since the contents of a data segment requires no further classification, they merely consist of a universal marker \(\mathsf{ok}\) indicating well-formedness.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-datatype}{\mathit{datatype}}} & ::= & \href{../valid/modules.html#valid-data}{\mathsf{ok}} \\ \end{array}\end{split}\]

Tag Types

Tag types classify the signature of tags with a function type.

\[\begin{split}\begin{array}{llll} \def\mathdef2456#1{{}}\mathdef2456{tag type} &\href{../syntax/types.html#syntax-tagtype}{\mathit{tagtype}} &::=& \href{../syntax/types.html#syntax-functype}{\mathit{functype}} \\ \end{array}\end{split}\]

Currently tags are only used for categorizing exceptions. The parameters of \(\href{../syntax/types.html#syntax-functype}{\mathit{functype}}\) define the list of values associated with the exception thrown with this tag. Furthermore, it is an invariant of the semantics that every \(\href{../syntax/types.html#syntax-functype}{\mathit{functype}}\) in a valid tag type for an exception has an empty result type.

Note

Future versions of WebAssembly may have additional uses for tags, and may allow non-empty result types in the function types of tags.

External Types

External types classify imports and external addresses with their respective types.

\[\begin{split}\begin{array}[t]{@{}l@{}rrl@{}l@{}} & {\href{../syntax/types.html#syntax-externtype}{\mathit{externtype}}} & ::= & \href{../syntax/types.html#syntax-externtype}{\mathsf{func}}~{\href{../syntax/types.html#syntax-typeuse}{\mathit{typeuse}}} ~|~ \href{../syntax/types.html#syntax-externtype}{\mathsf{global}}~{\href{../syntax/types.html#syntax-globaltype}{\mathit{globaltype}}} ~|~ \href{../syntax/types.html#syntax-externtype}{\mathsf{table}}~{\href{../syntax/types.html#syntax-tabletype}{\mathit{tabletype}}} ~|~ \href{../syntax/types.html#syntax-externtype}{\mathsf{mem}}~{\href{../syntax/types.html#syntax-memtype}{\mathit{memtype}}} ~|~ \href{../syntax/types.html#syntax-tagtype}{\mathsf{tag}}~{\href{../syntax/types.html#syntax-typeuse}{\mathit{typeuse}}} \\ \end{array}\end{split}\]

Conventions

The following auxiliary notation is defined for sequences of external types. It filters out entries of a specific kind in an order-preserving fashion:

\[\begin{split}\begin{array}[t]{@{}lcl@{}l@{}} {\href{../syntax/types.html#syntax-externtype}{\mathrm{funcs}}}(\epsilon) & = & \epsilon \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{funcs}}}((\href{../syntax/types.html#syntax-externtype}{\mathsf{func}}~{\mathit{dt}})~{{\mathit{xt}}^\ast}) & = & {\mathit{dt}}~{\href{../syntax/types.html#syntax-externtype}{\mathrm{funcs}}}({{\mathit{xt}}^\ast}) \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{funcs}}}({\href{../syntax/types.html#syntax-externtype}{\mathit{externtype}}}~{{\mathit{xt}}^\ast}) & = & {\href{../syntax/types.html#syntax-externtype}{\mathrm{funcs}}}({{\mathit{xt}}^\ast}) & \mbox{otherwise} \\[0.8ex] {\href{../syntax/types.html#syntax-externtype}{\mathrm{tables}}}(\epsilon) & = & \epsilon \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{tables}}}((\href{../syntax/types.html#syntax-externtype}{\mathsf{table}}~{\mathit{tt}})~{{\mathit{xt}}^\ast}) & = & {\mathit{tt}}~{\href{../syntax/types.html#syntax-externtype}{\mathrm{tables}}}({{\mathit{xt}}^\ast}) \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{tables}}}({\href{../syntax/types.html#syntax-externtype}{\mathit{externtype}}}~{{\mathit{xt}}^\ast}) & = & {\href{../syntax/types.html#syntax-externtype}{\mathrm{tables}}}({{\mathit{xt}}^\ast}) & \mbox{otherwise} \\[0.8ex] {\href{../syntax/types.html#syntax-externtype}{\mathrm{mems}}}(\epsilon) & = & \epsilon \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{mems}}}((\href{../syntax/types.html#syntax-externtype}{\mathsf{mem}}~{\mathit{mt}})~{{\mathit{xt}}^\ast}) & = & {\mathit{mt}}~{\href{../syntax/types.html#syntax-externtype}{\mathrm{mems}}}({{\mathit{xt}}^\ast}) \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{mems}}}({\href{../syntax/types.html#syntax-externtype}{\mathit{externtype}}}~{{\mathit{xt}}^\ast}) & = & {\href{../syntax/types.html#syntax-externtype}{\mathrm{mems}}}({{\mathit{xt}}^\ast}) & \mbox{otherwise} \\[0.8ex] {\href{../syntax/types.html#syntax-externtype}{\mathrm{globals}}}(\epsilon) & = & \epsilon \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{globals}}}((\href{../syntax/types.html#syntax-externtype}{\mathsf{global}}~{\mathit{gt}})~{{\mathit{xt}}^\ast}) & = & {\mathit{gt}}~{\href{../syntax/types.html#syntax-externtype}{\mathrm{globals}}}({{\mathit{xt}}^\ast}) \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{globals}}}({\href{../syntax/types.html#syntax-externtype}{\mathit{externtype}}}~{{\mathit{xt}}^\ast}) & = & {\href{../syntax/types.html#syntax-externtype}{\mathrm{globals}}}({{\mathit{xt}}^\ast}) & \mbox{otherwise} \\[0.8ex] {\href{../syntax/types.html#syntax-externtype}{\mathrm{tags}}}(\epsilon) & = & \epsilon \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{tags}}}((\href{../syntax/types.html#syntax-tagtype}{\mathsf{tag}}~{\mathit{at}})~{{\mathit{xt}}^\ast}) & = & {\mathit{at}}~{\href{../syntax/types.html#syntax-externtype}{\mathrm{tags}}}({{\mathit{xt}}^\ast}) \\ {\href{../syntax/types.html#syntax-externtype}{\mathrm{tags}}}({\href{../syntax/types.html#syntax-externtype}{\mathit{externtype}}}~{{\mathit{xt}}^\ast}) & = & {\href{../syntax/types.html#syntax-externtype}{\mathrm{tags}}}({{\mathit{xt}}^\ast}) & \mbox{otherwise} \\ \end{array}\end{split}\]