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

#eval evaluates term with failing tactics #1697

Open
gebner opened this issue Oct 7, 2022 · 4 comments
Open

#eval evaluates term with failing tactics #1697

gebner opened this issue Oct 7, 2022 · 4 comments
Labels
server Affects the Lean server code

Comments

@gebner
Copy link
Member

gebner commented Oct 7, 2022

#eval show Nat from False.rec (by decide)
  • In the server the file crashes.
  • On the command line it prints unreachable code (original report produced incomplete case)

We should probably not eval terms where the elaborator fails.

Zulip: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/crash.20when.20using.20.22by.20decide.22/near/301853648

@leodemoura
Copy link
Member

We should probably not eval terms where the elaborator fails.

+1

@david-christiansen
Copy link
Contributor

I ran into this today when working on the book. In particular, #eval crashed the LSP server when asked to look up an invalid index in a list. Another example that triggers this:

#eval [1,2,3][9]

@leodemoura
Copy link
Member

The following variant also crashes the LSP server

def foo :=
  [1,2,3][9]  -- Produces error here saying it failed to prove `... |- 9 < List.length [1, 2, 3]` as expected

-- `foo` is added to the environment with a `sorry` as a proof for ` ... |- 9 < ...`
-- `sorry` is erased during code generation 

#eval foo

@leodemoura leodemoura added the dev meeting It will be discussed at the (next) dev meeting label Oct 10, 2022
@Kha Kha removed the dev meeting It will be discussed at the (next) dev meeting label Dec 5, 2022
@mhuisi mhuisi added the server Affects the Lean server code label Sep 5, 2023
@Kha
Copy link
Member

Kha commented Jul 19, 2024

#4745 suggests that we may not want to run terms that transitively depend on sorry either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Affects the Lean server code
Projects
None yet
Development

No branches or pull requests

5 participants