some h
if the discriminant is annotated withh:
Instances For
Equations
- Lean.Meta.Match.instInhabitedDiscrInfo = { default := { hName? := default } }
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
- info.numAlts = info.altNumParams.size
Equations
- info.getDiscrRange = { start := info.getFirstDiscrPos, stop := info.getFirstDiscrPos + info.numDiscrs, step := 1, step_pos := Nat.zero_lt_one }
Equations
- info.getAltRange = { start := info.getFirstAltPos, stop := info.getFirstAltPos + info.numAlts, step := 1, step_pos := Nat.zero_lt_one }
Equations
- info.getMotivePos = info.numParams
Equations
- One or more equations did not get rendered due to their size.
Equations
- info.getNumDiscrEqs = Lean.Meta.Match.getNumEqsFromDiscrInfos info.discrInfos
- map : SMap Name MatcherInfo
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- s.switch = { map := s.map.switch }
def
Lean.Meta.Match.Extension.addMatcherInfo
(env : Environment)
(matcherName : Name)
(info : 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.Meta.Match.Extension.extension.getState env).map.find? declName
def
Lean.Meta.Match.addMatcherInfo
{m : Type → Type}
[Monad m]
[MonadEnv m]
(matcherName : Name)
(info : MatcherInfo)
:
m Unit
Equations
- Lean.Meta.Match.addMatcherInfo matcherName info = Lean.modifyEnv fun (env : Lean.Environment) => 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}
[Monad m]
[MonadEnv m]
(declName : Name)
:
m (Option MatcherInfo)
Equations
- Lean.Meta.getMatcherInfo? declName = do let __do_lift ← Lean.getEnv pure (Lean.Meta.getMatcherInfoCore? __do_lift declName)
@[export lean_is_matcher]
Equations
- Lean.Meta.isMatcherCore env declName = (Lean.Meta.getMatcherInfoCore? env declName).isSome
Equations
- Lean.Meta.isMatcher declName = do let __do_lift ← Lean.getEnv pure (Lean.Meta.isMatcherCore __do_lift declName)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Meta.isMatcherAppCore env e = (Lean.Meta.isMatcherAppCore? env e).isSome
Equations
- Lean.Meta.isMatcherApp e = do let __do_lift ← Lean.getEnv pure (Lean.Meta.isMatcherAppCore __do_lift e)