Skip to content

Conversation

@Stevengre
Copy link
Contributor

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 files and inject their rules into the definition
    • Can be specified multiple times for multiple modules
    • Currently supports JSON format only

These features enable the workflow:
kmir prove-rs -> kmir show --to-module --minimize-proof -> kmir prove-rs --add-module

@Stevengre Stevengre force-pushed the jh/draft-cse branch 5 times, most recently from 46d7d9c to 04e8234 Compare January 15, 2026 06:32
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.
@Stevengre Stevengre marked this pull request as ready for review January 15, 2026 06:33
@Stevengre Stevengre requested review from dkcumming, jberthold and tothtamas28 and removed request for jberthold January 15, 2026 06:33

# 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
Copy link
Contributor

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
@Stevengre Stevengre requested a review from tothtamas28 January 15, 2026 10:17
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}')
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Solved!

Copy link
Collaborator

@dkcumming dkcumming left a 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

@Stevengre Stevengre self-assigned this Jan 15, 2026
@automergerpr-permission-manager automergerpr-permission-manager bot merged commit 0f61f01 into master Jan 15, 2026
7 checks passed
@automergerpr-permission-manager automergerpr-permission-manager bot deleted the jh/draft-cse branch January 15, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants