-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encode and decode contracts in tests
- Loading branch information
1 parent
236a8de
commit 86104b3
Showing
5 changed files
with
43 additions
and
1 deletion.
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,8 +1,10 @@ | ||
```k | ||
requires "decoding/impl.md" | ||
requires "decoding/syntax.md" | ||
module UKM-DECODING | ||
imports private UKM-DECODING-IMPL | ||
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,16 @@ | ||
```k | ||
module UKM-DECODING-IMPL | ||
imports private COMMON-K-CELL | ||
imports private UKM-DECODING-SYNTAX | ||
imports private UKM-FULL-PREPROCESSED-CONFIGURATION | ||
syntax UkmFullPreprocessedCell ::= decodeUkmFullPreprocessedCell(Bytes) | ||
[function, hook(ULM.decode)] | ||
rule | ||
<k> ukmDecodePreprocessedCell(B:Bytes) => .K ... </k> | ||
(_:UkmFullPreprocessedCell => decodeUkmFullPreprocessedCell(B)) | ||
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
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,22 @@ | ||
```k | ||
module UKM-ENCODING-IMPL | ||
imports private COMMON-K-CELL | ||
imports private BYTES-SYNTAX | ||
imports private UKM-ENCODING-SYNTAX | ||
imports private UKM-FULL-PREPROCESSED-CONFIGURATION | ||
syntax Bytes ::= encodeUkmFullPreprocessedCell(UkmFullPreprocessedCell) | ||
[function, hook(ULM.encode)] | ||
rule | ||
<k> | ||
ukmEncodePreprocessedCell | ||
=> ukmEncodedPreprocessedCell(encodeUkmFullPreprocessedCell(Cell)) | ||
... | ||
</k> | ||
Cell:UkmFullPreprocessedCell | ||
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