-
Notifications
You must be signed in to change notification settings - Fork 5
chore: sync feature/p-token with master #1007
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f70f025
`volatile_{load,store}` with statics. Heap allocations. And transmuti…
dkcumming f0257bc
perf(test): remove redundant integration test executions (#972)
Stevengre b694d02
Basic support for floats (`f16`, `f32`, `f64`, `f128`) (#995)
dkcumming 92056cd
cleanup(rt): remove redundant #forceSetLocal (#810)
Stevengre eafe909
fix(types): make #pointeeProjection confluent with source-first unwra…
Stevengre 9af0261
fix(rt): handle zero-sized function types in decode and ZST recogniti…
Stevengre aa05ac9
Merge branch 'master' into feature/p-token
Stevengre 443f9ad
Teach kmir to reduce SMIR K definitions over a set of CFG roots (#845)
sskeirik 09514b3
ci: increase integration test timeouts (#1008)
Stevengre 1f3ff1d
Merge remote-tracking branch 'origin/master' into sync-pr1006
Stevengre e4f0f36
Allow compilation of a <file>:<module> via --add-module. (#990)
mariaKt 2d66d8f
Update dependency: deps/stable-mir-json_release (#998)
rv-jenkins f38addb
test: enable --terminate-on-thunk for all prove tests (#1009)
Stevengre d39f68e
Merge remote-tracking branch 'origin/master' into sync-pr1006
Stevengre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule stable-mir-json
updated
10 files
| +31 −0 | .github/scripts/install-yq.sh | |
| +48 −18 | .github/workflows/test.yml | |
| +162 −18 | Makefile | |
| +0 −6 | rust-toolchain.toml | |
| +32 −43 | src/bin/cargo_stable_mir_json.rs | |
| +10 −0 | src/printer/collect.rs | |
| +2 −3 | src/printer/items.rs | |
| +2 −3 | src/printer/schema.rs | |
| +60 −4 | src/printer/ty_visitor.rs | |
| +30 −16 | tests/ui/ensure_rustc_commit.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7da8e3bcd0aee1410be9c63cb92dd499f70e8fcc | ||
| 885ab4a9f6dd1b5416b57e914082fbb341c89f97 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Adding Extra Modules to Proofs | ||
|
|
||
| ## Overview | ||
|
|
||
| The `--add-module` option for `kmir prove` allows including extra K rules in a proof without compiling them into the base K definition. This is useful for proof-specific lemmas, simplification rules, or summarized rules that are only needed for certain proofs. | ||
|
|
||
| Rules from the added module are injected into the Haskell backend at prove time, alongside the SMIR-generated function equations. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### K source files (`.k` or `.md`) | ||
|
|
||
| To include rules from a K source file, use the `FILE:MODULE` format: | ||
|
|
||
| ```bash | ||
| kmir prove test.rs --add-module lemmas.k:MY-LEMMAS | ||
| kmir prove test.rs --add-module lemmas.md:MY-LEMMAS | ||
| ``` | ||
|
|
||
| The file is parsed against the compiled K definition using `kprove --dry-run`. The named module is extracted and its rules are converted to Kore axioms and added to the proof. | ||
|
|
||
| If the file contains multiple modules, only the named module's rules are included. For example, given a file with modules `HELPERS` and `MY-LEMMAS`: | ||
|
|
||
| ```bash | ||
| # Only rules from MY-LEMMAS are included | ||
| kmir prove test.rs --add-module lemmas.k:MY-LEMMAS | ||
| ``` | ||
|
|
||
| ### Pre-exported JSON files | ||
|
|
||
| To include rules from a JSON module file (generated by `kmir show --to-module`): | ||
|
|
||
| ```bash | ||
| kmir prove test.rs --add-module module.json | ||
| ``` | ||
|
|
||
| No module name is needed because JSON files are expected to contain exactly one serialized module (as produced by `--to-module`). Multi-module JSON inputs are not supported. | ||
|
|
||
| ## Module file requirements | ||
|
|
||
| ### K source files | ||
|
|
||
| - The file must have a `.k` or `.md` extension. | ||
| - The module can `imports` other modules that are already in the compiled definition. However, it must not `requires` files that would conflict with the compiled definition (i.e., do not re-require files already compiled in). | ||
|
|
||
| For simple rules the dynamically loading pipeline should work reliably. However, there are some known limitations that restrict the kind of rules that can be expressed in a dynamically loaded module. We plan to address them in the future. | ||
|
|
||
| ### JSON files | ||
|
|
||
| - The file must have a `.json` extension. | ||
| - The file must contain a serialized `KFlatModule` (as produced by `kmir show --to-module output.json`). | ||
|
|
||
| ## Limitations | ||
|
|
||
| The dynamic module loading pipeline has known limitations with complex rules. See the summary below, that includes a non-exhaustive list of the identified issues: | ||
|
|
||
| | Limitation | Description | Workaround | | ||
| |-----------|-------------|------------| | ||
| | Limited syntax declarations | `kprove` rejects `syntax` productions in proof modules other than for tokens for existing sorts | Compile syntax into the base definition | | ||
| | No `#as` patterns | pyk's `krule_to_kore` does not support `KAs` | Duplicate the matched pattern on the RHS | | ||
| | Function rules may fail | The booster may reject dynamically-added function rules | Compile function rules into the base definition | | ||
| | Sort injection issues | Complex rules with subsort relationships may crash the booster | Compile such rules into the base definition | | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Simple simplification lemma | ||
|
|
||
| ```k | ||
| // lemma.k | ||
| module MY-SIMPLIFICATION | ||
| imports INT | ||
|
|
||
| rule [zero-add]: 0 +Int X => X [simplification] | ||
|
|
||
| endmodule | ||
| ``` | ||
|
|
||
| ```bash | ||
| kmir prove test.rs --add-module lemma.k:MY-SIMPLIFICATION | ||
| ``` | ||
|
|
||
| ### Proof summary from a previous run | ||
|
|
||
| ```bash | ||
| # Export a proof node transition as a module | ||
| kmir show proof-id --to-module summary.json --proof-dir ./proofs | ||
|
|
||
| # Use it in a new proof | ||
| kmir prove test.rs --add-module summary.json | ||
| ``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 job was converted to a matrix, but the Docker container name remains
mir-semantics-ci-${{ github.sha }}in the setup/exec/teardown steps, so two matrix shards that land on the same self-hosted machine (shared Docker daemon) will contend for the same container and can fail with name-already-in-use or stop each other’s container mid-run. I checked.github/workflows/test.ymltogether with.github/actions/with-docker/action.yml(which doesdocker run --name ${CONTAINER_NAME}), and the name now needs a matrix-specific suffix to avoid cross-shard collisions.Useful? React with 👍 / 👎.