-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encapsulate program-level options (#108)
* Add GlobalOptions class to encapsulate options constant for one kontrol prove run * Set Version: 0.1.28 * Set Version: 0.1.30 * Don't pass options on public function * Move options construction to exec_prove, add constructor with default args * Fix typo in help message * Rename class to ProveOptions * Set Version: 0.1.33 * Update src/kontrol/prove.py * Address comments * Set Version: 0.1.34 * Update src/kontrol/options.py Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com> --------- Co-authored-by: devops <devops@runtimeverification.com> Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com>
- Loading branch information
1 parent
04ede35
commit 132a6c5
Showing
8 changed files
with
232 additions
and
154 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.33 | ||
0.1.34 |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
if TYPE_CHECKING: | ||
from typing import Final | ||
|
||
VERSION: Final = '0.1.33' | ||
VERSION: Final = '0.1.34' |
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from collections.abc import Iterable | ||
|
||
from pyk.utils import BugReport | ||
|
||
|
||
@dataclass(frozen=True) | ||
class ProveOptions: | ||
auto_abstract_gas: bool | ||
bug_report: BugReport | None | ||
use_booster: bool | ||
kore_rpc_command: tuple[str, ...] | ||
smt_timeout: int | None | ||
smt_retry_limit: int | None | ||
trace_rewrites: bool | ||
simplify_init: bool | ||
bmc_depth: int | None | ||
max_depth: int | ||
break_every_step: bool | ||
break_on_jumpi: bool | ||
break_on_calls: bool | ||
workers: int | ||
counterexample_info: bool | ||
max_iterations: int | None | ||
run_constructor: bool | ||
fail_fast: bool | ||
reinit: bool | ||
port: int | None | ||
|
||
def __init__( | ||
self, | ||
*, | ||
auto_abstract_gas: bool = False, | ||
bug_report: BugReport | None = None, | ||
use_booster: bool = True, | ||
kore_rpc_command: str | Iterable[str] | None = None, | ||
smt_timeout: int | None = None, | ||
smt_retry_limit: int | None = None, | ||
trace_rewrites: bool = False, | ||
bmc_depth: int | None = None, | ||
max_depth: int = 1000, | ||
break_every_step: bool = False, | ||
break_on_jumpi: bool = False, | ||
break_on_calls: bool = True, | ||
workers: int = 1, | ||
counterexample_info: bool = False, | ||
max_iterations: int | None = None, | ||
run_constructor: bool = False, | ||
fail_fast: bool = True, | ||
reinit: bool = False, | ||
port: int | None = None, | ||
) -> None: | ||
if kore_rpc_command is None: | ||
kore_rpc_command = ('kore-rpc-booster',) if use_booster else ('kore-rpc',) | ||
elif isinstance(kore_rpc_command, str): | ||
kore_rpc_command = (kore_rpc_command,) | ||
else: | ||
kore_rpc_command = tuple(kore_rpc_command) | ||
object.__setattr__(self, 'auto_abstract_gas', auto_abstract_gas) | ||
object.__setattr__(self, 'bug_report', bug_report) | ||
object.__setattr__(self, 'use_booster', use_booster) | ||
object.__setattr__(self, 'kore_rpc_command', kore_rpc_command) | ||
object.__setattr__(self, 'smt_timeout', smt_timeout) | ||
object.__setattr__(self, 'smt_retry_limit', smt_retry_limit) | ||
object.__setattr__(self, 'trace_rewrites', trace_rewrites) | ||
object.__setattr__(self, 'bmc_depth', bmc_depth) | ||
object.__setattr__(self, 'max_depth', max_depth) | ||
object.__setattr__(self, 'break_every_step', break_every_step) | ||
object.__setattr__(self, 'break_on_jumpi', break_on_jumpi) | ||
object.__setattr__(self, 'break_on_calls', break_on_calls) | ||
object.__setattr__(self, 'workers', workers) | ||
object.__setattr__(self, 'counterexample_info', counterexample_info) | ||
object.__setattr__(self, 'max_iterations', max_iterations) | ||
object.__setattr__(self, 'run_constructor', run_constructor) | ||
object.__setattr__(self, 'fail_fast', fail_fast) | ||
object.__setattr__(self, 'reinit', reinit) | ||
object.__setattr__(self, 'port', port) |
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
Oops, something went wrong.