-
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.
Merge branch 'master' into _update-deps/runtimeverification/wasm-sema…
…ntics
- Loading branch information
Showing
11 changed files
with
217 additions
and
5 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
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) |