8000 feat: make `let` and `have` term syntaxes be consistent by kmill · Pull Request #8914 · leanprover/lean4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: make let and have term syntaxes be consistent #8914

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 3 commits into from
Jun 22, 2025

Conversation

kmill
Copy link
Collaborator
@kmill kmill commented Jun 21, 2025

This PR modifies let and have term syntaxes to be consistent with each other. Adds configuration options; for example, have is equivalent to let +nondep, for nondependent lets. Other options include +usedOnly (for let_tmp), +zeta (for letI/haveI), and +postponeValue (for let_delayed). There is also let (eq := h) x := v; b for introducing h : x = v when elaborating b. The eq option works for pattern matching as well, for example let (eq := h) (x, y) := p; b.

Future PRs will add these options to tactic syntax, once a stage0 update has been done.

This PR modifies `let` and `have` syntaxes to be consistent with each other. Adds configuration options; for example, `have` is equivalent to `let +nondep`, for *nondependent* lets. Other options include `+usedOnly` (for `let_tmp`), `+zeta` (for `letI`/`haveI`), and `+postponeValue` (for `let_delayed)`. There is also `let (eq := h) x := v; b` for introducing `h : x = v` when elaborating `b`. The `eq` option works for pattern matching as well, for example `let (eq := h) (x, y) := p; b`.

Future PRs will add these options to tactic syntax as well, once a stage0 update has been done.
@kmill kmill requested a review from kim-em as a code owner June 21, 2025 06:38
@kmill kmill added the changelog-language Language features, tactics, and metaprograms label Jun 21, 2025
@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 Jun 21, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 21, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 21, 2025
@leanprover-community-bot
Copy link
Collaborator
leanprover-community-bot commented Jun 21, 2025

Mathlib CI status (docs):

@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Jun 21, 2025
@kmill kmill changed the title feat: make let and have syntaxes consistent feat: make let and have term syntaxes be consistent Jun 21, 2025
@leanprover-community-bot leanprover-community-bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Jun 21, 2025
@kmill kmill added this pull request to the merge queue Jun 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 21, 2025
@kmill kmill requested a review from digama0 as a code owner June 22, 2025 04:10
@kmill kmill enabled auto-merge June 22, 2025 04:11
@kmill kmill added this pull request to the merge queue Jun 22, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 22, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 22, 2025
Merged via the queue into leanprover:master with commit 219f821 Jun 22, 2025
18 checks passed
kmill added a commit to kmill/lean4 that referenced this pull request Jun 22, 2025
This PR does a first pass at cleaning things up after a stage0 update for leanprover#8914.
github-merge-queue bot pushed a commit that referenced this pull request Jun 22, 2025
This PR does a first pass at cleaning things up for #8914 after a stage0
update.
kmill added a commit to kmill/lean4 that referenced this pull request Jun 22, 2025
…ormat

This PR is a followup to leanprover#8914, fixing an oversight where `letIdDeclBinders` is was not updated with the new format. This just means that we will need another stage0 update and cleanup. This PR does stage0 cleanup that is possible at this moment.
github-merge-queue bot pushed a commit that referenced this pull request Jun 22, 2025
…ormat (#8929)

This PR is a followup to #8914, fixing an oversight where
`letIdDeclBinders` is was not updated with the new format. This relies
on some bootstrapping code to stay in place, but we do bootstrap cleanup
that is currently possible.
kmill added a commit to kmill/lean4 that referenced this pull request Jun 22, 2025
This PR finishes post-stage0-cleanup after leanprover#8914 and leanprover#8929. Also:
- adds configuration options for `haveI` and `letI` terms.
- adds `letConfig` parser alias
github-merge-queue bot pushed a commit that referenced this pull request Jun 22, 2025
This PR finishes post-stage0-cleanup after #8914 and #8929. Also:
- adds configuration options for `haveI` and `letI` terms.
- adds `letConfig` parser alias
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
)

This PR modifies `let` and `have` term syntaxes to be consistent with
each other. Adds configuration options; for example, `have` is
equivalent to `let +nondep`, for *nondependent* lets. Other options
include `+usedOnly` (for `let_tmp`), `+zeta` (for `letI`/`haveI`), and
`+postponeValue` (for `let_delayed)`. There is also `let (eq := h) x :=
v; b` for introducing `h : x = v` when elaborating `b`. The `eq` option
works for pattern matching as well, for example `let (eq := h) (x, y) :=
p; b`.

Future PRs will add these options to tactic syntax, once a stage0 update
has been done.
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
This PR does a first pass at cleaning things up for leanprover#8914 after a stage0
update.
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
…ormat (leanprover#8929)

This PR is a followup to leanprover#8914, fixing an oversight where
`letIdDeclBinders` is was not updated with the new format. This relies
on some bootstrapping code to stay in place, but we do bootstrap cleanup
that is currently possible.
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
This PR finishes post-stage0-cleanup after leanprover#8914 and leanprover#8929. Also:
- adds configuration options for `haveI` and `letI` terms.
- adds `letConfig` parser alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features, tactics, and metaprograms 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.

2 participants
0