Skip to content

Commit

Permalink
introducing the optimize_kcfg parameter (#2666)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetarMax authored Dec 17, 2024
1 parent afce9a6 commit 5e7a593
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions kevm-pyk/src/kevm_pyk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def create_kcfg_explore() -> KCFGExplore:
max_frontier_parallel=options.max_frontier_parallel,
force_sequential=options.force_sequential,
assume_defined=options.assume_defined,
optimize_kcfg=options.optimize_kcfg,
)
end_time = time.time()
_LOGGER.info(f'Proof timing {proof_problem.id}: {end_time - start_time}s')
Expand Down
9 changes: 9 additions & 0 deletions kevm-pyk/src/kevm_pyk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ class KProveOptions(Options):
direct_subproof_rules: bool
maintenance_rate: int
assume_defined: bool
optimize_kcfg: bool

@staticmethod
def default() -> dict[str, Any]:
Expand All @@ -390,6 +391,7 @@ def default() -> dict[str, Any]:
'direct_subproof_rules': False,
'maintenance_rate': 1,
'assume_defined': False,
'optimize_kcfg': False,
}


Expand Down Expand Up @@ -850,6 +852,13 @@ def kprove_args(self) -> ArgumentParser:
action='store_true',
help='Use the implication check of the Booster (experimental).',
)
args.add_argument(
'--optimize-kcfg',
dest='optimize_kcfg',
default=None,
action='store_true',
help='Optimize the constructed KCFG on-the-fly.',
)
return args

@cached_property
Expand Down
2 changes: 2 additions & 0 deletions kevm-pyk/src/kevm_pyk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def run_prover(
maintenance_rate: int = 1,
assume_defined: bool = False,
extra_module: KFlatModule | None = None,
optimize_kcfg: bool = False,
) -> bool:
prover: APRProver | ImpliesProver
try:
Expand All @@ -131,6 +132,7 @@ def create_prover() -> APRProver:
direct_subproof_rules=direct_subproof_rules,
assume_defined=assume_defined,
extra_module=extra_module,
optimize_kcfg=optimize_kcfg,
)

def update_status_bar(_proof: Proof) -> None:
Expand Down

0 comments on commit 5e7a593

Please sign in to comment.