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: safer #eval, and #eval! #4810

Merged
merged 7 commits into from
Jul 23, 2024
Merged

feat: safer #eval, and #eval! #4810

merged 7 commits into from
Jul 23, 2024

Conversation

nomeata
Copy link
Contributor

@nomeata nomeata commented Jul 23, 2024

previously, #eval would happily evaluate expressions that contain
sorry, either explicitly or because of failing tactics. In conjunction
with operations like array access this can lead to the lean process
crashing, which isn't particularly great.

So how #eval will refuse to run code that (transitively) depends on
the sorry axiom (using the same code as #print axioms).

If the user really wants to run it, they can use #eval!.

Closes #1697

previously, `#eval` would happily evaluate expressions that contain
`sorry`, either explicitly or because of failing tactics. In conjunction
with operations like array access this can lead to the lean process
crashing, which isn't particularly great.

So how `#eval` will refuse to run code that (transitively) depends on
the `sorry` axiom (using the same code as `#print axioms`).

If the user really wants to run it, they can use `#eval!`.
@nomeata nomeata requested a review from Kha as a code owner July 23, 2024 08:44
@nomeata nomeata added the awaiting-review Waiting for someone to review the PR label Jul 23, 2024
@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 Jul 23, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 5d632a97b838b0e701006903c51edc94aa579007 --onto 22ae04f3e7ea716c4af5cfbab587370d10cc06fa. (2024-07-23 09:38:12)

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc July 23, 2024 10:15 Inactive
@nomeata nomeata added will-merge-soon …unless someone speaks up and removed awaiting-review Waiting for someone to review the PR labels Jul 23, 2024
@nomeata
Copy link
Contributor Author

nomeata commented Jul 23, 2024

Actually I’m feeling confident enough, I’ll just merge :-)

@nomeata nomeata added this pull request to the merge queue Jul 23, 2024
Merged via the queue into master with commit 7d60d8b Jul 23, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN will-merge-soon …unless someone speaks up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#eval evaluates term with failing tactics
2 participants