File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed
src/Lean/Meta/Tactic/Grind Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -70,20 +70,9 @@ def getCasesTypes : CoreM CasesTypes :=
7070def isSplit (declName : Name) : CoreM Bool := do
7171 return (← getCasesTypes).isSplit declName
7272
73- private def getAlias? (value : Expr) : MetaM (Option Name) :=
74- lambdaTelescope value fun _ body => do
75- if let .const declName _ := body.getAppFn' then
76- return some declName
77- else
78- return none
79-
8073partial def isCasesAttrCandidate? (declName : Name) (eager : Bool) : CoreM (Option Name) := do
8174 match (← getConstInfo declName) with
8275 | .inductInfo info => if !info.isRec || !eager then return some declName else return none
83- | .defnInfo info =>
84- let some declName ← getAlias? info.value |>.run' {} {}
85- | return none
86- isCasesAttrCandidate? declName eager
8776 | _ => return none
8877
8978def isCasesAttrCandidate (declName : Name) (eager : Bool) : CoreM Bool := do
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ example (xs : Array Nat) (w : xs.reverse = xs) (j : Nat) (hj : 0 ≤ j) (hj' : j
1818 xs[j] = xs[xs.size - 1 - j] := by
1919 grind
2020
21+ attribute [grind ext] Array.ext -- TODO: should we mark it by default?
22+
2123theorem checkPalin1_correct' : checkPalin1 xs = true ↔ IsPalindrome xs := by
2224 unfold checkPalin1
2325 suffices ∀ i, checkPalin1.go xs i = true ↔ ∀ j, i ≤ j → (_ : j < xs.size / 2 ) → xs[j] = xs[xs.size - 1 - j] by
24- -- We need array extensionality. TODO: easy way to enable array extensionality, `extAll` enables all [ ext ] theorems
25- -- TODO: `IsPalindrome` (without `.eq_1`) produces bad error message.
26- grind +extAll [IsPalindrome.eq_1]
26+ grind [IsPalindrome]
2727 intro i
2828 fun_induction checkPalin1.go <;> grind
You can’t perform that action at this time.
0 commit comments