Induction Parse Error on zero cases : Misleading infoview and wrong error location #2876
Open
1 task done
Labels
bug
Something isn't working
Prerequisites
Description
The issue is twofold:
with
ininduction <Var> with
, the infoview says "No goals". The case distinctions that are visible if the "with" is not inserted disappear.unexpected end of input; expected '|'
) indicated by a red squiggly line appears well after adone
at the end of the file. Adding more empty lines to the file pushes the error further down.This is unhelpful because:
Context
Zulipchat discussion
Steps to Reproduce
Open the following examples in the web editor or your text editor and observe observe tactic state and error location as denoted by the comments:
Example 1:
Here the error message appears at the last line of the file.
Example 2:
The addition of
done
at the end has no effect.done
is not recognised as a point at which induction should stop parsing partially because it appears in the same column as the alternatives ofinduction
would.Example 3:
In this example we see that before adding
with
the goals for the induction alternatives are visible in the tactic state. There is rightly an error mark ondone
because there are unresolved goals. This should be the behaviour even afterwith
is added.Expected behavior: [Clear and concise description of what you expect to happen]
induction <var> with
the goals of the induction alternatives remain visible in the tactic state. This allows users to see what goals exist and what hypothesis they need to add names for.done
tactic.Actual behavior: Explained in ###Steps to Reproduce.
Versions
Lean (version 4.3.0-rc1, commit baa4b68a7192, Release)
Proposed Solution
@kmill proposes the following solutions:
colGt
to the syntax of each induction alternative. This ensures thatdone
and other tactic lines are not spuriously parsed as an arm ofinduction
. This is most probably the cause of induction's parser reading past thedone
in example 2.induction
. This allows a parse uptowith
to happen without error and report the tactic state.Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: