diff --git a/pykwasm/src/pykwasm/kdist/wasm-semantics/auxil.md b/pykwasm/src/pykwasm/kdist/wasm-semantics/auxil.md
index 1ed01b680..2cd20e5f1 100644
--- a/pykwasm/src/pykwasm/kdist/wasm-semantics/auxil.md
+++ b/pykwasm/src/pykwasm/kdist/wasm-semantics/auxil.md
@@ -24,7 +24,7 @@ module WASM-AUXIL
#clearConfig => .K ...
_ => .Int
_ => .ValStack
- _ => .Map
+ _ => .List
_ => .Bag
_ => .Map
_ => 0
diff --git a/pykwasm/src/pykwasm/kdist/wasm-semantics/test.md b/pykwasm/src/pykwasm/kdist/wasm-semantics/test.md
index 59c0fb6f9..52c4a445c 100644
--- a/pykwasm/src/pykwasm/kdist/wasm-semantics/test.md
+++ b/pykwasm/src/pykwasm/kdist/wasm-semantics/test.md
@@ -430,7 +430,8 @@ The operator `#assertLocal`/`#assertGlobal` operators perform a check for a loca
```k
rule #assertLocal INDEX VALUE _ => .K ...
- ... INDEX |-> VALUE ...
+ LOCALS
+ requires LOCALS[INDEX] ==K VALUE
rule #assertGlobal TFIDX VALUE _ => .K ...
CUR
diff --git a/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm-text.md b/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm-text.md
index 4d23c2dda..2d2684a58 100644
--- a/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm-text.md
+++ b/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm-text.md
@@ -1174,7 +1174,6 @@ They are currently supported in KWasm text files, but may be deprecated.
rule #t2aInstr(#block(VT:VecType, IS:Instrs, BLOCKINFO)) => #block(VT, #t2aInstrs(IS), BLOCKINFO)
- rule #t2aInstr<_>(init_local I V) => init_local I V
rule #t2aInstr<_>(init_locals VS) => init_locals VS
```
diff --git a/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm.md b/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm.md
index a0d4e8bfd..d0afb4e72 100644
--- a/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm.md
+++ b/pykwasm/src/pykwasm/kdist/wasm-semantics/wasm.md
@@ -164,10 +164,9 @@ Internal Syntax
module WASM-INTERNAL-SYNTAX
imports WASM-DATA-INTERNAL-SYNTAX
- syntax Instr ::= "init_local" Int Val
- | "init_locals" ValStack
- | "#init_locals" Int ValStack
- // --------------------------------------------
+ syntax Instr ::= "init_locals" ValStack
+ | "#init_locals" ValStack
+ // ----------------------------------------
syntax Int ::= #pageSize() [function, total]
syntax Int ::= #maxMemorySize() [function, total]
@@ -202,8 +201,8 @@ module WASM
.K
.ValStack
- .Map
- .Int
+ .List
+ .Int
.Map
.Map
@@ -549,17 +548,15 @@ Variable Operators
The various `init_local` variants assist in setting up the `locals` cell.
```k
- rule init_local INDEX VALUE => .K ...
- LOCALS => LOCALS [ INDEX <- VALUE ]
-
- rule init_locals VALUES => #init_locals 0 VALUES ...
+ rule init_locals VALUES => #init_locals VALUES ...
+ _ => .List
- rule #init_locals _ .ValStack => .K ...
- rule #init_locals N (VALUE : VALSTACK)
- => init_local N VALUE
- ~> #init_locals (N +Int 1) VALSTACK
+ rule #init_locals .ValStack => .K ...
+ rule #init_locals (VALUE : VALSTACK)
+ => #init_locals VALSTACK
...
+ ... .List => ListItem(VALUE)
```
The `*_local` instructions are defined here.
@@ -570,18 +567,18 @@ The `*_local` instructions are defined here.
| "#local.tee" "(" Int ")" [klabel(aLocal.tee), symbol]
// ----------------------------------------------------------------------
rule #local.get(I) => .K ...
- VALSTACK => VALUE : VALSTACK
- ... I |-> VALUE ...
+ VALSTACK => {LOCALS [ I ]}:>Val : VALSTACK
+ LOCALS
rule #local.set(I) => .K ...
VALUE : VALSTACK => VALSTACK
LOCALS => LOCALS[I <- VALUE]
- requires I in_keys(LOCALS)
+ requires I >=Int 0 andBool I #local.tee(I) => .K ...
VALUE : _VALSTACK
LOCALS => LOCALS[I <- VALUE]
- requires I in_keys(LOCALS)
+ requires I >=Int 0 andBool I ` cell), and
Unlike labels, only one frame can be "broken" through at a time.
```k
- syntax Frame ::= "frame" Int ValTypes ValStack Map
- // --------------------------------------------------
+ syntax Frame ::= "frame" Int ValTypes ValStack List
+ // ---------------------------------------------------
rule frame MODIDX' TRANGE VALSTACK' LOCAL' => .K ...
VALSTACK => #take(lengthValTypes(TRANGE), VALSTACK) ++ VALSTACK'
_ => LOCAL'
@@ -1187,7 +1184,7 @@ The `#take` function will return the parameter stack in the reversed order, then
...
VALSTACK => .ValStack
- LOCAL => .Map
+ LOCAL
MODIDX => MODIDX'
FADDR
diff --git a/tests/success-llvm.out b/tests/success-llvm.out
index 0eae581e8..bdfd25dfa 100644
--- a/tests/success-llvm.out
+++ b/tests/success-llvm.out
@@ -11,7 +11,7 @@
- .Map
+ .List
.Int