-
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.
* implement the harness * add lemma tests * Set Version: 0.1.51 * add CI job for lemma tests * format * update soroban sdk * Fix typo Co-authored-by: Everett Hildenbrandt <[email protected]> * Set Version: 0.1.55 * add `EqualityProof` support --------- Co-authored-by: devops <[email protected]> Co-authored-by: Everett Hildenbrandt <[email protected]>
- Loading branch information
1 parent
f240ca0
commit cbfb8fc
Showing
13 changed files
with
219 additions
and
7 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
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 +1 @@ | ||
0.1.54 | ||
0.1.55 |
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 = "komet" | ||
version = "0.1.54" | ||
version = "0.1.55" | ||
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
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
Empty file.
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,12 @@ | ||
module INT-BITWISE-SPEC | ||
imports KASMER | ||
|
||
// Tested lemmas: | ||
// - modInt-to-bit-mask | ||
claim [test-modInt-to-andInt]: | ||
( (I <<Int 32) |Int 4) modInt 256 | ||
=> | ||
( (I <<Int 32) |Int 4) &Int 255 | ||
requires 0 <=Int I | ||
|
||
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,12 @@ | ||
module TEST-SPEC | ||
imports KASMER | ||
|
||
// Tested lemmas: | ||
// - bitwise-mk-hostval-then-mask | ||
claim [test-bitwise-mk-hostval-then-mask]: | ||
( (I <<Int 32) |Int 4) &Int 255 | ||
=> | ||
4 | ||
requires 0 <=Int I | ||
|
||
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,30 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
from pyk.kast.outer import KClaim | ||
from pyk.kdist import kdist | ||
from pyk.ktool.kprove import KProve | ||
|
||
from komet.kasmer import Kasmer | ||
from komet.utils import symbolic_definition | ||
|
||
SYMBOLIC_DEFINITION_DIR = kdist.get('soroban-semantics.haskell') | ||
|
||
|
||
def parse_kclaims(claim_path: Path) -> list[KClaim]: | ||
modules = KProve(SYMBOLIC_DEFINITION_DIR).parse_modules(claim_path).modules | ||
return [sent for module in modules for sent in module.sentences if isinstance(sent, KClaim)] | ||
|
||
|
||
SPEC_DATA = (Path(__file__).parent / 'specs').resolve(strict=True) | ||
SPEC_FILES = SPEC_DATA.glob('*.k') | ||
|
||
|
||
@pytest.fixture | ||
def symbolic_kasmer() -> Kasmer: | ||
return Kasmer(symbolic_definition) | ||
|
||
|
||
@pytest.mark.parametrize('claim_file', SPEC_FILES, ids=str) | ||
def test_run(claim_file: Path, tmp_path: Path, symbolic_kasmer: Kasmer) -> None: | ||
symbolic_kasmer.prove_raw(claim_file=claim_file, proof_dir=tmp_path) |