Skip to content

Commit 2e1b698

Browse files
committed
Add --simplify-each option for booster
1 parent 9491a36 commit 2e1b698

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

pyk/src/pyk/cterm/symbolic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ def cterm_symbolic(
308308
start_server: bool = True,
309309
fallback_on: Iterable[FallbackReason] | None = None,
310310
interim_simplification: int | None = None,
311+
simplify_each: int | None = None,
311312
no_post_exec_simplify: bool = False,
312313
) -> Iterator[CTermSymbolic]:
313314
if start_server:
@@ -327,6 +328,7 @@ def cterm_symbolic(
327328
log_axioms_file=log_axioms_file,
328329
fallback_on=fallback_on,
329330
interim_simplification=interim_simplification,
331+
simplify_each=simplify_each,
330332
no_post_exec_simplify=no_post_exec_simplify,
331333
) as server:
332334
with KoreClient('localhost', server.port, bug_report=bug_report, bug_report_id=id) as client:

pyk/src/pyk/kore/rpc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ class BoosterServerArgs(KoreServerArgs, total=False):
12671267
llvm_kompiled_dir: Required[str | Path]
12681268
fallback_on: Iterable[str | FallbackReason] | None
12691269
interim_simplification: int | None
1270+
simplify_each: int | None
12701271
no_post_exec_simplify: bool | None
12711272
log_context: Iterable[str] | None
12721273
not_log_context: Iterable[str] | None
@@ -1280,6 +1281,7 @@ class BoosterServer(KoreServer):
12801281

12811282
_fallback_on: list[FallbackReason] | None
12821283
_interim_simplification: int | None
1284+
_simplify_each: int | None
12831285
_no_post_exec_simplify: bool
12841286
_log_context: list[str]
12851287
_not_log_context: list[str]
@@ -1306,6 +1308,7 @@ def __init__(self, args: BoosterServerArgs):
13061308
self._fallback_on = None
13071309

13081310
self._interim_simplification = args.get('interim_simplification')
1311+
self._simplify_each = args.get('simplify_each')
13091312
self._no_post_exec_simplify = bool(args.get('no_post_exec_simplify'))
13101313
self._log_context = list(args.get('log_context') or [])
13111314
self._not_log_context = list(args.get('not_log_context') or [])
@@ -1326,6 +1329,10 @@ def _validate(self) -> None:
13261329

13271330
if self._interim_simplification and self._interim_simplification < 0:
13281331
raise ValueError(f"'interim_simplification' must not be negative, got: {self._interim_simplification}")
1332+
1333+
if self._simplify_each and self._simplify_each < 0:
1334+
raise ValueError(f"'simplify_each' must not be negative, got: {self._simplify_each}")
1335+
13291336
super()._validate()
13301337

13311338
def _extra_args(self) -> list[str]:
@@ -1335,6 +1342,8 @@ def _extra_args(self) -> list[str]:
13351342
res += ['--fallback-on', ','.join(reason.value for reason in self._fallback_on)]
13361343
if self._interim_simplification is not None:
13371344
res += ['--interim-simplification', str(self._interim_simplification)]
1345+
if self._simplify_each is not None:
1346+
res += ['--simplify-each', str(self._simplify_each)]
13381347
if self._no_post_exec_simplify:
13391348
res += ['--no-post-exec-simplify']
13401349
res += [arg for glob in self._log_context for arg in ['--log-context', glob]]
@@ -1365,6 +1374,7 @@ def kore_server(
13651374
llvm_definition_dir: Path | None = None,
13661375
fallback_on: Iterable[str | FallbackReason] | None = None,
13671376
interim_simplification: int | None = None,
1377+
simplify_each: int | None = None,
13681378
no_post_exec_simplify: bool | None = None,
13691379
# ---
13701380
bug_report: BugReport | None = None,
@@ -1388,6 +1398,7 @@ def kore_server(
13881398
'llvm_kompiled_dir': llvm_definition_dir,
13891399
'fallback_on': fallback_on,
13901400
'interim_simplification': interim_simplification,
1401+
'simplify_each': simplify_each,
13911402
'no_post_exec_simplify': no_post_exec_simplify,
13921403
**kore_args,
13931404
}

pyk/src/tests/integration/kore/test_kore_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,7 @@ def test_add_module_with_hash_name_as_id_second_fails(self, kore_client: KoreCli
971971
{},
972972
{'fallback_on': ['Aborted', 'Stuck']},
973973
{'interim_simplification': 3},
974+
{'simplify_each': 5},
974975
{'no_post_exec_simpify': True},
975976
{'log_context': ['booster*']},
976977
{'log_context': ['kore*', '!detail']},

0 commit comments

Comments
 (0)