-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* helpers for reading/writing wasm memory * implement `Vec` * Set Version: 0.1.7 * implement `Symbol` * fix validSymbol too long case * Set Version: 0.1.8 * Update src/ksoroban/kdist/soroban-semantics/wasm-ops.md Co-authored-by: gtrepta <[email protected]> * fix encode/decode small symbols and refactor Co-authored-by: gtrepta <[email protected]> --------- Co-authored-by: devops <[email protected]> Co-authored-by: gtrepta <[email protected]> Co-authored-by: gtrepta <[email protected]>
- Loading branch information
1 parent
f90cc8e
commit 9942796
Showing
12 changed files
with
824 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.7 | ||
0.1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "ksoroban" | ||
version = "0.1.7" | ||
version = "0.1.8" | ||
description = "K tooling for the Soroban platform" | ||
authors = [ | ||
"Runtime Verification, Inc. <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
|
||
```k | ||
requires "integer.md" | ||
requires "symbol.md" | ||
requires "vector.md" | ||
module HOSTFUNS | ||
imports HOST-INTEGER | ||
imports HOST-SYMBOL | ||
imports HOST-VECTOR | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Symbol | ||
|
||
```k | ||
requires "../configuration.md" | ||
requires "../switch.md" | ||
requires "../wasm-ops.md" | ||
requires "integer.md" | ||
module HOST-SYMBOL | ||
imports CONFIG-OPERATIONS | ||
imports WASM-OPERATIONS | ||
imports HOST-INTEGER | ||
imports SWITCH-SYNTAX | ||
// symbol_new_from_linear_memory | ||
rule [hostfun-symbol-new-from-linear-memory]: | ||
<instrs> hostCall ( "b" , "j" , [ i64 i64 .ValTypes ] -> [ i64 .ValTypes ] ) | ||
=> #memLoad(getMajor(HostVal(LM_POS)), getMajor(HostVal(LEN))) | ||
~> symbolNewFromLinearMemory | ||
... | ||
</instrs> | ||
<locals> | ||
0 |-> < i64 > LM_POS // U32 | ||
1 |-> < i64 > LEN // U32 | ||
</locals> | ||
requires fromSmallValid(HostVal(LM_POS)) | ||
andBool fromSmallValid(HostVal(LEN)) | ||
syntax InternalInstr ::= "symbolNewFromLinearMemory" [symbol(symbolNewFromLinearMemory)] | ||
rule [symbolNewFromLinearMemory]: | ||
<instrs> symbolNewFromLinearMemory | ||
=> allocObject(Symbol(Bytes2String(BS))) | ||
~> returnHostVal | ||
... | ||
</instrs> | ||
<hostStack> BS:Bytes : S => S </hostStack> | ||
requires validSymbol(Bytes2String(BS)) | ||
endmodule | ||
``` |
Oops, something went wrong.