@@ -48,10 +48,10 @@ def ElimApp.evalNames (elimInfo : ElimInfo) (alts : Array (Name × MVarId)) (wit
48
48
let numFields ← getAltNumFields elimInfo altName
49
49
let (altVarNames, names') := names.splitAtD numFields `_
50
50
names := names'
51
- let (_, g) ← introN g numFields altVarNames
51
+ let (_, g) ← g.introN numFields altVarNames
52
52
let some (g, _) ← Cases.unifyEqs? numEqs g {} | pure ()
53
- let (_, g) ← introNP g numGeneralized
54
- let g ← liftM $ toClear.foldlM tryClear g
53
+ let (_, g) ← g.introNP numGeneralized
54
+ let g ← liftM $ toClear.foldlM MVarId. tryClear g
55
55
subgoals := subgoals.push g
56
56
pure subgoals
57
57
@@ -62,12 +62,12 @@ elab (name := induction') "induction' " tgts:(casesTarget,+)
62
62
genArg:((" generalizing " (colGt ident)+)?) : tactic => do
63
63
let targets ← elabCasesTargets tgts.1 .getSepArgs
64
64
let g ← getMainGoal
65
- withMVarContext g do
65
+ g.withContext do
66
66
let elimInfo ← getElimNameInfo usingArg targets (induction := true )
67
67
let targets ← addImplicitTargets elimInfo targets
68
68
evalInduction.checkTargets targets
69
69
let targetFVarIds := targets.map (·.fvarId!)
70
- withMVarContext g do
70
+ g.withContext do
71
71
let genArgs ← if genArg.1 .isNone then pure #[] else getFVarIds genArg.1 [1 ].getArgs
72
72
let forbidden ← mkGeneralizationForbiddenSet targets
73
73
let mut s ← getFVarSetToGeneralize targets forbidden
@@ -77,11 +77,11 @@ elab (name := induction') "induction' " tgts:(casesTarget,+)
77
77
if s.contains v then
78
78
throwError "unnecessary 'generalizing' argument, variable '{mkFVar v}' is generalized automatically"
79
79
s := s.insert v
80
- let (fvarIds, g) ← Meta .revert g (← sortFVarIds s.toArray)
81
- let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← getMVarTag g )
80
+ let (fvarIds, g) ← g .revert (← sortFVarIds s.toArray)
81
+ let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← g.getTag )
82
82
let elimArgs := result.elimApp.getAppArgs
83
83
ElimApp.setMotiveArg g elimArgs[elimInfo.motivePos]!.mvarId! targetFVarIds
84
- assignExprMVar g result.elimApp
84
+ g.assign result.elimApp
85
85
let subgoals ← ElimApp.evalNames elimInfo result.alts withArg
86
86
(numGeneralized := fvarIds.size) (toClear := targetFVarIds)
87
87
setGoals (subgoals ++ result.others).toList
@@ -91,18 +91,18 @@ elab (name := cases') "cases' " tgts:(casesTarget,+) usingArg:((" using " ident)
91
91
withArg:((" with " (colGt binderIdent)+)?) : tactic => do
92
92
let targets ← elabCasesTargets tgts.1 .getSepArgs
93
93
let g ← getMainGoal
94
- withMVarContext g do
94
+ g.withContext do
95
95
let elimInfo ← getElimNameInfo usingArg targets (induction := false )
96
96
let targets ← addImplicitTargets elimInfo targets
97
- let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← getMVarTag g )
97
+ let result ← withRef tgts <| ElimApp.mkElimApp elimInfo targets (← g.getTag )
98
98
let elimArgs := result.elimApp.getAppArgs
99
99
let targets ← elimInfo.targetsPos.mapM (instantiateMVars elimArgs[·]!)
100
100
let motive := elimArgs[elimInfo.motivePos]!
101
101
let g ← generalizeTargetsEq g (← inferType motive) targets
102
- let (targetsNew, g) ← introN g targets.size
103
- withMVarContext g do
102
+ let (targetsNew, g) ← g.introN targets.size
103
+ g.withContext do
104
104
ElimApp.setMotiveArg g motive.mvarId! targetsNew
105
- assignExprMVar g result.elimApp
105
+ g.assign result.elimApp
106
106
let subgoals ← ElimApp.evalNames elimInfo result.alts withArg
107
107
(numEqs := targets.size) (toClear := targetsNew)
108
108
setGoals subgoals.toList
0 commit comments