Skip to content

Commit a0e49e8

Browse files
Baltolirv-auditor
andauthored
Deprecate klabel attribute (#666)
* Deprecate klabel * Set Version: 0.1.74 --------- Co-authored-by: devops <[email protected]>
1 parent fd9c3f5 commit a0e49e8

File tree

9 files changed

+218
-218
lines changed

9 files changed

+218
-218
lines changed

package/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.73
1+
0.1.74

pykwasm/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "pykwasm"
7-
version = "0.1.73"
7+
version = "0.1.74"
88
description = ""
99
authors = [
1010
"Runtime Verification, Inc. <[email protected]>",

pykwasm/src/pykwasm/kdist/wasm-semantics/data.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ And we use `OptionalId` to handle the case where an identifier could be omitted.
3434

3535
```k
3636
syntax Identifier ::= IdentifierToken
37-
syntax OptionalId ::= "" [klabel(.Identifier), symbol]
37+
syntax OptionalId ::= "" [symbol(.Identifier)]
3838
| Identifier
3939
// --------------------------------
4040
```
@@ -88,15 +88,15 @@ WebAssembly has three kinds of [Value types](https://webassembly.github.io/spec/
8888
3. [Reference types](https://webassembly.github.io/spec/core/syntax/types.html#reference-types)
8989

9090
```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)]
9595
syntax ValType ::= IValType | FValType | RefValType
9696
// ---------------------------------------
9797
98-
syntax HeapType ::= "func" [klabel(func), symbol]
99-
| "extern" [klabel(extern), symbol]
98+
syntax HeapType ::= "func" [symbol(func)]
99+
| "extern" [symbol(extern)]
100100
```
101101

102102
#### Type Constructors
@@ -120,8 +120,8 @@ For the core language, only regular integers are allowed.
120120
### Type Mutability
121121

122122
```k
123-
syntax Mut ::= "const" [klabel(mutConst), symbol]
124-
| "var" [klabel(mutVar), symbol]
123+
syntax Mut ::= "const" [symbol(mutConst)]
124+
| "var" [symbol(mutVar)]
125125
// -----------------------------------------------
126126
```
127127

@@ -158,19 +158,19 @@ module WASM-DATA-INTERNAL-SYNTAX
158158
imports WASM-DATA-COMMON-SYNTAX
159159
imports BOOL
160160
161-
syntax ValStack ::= ".ValStack" [klabel(.ValStack), symbol]
162-
| Val ":" ValStack [klabel(concatValStack), symbol]
161+
syntax ValStack ::= ".ValStack" [symbol(.ValStack)]
162+
| Val ":" ValStack [symbol(concatValStack)]
163163
```
164164

165165
### Values
166166

167167
Proper values are numbers annotated with their types.
168168

169169
```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)]
174174
syntax Val ::= IVal | FVal | RefVal
175175
// ---------------------------
176176
@@ -204,9 +204,9 @@ We also add `undefined` as a value, which makes many partial functions in the se
204204
There are two basic type-constructors: sequencing (`[_]`) and function spaces (`_->_`).
205205

206206
```k
207-
syntax VecType ::= "[" ValTypes "]" [klabel(aVecType), symbol]
207+
syntax VecType ::= "[" ValTypes "]" [symbol(aVecType)]
208208
209-
syntax FuncType ::= VecType "->" VecType [klabel(aFuncType), symbol]
209+
syntax FuncType ::= VecType "->" VecType [symbol(aFuncType)]
210210
```
211211

212212
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
221221
The sort `OptionalInt` provides this potentially "undefined" `Int`.
222222

223223
```k
224-
syntax OptionalInt ::= Int | ".Int" [klabel(.Int), symbol]
224+
syntax OptionalInt ::= Int | ".Int" [symbol(.Int)]
225225
```
226226

227227
### Integer bounds
@@ -332,8 +332,8 @@ For `Int`, however, a the context is irrelevant and the index always just resolv
332332
Tables and memories have limits, defined as either a single `Int` or two `Int`s, representing min and max bounds.
333333

334334
```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)]
337337
// ------------------------------------------------------------------
338338
```
339339

@@ -360,7 +360,7 @@ Also we can reverse a `ValTypes` with `#revt`
360360

361361
```k
362362
syntax ValTypes ::= #revt ( ValTypes ) [function, total]
363-
| #revt ( ValTypes , ValTypes ) [function, total, klabel(#revtAux)]
363+
| #revt ( ValTypes , ValTypes ) [function, total, symbol(#revtAux)]
364364
// ------------------------------------------------------------------------------------------
365365
rule #revt(VT) => #revt(VT, .ValTypes)
366366
@@ -480,7 +480,7 @@ Some operations extend integers from 1, 2, or 4 bytes, so a special function wit
480480
Function `#bool` converts a `Bool` into an `Int`.
481481

482482
```k
483-
syntax Int ::= #bool ( Bool ) [function, total, smtlib(boolToInt), symbol, klabel(boolToInt)]
483+
syntax Int ::= #bool ( Bool ) [function, total, smtlib(boolToInt), symbol(boolToInt)]
484484
// ----------------------------------------------------
485485
rule #bool( B:Bool ) => 1 requires B
486486
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
511511
| #take ( Int , ValStack ) [function, total]
512512
| #drop ( Int , ValStack ) [function, total]
513513
| #revs ( ValStack ) [function, total]
514-
| #revs ( ValStack , ValStack ) [function, total, klabel(#revsAux)]
514+
| #revs ( ValStack , ValStack ) [function, total, symbol(#revsAux)]
515515
// ------------------------------------------------------------------------------------------
516516
rule #zero(.ValTypes) => .ValStack
517517
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
538538

539539
```k
540540
syntax String ::= unescape(String) [function]
541-
| unescape(String, Int, String) [function, klabel(unescapeAux)]
541+
| unescape(String, Int, String) [function, symbol(unescapeAux)]
542542
// -------------------------------------------------------------------------------
543543
rule unescape(S ) => unescape(S, 1, "")
544544
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
616616

617617
```k
618618
syntax String ::= #concatDS ( DataString ) [function]
619-
| #concatDS ( DataString, String ) [function, klabel(#concatDSAux)]
619+
| #concatDS ( DataString, String ) [function, symbol(#concatDSAux)]
620620
// -----------------------------------------------------------------------------------
621621
rule #concatDS ( DS ) => #concatDS ( DS, "" )
622622
rule #concatDS ( .DataString , S ) => S
@@ -690,7 +690,7 @@ endmodule
690690
module WASM-DATA-SYMBOLIC [symbolic]
691691
imports WASM-DATA-COMMON
692692
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)]
694694
695695
rule #signedTotal(Arg0:IValType, Arg1:Int)
696696
=> #signed(Arg0, Arg1)
@@ -730,4 +730,4 @@ module WASM-DATA
730730
imports WASM-DATA-CONCRETE
731731
imports WASM-DATA-SYMBOLIC
732732
endmodule
733-
```
733+
```

pykwasm/src/pykwasm/kdist/wasm-semantics/data/int-type.k

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module INT-TYPE
55
syntax WrappedInt
66
syntax Int
77

8-
syntax WrappedInt ::= wrap(Int) [symbol, klabel(wrapInt)]
9-
syntax Int ::= unwrap(WrappedInt) [function, total, injective, symbol, klabel(unwrapInt)]
8+
syntax WrappedInt ::= wrap(Int) [symbol(wrapInt)]
9+
syntax Int ::= unwrap(WrappedInt) [function, total, injective, symbol(unwrapInt)]
1010
rule unwrap(wrap(A:Int)) => A
1111
endmodule

pykwasm/src/pykwasm/kdist/wasm-semantics/data/list-ref.k

+15-15
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ module LIST-REF
1010
syntax ListRef [hook(LIST.List)]
1111
syntax ListRef ::= ListRef ListRef
1212
[ left, function, total, hook(LIST.concat),
13-
klabel(_ListRef_), symbol, smtlib(smt_seq_concat),
13+
symbol(_ListRef_), smtlib(smt_seq_concat),
1414
assoc, unit(.ListRef), element(ListRefItem),
1515
format(%1%n%2)
1616
]
1717
syntax ListRef ::= ".ListRef"
18-
[ function, total, hook(LIST.unit), klabel(.ListRef),
19-
symbol, smtlib(smt_seq_nil)
18+
[ function, total, hook(LIST.unit), symbol(.ListRef),
19+
smtlib(smt_seq_nil)
2020
]
2121
syntax ListRef ::= ListItem(RefVal)
22-
[ function, total, hook(LIST.element), klabel(ListRefItem),
23-
symbol, smtlib(smt_seq_elem)
22+
[ function, total, hook(LIST.element), symbol(ListRefItem),
23+
smtlib(smt_seq_elem)
2424
]
2525
syntax RefVal ::= ListRef "[" Int "]"
26-
[ function, hook(LIST.get), klabel(ListRef:get), symbol ]
26+
[ function, hook(LIST.get), symbol(ListRef:get) ]
2727
syntax ListRef ::= ListRef "[" index: Int "<-" value: RefVal "]"
28-
[function, hook(LIST.update), symbol, klabel(ListRef:set)]
28+
[function, hook(LIST.update), symbol(ListRef:set)]
2929
syntax ListRef ::= makeListRef(length: Int, value: RefVal)
3030
[function, hook(LIST.make)]
3131
syntax ListRef ::= updateList(dest: ListRef, index: Int, src: ListRef)
3232
[function, hook(LIST.updateAll)]
3333
syntax ListRef ::= fillList(ListRef, index: Int, length: Int, value: RefVal)
3434
[function, hook(LIST.fill)]
3535
syntax ListRef ::= range(ListRef, fromFront: Int, fromBack: Int)
36-
[function, hook(LIST.range), klabel(ListRef:range), symbol]
36+
[function, hook(LIST.range), symbol(ListRef:range)]
3737
syntax Bool ::= RefVal "in" ListRef
38-
[function, total, hook(LIST.in), symbol, klabel(_inListRef_)]
38+
[function, total, hook(LIST.in), symbol(_inListRef_)]
3939
syntax Int ::= size(ListRef)
40-
[function, total, hook(LIST.size), symbol, klabel (sizeListRef), smtlib(smt_seq_len)]
40+
[function, total, hook(LIST.size), symbol(sizeListRef), smtlib(smt_seq_len)]
4141
endmodule
4242

4343
module LIST-REF-EXTENSIONS
@@ -46,7 +46,7 @@ module LIST-REF-EXTENSIONS
4646
imports INT
4747

4848
syntax RefVal ::= ListRef "[" Int "]" "orDefault" RefVal
49-
[ function, total, klabel(ListRef:getOrDefault), symbol ]
49+
[ function, total, symbol(ListRef:getOrDefault) ]
5050
// ----------------------------------------------------------------
5151
rule ListItem(V:RefVal) _:ListRef [0] orDefault _:RefVal
5252
=> V
@@ -66,24 +66,24 @@ module LIST-REF-EXTENSIONS
6666
[simplification]
6767

6868
syntax RefVal ::= getRefOrNull(ListRef, Int)
69-
[ function, total, klabel(ListRef:getOrNull), symbol ]
69+
[ function, total, symbol(ListRef:getOrNull) ]
7070
// -------------------------------------------------------------
7171
rule getRefOrNull(L, N) => L [N] orDefault (<funcref> null)
7272

7373
syntax ListRef ::= makeListRefTotal(Int, RefVal)
74-
[function, total, klabel(ListRef:makeTotal), symbol]
74+
[function, total, symbol(ListRef:makeTotal)]
7575
// ----------------------------------------------------
7676
rule makeListRefTotal(N, V) => makeListRef(N, V)
7777
requires N >=Int 0
7878
rule makeListRefTotal(N, _) => .ListRef
7979
requires N <Int 0
8080

8181
syntax ListRef ::= dropListRef(Int, ListRef)
82-
[function, total, klabel(ListRef:drop), symbol]
82+
[function, total, symbol(ListRef:drop)]
8383
// --------------------------------------------------------------
8484
rule dropListRef(N, ListItem(_) L) => dropListRef(N -Int 1, L)
8585
requires N >Int 0
8686
rule dropListRef(_, L) => L
8787
[owise]
8888

89-
endmodule
89+
endmodule

pykwasm/src/pykwasm/kdist/wasm-semantics/data/sparse-bytes.k

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,50 @@ module SPARSE-BYTES
44
imports BYTES
55
imports INT
66

7-
syntax SBItem ::= #empty(Int) [symbol, klabel(SBItem:empty)]
8-
| #bytes(Bytes) [symbol, klabel(SBItem:bytes)]
7+
syntax SBItem ::= #empty(Int) [symbol(SBItem:empty)]
8+
| #bytes(Bytes) [symbol(SBItem:bytes)]
99

1010

1111
syntax SBItemChunk ::= SBChunk(SBItem)
1212

1313
syntax SparseBytes ::= List{SBItemChunk, ""}
1414

1515
syntax Bytes ::= unwrap(SparseBytes)
16-
[function, total, symbol, klabel(SparseBytes:unwrap)]
16+
[function, total, symbol(SparseBytes:unwrap)]
1717
// -----------------------------------------------------------------
1818
rule unwrap(SBChunk(SBI) REST) => unwrap(SBI) +Bytes unwrap(REST)
1919
rule unwrap(.SparseBytes) => .Bytes
2020

2121
syntax SparseBytes ::= fromBytes(Bytes)
22-
[function, total, symbol, klabel(SparseBytes:fromBytes)]
22+
[function, total, symbol(SparseBytes:fromBytes)]
2323
// ---------------------------------------------------------
2424
rule fromBytes(Bs) => SBChunk(#bytes(Bs))
2525

2626
syntax Bytes ::= unwrap(SBItem)
27-
[function, total, symbol, klabel(SBItem:unwrap)]
27+
[function, total, symbol(SBItem:unwrap)]
2828
// -----------------------------------------------
2929
rule unwrap(#bytes(Bs)) => Bs
3030
rule unwrap(#empty(N)) => zeros(N)
3131

32-
syntax Bytes ::= zeros(Int) [function, total, symbol, klabel(zeros)]
32+
syntax Bytes ::= zeros(Int) [function, total, symbol(zeros)]
3333
// -------------------------------------------------------------------
3434
rule zeros(N) => padLeftBytes(.Bytes, size(#empty(N)), 0)
3535

3636
syntax Int ::= size(SparseBytes)
37-
[function, total, klabel(SparseBytes:size), symbol]
37+
[function, total, symbol(SparseBytes:size)]
3838
// ---------------------------------------------------
3939
rule size(SBChunk(SBI) SBS) => size(SBI) +Int size(SBS)
4040
rule size(.SparseBytes) => 0
4141

4242
syntax Int ::= size(SBItem)
43-
[function, total, symbol, klabel(SBItem:size)]
43+
[function, total, symbol(SBItem:size)]
4444
// -----------------------------------------------
4545
rule size(#bytes(Bs)) => lengthBytes(Bs)
4646
rule size(#empty(N)) => maxInt(N,0)
4747

4848

4949
syntax SparseBytes ::= substrSparseBytes(SparseBytes, from: Int, to: Int)
50-
[function, total, klabel(SparseBytes:substr), symbol]
50+
[function, total, symbol(SparseBytes:substr)]
5151
// ------------------------------------------------------------------------
5252
rule substrSparseBytes(_, S, E) => .SparseBytes
5353
requires notBool( 0 <=Int S andBool S <=Int E )
@@ -66,7 +66,7 @@ module SPARSE-BYTES
6666
andBool size(SBI) >Int S
6767

6868
syntax SparseBytes ::= substrSBItem(SBItem, from: Int, to: Int)
69-
[function, total, klabel(SBItem:substr), symbol]
69+
[function, total, symbol(SBItem:substr)]
7070
// -------------------------------------------------------------
7171
rule substrSBItem(_SBI, S, E) => .SparseBytes
7272
requires S <Int 0 orBool E <Int S
@@ -90,7 +90,7 @@ module SPARSE-BYTES
9090

9191

9292
syntax SparseBytes ::= replaceAt(SparseBytes, Int, Bytes)
93-
[function, total, symbol, klabel(SparseBytes:replaceAt)]
93+
[function, total, symbol(SparseBytes:replaceAt)]
9494
// --------------------------------------------------------
9595
// invalid argument
9696
rule replaceAt(_, S, _) => .SparseBytes
@@ -115,7 +115,7 @@ module SPARSE-BYTES
115115
requires S <Int lengthBytes(B)
116116

117117
syntax SparseBytes ::= replaceAtZ(Int, SparseBytes, Int, Bytes)
118-
[function, total, symbol, klabel(SparseBytes:replaceAtZ)]
118+
[function, total, symbol(SparseBytes:replaceAtZ)]
119119
// ---------------------------------------------------------------
120120
////////////// S < 0
121121
rule replaceAtZ(_, _, S, _) => .SparseBytes
@@ -156,7 +156,7 @@ module SPARSE-BYTES
156156

157157

158158
syntax SparseBytes ::= replaceAtB(Bytes, SparseBytes, Int, Bytes)
159-
[function, total, symbol, klabel(SparseBytes:replaceAtB)]
159+
[function, total, symbol(SparseBytes:replaceAtB)]
160160
// ---------------------------------------------------------------
161161
////////// S + len(Bs) <= len(MB)
162162
rule replaceAtB(MB, REST, S, Bs)

0 commit comments

Comments
 (0)