Skip to content
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

feat: support let rec in #eval #5663

Merged
merged 2 commits into from
Oct 11, 2024
Merged

feat: support let rec in #eval #5663

merged 2 commits into from
Oct 11, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Oct 9, 2024

Makes #eval use the elabMutualDef machinery to process all the let recs that might appear in the expression. This now works:

#eval
  let rec fact (n : Nat) : Nat :=
    match n with
    | 0 => 1
    | n' + 1 => n * fact n'
  fact 5

Closes #2374

@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 Oct 9, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Oct 9, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 9, 2024
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Oct 9, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Oct 9, 2024

Mathlib CI status (docs):

  • ✅ Mathlib branch lean-pr-testing-5663 has successfully built against this PR. (2024-10-09 22:06:10) View Log
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 8e88e8061a8b497d74f95e2232314c73b335b8a9 --onto d10d41bc07942ca6d8f3081a637045321db15c5a. (2024-10-11 06:49:57)
  • ✅ Mathlib branch lean-pr-testing-5663 has successfully built against this PR. (2024-10-11 07:05:41) View Log

@kmill kmill enabled auto-merge October 11, 2024 05:50
@kmill kmill added this pull request to the merge queue Oct 11, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Oct 11, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 11, 2024
@kmill kmill removed this pull request from the merge queue due to a manual request Oct 11, 2024
kmill added 2 commits October 10, 2024 23:31
Makes `#eval` use the `elabMutualDef` machinery to process all the `let rec`s that might appear in the expression. This now works:
```lean
  let rec fact (n : Nat) : Nat :=
    match n with
    | 0 => 1
    | n' + 1 => n * fact n'
  fact 5
```

Closes leanprover#2374
@kmill kmill enabled auto-merge October 11, 2024 06:35
@kmill kmill added this pull request to the merge queue Oct 11, 2024
Merged via the queue into leanprover:master with commit 742ca6a Oct 11, 2024
13 checks passed
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 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.

#eval on let rec causes error in kernel
2 participants