Built with doc-gen4, running Lean4. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓to navigate, Ctrl+🖱️to focus. On Mac, use Cmdinstead of Ctrl.
/-
Copyright (c) 2022 Jannis Limperg. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jannis Limperg
-/

import Std.Lean.Meta.Basic

open Lean Lean.Meta

/--
Try to clear the given fvars from the local context. Returns the new goal and
the hypotheses that were cleared. Unlike `Lean.MVarId.tryClearMany`, this
function does not require the `hyps` to be given in the order in which they
appear in the local context.
-/
def 
Lean.MVarId.tryClearMany': MVarIdArray FVarIdMetaM (MVarId × Array FVarId)
Lean.MVarId.tryClearMany'
(
goal: MVarId
goal
:
MVarId: Type
MVarId
) (hyps :
Array: Type ?u.4 → Type ?u.4
Array
FVarId: Type
FVarId
) :
MetaM: TypeType
MetaM
(
MVarId: Type
MVarId
×
Array: Type ?u.9 → Type ?u.9
Array
FVarId: Type
FVarId
) :=
goal: MVarId
goal
.
withContext: {n : TypeType ?u.15} → [inst : MonadControlT MetaM n] → [inst : Monad n] → {α : Type} → MVarIdn αn α
withContext
do let
hyps: ?m.153
hyps
sortFVarsByContextOrder: {m : TypeType} → [inst : Monad m] → [inst : MonadLCtx m] → Array FVarIdm (Array FVarId)
sortFVarsByContextOrder
hyps
hyps: ?m.153
hyps
.
foldrM: {α : Type ?u.157} → {β : Type ?u.156} → {m : Type ?u.156 → Type ?u.155} → [inst : Monad m] → (αβm β) → β(as : Array α) → optParam Nat (Array.size as)optParam Nat 0m β
foldrM
(init := (
goal: MVarId
goal
,
Array.mkEmpty: {α : Type ?u.547} → NatArray α
Array.mkEmpty
hyps: ?m.153
hyps
.
size: {α : Type ?u.550} → Array αNat
size
)) λ
h: ?m.198
h
(
goal: MVarId
goal
,
cleared: Array FVarId
cleared
) => do let
goal': ?m.288
goal'
goal: MVarId
goal
.
tryClear: MVarIdFVarIdMetaM MVarId
tryClear
h: ?m.198
h
let
cleared: ?m.291
cleared
:= if
goal: MVarId
goal
==
goal': ?m.288
goal'
then
cleared: Array FVarId
cleared
else
cleared: Array FVarId
cleared
.
push: {α : Type ?u.388} → Array ααArray α
push
h: ?m.198
h
return (
goal': ?m.288
goal'
,
cleared: ?m.291
cleared
)