Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing the optimize-kcfg parameter #2666

Merged
merged 1 commit into from
Dec 17, 2024
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
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.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a bit more detailed?

Suggested change
help='Optimize the constructed KCFG on-the-fly.',
help='Optimize the constructed KCFG on-the-fly by minimizing consecutive edges.',

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what it is now, but we don't know what else it will be in the future.

)
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
Loading