Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.540
0.1.541
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pyk"
version = "0.1.540"
version = "0.1.541"
description = ""
authors = [
"Runtime Verification, Inc. <contact@runtimeverification.com>",
Expand Down
14 changes: 14 additions & 0 deletions src/pyk/ktool/kompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,20 @@ def __init__(self, kompile_command: str):
super().__init__(f'Kompile command not found: {str}')


class TypeInferenceMode(Enum):
Z3 = 'z3'
SIMPLESUB = 'simplesub'
CHECKED = 'checked'
DEFAULT = 'default'


def kompile(
main_file: str | Path,
*,
command: Iterable[str] = ('kompile',),
output_dir: str | Path | None = None,
temp_dir: str | Path | None = None,
type_inference_mode: str | TypeInferenceMode | None = None,
debug: bool = False,
verbose: bool = False,
cwd: Path | None = None,
Expand All @@ -48,6 +56,7 @@ def kompile(
command=command,
output_dir=output_dir,
temp_dir=temp_dir,
type_inference_mode=type_inference_mode,
debug=debug,
verbose=verbose,
cwd=cwd,
Expand Down Expand Up @@ -115,6 +124,7 @@ def __call__(
*,
output_dir: str | Path | None = None,
temp_dir: str | Path | None = None,
type_inference_mode: str | TypeInferenceMode | None = None,
debug: bool = False,
verbose: bool = False,
cwd: Path | None = None,
Expand All @@ -138,6 +148,10 @@ def __call__(
temp_dir = Path(temp_dir)
args += ['--temp-dir', str(temp_dir)]

if type_inference_mode is not None:
type_inference_mode = TypeInferenceMode(type_inference_mode)
args += ['--type-inference-mode', type_inference_mode.value]

if debug:
args += ['--debug']

Expand Down
4 changes: 2 additions & 2 deletions src/pyk/testing/_kompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ..kllvm.importer import import_runtime
from ..kore.pool import KoreServerPool
from ..kore.rpc import BoosterServer, KoreClient, KoreServer
from ..ktool.kompile import DefinitionInfo, Kompile
from ..ktool.kompile import DefinitionInfo, Kompile, TypeInferenceMode
from ..ktool.kprint import KPrint
from ..ktool.kprove import KProve
from ..ktool.krun import KRun
Expand Down Expand Up @@ -43,7 +43,7 @@ def __call__(self, main_file: str | Path, **kwargs: Any) -> Path:
kompile = Kompile.from_dict(kwargs)
if kompile not in self._cache:
output_dir = self._path / self._uid(kompile)
self._cache[kompile] = kompile(output_dir=output_dir)
self._cache[kompile] = kompile(output_dir=output_dir, type_inference_mode=TypeInferenceMode.CHECKED)

return self._cache[kompile]

Expand Down