-
Notifications
You must be signed in to change notification settings - Fork 435
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
Confusing goal with unfinished have
#779
Comments
@Vtec234 Note that the example above is currently parsed as example : ∃n, n < 1 := by
have h : 0 < 1 := exact ⟨0, h⟩ The (Term.app `exact [(Term.anonymousCtor "⟨" [(numLit "0") "," `h] "⟩")]) The info view shows the correct "Expected type" ( |
@Kha Any ideas? |
Good question. If we can make it show the expected type here, do we want to hide the goal by default if we're inside of a term? We definitely don't want to always do that, e.g. when typing a |
I am inclined to mark this issue as "wontfix", and close it. @Vtec234 I acknowledge the current behavior is confusing, but I don't see a good solution. Any suggestions on how to improve it? |
It is something that confused one of the students at the course we were teaching, and it briefly confused me as well. But I agree that changing this might be more trouble than it's worth, so closing is okay with me. The only thing I could think of would be to require have h :=
term is considered acceptable or not. EDIT: Oh well, with |
I'm not sure why you expect the goal state to change here. After Would it be less confusing if we had a |
Yes, this is what I expected. |
I agree. I did not have time to investigate this issue yet. Do you know why we are not getting the correct expected type here?
I like this idea. |
I'm pretty sure that's because we look for the smallest term node around the cursor, but there's no term node around the space after import Lean
open Lean Elab Command
elab "#dump" t:term : command => do
logInfo (repr t)
#dump by have h :=
exact
-- ^^ newline is part of := |
I agree. @Kha @gebner Any ideas on how to fix this? The first hack that comes to mind is to move the trailing spaces for the |
I don't think that would work if what follows the |
* `@[to_additive]` will now correctly guess names with `CoeTC`, `CoeT` and `CoeHTCT` in it * rewrite function `targetName`. - It will now warn the user if it gives a composite name that can be auto-generated (before `to_additive` would never warn if a composite name was given). - the logic when `allowAutoName = true` now corresponds to the docstring - Fix a bug where declarations were silently allowed to translate to itself (maybe because the `return` statements returned a value for the whole function?) - Add some more tracing - The behavior of namespaces when giving a composite name has been changed. It will always generate a name with the same number of components. Example: ```lean namespace MeasureTheory.MulMeasure @[to_additive AddMeasure.myOperation] def myOperation := ... -- before: generates `AddMeasure.myOperation` (and never gives a warning) -- after: generates `MeasureTheory.AddMeasure.myOperation` (and probably warns that the name can be auto-generated) end MeasureTheory.MulMeasure ``` * This should fix all problems in leanprover#659 other than leanprover#660 Minor changes: * When applying `@[to_additive]` to a structure, add a trace message if no translation is inserted for a field. * Define `Name.fromComponents` and `Name.splitAt` * Reduce transitive imports of `Tactic/toAdditive` * Move some auxiliary declarations from `Tactic/Simps` to more appropriate places - swap arguments of `String.isPrefixOf?` - improve `Name.getString` Co-authored-by: Scott Morrison <[email protected]>
Description
In the following unfinished proof:
the goal state shows up as
with
0 < 1
as the assumption. To see the "real" goal⊢ 0 < 1
we have to writeby
. This is confusing for beginners, since really at that cursor there is no goal state at all -- one should produce a term. So I suggest we show anexpected type
there rather than a goal state.Versions
8df2b07
The text was updated successfully, but these errors were encountered: