From 0c10f5d92b3cede2e90b5a2465b084a783373bbc Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Mon, 6 Nov 2023 17:21:13 +0000 Subject: [PATCH] kevm-pyk/__main__, Makefile: rename kevm {kompile => kompile-spec} for more accurate usage --- Makefile | 2 +- kevm-pyk/src/kevm_pyk/__main__.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 56eda9ce80..03ebeadf81 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ tests/specs/%.prove: tests/specs/% tests/specs/$$(firstword $$(subst /, ,$$*))/$ --definition tests/specs/$(firstword $(subst /, ,$*))/$(KPROVE_FILE)/$(TEST_SYMBOLIC_BACKEND) tests/specs/%/timestamp: tests/specs/$$(firstword $$(subst /, ,$$*))/$$(KPROVE_FILE).$$(KPROVE_EXT) - $(POETRY_RUN) kevm-pyk kompile \ + $(POETRY_RUN) kevm-pyk kompile-spec \ $< \ --target $(word 3, $(subst /, , $*)) \ --output-definition tests/specs/$(firstword $(subst /, ,$*))/$(KPROVE_FILE)/$(word 3, $(subst /, , $*)) \ diff --git a/kevm-pyk/src/kevm_pyk/__main__.py b/kevm-pyk/src/kevm_pyk/__main__.py index 836ce7b7e8..6203bb58aa 100644 --- a/kevm-pyk/src/kevm_pyk/__main__.py +++ b/kevm-pyk/src/kevm_pyk/__main__.py @@ -33,7 +33,7 @@ from .cli import KEVMCLIArgs, node_id_like from .gst_to_kore import SORT_ETHEREUM_SIMULATION, gst_to_kore, kore_pgm_to_kore from .kevm import KEVM, KEVMSemantics, kevm_node_printer -from .kompile import run_kompile +from .kompile import KompileTarget, run_kompile from .utils import ( claim_dependency_dict, ensure_ksequence_on_k_cell, @@ -53,8 +53,6 @@ from pyk.proof.proof import Proof from pyk.utils import BugReport - from .kompile import KompileTarget - T = TypeVar('T') _LOGGER: Final = logging.getLogger(__name__) @@ -89,12 +87,11 @@ def exec_version(**kwargs: Any) -> None: print(f'KEVM Version: {VERSION}') -def exec_kompile( +def exec_kompile_spec( output_dir: Path | None, main_file: Path, emit_json: bool, includes: list[str], - target: KompileTarget, main_module: str | None, syntax_module: str | None, read_only: bool = False, @@ -123,7 +120,7 @@ def exec_kompile( optimization = 0 run_kompile( - target, + KompileTarget.HASKELL, output_dir=output_dir, main_file=main_file, main_module=main_module, @@ -671,13 +668,12 @@ def parse(s: str) -> list[T]: command_parser.add_parser('version', help='Print KEVM version and exit.', parents=[kevm_cli_args.logging_args]) kevm_kompile_args = command_parser.add_parser( - 'kompile', + 'kompile-spec', help='Kompile KEVM specification.', parents=[ kevm_cli_args.logging_args, kevm_cli_args.k_args, kevm_cli_args.kompile_args, - kevm_cli_args.target_args, ], ) kevm_kompile_args.add_argument('main_file', type=file_path, help='Path to file with main module.')