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

Error message when -> fails has the top of the stack as a hypothesis in the context #15

Open
dranov opened this issue Mar 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dranov
Copy link
Contributor

dranov commented Mar 6, 2024

/-- error:
tactic 'rewrite' failed, did not find instance of the pattern in the target expression
  x
x y z : Nat
H : x = y
⊢ z = z
---
error: unsolved goals
x y z : Nat
⊢ x = y → z = z
-/
theorem rrw_intro_fail : ∀ (x y z : Nat), x = y → z = z := by
  move=>x y z ->

I would expect the H to not be there in the error message (it isn't there after the tactic fails), but this is not very important.

@dranov
Copy link
Contributor Author

dranov commented Mar 6, 2024

There are two problems with this error message:

  1. It leaks the implementation details of ->, mentioning the tactic rewrite which the user didn't write themselves;
  2. It shows a goal that does not match the user's goal at the error point, but rather a goal that only shows up as an intermediate step in the implementation

To avoid this, we would need to write our own error message rather than rely on the one generated by the tactics used to implement ->.

@dranov dranov added the enhancement New feature or request label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant