Skip to content

refactor: rename WP.wpTrans to WP.trans and the wp_consequence family to wp_monotone - #15171

Merged
sgraf812 merged 8 commits into
masterfrom
sg/wp-trans-rename
Sep 18, 2026
Merged

sgraf812 merged 8 commits into
masterfrom
sg/wp-trans-rename

Conversation

@sgraf812

@sgraf812 sgraf812 commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

This PR renames several Std.WP names for consistency and deprecates the old ones. The WP.wpTrans projection becomes WP.trans, its monotonicity field WP.wp_trans_monotone becomes WP.trans_monotone, and the wpTrans_apply_eq lemma becomes trans_apply_eq. The weakest-precondition monotonicity lemmas WP.wp_consequence/wp_econs become a uniform wp_monotone family: wp_monotone for both channels, wp_monotone_post and wp_monotone_epost for one channel, wp_monotone_bot for the empty exception postcondition, and the _le transitivity variants.

This PR renames the `WP.wpTrans` projection to `WP.trans` and the derived `wpTrans_apply_eq` lemmas to `trans_apply_eq`.

This is a mechanical rename with no behavioral change.
@sgraf812 sgraf812 added the changelog-library Library label Sep 15, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Sep 15, 2026
This PR renames the `WP.wp_trans_monotone` monotonicity field to `trans_monotone`, matching the `trans` projection.
… deprecations

This PR renames the `WP.wp_consequence`/`wp_econs` weakest-precondition monotonicity lemmas to a uniform `wp_monotone` family (`wp_monotone`, `wp_monotone_post`, `wp_monotone_epost`, `wp_monotone_bot`, and their `_le` variants), and adds deprecated aliases for every renamed name, including the earlier `WP.wpTrans`, `WP.wp_trans_monotone` and `WP.wpTrans_apply_eq` renames.
@sgraf812 sgraf812 changed the title refactor: rename WP.wpTrans to WP.trans refactor: rename WP.wpTrans to WP.trans and the wp_consequence family to wp_monotone Sep 17, 2026
This PR keeps `WP.wpTrans`/`WP.wp_trans_monotone` as deprecated fields alongside the new `WP.trans`/`WP.trans_monotone`, with mutual default values so an instance can define either name. Existing `WP` instances that construct with the old field names keep compiling, and reading the old projections warns.
This PR makes the program and pre-/postcondition arguments of `WP.wp_monotone`, `wp_monotone_post`, `wp_monotone_epost` and `wp_monotone_bot` implicit, since they are recovered from the goal by `apply`; only the entailment hypotheses stay explicit. The `_le` variants keep explicit arguments, as they are applied by `mkAppM` in vcgen.
This PR drops the explicit `x`/`epost` hints at the `WP.wp_monotone_post` call in `WPMonad.withFrameClosure`; the surrounding `PartialOrder.rel_trans` already determines them.
@sgraf812
sgraf812 marked this pull request as ready for review September 18, 2026 08:38
@downstream-lean4

Copy link
Copy Markdown

The adaptation PR for this PR is leanprover/downstream-lean4#84.

@sgraf812
sgraf812 added this pull request to the merge queue Sep 18, 2026
Merged via the queue into master with commit 70b4b72 Sep 18, 2026
27 checks passed
@sgraf812
sgraf812 deleted the sg/wp-trans-rename branch September 18, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-library Library downstream Request a downstream-lean4 adaptation PR. toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant