-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add --to-module, --minimize-proof, and --add-module CLI options #907
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
Conversation
46d7d9c to
04e8234
Compare
Add CLI options for semantics summarization evaluation: 1. `--to-module <file>` for `kmir show`: - Export proof KCFG as K module to specified file - Supports .json (KFlatModule JSON format) and .k (K text format) 2. `--minimize-proof` for `kmir show`: - Minimize the proof KCFG before displaying or exporting - Saves minimized proof back to disk 3. `--add-module <file>` for `kmir prove-rs`: - Load K module file and pass to APRProver via extra_module parameter - Currently supports JSON format only Note: The --add-module feature uses pyk's native extra_module support in APRProver. However, rules from KCFGShow.to_module() have complex partial configurations that may cause sort injection failures during Kore conversion.
04e8234 to
0f33cd3
Compare
|
|
||
| # Process LLVM definition | ||
| # Process LLVM definition (only SMIR rules, not extra module rules) | ||
| # Extra module rules are configuration rewrites that LLVM backend doesn't support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting a bit too complicated IMO. We should extract two helpers for the two cases of if symbolic (not in this PR though).
- Extract _write_to_module helper function in __main__.py - Use exc_info=True for better exception logging in kompile.py
kmir/src/kmir/__main__.py
Outdated
| k_module_text = kmir.pretty_print(k_module_readable) | ||
| to_module_path.write_text(k_module_text) | ||
| _LOGGER.info(f'Module written to: {to_module_path}') | ||
| print(f'Module written to: {to_module_path}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider pulling this side effect to the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved!
dkcumming
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is all good
Add CLI options for semantics summarization evaluation:
--to-module <file>forkmir show:--minimize-proofforkmir show:--add-module <file>forkmir prove-rs:These features enable the workflow:
kmir prove-rs -> kmir show --to-module --minimize-proof -> kmir prove-rs --add-module