Skip to content

Commit

Permalink
Add command-line argument to set Z3 tactic to be used by KoreServer (#…
Browse files Browse the repository at this point in the history
…660)

`kore-rpc` now supports (and `kore-rpc-booster` will soon support, after
runtimeverification/hs-backend-booster#317 is
merged) the `--smt-tactic` option, that allows customizing the Z3 tactic
used for checking satisfiability. THis PR allows setting this argument
from command-line in `pyk`-powered tools.

---------

Co-authored-by: devops <[email protected]>
  • Loading branch information
geo2a and devops authored Sep 25, 2023
1 parent 40069ca commit db8f951
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyk/package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.447
0.1.448
2 changes: 1 addition & 1 deletion pyk/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.447"
version = "0.1.448"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
6 changes: 6 additions & 0 deletions pyk/src/pyk/cli/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ def smt_args(self) -> ArgumentParser:
type=int,
help='Number of times to retry SMT queries with scaling timeouts.',
)
args.add_argument(
'--smt-tactic',
dest='smt_tactic',
type=str,
help='Z3 tactic to use when checking satisfiability. Example: (check-sat-using smt)',
)
return args

@cached_property
Expand Down
8 changes: 8 additions & 0 deletions pyk/src/pyk/kore/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ def __init__(
smt_timeout: int | None = None,
smt_retry_limit: int | None = None,
smt_reset_interval: int | None = None,
smt_tactic: str | None = None,
command: str | Iterable[str] | None = None,
bug_report: BugReport | None = None,
haskell_log_format: KoreExecLogFormat = KoreExecLogFormat.ONELINE,
Expand Down Expand Up @@ -881,6 +882,8 @@ def __init__(
smt_server_args += ['--smt-retry-limit', str(smt_retry_limit)]
if smt_reset_interval:
smt_server_args += ['--smt-reset-interval', str(smt_reset_interval)]
if smt_tactic:
smt_server_args += ['--smt-tactic', smt_tactic]

haskell_log_args = (
[
Expand Down Expand Up @@ -980,6 +983,7 @@ def __init__(
smt_timeout: int | None = None,
smt_retry_limit: int | None = None,
smt_reset_interval: int | None = None,
smt_tactic: str | None = None,
command: str | Iterable[str] | None,
bug_report: BugReport | None = None,
haskell_log_format: KoreExecLogFormat = KoreExecLogFormat.ONELINE,
Expand Down Expand Up @@ -1027,6 +1031,7 @@ def __init__(
smt_timeout=smt_timeout,
smt_retry_limit=smt_retry_limit,
smt_reset_interval=smt_reset_interval,
smt_tactic=smt_tactic,
command=args,
bug_report=bug_report,
haskell_log_format=haskell_log_format,
Expand All @@ -1045,6 +1050,7 @@ def kore_server(
bug_report: BugReport | None = None,
smt_timeout: int | None = None,
smt_retry_limit: int | None = None,
smt_tactic: str | None = None,
haskell_log_format: KoreExecLogFormat = KoreExecLogFormat.ONELINE,
haskell_log_entries: Iterable[str] = (),
log_axioms_file: Path | None = None,
Expand All @@ -1059,6 +1065,7 @@ def kore_server(
bug_report=bug_report,
smt_timeout=smt_timeout,
smt_retry_limit=smt_retry_limit,
smt_tactic=smt_tactic,
haskell_log_format=haskell_log_format,
haskell_log_entries=haskell_log_entries,
log_axioms_file=log_axioms_file,
Expand All @@ -1072,6 +1079,7 @@ def kore_server(
bug_report=bug_report,
smt_timeout=smt_timeout,
smt_retry_limit=smt_retry_limit,
smt_tactic=smt_tactic,
haskell_log_format=haskell_log_format,
haskell_log_entries=haskell_log_entries,
log_axioms_file=log_axioms_file,
Expand Down

0 comments on commit db8f951

Please sign in to comment.