You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- TODO: when extending this to selection patterns, consider adding a selection pattern %x for pure hypotheses such that it is syntactically clear whether an argument of irevert refers to a pure or an Iris hypothesis
109
-
elab"irevert" hs:(colGt ident)+ : tactic => do
110
-
ProofModeM.runTactic fun mvar { bi, e, hyps, goal, .. } => do
111
-
let init : RevertState bi e goal := { e, hyps, goal, pf := q(id) }
112
-
let st ← hs.reverse.toList.foldlM (init := init) fun st hyp => do
113
-
iflet some _ := st.hyps.find? hyp.getId then
114
-
st.revertProofModeHyp hyp
115
-
else
116
-
st.revertLeanHyp hyp
92
+
elab"irevert" pats:(colGt selPat)+ : tactic => do
93
+
let pats ← liftMacroM <| SelPat.parse pats
94
+
95
+
ProofModeM.runTactic fun mvar { e, hyps, goal, .. } => do
96
+
let targets ← SelPat.resolve hyps pats
97
+
let init : RevertState e goal := { e, hyps, goal, pf := q(id) }
98
+
let st ← targets.reverse.foldlM (init := init) fun st target => do
99
+
match target with
100
+
| .inl uniq => st.revertProofModeHyp uniq
101
+
| .inr fvar => st.revertLeanHyp fvar
117
102
118
-
-- Clear Lean locals already reverted into the accumulated BI goal from the final generated subgoal.
119
-
let finalGoalId ← (← mkBIGoal st.hyps st.goal).mvarId!.tryClearMany st.reverted.reverse
120
-
addMVarGoal finalGoalId
121
-
mvar.assign (mkApp st.pf (Expr.mvar finalGoalId))
103
+
let pf' ← addBIGoalWithoutFVars st.hyps st.goal st.reverted.reverse
0 commit comments