@@ -34,7 +34,7 @@ And we use `OptionalId` to handle the case where an identifier could be omitted.
34
34
35
35
``` k
36
36
syntax Identifier ::= IdentifierToken
37
- syntax OptionalId ::= "" [klabel (.Identifier), symbol ]
37
+ syntax OptionalId ::= "" [symbol (.Identifier)]
38
38
| Identifier
39
39
// --------------------------------
40
40
```
@@ -88,15 +88,15 @@ WebAssembly has three kinds of [Value types](https://webassembly.github.io/spec/
88
88
3 . [ Reference types] ( https://webassembly.github.io/spec/core/syntax/types.html#reference-types )
89
89
90
90
``` k
91
- syntax IValType ::= "i32" [klabel (i32), symbol ] | "i64" [klabel (i64), symbol ]
92
- syntax FValType ::= "f32" [klabel (f32), symbol ] | "f64" [klabel (f64), symbol ]
93
- syntax RefValType ::= "funcref" [klabel (funcref), symbol ]
94
- | "externref" [klabel (externref), symbol ]
91
+ syntax IValType ::= "i32" [symbol (i32)] | "i64" [symbol (i64)]
92
+ syntax FValType ::= "f32" [symbol (f32)] | "f64" [symbol (f64)]
93
+ syntax RefValType ::= "funcref" [symbol (funcref)]
94
+ | "externref" [symbol (externref)]
95
95
syntax ValType ::= IValType | FValType | RefValType
96
96
// ---------------------------------------
97
97
98
- syntax HeapType ::= "func" [klabel (func), symbol ]
99
- | "extern" [klabel (extern), symbol ]
98
+ syntax HeapType ::= "func" [symbol (func)]
99
+ | "extern" [symbol (extern)]
100
100
```
101
101
102
102
#### Type Constructors
@@ -120,8 +120,8 @@ For the core language, only regular integers are allowed.
120
120
### Type Mutability
121
121
122
122
``` k
123
- syntax Mut ::= "const" [klabel (mutConst), symbol ]
124
- | "var" [klabel (mutVar), symbol ]
123
+ syntax Mut ::= "const" [symbol (mutConst)]
124
+ | "var" [symbol (mutVar)]
125
125
// -----------------------------------------------
126
126
```
127
127
@@ -158,19 +158,19 @@ module WASM-DATA-INTERNAL-SYNTAX
158
158
imports WASM-DATA-COMMON-SYNTAX
159
159
imports BOOL
160
160
161
- syntax ValStack ::= ".ValStack" [klabel (.ValStack), symbol ]
162
- | Val ":" ValStack [klabel (concatValStack), symbol ]
161
+ syntax ValStack ::= ".ValStack" [symbol (.ValStack)]
162
+ | Val ":" ValStack [symbol (concatValStack)]
163
163
```
164
164
165
165
### Values
166
166
167
167
Proper values are numbers annotated with their types.
168
168
169
169
``` k
170
- syntax IVal ::= "<" IValType ">" Int [klabel (IVal), symbol ]
171
- syntax FVal ::= "<" FValType ">" Float [klabel (FVal), symbol ]
172
- syntax RefVal ::= "<" RefValType ">" Int [klabel (RefVal), symbol ]
173
- | "<" RefValType ">" "null" [klabel (RefValNull), symbol ]
170
+ syntax IVal ::= "<" IValType ">" Int [symbol (IVal)]
171
+ syntax FVal ::= "<" FValType ">" Float [symbol (FVal)]
172
+ syntax RefVal ::= "<" RefValType ">" Int [symbol (RefVal)]
173
+ | "<" RefValType ">" "null" [symbol (RefValNull)]
174
174
syntax Val ::= IVal | FVal | RefVal
175
175
// ---------------------------
176
176
@@ -204,9 +204,9 @@ We also add `undefined` as a value, which makes many partial functions in the se
204
204
There are two basic type-constructors: sequencing (` [_] ` ) and function spaces (` _->_ ` ).
205
205
206
206
``` k
207
- syntax VecType ::= "[" ValTypes "]" [klabel (aVecType), symbol ]
207
+ syntax VecType ::= "[" ValTypes "]" [symbol (aVecType)]
208
208
209
- syntax FuncType ::= VecType "->" VecType [klabel (aFuncType), symbol ]
209
+ syntax FuncType ::= VecType "->" VecType [symbol (aFuncType)]
210
210
```
211
211
212
212
All told, a ` Type ` can be a value type, vector of types, or function type.
@@ -221,7 +221,7 @@ In some cases, an integer is optional, such as when either giving or omitting th
221
221
The sort ` OptionalInt ` provides this potentially "undefined" ` Int ` .
222
222
223
223
``` k
224
- syntax OptionalInt ::= Int | ".Int" [klabel (.Int), symbol ]
224
+ syntax OptionalInt ::= Int | ".Int" [symbol (.Int)]
225
225
```
226
226
227
227
### Integer bounds
@@ -332,8 +332,8 @@ For `Int`, however, a the context is irrelevant and the index always just resolv
332
332
Tables and memories have limits, defined as either a single ` Int ` or two ` Int ` s, representing min and max bounds.
333
333
334
334
``` k
335
- syntax Limits ::= #limitsMin(Int) [klabel (limitsMin), symbol ]
336
- | #limits(Int, Int) [klabel (limitsMinMax), symbol ]
335
+ syntax Limits ::= #limitsMin(Int) [symbol (limitsMin)]
336
+ | #limits(Int, Int) [symbol (limitsMinMax)]
337
337
// ------------------------------------------------------------------
338
338
```
339
339
@@ -360,7 +360,7 @@ Also we can reverse a `ValTypes` with `#revt`
360
360
361
361
``` k
362
362
syntax ValTypes ::= #revt ( ValTypes ) [function, total]
363
- | #revt ( ValTypes , ValTypes ) [function, total, klabel (#revtAux)]
363
+ | #revt ( ValTypes , ValTypes ) [function, total, symbol (#revtAux)]
364
364
// ------------------------------------------------------------------------------------------
365
365
rule #revt(VT) => #revt(VT, .ValTypes)
366
366
@@ -480,7 +480,7 @@ Some operations extend integers from 1, 2, or 4 bytes, so a special function wit
480
480
Function ` #bool ` converts a ` Bool ` into an ` Int ` .
481
481
482
482
``` k
483
- syntax Int ::= #bool ( Bool ) [function, total, smtlib(boolToInt), symbol, klabel (boolToInt)]
483
+ syntax Int ::= #bool ( Bool ) [function, total, smtlib(boolToInt), symbol(boolToInt)]
484
484
// ----------------------------------------------------
485
485
rule #bool( B:Bool ) => 1 requires B
486
486
rule #bool( B:Bool ) => 0 requires notBool B
@@ -511,7 +511,7 @@ Each call site _must_ ensure that this is desired behavior before using these fu
511
511
| #take ( Int , ValStack ) [function, total]
512
512
| #drop ( Int , ValStack ) [function, total]
513
513
| #revs ( ValStack ) [function, total]
514
- | #revs ( ValStack , ValStack ) [function, total, klabel (#revsAux)]
514
+ | #revs ( ValStack , ValStack ) [function, total, symbol (#revsAux)]
515
515
// ------------------------------------------------------------------------------------------
516
516
rule #zero(.ValTypes) => .ValStack
517
517
rule #zero(ITYPE:IValType VTYPES) => < ITYPE > 0 : #zero(VTYPES)
@@ -538,7 +538,7 @@ Wasm uses a different character escape rule with K, so we need to define the `un
538
538
539
539
``` k
540
540
syntax String ::= unescape(String) [function]
541
- | unescape(String, Int, String) [function, klabel (unescapeAux)]
541
+ | unescape(String, Int, String) [function, symbol (unescapeAux)]
542
542
// -------------------------------------------------------------------------------
543
543
rule unescape(S ) => unescape(S, 1, "")
544
544
rule unescape(S, IDX, SB) => SB requires IDX ==Int lengthString(S) -Int 1
@@ -616,7 +616,7 @@ The strings to connect needs to be unescaped before concatenated, because the `u
616
616
617
617
``` k
618
618
syntax String ::= #concatDS ( DataString ) [function]
619
- | #concatDS ( DataString, String ) [function, klabel (#concatDSAux)]
619
+ | #concatDS ( DataString, String ) [function, symbol (#concatDSAux)]
620
620
// -----------------------------------------------------------------------------------
621
621
rule #concatDS ( DS ) => #concatDS ( DS, "" )
622
622
rule #concatDS ( .DataString , S ) => S
@@ -690,7 +690,7 @@ endmodule
690
690
module WASM-DATA-SYMBOLIC [symbolic]
691
691
imports WASM-DATA-COMMON
692
692
693
- syntax Int ::= #signedTotal ( IValType , Int) [function, total, klabel (#signedTotal), symbol , no-evaluators, smtlib(signedTotal)]
693
+ syntax Int ::= #signedTotal ( IValType , Int) [function, total, symbol (#signedTotal), no-evaluators, smtlib(signedTotal)]
694
694
695
695
rule #signedTotal(Arg0:IValType, Arg1:Int)
696
696
=> #signed(Arg0, Arg1)
@@ -730,4 +730,4 @@ module WASM-DATA
730
730
imports WASM-DATA-CONCRETE
731
731
imports WASM-DATA-SYMBOLIC
732
732
endmodule
733
- ```
733
+ ```
0 commit comments