some h
if the discriminant is annotated withh:
Equations
- Lean.Meta.Match.instInhabitedDiscrInfo = { default := { hName? := default } }
- numParams : Nat
- numDiscrs : Nat
discrInfos[i] = { hName? := some h }
if the i-th discriminant was annotated withh :
.discrInfos : Array Lean.Meta.Match.DiscrInfo
A "matcher" auxiliary declaration has the following structure:
numParams
parameters- motive
numDiscrs
discriminators (aka major premises)altNumParams.size
alternatives (aka minor premises) where alternativei
hasaltNumParams[i]
parametersuElimPos?
issome pos
when the matcher can eliminate in different universe levels, andpos
is the position of the universe level parameter that specifies the elimination universe. It isnone
if the matcher only eliminates intoProp
.
Equations
- Lean.Meta.Match.MatcherInfo.numAlts info = Array.size info.altNumParams
Equations
- Lean.Meta.Match.MatcherInfo.arity info = info.numParams + 1 + info.numDiscrs + Lean.Meta.Match.MatcherInfo.numAlts info
Equations
- Lean.Meta.Match.MatcherInfo.getFirstDiscrPos info = info.numParams + 1
Equations
- Lean.Meta.Match.MatcherInfo.getFirstAltPos info = info.numParams + 1 + info.numDiscrs
Equations
- Lean.Meta.Match.MatcherInfo.getMotivePos info = info.numParams
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Meta.Match.MatcherInfo.getNumDiscrEqs info = Lean.Meta.Match.getNumEqsFromDiscrInfos info.discrInfos
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Meta.Match.Extension.State.addEntry
(s : Lean.Meta.Match.Extension.State)
(e : Lean.Meta.Match.Extension.Entry)
:
Equations
- Lean.Meta.Match.Extension.State.addEntry s e = { map := Lean.SMap.insert s.map e.name e.info }
Equations
- Lean.Meta.Match.Extension.State.switch s = { map := Lean.SMap.switch s.map }
def
Lean.Meta.Match.Extension.addMatcherInfo
(env : Lean.Environment)
(matcherName : Lean.Name)
(info : Lean.Meta.MatcherInfo)
:
Equations
- Lean.Meta.Match.Extension.addMatcherInfo env matcherName info = Lean.PersistentEnvExtension.addEntry Lean.Meta.Match.Extension.extension env { name := matcherName, info := info }
Equations
- Lean.Meta.Match.Extension.getMatcherInfo? env declName = Lean.SMap.find? (Lean.SimplePersistentEnvExtension.getState Lean.Meta.Match.Extension.extension env).map declName
Equations
- Lean.Meta.Match.addMatcherInfo matcherName info = Lean.modifyEnv fun env => Lean.Meta.Match.Extension.addMatcherInfo env matcherName info
Equations
- Lean.Meta.getMatcherInfoCore? env declName = Lean.Meta.Match.Extension.getMatcherInfo? env declName
def
Lean.Meta.getMatcherInfo?
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
(declName : Lean.Name)
:
Equations
- Lean.Meta.getMatcherInfo? declName = do let a ← Lean.getEnv pure (Lean.Meta.getMatcherInfoCore? a declName)
@[export lean_is_matcher]
Equations
- Lean.Meta.isMatcherCore env declName = Option.isSome (Lean.Meta.getMatcherInfoCore? env declName)
def
Lean.Meta.isMatcher
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
(declName : Lean.Name)
:
m Bool
Equations
- Lean.Meta.isMatcher declName = do let a ← Lean.getEnv pure (Lean.Meta.isMatcherCore a declName)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Meta.isMatcherAppCore env e = Option.isSome (Lean.Meta.isMatcherAppCore? env e)
def
Lean.Meta.isMatcherApp
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
(e : Lean.Expr)
:
m Bool
Equations
- Lean.Meta.isMatcherApp e = do let a ← Lean.getEnv pure (Lean.Meta.isMatcherAppCore a e)
def
Lean.Meta.matchMatcherApp?
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadEnv m]
(e : Lean.Expr)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.