chore: update stage0
This commit is contained in:
parent
e6f02b7b1a
commit
ae5eb9f793
47 changed files with 32634 additions and 24462 deletions
1
stage0/src/CMakeLists.txt
generated
1
stage0/src/CMakeLists.txt
generated
|
|
@ -305,6 +305,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftls-model=initial-exec")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../lib/lean")
|
||||
set(LEANSHARED_LINKER_FLAGS "${LEANSHARED_LINKER_FLAGS} -install_name @rpath/libleanshared.dylib")
|
||||
endif()
|
||||
|
||||
# export all symbols for the interpreter
|
||||
|
|
|
|||
2
stage0/src/Init/Classical.lean
generated
2
stage0/src/Init/Classical.lean
generated
|
|
@ -39,7 +39,7 @@ theorem em (p : Prop) : p ∨ ¬p :=
|
|||
| Or.inr h, _ => Or.inr h
|
||||
| _, Or.inr h => Or.inr h
|
||||
| Or.inl hut, Or.inl hvf =>
|
||||
have hne : u ≠ v := by simp (config := { zeta := false }) [hvf, hut, true_ne_false]
|
||||
have hne : u ≠ v := by simp [hvf, hut, true_ne_false]
|
||||
Or.inl hne
|
||||
have p_implies_uv : p → u = v :=
|
||||
fun hp =>
|
||||
|
|
|
|||
18
stage0/src/Init/SimpLemmas.lean
generated
18
stage0/src/Init/SimpLemmas.lean
generated
|
|
@ -47,6 +47,24 @@ theorem forall_congr {α : Sort u} {p q : α → Prop} (h : ∀ a, (p a = q a))
|
|||
have : p = q := funext h
|
||||
this ▸ rfl
|
||||
|
||||
theorem let_congr {α : Sort u} {β : Sort v} {a a' : α} {b b' : α → β} (h₁ : a = a') (h₂ : ∀ x, b x = b' x) :
|
||||
(let x := a; b x) = (let x := a'; b' x) := by
|
||||
subst h₁
|
||||
have : b = b' := funext h₂
|
||||
subst this
|
||||
rfl
|
||||
|
||||
theorem let_val_congr {α : Sort u} {β : Sort v} {a a' : α} (b : α → β) (h : a = a') :
|
||||
(let x := a; b x) = (let x := a'; b x) := by
|
||||
subst h
|
||||
rfl
|
||||
|
||||
theorem let_body_congr {α : Sort u} {β : α → Sort v} {b b' : (a : α) → β a} (a : α) (h : ∀ x, b x = b' x) :
|
||||
(let x := a; b x) = (let x := a; b' x) := by
|
||||
have : b = b' := funext h
|
||||
subst this
|
||||
rfl
|
||||
|
||||
@[congr]
|
||||
theorem ite_congr {x y u v : α} {s : Decidable b} [Decidable c] (h₁ : b = c) (h₂ : c → x = u) (h₃ : ¬ c → y = v) : ite b x y = ite c u v := by
|
||||
cases Decidable.em c with
|
||||
|
|
|
|||
2
stage0/src/Lean/Elab/Binders.lean
generated
2
stage0/src/Lean/Elab/Binders.lean
generated
|
|
@ -565,7 +565,7 @@ def elabLetDeclAux (id : Syntax) (binders : Array Syntax) (typeStx : Syntax) (va
|
|||
let body ← elabTermEnsuringType body expectedType?
|
||||
let body ← instantiateMVars body
|
||||
mkLambdaFVars #[x] body (usedLetOnly := false)
|
||||
pure <| mkApp f val
|
||||
pure <| mkLetFunAnnotation (mkApp f val)
|
||||
if elabBodyFirst then
|
||||
forallBoundedTelescope type arity fun xs type => do
|
||||
let valResult ← elabTermEnsuringType valStx type
|
||||
|
|
|
|||
10
stage0/src/Lean/Elab/Command.lean
generated
10
stage0/src/Lean/Elab/Command.lean
generated
|
|
@ -405,6 +405,16 @@ def modifyScope (f : Scope → Scope) : CommandElabM Unit :=
|
|||
| [] => unreachable!
|
||||
}
|
||||
|
||||
def withScope (f : Scope → Scope) (x : CommandElabM α) : CommandElabM α := do
|
||||
match (← get).scopes with
|
||||
| [] => x
|
||||
| h :: t =>
|
||||
try
|
||||
modify fun s => { s with scopes := f h :: t }
|
||||
x
|
||||
finally
|
||||
modify fun s => { s with scopes := h :: t }
|
||||
|
||||
def getLevelNames : CommandElabM (List Name) :=
|
||||
return (← getScope).levelNames
|
||||
|
||||
|
|
|
|||
597
stage0/src/Lean/Elab/PreDefinition/Structural.lean
generated
597
stage0/src/Lean/Elab/PreDefinition/Structural.lean
generated
|
|
@ -3,599 +3,4 @@ Copyright (c) 2020 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Util.ForEachExpr
|
||||
import Lean.Meta.ForEachExpr
|
||||
import Lean.Meta.RecursorInfo
|
||||
import Lean.Meta.Match.Match
|
||||
import Lean.Meta.Transform
|
||||
import Lean.Meta.IndPredBelow
|
||||
import Lean.Elab.PreDefinition.Basic
|
||||
namespace Lean.Elab
|
||||
namespace Structural
|
||||
open Meta
|
||||
|
||||
private def getFixedPrefix (declName : Name) (xs : Array Expr) (value : Expr) : MetaM Nat := do
|
||||
let numFixedRef ← IO.mkRef xs.size
|
||||
forEachExpr' value fun e => do
|
||||
if e.isAppOf declName then
|
||||
let args := e.getAppArgs
|
||||
numFixedRef.modify fun numFixed => if args.size < numFixed then args.size else numFixed
|
||||
for arg in args, x in xs do
|
||||
/- We should not use structural equality here. For example, given the definition
|
||||
```
|
||||
def V.map {α β} f x x_1 :=
|
||||
@V.map.match_1.{1} α (fun x x_2 => V β x) x x_1
|
||||
(fun x x_2 => @V.mk₁ β x (f Bool.true x_2))
|
||||
(fun e => @V.mk₂ β (V.map (fun b => α b) (fun b => β b) f Bool.false e))
|
||||
```
|
||||
The first three arguments at `V.map (fun b => α b) (fun b => β b) f Bool.false e` are "fixed"
|
||||
modulo definitional equality.
|
||||
|
||||
We disable to proof irrelevance to be able to use structural recursion on inductive predicates.
|
||||
For example, consider the example
|
||||
```
|
||||
inductive PList (α : Type) : Prop
|
||||
| nil
|
||||
| cons : α → PList α → PList α
|
||||
|
||||
infixr:67 " ::: " => PList.cons
|
||||
|
||||
set_option trace.Elab.definition.structural true in
|
||||
def pmap {α β} (f : α → β) : PList α → PList β
|
||||
| PList.nil => PList.nil
|
||||
| a:::as => f a ::: pmap f as
|
||||
```
|
||||
The "Fixed" prefix would be 4 since all elements of type `PList α` are definitionally equal.
|
||||
-/
|
||||
if !(← withoutProofIrrelevance <| withReducible <| isDefEq arg x) then
|
||||
-- We continue searching if e's arguments are not a prefix of `xs`
|
||||
return true
|
||||
return false
|
||||
else
|
||||
return true
|
||||
numFixedRef.get
|
||||
|
||||
structure RecArgInfo where
|
||||
/- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
|
||||
fixedParams : Array Expr
|
||||
ys : Array Expr -- recursion arguments
|
||||
pos : Nat -- position in `ys` of the argument we are recursing on
|
||||
indicesPos : Array Nat -- position in `ys` of the inductive datatype indices we are recursing on
|
||||
indName : Name -- inductive datatype name of the argument we are recursing on
|
||||
indLevels : List Level -- inductice datatype universe levels of the argument we are recursing on
|
||||
indParams : Array Expr -- inductive datatype parameters of the argument we are recursing on
|
||||
indIndices : Array Expr -- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i`
|
||||
reflexive : Bool -- true if we are recursing over a reflexive inductive datatype
|
||||
indPred : Bool -- true if the type is an inductive predicate
|
||||
|
||||
private def getIndexMinPos (xs : Array Expr) (indices : Array Expr) : Nat := do
|
||||
let mut minPos := xs.size
|
||||
for index in indices do
|
||||
match xs.indexOf? index with
|
||||
| some pos => if pos.val < minPos then minPos := pos.val
|
||||
| _ => pure ()
|
||||
return minPos
|
||||
|
||||
-- Indices can only depend on other indices
|
||||
private def hasBadIndexDep? (ys : Array Expr) (indices : Array Expr) : MetaM (Option (Expr × Expr)) := do
|
||||
for index in indices do
|
||||
let indexType ← inferType index
|
||||
for y in ys do
|
||||
if !indices.contains y && (← dependsOn indexType y.fvarId!) then
|
||||
return some (index, y)
|
||||
return none
|
||||
|
||||
-- Inductive datatype parameters cannot depend on ys
|
||||
private def hasBadParamDep? (ys : Array Expr) (indParams : Array Expr) : MetaM (Option (Expr × Expr)) := do
|
||||
for p in indParams do
|
||||
let pType ← inferType p
|
||||
for y in ys do
|
||||
if ← dependsOn pType y.fvarId! then
|
||||
return some (p, y)
|
||||
return none
|
||||
|
||||
private def throwStructuralFailed {α} : MetaM α :=
|
||||
throwError "structural recursion cannot be used"
|
||||
|
||||
structure State where
|
||||
/- When compiling structural recursion we use the `brecOn` recursor automatically built by
|
||||
the `inductive` command. For an inductive datatype `C`, it has the form
|
||||
`C.brecOn As motive is c F`
|
||||
where `As` are the inductive datatype parameters, `is` are the inductive datatype indices,
|
||||
`c : C As is`, and `F : (js) → (d : C As js) → C.below d → motive d`
|
||||
The `C.below d` is used to eliminate recursive applications. We refine its type when we process
|
||||
a nested dependent pattern matcher using `MatcherApp.addArg`. See `replaceRecApps` for additional details.
|
||||
We store the names of the matcher where we used `MatcherApp.addArg` at `matcherBelowDep`.
|
||||
We use this information to generate the auxiliary `_sunfold` definition needed by the smart unfolding
|
||||
technique used at WHNF. -/
|
||||
matcherBelowDep : NameSet := {}
|
||||
/- As part of the inductive predicates case, we keep adding more and more discriminants from the
|
||||
local context and build up a bigger matcher application until we reach a fixed point.
|
||||
As a side-effect, this creates matchers. Here we capture all these side-effects, because
|
||||
the construction rolls back any changes done to the environment and the side-effects
|
||||
need to be replayed. -/
|
||||
addMatchers : Array $ MetaM Unit := #[]
|
||||
|
||||
abbrev M := StateRefT State MetaM
|
||||
|
||||
instance {α} : Inhabited (M α) where
|
||||
default := throwError "failed"
|
||||
|
||||
private def run {α} (x : M α) (s : State := {}) : MetaM (α × State) :=
|
||||
StateRefT'.run x s
|
||||
|
||||
private def orelse' {α} (x y : M α) : M α := do
|
||||
let saveState ← get
|
||||
orelseMergeErrors x (do set saveState; y)
|
||||
|
||||
private partial def findRecArg {α} (numFixed : Nat) (xs : Array Expr) (k : RecArgInfo → M α) : M α :=
|
||||
let rec loop (i : Nat) : M α := do
|
||||
if h : i < xs.size then
|
||||
let x := xs.get ⟨i, h⟩
|
||||
let localDecl ← getFVarLocalDecl x
|
||||
if localDecl.isLet then
|
||||
throwStructuralFailed
|
||||
else
|
||||
let xType ← whnfD localDecl.type
|
||||
matchConstInduct xType.getAppFn (fun _ => loop (i+1)) fun indInfo us => do
|
||||
if !(← hasConst (mkBRecOnName indInfo.name)) then
|
||||
loop (i+1)
|
||||
else if indInfo.isReflexive && !(← hasConst (mkBInductionOnName indInfo.name)) then
|
||||
loop (i+1)
|
||||
else
|
||||
let indArgs := xType.getAppArgs
|
||||
let indParams := indArgs.extract 0 indInfo.numParams
|
||||
let indIndices := indArgs.extract indInfo.numParams indArgs.size
|
||||
if !indIndices.all Expr.isFVar then
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive family and indices are not variables{indentExpr xType}")
|
||||
(loop (i+1))
|
||||
else if !indIndices.allDiff then
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive family and indices are not pairwise distinct{indentExpr xType}")
|
||||
(loop (i+1))
|
||||
else
|
||||
let indexMinPos := getIndexMinPos xs indIndices
|
||||
let numFixed := if indexMinPos < numFixed then indexMinPos else numFixed
|
||||
let fixedParams := xs.extract 0 numFixed
|
||||
let ys := xs.extract numFixed xs.size
|
||||
match (← hasBadIndexDep? ys indIndices) with
|
||||
| some (index, y) =>
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive family{indentExpr xType}\nand index{indentExpr index}\ndepends on the non index{indentExpr y}")
|
||||
(loop (i+1))
|
||||
| none =>
|
||||
match (← hasBadParamDep? ys indParams) with
|
||||
| some (indParam, y) =>
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive datatype{indentExpr xType}\nand parameter{indentExpr indParam}\ndepends on{indentExpr y}")
|
||||
(loop (i+1))
|
||||
| none =>
|
||||
let indicesPos := indIndices.map fun index => match ys.indexOf? index with | some i => i.val | none => unreachable!
|
||||
orelse'
|
||||
(mapError
|
||||
(k { fixedParams := fixedParams
|
||||
ys := ys
|
||||
pos := i - fixedParams.size
|
||||
indicesPos := indicesPos
|
||||
indName := indInfo.name
|
||||
indLevels := us
|
||||
indParams := indParams
|
||||
indIndices := indIndices
|
||||
reflexive := indInfo.isReflexive
|
||||
indPred := ←isInductivePredicate indInfo.name })
|
||||
(fun msg => m!"argument #{i+1} was not used for structural recursion{indentD msg}"))
|
||||
(loop (i+1))
|
||||
else
|
||||
throwStructuralFailed
|
||||
loop numFixed
|
||||
|
||||
private def containsRecFn (recFnName : Name) (e : Expr) : Bool :=
|
||||
(e.find? fun e => e.isConstOf recFnName).isSome
|
||||
|
||||
private def ensureNoRecFn (recFnName : Name) (e : Expr) : MetaM Expr := do
|
||||
if containsRecFn recFnName e then
|
||||
Meta.forEachExpr e fun e => do
|
||||
if e.isAppOf recFnName then
|
||||
throwError "unexpected occurrence of recursive application{indentExpr e}"
|
||||
pure e
|
||||
else
|
||||
pure e
|
||||
|
||||
private def throwToBelowFailed {α} : MetaM α :=
|
||||
throwError "toBelow failed"
|
||||
|
||||
/- See toBelow -/
|
||||
private partial def toBelowAux (C : Expr) : Expr → Expr → Expr → MetaM Expr
|
||||
| belowDict, arg, F => do
|
||||
let belowDict ← whnf belowDict
|
||||
trace[Elab.definition.structural] "belowDict: {belowDict}, arg: {arg}"
|
||||
match belowDict with
|
||||
| Expr.app (Expr.app (Expr.const `PProd _ _) d1 _) d2 _ =>
|
||||
(do toBelowAux C d1 arg (← mkAppM `PProd.fst #[F]))
|
||||
<|>
|
||||
(do toBelowAux C d2 arg (← mkAppM `PProd.snd #[F]))
|
||||
| Expr.app (Expr.app (Expr.const `And _ _) d1 _) d2 _ =>
|
||||
(do toBelowAux C d1 arg (← mkAppM `And.left #[F]))
|
||||
<|>
|
||||
(do toBelowAux C d2 arg (← mkAppM `And.right #[F]))
|
||||
| _ => forallTelescopeReducing belowDict fun xs belowDict => do
|
||||
let argArgs := arg.getAppArgs
|
||||
unless argArgs.size >= xs.size do throwToBelowFailed
|
||||
let n := argArgs.size
|
||||
let argTailArgs := argArgs.extract (n - xs.size) n
|
||||
let belowDict := belowDict.replaceFVars xs argTailArgs
|
||||
match belowDict with
|
||||
| Expr.app belowDictFun belowDictArg _ =>
|
||||
unless belowDictFun.getAppFn == C do throwToBelowFailed
|
||||
unless ← isDefEq belowDictArg arg do throwToBelowFailed
|
||||
pure (mkAppN F argTailArgs)
|
||||
| _ => throwToBelowFailed
|
||||
|
||||
/- See toBelow -/
|
||||
private def withBelowDict {α} (below : Expr) (numIndParams : Nat) (k : Expr → Expr → MetaM α) : MetaM α := do
|
||||
let belowType ← inferType below
|
||||
trace[Elab.definition.structural] "belowType: {belowType}"
|
||||
belowType.withApp fun f args => do
|
||||
let motivePos := numIndParams + 1
|
||||
unless motivePos < args.size do throwError "unexpected 'below' type{indentExpr belowType}"
|
||||
let pre := mkAppN f (args.extract 0 numIndParams)
|
||||
let preType ← inferType pre
|
||||
forallBoundedTelescope preType (some 1) fun x _ => do
|
||||
let motiveType ← inferType x[0]
|
||||
let C ← mkFreshUserName `C
|
||||
withLocalDeclD C motiveType fun C =>
|
||||
let belowDict := mkApp pre C
|
||||
let belowDict := mkAppN belowDict (args.extract (numIndParams + 1) args.size)
|
||||
k C belowDict
|
||||
|
||||
/-
|
||||
`below` is a free variable with type of the form `I.below indParams motive indices major`,
|
||||
where `I` is the name of an inductive datatype.
|
||||
|
||||
For example, when trying to show that the following function terminates using structural recursion
|
||||
```lean
|
||||
def addAdjacent : List Nat → List Nat
|
||||
| [] => []
|
||||
| [a] => [a]
|
||||
| a::b::as => (a+b) :: addAdjacent as
|
||||
```
|
||||
when we are visiting `addAdjacent as` at `replaceRecApps`, `below` has type
|
||||
`@List.below Nat (fun (x : List Nat) => List Nat) (a::b::as)`
|
||||
The motive `fun (x : List Nat) => List Nat` depends on the actual function we are trying to compute.
|
||||
So, we first replace it with a fresh variable `C` at `withBelowDict`.
|
||||
Recall that `brecOn` implements course-of-values recursion, and `below` can be viewed as a dictionary
|
||||
of the "previous values".
|
||||
We search this dictionary using the auxiliary function `toBelowAux`.
|
||||
The dictionary is built using the `PProd` (`And` for inductive predicates).
|
||||
We keep searching it until we find `C recArg`, where `C` is the auxiliary fresh variable created at `withBelowDict`. -/
|
||||
private partial def toBelow (below : Expr) (numIndParams : Nat) (recArg : Expr) : MetaM Expr := do
|
||||
withBelowDict below numIndParams fun C belowDict =>
|
||||
toBelowAux C belowDict recArg below
|
||||
|
||||
/--
|
||||
Return true iff `e` contains an application `recFnName .. t ..` where the term `t` is
|
||||
the argument we are trying to recurse on, and it contains loose bound variables.
|
||||
|
||||
We use this test to decide whether we should process a matcher-application as a regular
|
||||
applicaton or not. That is, whether we should push the `below` argument should be affected by the matcher or not.
|
||||
If `e` does not contain an application of the form `recFnName .. t ..`, then we know
|
||||
the recursion doesn't depend on any pattern variable in this matcher.
|
||||
-/
|
||||
private def recArgHasLooseBVarsAt (recFnName : Name) (recArgInfo : RecArgInfo) (e : Expr) : Bool :=
|
||||
let recArgPos := recArgInfo.fixedParams.size + recArgInfo.pos
|
||||
let app? := e.find? fun e =>
|
||||
e.isAppOf recFnName && e.getAppNumArgs > recArgPos && (e.getArg! recArgPos).hasLooseBVars
|
||||
app?.isSome
|
||||
|
||||
private partial def replaceRecApps (recFnName : Name) (recArgInfo : RecArgInfo) (below : Expr) (e : Expr) : M Expr :=
|
||||
let rec loop (below : Expr) (e : Expr) : M Expr := do
|
||||
match e with
|
||||
| Expr.lam n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop below d) fun x => do
|
||||
mkLambdaFVars #[x] (← loop below (b.instantiate1 x))
|
||||
| Expr.forallE n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop below d) fun x => do
|
||||
mkForallFVars #[x] (← loop below (b.instantiate1 x))
|
||||
| Expr.letE n type val body _ =>
|
||||
withLetDecl n (← loop below type) (← loop below val) fun x => do
|
||||
mkLetFVars #[x] (← loop below (body.instantiate1 x))
|
||||
| Expr.mdata d e _ => return mkMData d (← loop below e)
|
||||
| Expr.proj n i e _ => return mkProj n i (← loop below e)
|
||||
| Expr.app _ _ _ =>
|
||||
let processApp (e : Expr) : M Expr :=
|
||||
e.withApp fun f args => do
|
||||
if f.isConstOf recFnName then
|
||||
let numFixed := recArgInfo.fixedParams.size
|
||||
let recArgPos := recArgInfo.fixedParams.size + recArgInfo.pos
|
||||
if recArgPos >= args.size then
|
||||
throwError "insufficient number of parameters at recursive application {indentExpr e}"
|
||||
let recArg := args[recArgPos]
|
||||
-- For reflexive type, we may have nested recursive applications in recArg
|
||||
let recArg ← loop below recArg
|
||||
let f ← try toBelow below recArgInfo.indParams.size recArg catch _ => throwError "failed to eliminate recursive application{indentExpr e}"
|
||||
-- Recall that the fixed parameters are not in the scope of the `brecOn`. So, we skip them.
|
||||
let argsNonFixed := args.extract numFixed args.size
|
||||
-- The function `f` does not explicitly take `recArg` and its indices as arguments. So, we skip them too.
|
||||
let mut fArgs := #[]
|
||||
for i in [:argsNonFixed.size] do
|
||||
if recArgInfo.pos != i && !recArgInfo.indicesPos.contains i then
|
||||
let arg := argsNonFixed[i]
|
||||
let arg ← replaceRecApps recFnName recArgInfo below arg
|
||||
fArgs := fArgs.push arg
|
||||
return mkAppN f fArgs
|
||||
else
|
||||
return mkAppN (← loop below f) (← args.mapM (loop below))
|
||||
let matcherApp? ← matchMatcherApp? e
|
||||
match matcherApp? with
|
||||
| some matcherApp =>
|
||||
if !recArgHasLooseBVarsAt recFnName recArgInfo e then
|
||||
processApp e
|
||||
else
|
||||
/- Here is an example we currently not handle
|
||||
```
|
||||
def g (xs : List Nat) : Nat :=
|
||||
match xs with
|
||||
| [] => 0
|
||||
| y::ys =>
|
||||
match ys with
|
||||
| [] => 1
|
||||
| _::_::zs => g zs + 1
|
||||
| zs => g ys + 2
|
||||
```
|
||||
We are matching on `ys`, but still using `ys` in the third alternative.
|
||||
If we push the `below` argument over the dependent match it will be able to eliminate recursive call using `zs`.
|
||||
To make it work, users have to write the third alternative as `| zs => g zs + 2`
|
||||
If this is too annoying in practice, we may replace `ys` with the matching term, but
|
||||
this may generate weird error messages, when it doesn't work. -/
|
||||
trace[Elab.definition.structural] "below before matcherApp.addArg: {below} : {← inferType below}"
|
||||
let matcherApp ← mapError (matcherApp.addArg below) (fun msg => "failed to add `below` argument to 'matcher' application" ++ indentD msg)
|
||||
modify fun s => { s with matcherBelowDep := s.matcherBelowDep.insert matcherApp.matcherName }
|
||||
let altsNew ← (Array.zip matcherApp.alts matcherApp.altNumParams).mapM fun (alt, numParams) =>
|
||||
lambdaTelescope alt fun xs altBody => do
|
||||
trace[Elab.definition.structural] "altNumParams: {numParams}, xs: {xs}"
|
||||
unless xs.size >= numParams do
|
||||
throwError "unexpected matcher application alternative{indentExpr alt}\nat application{indentExpr e}"
|
||||
let belowForAlt := xs[numParams - 1]
|
||||
mkLambdaFVars xs (← loop belowForAlt altBody)
|
||||
pure { matcherApp with alts := altsNew }.toExpr
|
||||
| none => processApp e
|
||||
| e => ensureNoRecFn recFnName e
|
||||
loop below e
|
||||
|
||||
private partial def replaceIndPredRecApps (recFnName : Name) (recArgInfo : RecArgInfo) (motive : Expr) (e : Expr) : M Expr := do
|
||||
let maxDepth := IndPredBelow.maxBackwardChainingDepth.get $ ←getOptions
|
||||
let rec loop (e : Expr) : M Expr := do
|
||||
match e with
|
||||
| Expr.lam n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop d) fun x => do
|
||||
mkLambdaFVars #[x] (← loop (b.instantiate1 x))
|
||||
| Expr.forallE n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop d) fun x => do
|
||||
mkForallFVars #[x] (← loop (b.instantiate1 x))
|
||||
| Expr.letE n type val body _ =>
|
||||
withLetDecl n (← loop type) (← loop val) fun x => do
|
||||
mkLetFVars #[x] (← loop (body.instantiate1 x))
|
||||
| Expr.mdata d e _ => return mkMData d (← loop e)
|
||||
| Expr.proj n i e _ => return mkProj n i (← loop e)
|
||||
| Expr.app _ _ _ =>
|
||||
let processApp (e : Expr) : M Expr := do
|
||||
e.withApp fun f args => do
|
||||
if f.isConstOf recFnName then
|
||||
let ty ← inferType e
|
||||
let main ← mkFreshExprSyntheticOpaqueMVar ty
|
||||
if ←IndPredBelow.backwardsChaining main.mvarId! maxDepth then
|
||||
main
|
||||
else
|
||||
throwError "could not solve using backwards chaining {MessageData.ofGoal main.mvarId!}"
|
||||
else
|
||||
return mkAppN (← loop f) (← args.mapM loop)
|
||||
match (←matchMatcherApp? e) with
|
||||
| some matcherApp =>
|
||||
if !recArgHasLooseBVarsAt recFnName recArgInfo e then
|
||||
processApp e
|
||||
else
|
||||
trace[Elab.definition.structural] "matcherApp before adding below transformation:\n{matcherApp.toExpr}"
|
||||
let rec addBelow (matcherApp : MatcherApp) : M Expr := do
|
||||
if let some (t, idx) ← IndPredBelow.findBelowIdx matcherApp.discrs motive then
|
||||
let (newApp, addMatcher) ← IndPredBelow.mkBelowMatcher matcherApp motive t idx
|
||||
modify fun s => { s with addMatchers := s.addMatchers.push addMatcher }
|
||||
let some newApp ← matchMatcherApp? newApp | throwError "not a matcherApp: {newApp}"
|
||||
addBelow newApp
|
||||
else matcherApp.toExpr
|
||||
|
||||
let newApp ← addBelow matcherApp
|
||||
if newApp == matcherApp.toExpr then
|
||||
throwError "could not add below discriminant"
|
||||
else
|
||||
trace[Elab.definition.structural] "modified matcher:\n{newApp}"
|
||||
processApp newApp
|
||||
| none => processApp e
|
||||
| e => ensureNoRecFn recFnName e
|
||||
loop e
|
||||
|
||||
private def mkBRecOn (recFnName : Name) (recArgInfo : RecArgInfo) (value : Expr) : M Expr := do
|
||||
let type := (← inferType value).headBeta
|
||||
let major := recArgInfo.ys[recArgInfo.pos]
|
||||
let otherArgs := recArgInfo.ys.filter fun y => y != major && !recArgInfo.indIndices.contains y
|
||||
trace[Elab.definition.structural] "fixedParams: {recArgInfo.fixedParams}, otherArgs: {otherArgs}"
|
||||
let motive ← mkForallFVars otherArgs type
|
||||
let mut brecOnUniv ← getLevel motive
|
||||
trace[Elab.definition.structural] "brecOn univ: {brecOnUniv}"
|
||||
let useBInductionOn := recArgInfo.reflexive && brecOnUniv == levelZero
|
||||
if recArgInfo.reflexive && brecOnUniv != levelZero then
|
||||
brecOnUniv ← decLevel brecOnUniv
|
||||
let motive ← mkLambdaFVars (recArgInfo.indIndices.push major) motive
|
||||
trace[Elab.definition.structural] "brecOn motive: {motive}"
|
||||
let brecOn :=
|
||||
if useBInductionOn then
|
||||
Lean.mkConst (mkBInductionOnName recArgInfo.indName) recArgInfo.indLevels
|
||||
else
|
||||
Lean.mkConst (mkBRecOnName recArgInfo.indName) (brecOnUniv :: recArgInfo.indLevels)
|
||||
let brecOn := mkAppN brecOn recArgInfo.indParams
|
||||
let brecOn := mkApp brecOn motive
|
||||
let brecOn := mkAppN brecOn recArgInfo.indIndices
|
||||
let brecOn := mkApp brecOn major
|
||||
check brecOn
|
||||
let brecOnType ← inferType brecOn
|
||||
trace[Elab.definition.structural] "brecOn {brecOn}"
|
||||
trace[Elab.definition.structural] "brecOnType {brecOnType}"
|
||||
forallBoundedTelescope brecOnType (some 1) fun F _ => do
|
||||
let F := F[0]
|
||||
let FType ← inferType F
|
||||
trace[Elab.definition.structural] "FType: {FType}"
|
||||
let FType ← instantiateForall FType recArgInfo.indIndices
|
||||
let FType ← instantiateForall FType #[major]
|
||||
forallBoundedTelescope FType (some 1) fun below _ => do
|
||||
let below := below[0]
|
||||
let valueNew ← replaceRecApps recFnName recArgInfo below value
|
||||
let Farg ← mkLambdaFVars (recArgInfo.indIndices ++ #[major, below] ++ otherArgs) valueNew
|
||||
let brecOn := mkApp brecOn Farg
|
||||
pure $ mkAppN brecOn otherArgs
|
||||
|
||||
private def mkIndPredBRecOn (recFnName : Name) (recArgInfo : RecArgInfo) (value : Expr) : M Expr := do
|
||||
let type := (← inferType value).headBeta
|
||||
let major := recArgInfo.ys[recArgInfo.pos]
|
||||
let otherArgs := recArgInfo.ys.filter fun y => y != major && !recArgInfo.indIndices.contains y
|
||||
trace[Elab.definition.structural] "fixedParams: {recArgInfo.fixedParams}, otherArgs: {otherArgs}"
|
||||
let motive ← mkForallFVars otherArgs type
|
||||
let motive ← mkLambdaFVars (recArgInfo.indIndices.push major) motive
|
||||
trace[Elab.definition.structural] "brecOn motive: {motive}"
|
||||
let brecOn :=
|
||||
Lean.mkConst (mkBRecOnName recArgInfo.indName) recArgInfo.indLevels
|
||||
let brecOn := mkAppN brecOn recArgInfo.indParams
|
||||
let brecOn := mkApp brecOn motive
|
||||
let brecOn := mkAppN brecOn recArgInfo.indIndices
|
||||
let brecOn := mkApp brecOn major
|
||||
check brecOn
|
||||
let brecOnType ← inferType brecOn
|
||||
trace[Elab.definition.structural] "brecOn {brecOn}"
|
||||
trace[Elab.definition.structural] "brecOnType {brecOnType}"
|
||||
-- we need to close the telescope here, because the local context is used:
|
||||
-- The root cause was, that this copied code puts an ih : FType into the
|
||||
-- local context and later, when we use the local context to build the recursive
|
||||
-- call, it uses this ih. But that ih doesn't exist in the actual brecOn call.
|
||||
-- That's why it must go.
|
||||
let FType ← forallBoundedTelescope brecOnType (some 1) fun F _ => do
|
||||
let F := F[0]
|
||||
let FType ← inferType F
|
||||
trace[Elab.definition.structural] "FType: {FType}"
|
||||
let FType ← instantiateForall FType recArgInfo.indIndices
|
||||
instantiateForall FType #[major]
|
||||
forallBoundedTelescope FType (some 1) fun below _ => do
|
||||
let main ← mkFreshExprSyntheticOpaqueMVar FType
|
||||
let below := below[0]
|
||||
let valueNew ← replaceIndPredRecApps recFnName recArgInfo motive value
|
||||
let Farg ← mkLambdaFVars (recArgInfo.indIndices ++ #[major, below] ++ otherArgs) valueNew
|
||||
let brecOn := mkApp brecOn Farg
|
||||
pure $ mkAppN brecOn otherArgs
|
||||
|
||||
private def shouldBetaReduce (e : Expr) (recFnName : Name) : Bool :=
|
||||
if e.isHeadBetaTarget then
|
||||
e.getAppFn.find? (·.isConstOf recFnName) |>.isSome
|
||||
else
|
||||
false
|
||||
|
||||
/--
|
||||
Beta reduce terms where the recursive function occurs in the lambda term.
|
||||
This is useful to improve the effectiveness of `elimRecursion`.
|
||||
Example:
|
||||
```
|
||||
def f : Nat → Nat
|
||||
| 0 => 1
|
||||
| i+1 => (fun x => f x) i
|
||||
```
|
||||
-/
|
||||
private def preprocess (e : Expr) (recFnName : Name) : CoreM Expr :=
|
||||
Core.transform e
|
||||
fun e => return TransformStep.visit <|
|
||||
if shouldBetaReduce e recFnName then
|
||||
e.headBeta
|
||||
else
|
||||
e
|
||||
|
||||
private def elimRecursion (preDef : PreDefinition) : M PreDefinition :=
|
||||
withoutModifyingEnv do lambdaTelescope preDef.value fun xs value => do
|
||||
addAsAxiom preDef
|
||||
let value ← preprocess value preDef.declName
|
||||
trace[Elab.definition.structural] "{preDef.declName} {xs} :=\n{value}"
|
||||
let numFixed ← getFixedPrefix preDef.declName xs value
|
||||
trace[Elab.definition.structural] "numFixed: {numFixed}"
|
||||
findRecArg numFixed xs fun recArgInfo => do
|
||||
-- when (recArgInfo.indName == `Nat) throwStructuralFailed -- HACK to skip Nat argument
|
||||
let valueNew ←
|
||||
if recArgInfo.indPred then mkIndPredBRecOn preDef.declName recArgInfo value
|
||||
else mkBRecOn preDef.declName recArgInfo value
|
||||
let valueNew ← mkLambdaFVars xs valueNew
|
||||
trace[Elab.definition.structural] "result: {valueNew}"
|
||||
-- Recursive applications may still occur in expressions that were not visited by replaceRecApps (e.g., in types)
|
||||
let valueNew ← ensureNoRecFn preDef.declName valueNew
|
||||
pure { preDef with value := valueNew }
|
||||
|
||||
partial def addSmartUnfoldingDefAux (preDef : PreDefinition) (matcherBelowDep : NameSet) : MetaM PreDefinition := do
|
||||
let recFnName := preDef.declName
|
||||
let isMarkedMatcherName (n : Name) : Bool := matcherBelowDep.contains n
|
||||
let isMarkedMatcherConst (e : Expr) : Bool := e.isConst && isMarkedMatcherName e.constName!
|
||||
let isMarkedMatcherApp (e : Expr) : Bool := isMarkedMatcherConst e.getAppFn
|
||||
let containsMarkedMatcher (e : Expr) : Bool := e.find? isMarkedMatcherConst |>.isSome
|
||||
let rec visit (e : Expr) : MetaM Expr := do
|
||||
match e with
|
||||
| Expr.lam .. => lambdaTelescope e fun xs b => do mkLambdaFVars xs (← visit b)
|
||||
| Expr.forallE .. => forallTelescope e fun xs b => do mkForallFVars xs (← visit b)
|
||||
| Expr.letE n type val body _ =>
|
||||
withLetDecl n type (← visit val) fun x => do
|
||||
mkLetFVars #[x] (← visit (body.instantiate1 x))
|
||||
| Expr.mdata d b _ => return mkMData d (← visit b)
|
||||
| Expr.proj n i s _ => return mkProj n i (← visit s)
|
||||
| Expr.app .. =>
|
||||
let processApp (e : Expr) : MetaM Expr :=
|
||||
e.withApp fun f args => do
|
||||
return mkAppN (← visit f) (← args.mapM visit)
|
||||
match isMarkedMatcherApp e, (← matchMatcherApp? e) with
|
||||
| true, some matcherApp =>
|
||||
let altsNew ← (Array.zip matcherApp.alts matcherApp.altNumParams).mapM fun (alt, numParams) =>
|
||||
lambdaTelescope alt fun xs altBody => do
|
||||
unless xs.size >= numParams do
|
||||
throwError "unexpected matcher application alternative{indentExpr alt}\nat application{indentExpr e}"
|
||||
if containsMarkedMatcher altBody then
|
||||
-- continue
|
||||
mkLambdaFVars xs (← visit altBody)
|
||||
else
|
||||
-- add idRhs marker
|
||||
let altBody ← mkLambdaFVars xs[numParams:xs.size] altBody
|
||||
let altBody ← mkIdRhs altBody
|
||||
mkLambdaFVars xs[0:numParams] altBody
|
||||
pure { matcherApp with alts := altsNew }.toExpr
|
||||
| _, _ => processApp e
|
||||
| _ => pure e
|
||||
return { preDef with
|
||||
declName := mkSmartUnfoldingNameFor preDef.declName,
|
||||
value := (← visit preDef.value),
|
||||
modifiers := {}
|
||||
}
|
||||
|
||||
partial def addSmartUnfoldingDef (preDef : PreDefinition) (state : State) : TermElabM Unit := do
|
||||
if (← isProp preDef.type) then
|
||||
return ()
|
||||
else
|
||||
let preDefSUnfold ← addSmartUnfoldingDefAux preDef state.matcherBelowDep
|
||||
addNonRec preDefSUnfold
|
||||
|
||||
def structuralRecursion (preDefs : Array PreDefinition) : TermElabM Unit :=
|
||||
if preDefs.size != 1 then
|
||||
throwError "structural recursion does not handle mutually recursive functions"
|
||||
else do
|
||||
let (preDefNonRec, state) ← run $ elimRecursion preDefs[0]
|
||||
state.addMatchers.forM liftM
|
||||
mapError (addNonRec preDefNonRec) (fun msg => m!"structural recursion failed, produced type incorrect term{indentD msg}")
|
||||
addAndCompilePartialRec preDefs
|
||||
addSmartUnfoldingDef preDefs[0] state
|
||||
|
||||
builtin_initialize
|
||||
registerTraceClass `Elab.definition.structural
|
||||
|
||||
end Structural
|
||||
|
||||
export Structural (structuralRecursion)
|
||||
|
||||
end Lean.Elab
|
||||
import Lean.Elab.PreDefinition.Structural.Main
|
||||
|
|
|
|||
197
stage0/src/Lean/Elab/PreDefinition/Structural/BRecOn.lean
generated
Normal file
197
stage0/src/Lean/Elab/PreDefinition/Structural/BRecOn.lean
generated
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Meta.Match.Match
|
||||
import Lean.Elab.PreDefinition.Structural.Basic
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
open Meta
|
||||
|
||||
private def throwToBelowFailed : MetaM α :=
|
||||
throwError "toBelow failed"
|
||||
|
||||
/- See toBelow -/
|
||||
private partial def toBelowAux (C : Expr) : Expr → Expr → Expr → MetaM Expr
|
||||
| belowDict, arg, F => do
|
||||
let belowDict ← whnf belowDict
|
||||
trace[Elab.definition.structural] "belowDict: {belowDict}, arg: {arg}"
|
||||
match belowDict with
|
||||
| Expr.app (Expr.app (Expr.const `PProd _ _) d1 _) d2 _ =>
|
||||
(do toBelowAux C d1 arg (← mkAppM `PProd.fst #[F]))
|
||||
<|>
|
||||
(do toBelowAux C d2 arg (← mkAppM `PProd.snd #[F]))
|
||||
| Expr.app (Expr.app (Expr.const `And _ _) d1 _) d2 _ =>
|
||||
(do toBelowAux C d1 arg (← mkAppM `And.left #[F]))
|
||||
<|>
|
||||
(do toBelowAux C d2 arg (← mkAppM `And.right #[F]))
|
||||
| _ => forallTelescopeReducing belowDict fun xs belowDict => do
|
||||
let argArgs := arg.getAppArgs
|
||||
unless argArgs.size >= xs.size do throwToBelowFailed
|
||||
let n := argArgs.size
|
||||
let argTailArgs := argArgs.extract (n - xs.size) n
|
||||
let belowDict := belowDict.replaceFVars xs argTailArgs
|
||||
match belowDict with
|
||||
| Expr.app belowDictFun belowDictArg _ =>
|
||||
unless belowDictFun.getAppFn == C do throwToBelowFailed
|
||||
unless ← isDefEq belowDictArg arg do throwToBelowFailed
|
||||
pure (mkAppN F argTailArgs)
|
||||
| _ => throwToBelowFailed
|
||||
|
||||
/- See toBelow -/
|
||||
private def withBelowDict (below : Expr) (numIndParams : Nat) (k : Expr → Expr → MetaM α) : MetaM α := do
|
||||
let belowType ← inferType below
|
||||
trace[Elab.definition.structural] "belowType: {belowType}"
|
||||
belowType.withApp fun f args => do
|
||||
let motivePos := numIndParams + 1
|
||||
unless motivePos < args.size do throwError "unexpected 'below' type{indentExpr belowType}"
|
||||
let pre := mkAppN f (args.extract 0 numIndParams)
|
||||
let preType ← inferType pre
|
||||
forallBoundedTelescope preType (some 1) fun x _ => do
|
||||
let motiveType ← inferType x[0]
|
||||
let C ← mkFreshUserName `C
|
||||
withLocalDeclD C motiveType fun C =>
|
||||
let belowDict := mkApp pre C
|
||||
let belowDict := mkAppN belowDict (args.extract (numIndParams + 1) args.size)
|
||||
k C belowDict
|
||||
|
||||
/-
|
||||
`below` is a free variable with type of the form `I.below indParams motive indices major`,
|
||||
where `I` is the name of an inductive datatype.
|
||||
|
||||
For example, when trying to show that the following function terminates using structural recursion
|
||||
```lean
|
||||
def addAdjacent : List Nat → List Nat
|
||||
| [] => []
|
||||
| [a] => [a]
|
||||
| a::b::as => (a+b) :: addAdjacent as
|
||||
```
|
||||
when we are visiting `addAdjacent as` at `replaceRecApps`, `below` has type
|
||||
`@List.below Nat (fun (x : List Nat) => List Nat) (a::b::as)`
|
||||
The motive `fun (x : List Nat) => List Nat` depends on the actual function we are trying to compute.
|
||||
So, we first replace it with a fresh variable `C` at `withBelowDict`.
|
||||
Recall that `brecOn` implements course-of-values recursion, and `below` can be viewed as a dictionary
|
||||
of the "previous values".
|
||||
We search this dictionary using the auxiliary function `toBelowAux`.
|
||||
The dictionary is built using the `PProd` (`And` for inductive predicates).
|
||||
We keep searching it until we find `C recArg`, where `C` is the auxiliary fresh variable created at `withBelowDict`. -/
|
||||
private partial def toBelow (below : Expr) (numIndParams : Nat) (recArg : Expr) : MetaM Expr := do
|
||||
withBelowDict below numIndParams fun C belowDict =>
|
||||
toBelowAux C belowDict recArg below
|
||||
|
||||
private partial def replaceRecApps (recFnName : Name) (recArgInfo : RecArgInfo) (below : Expr) (e : Expr) : M Expr :=
|
||||
let rec loop (below : Expr) (e : Expr) : M Expr := do
|
||||
match e with
|
||||
| Expr.lam n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop below d) fun x => do
|
||||
mkLambdaFVars #[x] (← loop below (b.instantiate1 x))
|
||||
| Expr.forallE n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop below d) fun x => do
|
||||
mkForallFVars #[x] (← loop below (b.instantiate1 x))
|
||||
| Expr.letE n type val body _ =>
|
||||
withLetDecl n (← loop below type) (← loop below val) fun x => do
|
||||
mkLetFVars #[x] (← loop below (body.instantiate1 x))
|
||||
| Expr.mdata d e _ => return mkMData d (← loop below e)
|
||||
| Expr.proj n i e _ => return mkProj n i (← loop below e)
|
||||
| Expr.app _ _ _ =>
|
||||
let processApp (e : Expr) : M Expr :=
|
||||
e.withApp fun f args => do
|
||||
if f.isConstOf recFnName then
|
||||
let numFixed := recArgInfo.fixedParams.size
|
||||
let recArgPos := recArgInfo.fixedParams.size + recArgInfo.pos
|
||||
if recArgPos >= args.size then
|
||||
throwError "insufficient number of parameters at recursive application {indentExpr e}"
|
||||
let recArg := args[recArgPos]
|
||||
-- For reflexive type, we may have nested recursive applications in recArg
|
||||
let recArg ← loop below recArg
|
||||
let f ← try toBelow below recArgInfo.indParams.size recArg catch _ => throwError "failed to eliminate recursive application{indentExpr e}"
|
||||
-- Recall that the fixed parameters are not in the scope of the `brecOn`. So, we skip them.
|
||||
let argsNonFixed := args.extract numFixed args.size
|
||||
-- The function `f` does not explicitly take `recArg` and its indices as arguments. So, we skip them too.
|
||||
let mut fArgs := #[]
|
||||
for i in [:argsNonFixed.size] do
|
||||
if recArgInfo.pos != i && !recArgInfo.indicesPos.contains i then
|
||||
let arg := argsNonFixed[i]
|
||||
let arg ← replaceRecApps recFnName recArgInfo below arg
|
||||
fArgs := fArgs.push arg
|
||||
return mkAppN f fArgs
|
||||
else
|
||||
return mkAppN (← loop below f) (← args.mapM (loop below))
|
||||
let matcherApp? ← matchMatcherApp? e
|
||||
match matcherApp? with
|
||||
| some matcherApp =>
|
||||
if !recArgHasLooseBVarsAt recFnName recArgInfo e then
|
||||
processApp e
|
||||
else
|
||||
/- Here is an example we currently not handle
|
||||
```
|
||||
def g (xs : List Nat) : Nat :=
|
||||
match xs with
|
||||
| [] => 0
|
||||
| y::ys =>
|
||||
match ys with
|
||||
| [] => 1
|
||||
| _::_::zs => g zs + 1
|
||||
| zs => g ys + 2
|
||||
```
|
||||
We are matching on `ys`, but still using `ys` in the third alternative.
|
||||
If we push the `below` argument over the dependent match it will be able to eliminate recursive call using `zs`.
|
||||
To make it work, users have to write the third alternative as `| zs => g zs + 2`
|
||||
If this is too annoying in practice, we may replace `ys` with the matching term, but
|
||||
this may generate weird error messages, when it doesn't work. -/
|
||||
trace[Elab.definition.structural] "below before matcherApp.addArg: {below} : {← inferType below}"
|
||||
let matcherApp ← mapError (matcherApp.addArg below) (fun msg => "failed to add `below` argument to 'matcher' application" ++ indentD msg)
|
||||
modify fun s => { s with matcherBelowDep := s.matcherBelowDep.insert matcherApp.matcherName }
|
||||
let altsNew ← (Array.zip matcherApp.alts matcherApp.altNumParams).mapM fun (alt, numParams) =>
|
||||
lambdaTelescope alt fun xs altBody => do
|
||||
trace[Elab.definition.structural] "altNumParams: {numParams}, xs: {xs}"
|
||||
unless xs.size >= numParams do
|
||||
throwError "unexpected matcher application alternative{indentExpr alt}\nat application{indentExpr e}"
|
||||
let belowForAlt := xs[numParams - 1]
|
||||
mkLambdaFVars xs (← loop belowForAlt altBody)
|
||||
pure { matcherApp with alts := altsNew }.toExpr
|
||||
| none => processApp e
|
||||
| e => ensureNoRecFn recFnName e
|
||||
loop below e
|
||||
|
||||
def mkBRecOn (recFnName : Name) (recArgInfo : RecArgInfo) (value : Expr) : M Expr := do
|
||||
let type := (← inferType value).headBeta
|
||||
let major := recArgInfo.ys[recArgInfo.pos]
|
||||
let otherArgs := recArgInfo.ys.filter fun y => y != major && !recArgInfo.indIndices.contains y
|
||||
trace[Elab.definition.structural] "fixedParams: {recArgInfo.fixedParams}, otherArgs: {otherArgs}"
|
||||
let motive ← mkForallFVars otherArgs type
|
||||
let mut brecOnUniv ← getLevel motive
|
||||
trace[Elab.definition.structural] "brecOn univ: {brecOnUniv}"
|
||||
let useBInductionOn := recArgInfo.reflexive && brecOnUniv == levelZero
|
||||
if recArgInfo.reflexive && brecOnUniv != levelZero then
|
||||
brecOnUniv ← decLevel brecOnUniv
|
||||
let motive ← mkLambdaFVars (recArgInfo.indIndices.push major) motive
|
||||
trace[Elab.definition.structural] "brecOn motive: {motive}"
|
||||
let brecOn :=
|
||||
if useBInductionOn then
|
||||
Lean.mkConst (mkBInductionOnName recArgInfo.indName) recArgInfo.indLevels
|
||||
else
|
||||
Lean.mkConst (mkBRecOnName recArgInfo.indName) (brecOnUniv :: recArgInfo.indLevels)
|
||||
let brecOn := mkAppN brecOn recArgInfo.indParams
|
||||
let brecOn := mkApp brecOn motive
|
||||
let brecOn := mkAppN brecOn recArgInfo.indIndices
|
||||
let brecOn := mkApp brecOn major
|
||||
check brecOn
|
||||
let brecOnType ← inferType brecOn
|
||||
trace[Elab.definition.structural] "brecOn {brecOn}"
|
||||
trace[Elab.definition.structural] "brecOnType {brecOnType}"
|
||||
forallBoundedTelescope brecOnType (some 1) fun F _ => do
|
||||
let F := F[0]
|
||||
let FType ← inferType F
|
||||
trace[Elab.definition.structural] "FType: {FType}"
|
||||
let FType ← instantiateForall FType recArgInfo.indIndices
|
||||
let FType ← instantiateForall FType #[major]
|
||||
forallBoundedTelescope FType (some 1) fun below _ => do
|
||||
let below := below[0]
|
||||
let valueNew ← replaceRecApps recFnName recArgInfo below value
|
||||
let Farg ← mkLambdaFVars (recArgInfo.indIndices ++ #[major, below] ++ otherArgs) valueNew
|
||||
let brecOn := mkApp brecOn Farg
|
||||
return mkAppN brecOn otherArgs
|
||||
|
||||
end Lean.Elab.Structural
|
||||
78
stage0/src/Lean/Elab/PreDefinition/Structural/Basic.lean
generated
Normal file
78
stage0/src/Lean/Elab/PreDefinition/Structural/Basic.lean
generated
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Meta.Basic
|
||||
import Lean.Meta.ForEachExpr
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
|
||||
structure RecArgInfo where
|
||||
/- `fixedParams ++ ys` are the arguments of the function we are trying to justify termination using structural recursion. -/
|
||||
fixedParams : Array Expr
|
||||
ys : Array Expr -- recursion arguments
|
||||
pos : Nat -- position in `ys` of the argument we are recursing on
|
||||
indicesPos : Array Nat -- position in `ys` of the inductive datatype indices we are recursing on
|
||||
indName : Name -- inductive datatype name of the argument we are recursing on
|
||||
indLevels : List Level -- inductice datatype universe levels of the argument we are recursing on
|
||||
indParams : Array Expr -- inductive datatype parameters of the argument we are recursing on
|
||||
indIndices : Array Expr -- inductive datatype indices of the argument we are recursing on, it is equal to `indicesPos.map fun i => ys.get! i`
|
||||
reflexive : Bool -- true if we are recursing over a reflexive inductive datatype
|
||||
indPred : Bool -- true if the type is an inductive predicate
|
||||
|
||||
structure State where
|
||||
/- When compiling structural recursion we use the `brecOn` recursor automatically built by
|
||||
the `inductive` command. For an inductive datatype `C`, it has the form
|
||||
`C.brecOn As motive is c F`
|
||||
where `As` are the inductive datatype parameters, `is` are the inductive datatype indices,
|
||||
`c : C As is`, and `F : (js) → (d : C As js) → C.below d → motive d`
|
||||
The `C.below d` is used to eliminate recursive applications. We refine its type when we process
|
||||
a nested dependent pattern matcher using `MatcherApp.addArg`. See `replaceRecApps` for additional details.
|
||||
We store the names of the matcher where we used `MatcherApp.addArg` at `matcherBelowDep`.
|
||||
We use this information to generate the auxiliary `_sunfold` definition needed by the smart unfolding
|
||||
technique used at WHNF. -/
|
||||
matcherBelowDep : NameSet := {}
|
||||
/- As part of the inductive predicates case, we keep adding more and more discriminants from the
|
||||
local context and build up a bigger matcher application until we reach a fixed point.
|
||||
As a side-effect, this creates matchers. Here we capture all these side-effects, because
|
||||
the construction rolls back any changes done to the environment and the side-effects
|
||||
need to be replayed. -/
|
||||
addMatchers : Array $ MetaM Unit := #[]
|
||||
|
||||
abbrev M := StateRefT State MetaM
|
||||
|
||||
instance : Inhabited (M α) where
|
||||
default := throwError "failed"
|
||||
|
||||
def run (x : M α) (s : State := {}) : MetaM (α × State) :=
|
||||
StateRefT'.run x s
|
||||
|
||||
/--
|
||||
Return true iff `e` contains an application `recFnName .. t ..` where the term `t` is
|
||||
the argument we are trying to recurse on, and it contains loose bound variables.
|
||||
|
||||
We use this test to decide whether we should process a matcher-application as a regular
|
||||
applicaton or not. That is, whether we should push the `below` argument should be affected by the matcher or not.
|
||||
If `e` does not contain an application of the form `recFnName .. t ..`, then we know
|
||||
the recursion doesn't depend on any pattern variable in this matcher.
|
||||
-/
|
||||
def recArgHasLooseBVarsAt (recFnName : Name) (recArgInfo : RecArgInfo) (e : Expr) : Bool :=
|
||||
let recArgPos := recArgInfo.fixedParams.size + recArgInfo.pos
|
||||
let app? := e.find? fun e =>
|
||||
e.isAppOf recFnName && e.getAppNumArgs > recArgPos && (e.getArg! recArgPos).hasLooseBVars
|
||||
app?.isSome
|
||||
|
||||
private def containsRecFn (recFnName : Name) (e : Expr) : Bool :=
|
||||
(e.find? fun e => e.isConstOf recFnName).isSome
|
||||
|
||||
def ensureNoRecFn (recFnName : Name) (e : Expr) : MetaM Expr := do
|
||||
if containsRecFn recFnName e then
|
||||
Meta.forEachExpr e fun e => do
|
||||
if e.isAppOf recFnName then
|
||||
throwError "unexpected occurrence of recursive application{indentExpr e}"
|
||||
pure e
|
||||
else
|
||||
pure e
|
||||
|
||||
end Lean.Elab.Structural
|
||||
18
stage0/src/Lean/Elab/PreDefinition/Structural/Eqns.lean
generated
Normal file
18
stage0/src/Lean/Elab/PreDefinition/Structural/Eqns.lean
generated
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Elab.PreDefinition.Basic
|
||||
import Lean.Elab.PreDefinition.Structural.Basic
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
|
||||
def mkEqns (preDef : PreDefinition) : TermElabM Unit := do
|
||||
trace[Elab.definition.structural.eqns] "mkEqns:\n{preDef.value}"
|
||||
return ()
|
||||
|
||||
builtin_initialize
|
||||
registerTraceClass `Elab.definition.structural.eqns
|
||||
|
||||
end Lean.Elab.Structural
|
||||
106
stage0/src/Lean/Elab/PreDefinition/Structural/FindRecArg.lean
generated
Normal file
106
stage0/src/Lean/Elab/PreDefinition/Structural/FindRecArg.lean
generated
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Elab.PreDefinition.Structural.Basic
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
open Meta
|
||||
|
||||
private def getIndexMinPos (xs : Array Expr) (indices : Array Expr) : Nat := do
|
||||
let mut minPos := xs.size
|
||||
for index in indices do
|
||||
match xs.indexOf? index with
|
||||
| some pos => if pos.val < minPos then minPos := pos.val
|
||||
| _ => pure ()
|
||||
return minPos
|
||||
|
||||
-- Indices can only depend on other indices
|
||||
private def hasBadIndexDep? (ys : Array Expr) (indices : Array Expr) : MetaM (Option (Expr × Expr)) := do
|
||||
for index in indices do
|
||||
let indexType ← inferType index
|
||||
for y in ys do
|
||||
if !indices.contains y && (← dependsOn indexType y.fvarId!) then
|
||||
return some (index, y)
|
||||
return none
|
||||
|
||||
-- Inductive datatype parameters cannot depend on ys
|
||||
private def hasBadParamDep? (ys : Array Expr) (indParams : Array Expr) : MetaM (Option (Expr × Expr)) := do
|
||||
for p in indParams do
|
||||
let pType ← inferType p
|
||||
for y in ys do
|
||||
if ← dependsOn pType y.fvarId! then
|
||||
return some (p, y)
|
||||
return none
|
||||
|
||||
private def throwStructuralFailed : MetaM α :=
|
||||
throwError "structural recursion cannot be used"
|
||||
|
||||
private def orelse' (x y : M α) : M α := do
|
||||
let saveState ← get
|
||||
orelseMergeErrors x (do set saveState; y)
|
||||
|
||||
partial def findRecArg (numFixed : Nat) (xs : Array Expr) (k : RecArgInfo → M α) : M α :=
|
||||
let rec loop (i : Nat) : M α := do
|
||||
if h : i < xs.size then
|
||||
let x := xs.get ⟨i, h⟩
|
||||
let localDecl ← getFVarLocalDecl x
|
||||
if localDecl.isLet then
|
||||
throwStructuralFailed
|
||||
else
|
||||
let xType ← whnfD localDecl.type
|
||||
matchConstInduct xType.getAppFn (fun _ => loop (i+1)) fun indInfo us => do
|
||||
if !(← hasConst (mkBRecOnName indInfo.name)) then
|
||||
loop (i+1)
|
||||
else if indInfo.isReflexive && !(← hasConst (mkBInductionOnName indInfo.name)) then
|
||||
loop (i+1)
|
||||
else
|
||||
let indArgs := xType.getAppArgs
|
||||
let indParams := indArgs.extract 0 indInfo.numParams
|
||||
let indIndices := indArgs.extract indInfo.numParams indArgs.size
|
||||
if !indIndices.all Expr.isFVar then
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive family and indices are not variables{indentExpr xType}")
|
||||
(loop (i+1))
|
||||
else if !indIndices.allDiff then
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive family and indices are not pairwise distinct{indentExpr xType}")
|
||||
(loop (i+1))
|
||||
else
|
||||
let indexMinPos := getIndexMinPos xs indIndices
|
||||
let numFixed := if indexMinPos < numFixed then indexMinPos else numFixed
|
||||
let fixedParams := xs.extract 0 numFixed
|
||||
let ys := xs.extract numFixed xs.size
|
||||
match (← hasBadIndexDep? ys indIndices) with
|
||||
| some (index, y) =>
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive family{indentExpr xType}\nand index{indentExpr index}\ndepends on the non index{indentExpr y}")
|
||||
(loop (i+1))
|
||||
| none =>
|
||||
match (← hasBadParamDep? ys indParams) with
|
||||
| some (indParam, y) =>
|
||||
orelse'
|
||||
(throwError "argument #{i+1} was not used because its type is an inductive datatype{indentExpr xType}\nand parameter{indentExpr indParam}\ndepends on{indentExpr y}")
|
||||
(loop (i+1))
|
||||
| none =>
|
||||
let indicesPos := indIndices.map fun index => match ys.indexOf? index with | some i => i.val | none => unreachable!
|
||||
orelse'
|
||||
(mapError
|
||||
(k { fixedParams := fixedParams
|
||||
ys := ys
|
||||
pos := i - fixedParams.size
|
||||
indicesPos := indicesPos
|
||||
indName := indInfo.name
|
||||
indLevels := us
|
||||
indParams := indParams
|
||||
indIndices := indIndices
|
||||
reflexive := indInfo.isReflexive
|
||||
indPred := ←isInductivePredicate indInfo.name })
|
||||
(fun msg => m!"argument #{i+1} was not used for structural recursion{indentD msg}"))
|
||||
(loop (i+1))
|
||||
else
|
||||
throwStructuralFailed
|
||||
loop numFixed
|
||||
|
||||
end Lean.Elab.Structural
|
||||
100
stage0/src/Lean/Elab/PreDefinition/Structural/IndPred.lean
generated
Normal file
100
stage0/src/Lean/Elab/PreDefinition/Structural/IndPred.lean
generated
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Dany Fabian
|
||||
-/
|
||||
import Lean.Meta.IndPredBelow
|
||||
import Lean.Elab.PreDefinition.Basic
|
||||
import Lean.Elab.PreDefinition.Structural.Basic
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
open Meta
|
||||
|
||||
private partial def replaceIndPredRecApps (recFnName : Name) (recArgInfo : RecArgInfo) (motive : Expr) (e : Expr) : M Expr := do
|
||||
let maxDepth := IndPredBelow.maxBackwardChainingDepth.get (← getOptions)
|
||||
let rec loop (e : Expr) : M Expr := do
|
||||
match e with
|
||||
| Expr.lam n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop d) fun x => do
|
||||
mkLambdaFVars #[x] (← loop (b.instantiate1 x))
|
||||
| Expr.forallE n d b c =>
|
||||
withLocalDecl n c.binderInfo (← loop d) fun x => do
|
||||
mkForallFVars #[x] (← loop (b.instantiate1 x))
|
||||
| Expr.letE n type val body _ =>
|
||||
withLetDecl n (← loop type) (← loop val) fun x => do
|
||||
mkLetFVars #[x] (← loop (body.instantiate1 x))
|
||||
| Expr.mdata d e _ => return mkMData d (← loop e)
|
||||
| Expr.proj n i e _ => return mkProj n i (← loop e)
|
||||
| Expr.app _ _ _ =>
|
||||
let processApp (e : Expr) : M Expr := do
|
||||
e.withApp fun f args => do
|
||||
if f.isConstOf recFnName then
|
||||
let ty ← inferType e
|
||||
let main ← mkFreshExprSyntheticOpaqueMVar ty
|
||||
if ←IndPredBelow.backwardsChaining main.mvarId! maxDepth then
|
||||
main
|
||||
else
|
||||
throwError "could not solve using backwards chaining {MessageData.ofGoal main.mvarId!}"
|
||||
else
|
||||
return mkAppN (← loop f) (← args.mapM loop)
|
||||
match (←matchMatcherApp? e) with
|
||||
| some matcherApp =>
|
||||
if !recArgHasLooseBVarsAt recFnName recArgInfo e then
|
||||
processApp e
|
||||
else
|
||||
trace[Elab.definition.structural] "matcherApp before adding below transformation:\n{matcherApp.toExpr}"
|
||||
let rec addBelow (matcherApp : MatcherApp) : M Expr := do
|
||||
if let some (t, idx) ← IndPredBelow.findBelowIdx matcherApp.discrs motive then
|
||||
let (newApp, addMatcher) ← IndPredBelow.mkBelowMatcher matcherApp motive t idx
|
||||
modify fun s => { s with addMatchers := s.addMatchers.push addMatcher }
|
||||
let some newApp ← matchMatcherApp? newApp | throwError "not a matcherApp: {newApp}"
|
||||
addBelow newApp
|
||||
else matcherApp.toExpr
|
||||
|
||||
let newApp ← addBelow matcherApp
|
||||
if newApp == matcherApp.toExpr then
|
||||
throwError "could not add below discriminant"
|
||||
else
|
||||
trace[Elab.definition.structural] "modified matcher:\n{newApp}"
|
||||
processApp newApp
|
||||
| none => processApp e
|
||||
| e => ensureNoRecFn recFnName e
|
||||
loop e
|
||||
|
||||
def mkIndPredBRecOn (recFnName : Name) (recArgInfo : RecArgInfo) (value : Expr) : M Expr := do
|
||||
let type := (← inferType value).headBeta
|
||||
let major := recArgInfo.ys[recArgInfo.pos]
|
||||
let otherArgs := recArgInfo.ys.filter fun y => y != major && !recArgInfo.indIndices.contains y
|
||||
trace[Elab.definition.structural] "fixedParams: {recArgInfo.fixedParams}, otherArgs: {otherArgs}"
|
||||
let motive ← mkForallFVars otherArgs type
|
||||
let motive ← mkLambdaFVars (recArgInfo.indIndices.push major) motive
|
||||
trace[Elab.definition.structural] "brecOn motive: {motive}"
|
||||
let brecOn := Lean.mkConst (mkBRecOnName recArgInfo.indName) recArgInfo.indLevels
|
||||
let brecOn := mkAppN brecOn recArgInfo.indParams
|
||||
let brecOn := mkApp brecOn motive
|
||||
let brecOn := mkAppN brecOn recArgInfo.indIndices
|
||||
let brecOn := mkApp brecOn major
|
||||
check brecOn
|
||||
let brecOnType ← inferType brecOn
|
||||
trace[Elab.definition.structural] "brecOn {brecOn}"
|
||||
trace[Elab.definition.structural] "brecOnType {brecOnType}"
|
||||
-- we need to close the telescope here, because the local context is used:
|
||||
-- The root cause was, that this copied code puts an ih : FType into the
|
||||
-- local context and later, when we use the local context to build the recursive
|
||||
-- call, it uses this ih. But that ih doesn't exist in the actual brecOn call.
|
||||
-- That's why it must go.
|
||||
let FType ← forallBoundedTelescope brecOnType (some 1) fun F _ => do
|
||||
let F := F[0]
|
||||
let FType ← inferType F
|
||||
trace[Elab.definition.structural] "FType: {FType}"
|
||||
let FType ← instantiateForall FType recArgInfo.indIndices
|
||||
instantiateForall FType #[major]
|
||||
forallBoundedTelescope FType (some 1) fun below _ => do
|
||||
let main ← mkFreshExprSyntheticOpaqueMVar FType
|
||||
let below := below[0]
|
||||
let valueNew ← replaceIndPredRecApps recFnName recArgInfo motive value
|
||||
let Farg ← mkLambdaFVars (recArgInfo.indIndices ++ #[major, below] ++ otherArgs) valueNew
|
||||
let brecOn := mkApp brecOn Farg
|
||||
return mkAppN brecOn otherArgs
|
||||
|
||||
end Lean.Elab.Structural
|
||||
95
stage0/src/Lean/Elab/PreDefinition/Structural/Main.lean
generated
Normal file
95
stage0/src/Lean/Elab/PreDefinition/Structural/Main.lean
generated
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Elab.PreDefinition.Structural.Basic
|
||||
import Lean.Elab.PreDefinition.Structural.FindRecArg
|
||||
import Lean.Elab.PreDefinition.Structural.Preprocess
|
||||
import Lean.Elab.PreDefinition.Structural.BRecOn
|
||||
import Lean.Elab.PreDefinition.Structural.IndPred
|
||||
import Lean.Elab.PreDefinition.Structural.Eqns
|
||||
import Lean.Elab.PreDefinition.Structural.SmartUnfolding
|
||||
|
||||
namespace Lean.Elab
|
||||
namespace Structural
|
||||
open Meta
|
||||
|
||||
private def getFixedPrefix (declName : Name) (xs : Array Expr) (value : Expr) : MetaM Nat := do
|
||||
let numFixedRef ← IO.mkRef xs.size
|
||||
forEachExpr' value fun e => do
|
||||
if e.isAppOf declName then
|
||||
let args := e.getAppArgs
|
||||
numFixedRef.modify fun numFixed => if args.size < numFixed then args.size else numFixed
|
||||
for arg in args, x in xs do
|
||||
/- We should not use structural equality here. For example, given the definition
|
||||
```
|
||||
def V.map {α β} f x x_1 :=
|
||||
@V.map.match_1.{1} α (fun x x_2 => V β x) x x_1
|
||||
(fun x x_2 => @V.mk₁ β x (f Bool.true x_2))
|
||||
(fun e => @V.mk₂ β (V.map (fun b => α b) (fun b => β b) f Bool.false e))
|
||||
```
|
||||
The first three arguments at `V.map (fun b => α b) (fun b => β b) f Bool.false e` are "fixed"
|
||||
modulo definitional equality.
|
||||
|
||||
We disable to proof irrelevance to be able to use structural recursion on inductive predicates.
|
||||
For example, consider the example
|
||||
```
|
||||
inductive PList (α : Type) : Prop
|
||||
| nil
|
||||
| cons : α → PList α → PList α
|
||||
|
||||
infixr:67 " ::: " => PList.cons
|
||||
|
||||
set_option trace.Elab.definition.structural true in
|
||||
def pmap {α β} (f : α → β) : PList α → PList β
|
||||
| PList.nil => PList.nil
|
||||
| a:::as => f a ::: pmap f as
|
||||
```
|
||||
The "Fixed" prefix would be 4 since all elements of type `PList α` are definitionally equal.
|
||||
-/
|
||||
if !(← withoutProofIrrelevance <| withReducible <| isDefEq arg x) then
|
||||
-- We continue searching if e's arguments are not a prefix of `xs`
|
||||
return true
|
||||
return false
|
||||
else
|
||||
return true
|
||||
numFixedRef.get
|
||||
|
||||
private def elimRecursion (preDef : PreDefinition) : M PreDefinition :=
|
||||
withoutModifyingEnv do lambdaTelescope preDef.value fun xs value => do
|
||||
addAsAxiom preDef
|
||||
let value ← preprocess value preDef.declName
|
||||
trace[Elab.definition.structural] "{preDef.declName} {xs} :=\n{value}"
|
||||
let numFixed ← getFixedPrefix preDef.declName xs value
|
||||
trace[Elab.definition.structural] "numFixed: {numFixed}"
|
||||
findRecArg numFixed xs fun recArgInfo => do
|
||||
-- when (recArgInfo.indName == `Nat) throwStructuralFailed -- HACK to skip Nat argument
|
||||
let valueNew ←
|
||||
if recArgInfo.indPred then mkIndPredBRecOn preDef.declName recArgInfo value
|
||||
else mkBRecOn preDef.declName recArgInfo value
|
||||
let valueNew ← mkLambdaFVars xs valueNew
|
||||
trace[Elab.definition.structural] "result: {valueNew}"
|
||||
-- Recursive applications may still occur in expressions that were not visited by replaceRecApps (e.g., in types)
|
||||
let valueNew ← ensureNoRecFn preDef.declName valueNew
|
||||
pure { preDef with value := valueNew }
|
||||
|
||||
def structuralRecursion (preDefs : Array PreDefinition) : TermElabM Unit :=
|
||||
if preDefs.size != 1 then
|
||||
throwError "structural recursion does not handle mutually recursive functions"
|
||||
else do
|
||||
let (preDefNonRec, state) ← run <| elimRecursion preDefs[0]
|
||||
state.addMatchers.forM liftM
|
||||
mapError (addNonRec preDefNonRec) (fun msg => m!"structural recursion failed, produced type incorrect term{indentD msg}")
|
||||
addAndCompilePartialRec preDefs
|
||||
addSmartUnfoldingDef preDefs[0] state
|
||||
mkEqns preDefs[0]
|
||||
|
||||
builtin_initialize
|
||||
registerTraceClass `Elab.definition.structural
|
||||
|
||||
end Structural
|
||||
|
||||
export Structural (structuralRecursion)
|
||||
|
||||
end Lean.Elab
|
||||
35
stage0/src/Lean/Elab/PreDefinition/Structural/Preprocess.lean
generated
Normal file
35
stage0/src/Lean/Elab/PreDefinition/Structural/Preprocess.lean
generated
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Meta.Transform
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
open Meta
|
||||
|
||||
private def shouldBetaReduce (e : Expr) (recFnName : Name) : Bool :=
|
||||
if e.isHeadBetaTarget then
|
||||
e.getAppFn.find? (·.isConstOf recFnName) |>.isSome
|
||||
else
|
||||
false
|
||||
|
||||
/--
|
||||
Beta reduce terms where the recursive function occurs in the lambda term.
|
||||
This is useful to improve the effectiveness of `elimRecursion`.
|
||||
Example:
|
||||
```
|
||||
def f : Nat → Nat
|
||||
| 0 => 1
|
||||
| i+1 => (fun x => f x) i
|
||||
```
|
||||
-/
|
||||
def preprocess (e : Expr) (recFnName : Name) : CoreM Expr :=
|
||||
Core.transform e
|
||||
fun e => return TransformStep.visit <|
|
||||
if shouldBetaReduce e recFnName then
|
||||
e.headBeta
|
||||
else
|
||||
e
|
||||
|
||||
end Lean.Elab.Structural
|
||||
61
stage0/src/Lean/Elab/PreDefinition/Structural/SmartUnfolding.lean
generated
Normal file
61
stage0/src/Lean/Elab/PreDefinition/Structural/SmartUnfolding.lean
generated
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura
|
||||
-/
|
||||
import Lean.Elab.PreDefinition.Basic
|
||||
import Lean.Elab.PreDefinition.Structural.Basic
|
||||
|
||||
namespace Lean.Elab.Structural
|
||||
open Meta
|
||||
|
||||
partial def addSmartUnfoldingDefAux (preDef : PreDefinition) (matcherBelowDep : NameSet) : MetaM PreDefinition := do
|
||||
let recFnName := preDef.declName
|
||||
let isMarkedMatcherName (n : Name) : Bool := matcherBelowDep.contains n
|
||||
let isMarkedMatcherConst (e : Expr) : Bool := e.isConst && isMarkedMatcherName e.constName!
|
||||
let isMarkedMatcherApp (e : Expr) : Bool := isMarkedMatcherConst e.getAppFn
|
||||
let containsMarkedMatcher (e : Expr) : Bool := e.find? isMarkedMatcherConst |>.isSome
|
||||
let rec visit (e : Expr) : MetaM Expr := do
|
||||
match e with
|
||||
| Expr.lam .. => lambdaTelescope e fun xs b => do mkLambdaFVars xs (← visit b)
|
||||
| Expr.forallE .. => forallTelescope e fun xs b => do mkForallFVars xs (← visit b)
|
||||
| Expr.letE n type val body _ =>
|
||||
withLetDecl n type (← visit val) fun x => do
|
||||
mkLetFVars #[x] (← visit (body.instantiate1 x))
|
||||
| Expr.mdata d b _ => return mkMData d (← visit b)
|
||||
| Expr.proj n i s _ => return mkProj n i (← visit s)
|
||||
| Expr.app .. =>
|
||||
let processApp (e : Expr) : MetaM Expr :=
|
||||
e.withApp fun f args => do
|
||||
return mkAppN (← visit f) (← args.mapM visit)
|
||||
match isMarkedMatcherApp e, (← matchMatcherApp? e) with
|
||||
| true, some matcherApp =>
|
||||
let altsNew ← (Array.zip matcherApp.alts matcherApp.altNumParams).mapM fun (alt, numParams) =>
|
||||
lambdaTelescope alt fun xs altBody => do
|
||||
unless xs.size >= numParams do
|
||||
throwError "unexpected matcher application alternative{indentExpr alt}\nat application{indentExpr e}"
|
||||
if containsMarkedMatcher altBody then
|
||||
-- continue
|
||||
mkLambdaFVars xs (← visit altBody)
|
||||
else
|
||||
-- add idRhs marker
|
||||
let altBody ← mkLambdaFVars xs[numParams:xs.size] altBody
|
||||
let altBody ← mkIdRhs altBody
|
||||
mkLambdaFVars xs[0:numParams] altBody
|
||||
pure { matcherApp with alts := altsNew }.toExpr
|
||||
| _, _ => processApp e
|
||||
| _ => pure e
|
||||
return { preDef with
|
||||
declName := mkSmartUnfoldingNameFor preDef.declName,
|
||||
value := (← visit preDef.value),
|
||||
modifiers := {}
|
||||
}
|
||||
|
||||
partial def addSmartUnfoldingDef (preDef : PreDefinition) (state : State) : TermElabM Unit := do
|
||||
if (← isProp preDef.type) then
|
||||
return ()
|
||||
else
|
||||
let preDefSUnfold ← addSmartUnfoldingDefAux preDef state.matcherBelowDep
|
||||
addNonRec preDefSUnfold
|
||||
|
||||
end Lean.Elab.Structural
|
||||
11
stage0/src/Lean/Expr.lean
generated
11
stage0/src/Lean/Expr.lean
generated
|
|
@ -1079,6 +1079,17 @@ def annotation? (kind : Name) (e : Expr) : Option Expr :=
|
|||
| Expr.mdata d b _ => if d.size == 1 && d.getBool kind false then some b else none
|
||||
| _ => none
|
||||
|
||||
def mkLetFunAnnotation (e : Expr) : Expr :=
|
||||
mkAnnotation `let_fun e
|
||||
|
||||
def letFunAnnotation? (e : Expr) : Option Expr :=
|
||||
annotation? `let_fun e
|
||||
|
||||
def isLetFun (e : Expr) : Bool :=
|
||||
match letFunAnnotation? e with
|
||||
| none => false
|
||||
| some e => e.isApp && e.appFn!.isLambda
|
||||
|
||||
/--
|
||||
Annotate `e` with the LHS annotation. The delaborator displays
|
||||
expressions of the form `lhs = rhs` as `lhs` when they have this annotation.
|
||||
|
|
|
|||
12
stage0/src/Lean/Meta/AppBuilder.lean
generated
12
stage0/src/Lean/Meta/AppBuilder.lean
generated
|
|
@ -440,6 +440,18 @@ def mkFunExt (h : Expr) : MetaM Expr :=
|
|||
def mkPropExt (h : Expr) : MetaM Expr :=
|
||||
mkAppM ``propext #[h]
|
||||
|
||||
/-- Return `let_congr h₁ h₂` -/
|
||||
def mkLetCongr (h₁ h₂ : Expr) : MetaM Expr :=
|
||||
mkAppM ``let_congr #[h₁, h₂]
|
||||
|
||||
/-- Return `let_val_congr b h` -/
|
||||
def mkLetValCongr (b h : Expr) : MetaM Expr :=
|
||||
mkAppM ``let_val_congr #[b, h]
|
||||
|
||||
/-- Return `let_body_congr a h` -/
|
||||
def mkLetBodyCongr (a h : Expr) : MetaM Expr :=
|
||||
mkAppM ``let_body_congr #[a, h]
|
||||
|
||||
/-- Return `of_eq_true h` -/
|
||||
def mkOfEqTrue (h : Expr) : MetaM Expr :=
|
||||
mkAppM ``of_eq_true #[h]
|
||||
|
|
|
|||
4
stage0/src/Lean/Meta/Match/Match.lean
generated
4
stage0/src/Lean/Meta/Match/Match.lean
generated
|
|
@ -725,11 +725,11 @@ def mkMatcherAuxDefinition (name : Name) (type : Expr) (value : Expr) : MetaM (E
|
|||
trace[Meta.debug] "{name} : {result.type} := {result.value}"
|
||||
let addMatcher : MatcherInfo → MetaM Unit := fun mi => do
|
||||
addDecl decl
|
||||
if compile then
|
||||
compileDecl decl
|
||||
modifyEnv fun env => matcherExt.modifyState env fun s => s.insert (result.value, compile) name
|
||||
addMatcherInfo name mi
|
||||
setInlineAttribute name
|
||||
if compile then
|
||||
compileDecl decl
|
||||
(mkMatcherConst name, some addMatcher)
|
||||
|
||||
|
||||
|
|
|
|||
16
stage0/src/Lean/Meta/Match/MatcherInfo.lean
generated
16
stage0/src/Lean/Meta/Match/MatcherInfo.lean
generated
|
|
@ -29,8 +29,12 @@ def MatcherInfo.numAlts (info : MatcherInfo) : Nat :=
|
|||
def MatcherInfo.arity (info : MatcherInfo) : Nat :=
|
||||
info.numParams + 1 + info.numDiscrs + info.numAlts
|
||||
|
||||
def MatcherInfo.getFirstDiscrPos (info : MatcherInfo) : Nat :=
|
||||
info.numParams + 1
|
||||
|
||||
def MatcherInfo.getMotivePos (info : MatcherInfo) : Nat :=
|
||||
info.numParams
|
||||
|
||||
namespace Extension
|
||||
|
||||
structure Entry where
|
||||
|
|
@ -73,21 +77,25 @@ def getMatcherInfoCore? (env : Environment) (declName : Name) : Option MatcherIn
|
|||
def getMatcherInfo? [Monad m] [MonadEnv m] (declName : Name) : m (Option MatcherInfo) :=
|
||||
return getMatcherInfoCore? (← getEnv) declName
|
||||
|
||||
@[export lean_is_matcher]
|
||||
def isMatcherCore (env : Environment) (declName : Name) : Bool :=
|
||||
getMatcherInfoCore? env declName |>.isSome
|
||||
|
||||
def isMatcher [Monad m] [MonadEnv m] (declName : Name) : m Bool :=
|
||||
return isMatcherCore (← getEnv) declName
|
||||
|
||||
def isMatcherAppCore (env : Environment) (e : Expr) : Bool :=
|
||||
def isMatcherAppCore? (env : Environment) (e : Expr) : Option MatcherInfo :=
|
||||
let fn := e.getAppFn
|
||||
if fn.isConst then
|
||||
if let some matcherInfo := getMatcherInfoCore? env fn.constName! then
|
||||
e.getAppNumArgs ≥ matcherInfo.arity
|
||||
if e.getAppNumArgs ≥ matcherInfo.arity then some matcherInfo else none
|
||||
else
|
||||
false
|
||||
none
|
||||
else
|
||||
false
|
||||
none
|
||||
|
||||
def isMatcherAppCore (env : Environment) (e : Expr) : Bool :=
|
||||
isMatcherAppCore? env e |>.isSome
|
||||
|
||||
def isMatcherApp [Monad m] [MonadEnv m] (e : Expr) : m Bool :=
|
||||
return isMatcherAppCore (← getEnv) e
|
||||
|
|
|
|||
50
stage0/src/Lean/Meta/Tactic/Simp/Main.lean
generated
50
stage0/src/Lean/Meta/Tactic/Simp/Main.lean
generated
|
|
@ -155,18 +155,18 @@ where
|
|||
|
||||
simpStep (e : Expr) : M Result := do
|
||||
match e with
|
||||
| Expr.mdata _ e _ => simp e
|
||||
| Expr.proj .. => pure { expr := (← reduceProj e) }
|
||||
| Expr.mdata m e _ => let r ← simp e; return { r with expr := mkMData m r.expr }
|
||||
| Expr.proj .. => return { expr := (← reduceProj e) }
|
||||
| Expr.app .. => simpApp e
|
||||
| Expr.lam .. => simpLambda e
|
||||
| Expr.forallE .. => simpForall e
|
||||
| Expr.letE .. => simpLet e
|
||||
| Expr.const .. => simpConst e
|
||||
| Expr.bvar .. => unreachable!
|
||||
| Expr.sort .. => pure { expr := e }
|
||||
| Expr.sort .. => return { expr := e }
|
||||
| Expr.lit .. => simpLit e
|
||||
| Expr.mvar .. => pure { expr := (← instantiateMVars e) }
|
||||
| Expr.fvar .. => pure { expr := (← reduceFVar (← getConfig) e) }
|
||||
| Expr.mvar .. => return { expr := (← instantiateMVars e) }
|
||||
| Expr.fvar .. => return { expr := (← reduceFVar (← getConfig) e) }
|
||||
|
||||
congrDefault (e : Expr) : M Result :=
|
||||
withParent e <| e.withApp fun f args => do
|
||||
|
|
@ -323,13 +323,39 @@ where
|
|||
return { expr := (← dsimp e) }
|
||||
|
||||
simpLet (e : Expr) : M Result := do
|
||||
if (← getConfig).zeta then
|
||||
match e with
|
||||
| Expr.letE _ _ v b _ => return { expr := b.instantiate1 v }
|
||||
| _ => unreachable!
|
||||
else
|
||||
-- TODO: simplify nondependent let-decls
|
||||
return { expr := (← dsimp e) }
|
||||
match e with
|
||||
| Expr.letE n t v b _ =>
|
||||
if (← getConfig).zeta then
|
||||
return { expr := b.instantiate1 v }
|
||||
else
|
||||
withLocalDeclD n t fun x => do
|
||||
let bx := b.instantiate1 x
|
||||
/- The following step is potentially very expensive when we have many nested let-decls.
|
||||
TODO: handle a block of nested let decls in a single pass if this becomes a performance problem. -/
|
||||
if (← isTypeCorrect bx) then
|
||||
let bxType ← whnf (← inferType bx)
|
||||
let rbx ← simp bx
|
||||
let hb? ← match rbx.proof? with
|
||||
| none => pure none
|
||||
| some h => pure (some (← mkLambdaFVars #[x] h))
|
||||
if (← dependsOn bxType x.fvarId!) then
|
||||
/- The type of the body depends on `x`. So, we use `let_body_congr` -/
|
||||
let v' ← dsimp v
|
||||
let e' := mkLet n t v' (← abstract rbx.expr #[x])
|
||||
match hb? with
|
||||
| none => return { expr := e' }
|
||||
| some h => return { expr := e', proof? := some (← mkLetBodyCongr v' h) }
|
||||
else
|
||||
/- The type of the body does not depend on `x`. So, we use `let_congr` -/
|
||||
let rv ← simp v
|
||||
let e' := mkLet n t rv.expr (← abstract rbx.expr #[x])
|
||||
match rv.proof?, hb? with
|
||||
| none, none => return { expr := e' }
|
||||
| some h, none => return { expr := e', proof? := some (← mkLetValCongr (← mkLambdaFVars #[x] rbx.expr) h) }
|
||||
| _, some h => return { expr := e', proof? := some (← mkLetCongr (← rv.getProof) h) }
|
||||
else
|
||||
return { expr := (← dsimp e) }
|
||||
| _ => unreachable!
|
||||
|
||||
cacheResult (cfg : Config) (r : Result) : M Result := do
|
||||
if cfg.memoize then
|
||||
|
|
|
|||
17
stage0/src/Lean/Meta/Tactic/Split.lean
generated
17
stage0/src/Lean/Meta/Tactic/Split.lean
generated
|
|
@ -100,7 +100,7 @@ def splitMatch (mvarId : MVarId) (e : Expr) : MetaM (List MVarId) := do
|
|||
|
||||
/-- Return an `if-then-else` or `match-expr` to split. -/
|
||||
partial def findSplit? (env : Environment) (e : Expr) : Option Expr :=
|
||||
if let some target := e.find? fun e => !e.hasLooseBVars && (e.isIte || e.isDIte || isMatcherAppCore env e) then
|
||||
if let some target := e.find? isCandidate then
|
||||
if e.isIte || e.isDIte then
|
||||
let cond := target.getArg! 1 5
|
||||
-- Try to find a nested `if` in `cond`
|
||||
|
|
@ -109,6 +109,18 @@ partial def findSplit? (env : Environment) (e : Expr) : Option Expr :=
|
|||
some target
|
||||
else
|
||||
none
|
||||
where
|
||||
isCandidate (e : Expr) : Bool := do
|
||||
if e.isIte || e.isDIte then
|
||||
!(e.getArg! 1 5).hasLooseBVars
|
||||
else if let some info := isMatcherAppCore? env e then
|
||||
let args := e.getAppArgs
|
||||
for i in [info.getFirstDiscrPos : info.getFirstDiscrPos + info.numDiscrs] do
|
||||
if args[i].hasLooseBVars then
|
||||
return false
|
||||
return true
|
||||
else
|
||||
false
|
||||
|
||||
end Split
|
||||
|
||||
|
|
@ -121,6 +133,7 @@ def splitTarget? (mvarId : MVarId) : MetaM (Option (List MVarId)) := commitWhenS
|
|||
else
|
||||
splitMatch mvarId e
|
||||
else
|
||||
trace[Meta.Tactic.split] "did not find term to split\n{MessageData.ofGoal mvarId}"
|
||||
return none
|
||||
|
||||
def splitLocalDecl? (mvarId : MVarId) (fvarId : FVarId) : MetaM (Option (List MVarId)) := commitWhenSome? do
|
||||
|
|
@ -137,4 +150,6 @@ def splitLocalDecl? (mvarId : MVarId) (fvarId : FVarId) : MetaM (Option (List MV
|
|||
else
|
||||
return none
|
||||
|
||||
builtin_initialize registerTraceClass `Meta.Tactic.split
|
||||
|
||||
end Lean.Meta
|
||||
|
|
|
|||
2
stage0/src/Lean/Meta/Tactic/SplitIf.lean
generated
2
stage0/src/Lean/Meta/Tactic/SplitIf.lean
generated
|
|
@ -63,7 +63,7 @@ def discharge? (useDecide := false) : Simp.Discharge := fun prop => do
|
|||
|
||||
/-- Return the condition of an `if` expression to case split. -/
|
||||
partial def findIfToSplit? (e : Expr) : Option Expr :=
|
||||
if let some iteApp := e.find? fun e => !e.hasLooseBVars && (e.isIte || e.isDIte) then
|
||||
if let some iteApp := e.find? fun e => (e.isIte || e.isDIte) && !(e.getArg! 1 5).hasLooseBVars then
|
||||
let cond := iteApp.getArg! 1 5
|
||||
-- Try to find a nested `if` in `cond`
|
||||
findIfToSplit? cond |>.getD cond
|
||||
|
|
|
|||
|
|
@ -407,6 +407,21 @@ def delabAppMatch : Delab := whenPPOption getPPNotation <| whenPPOption getPPMat
|
|||
`(match $[$st.discrs:term],* with $[| $pats,* => $st.rhss]*)
|
||||
Syntax.mkApp stx st.moreArgs
|
||||
|
||||
/--
|
||||
Delaborate applications of the form `(fun x => b) v` as `let_fun x := v; b`
|
||||
-/
|
||||
def delabLetFun : Delab := do
|
||||
let stxV ← withAppArg delab
|
||||
withAppFn do
|
||||
let Expr.lam n t b _ ← getExpr | unreachable!
|
||||
let n ← getUnusedName n b
|
||||
let stxB ← withBindingBody n delab
|
||||
if ← getPPOption getPPLetVarTypes <||> getPPOption getPPAnalysisLetVarType then
|
||||
let stxT ← withBindingDomain delab
|
||||
`(let_fun $(mkIdent n) : $stxT := $stxV; $stxB)
|
||||
else
|
||||
`(let_fun $(mkIdent n) := $stxV; $stxB)
|
||||
|
||||
@[builtinDelab mdata]
|
||||
def delabMData : Delab := do
|
||||
if let some _ := Lean.Meta.Match.inaccessible? (← getExpr) then
|
||||
|
|
@ -415,6 +430,8 @@ def delabMData : Delab := do
|
|||
`(.($s)) -- We only include the inaccessible annotation when we are delaborating patterns
|
||||
else
|
||||
return s
|
||||
else if isLetFun (← getExpr) then
|
||||
withMDataExpr <| delabLetFun
|
||||
else if let some _ := isLHSGoal? (← getExpr) then
|
||||
withMDataExpr <| withAppFn <| withAppArg <| delab
|
||||
else
|
||||
|
|
|
|||
13
stage0/src/library/compiler/compiler.cpp
generated
13
stage0/src/library/compiler/compiler.cpp
generated
|
|
@ -165,6 +165,10 @@ expr csimp_replace_constants(environment const & env, expr const & e) {
|
|||
return expr(lean_csimp_replace_constants(env.to_obj_arg(), e.to_obj_arg()));
|
||||
}
|
||||
|
||||
bool is_matcher(environment const & env, comp_decls const & ds) {
|
||||
return length(ds) == 1 && is_matcher(env, head(ds).fst());
|
||||
}
|
||||
|
||||
environment compile(environment const & env, options const & opts, names cs) {
|
||||
if (!is_codegen_enabled(opts))
|
||||
return env;
|
||||
|
|
@ -222,6 +226,15 @@ environment compile(environment const & env, options const & opts, names cs) {
|
|||
ds = apply(max_sharing, ds);
|
||||
trace_compiler(name({"compiler", "stage1"}), ds);
|
||||
new_env = cache_stage1(new_env, ds);
|
||||
if (is_matcher(new_env, ds)) {
|
||||
/* Auxiliary matcher applications are marked as inlined, and are always fully applied
|
||||
(if users don't use them manually). So, we skip code generation for them.
|
||||
By caching stage1, we make sure we have all information we need to inline them.
|
||||
|
||||
TODO: we should have a "[strong_inline]" annotation that will inline a definition even
|
||||
when it is partially applied. Then, we can mark all `match` auxiliary functions as `[strong_inline]` */
|
||||
return new_env;
|
||||
}
|
||||
std::tie(new_env, ds) = specialize(new_env, ds, cfg);
|
||||
lean_assert(lcnf_check_let_decls(new_env, ds));
|
||||
trace_compiler(name({"compiler", "specialize"}), ds);
|
||||
|
|
|
|||
7
stage0/src/library/compiler/csimp.cpp
generated
7
stage0/src/library/compiler/csimp.cpp
generated
|
|
@ -1729,7 +1729,12 @@ class csimp_fn {
|
|||
return none_expr();
|
||||
}
|
||||
if (!inline_if_reduce_attr && is_recursive(const_name(fn))) return none_expr();
|
||||
if (uses_unsafe_inductive(c)) return none_expr();
|
||||
if (!is_matcher(env(), const_name(fn))) {
|
||||
// Hack for test `inliner_loop`. We don't generate code for auxiliary matcher applications.
|
||||
// However, they are safe to be inline even when they use unsafe inductive types.
|
||||
// REMARK: the to be implemented `[strong_inline]` attribute should not be used in unsafe code.
|
||||
if (uses_unsafe_inductive(c)) return none_expr();
|
||||
}
|
||||
lean_trace(name({"compiler", "inline"}), tout() << const_name(fn) << "\n";);
|
||||
expr new_fn = instantiate_value_lparams(*info, const_levels(fn));
|
||||
if (inline_if_reduce_attr && !inline_attr) {
|
||||
|
|
|
|||
6
stage0/src/library/compiler/util.h
generated
6
stage0/src/library/compiler/util.h
generated
|
|
@ -198,6 +198,12 @@ optional<unsigned> is_enum_type(environment const & env, expr const & type);
|
|||
|
||||
// =======================================
|
||||
|
||||
extern "C" uint8 lean_is_matcher(object* env, object* n);
|
||||
|
||||
inline bool is_matcher(environment const & env, name const & n) {
|
||||
return lean_is_matcher(env.to_obj_arg(), n.to_obj_arg());
|
||||
}
|
||||
|
||||
void initialize_compiler_util();
|
||||
void finalize_compiler_util();
|
||||
}
|
||||
|
|
|
|||
624
stage0/stdlib/Init/Classical.c
generated
624
stage0/stdlib/Init/Classical.c
generated
File diff suppressed because it is too large
Load diff
92
stage0/stdlib/Lean/Elab/Binders.c
generated
92
stage0/stdlib/Lean/Elab/Binders.c
generated
|
|
@ -147,6 +147,7 @@ lean_object* lean_array_get_size(lean_object*);
|
|||
lean_object* l_Lean_Elab_Term_expandLetEqnsDecl(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_elabLetDelayedDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_elabBinderViews_loop___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_mkLetFunAnnotation(lean_object*);
|
||||
lean_object* lean_string_append(lean_object*, lean_object*);
|
||||
lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_quoteAutoTactic___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isClass_x3f(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -270,7 +271,7 @@ lean_object* l_Lean_replaceRef(lean_object*, lean_object*);
|
|||
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_addLocalVarInfo(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_mkLambdaFVars(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5652_(lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5654_(lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_1125_(lean_object*);
|
||||
static lean_object* l___regBuiltin_Lean_Elab_Term_elabDepArrow___closed__4;
|
||||
lean_object* l_Lean_Elab_Term_elabLetDeclAux___lambda__6(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -24517,7 +24518,7 @@ lean_inc(x_5);
|
|||
x_21 = l_Lean_Meta_withLocalDecl___at___private_Lean_Elab_Term_0__Lean_Elab_Term_elabImplicitLambda_loop___spec__1___rarg(x_18, x_20, x_5, x_19, x_11, x_12, x_13, x_14, x_15, x_16, x_17);
|
||||
if (lean_obj_tag(x_21) == 0)
|
||||
{
|
||||
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25;
|
||||
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
|
||||
x_22 = lean_ctor_get(x_21, 0);
|
||||
lean_inc(x_22);
|
||||
x_23 = lean_ctor_get(x_21, 1);
|
||||
|
|
@ -24525,12 +24526,13 @@ lean_inc(x_23);
|
|||
lean_dec(x_21);
|
||||
lean_inc(x_4);
|
||||
x_24 = l_Lean_mkApp(x_22, x_4);
|
||||
x_25 = l_Lean_Elab_Term_elabLetDeclAux___lambda__4(x_1, x_2, x_3, x_4, x_5, x_24, x_11, x_12, x_13, x_14, x_15, x_16, x_23);
|
||||
return x_25;
|
||||
x_25 = l_Lean_mkLetFunAnnotation(x_24);
|
||||
x_26 = l_Lean_Elab_Term_elabLetDeclAux___lambda__4(x_1, x_2, x_3, x_4, x_5, x_25, x_11, x_12, x_13, x_14, x_15, x_16, x_23);
|
||||
return x_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_26;
|
||||
uint8_t x_27;
|
||||
lean_dec(x_16);
|
||||
lean_dec(x_15);
|
||||
lean_dec(x_14);
|
||||
|
|
@ -24541,34 +24543,34 @@ lean_dec(x_5);
|
|||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
x_26 = !lean_is_exclusive(x_21);
|
||||
if (x_26 == 0)
|
||||
x_27 = !lean_is_exclusive(x_21);
|
||||
if (x_27 == 0)
|
||||
{
|
||||
return x_21;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_27; lean_object* x_28; lean_object* x_29;
|
||||
x_27 = lean_ctor_get(x_21, 0);
|
||||
x_28 = lean_ctor_get(x_21, 1);
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30;
|
||||
x_28 = lean_ctor_get(x_21, 0);
|
||||
x_29 = lean_ctor_get(x_21, 1);
|
||||
lean_inc(x_29);
|
||||
lean_inc(x_28);
|
||||
lean_inc(x_27);
|
||||
lean_dec(x_21);
|
||||
x_29 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_29, 0, x_27);
|
||||
lean_ctor_set(x_29, 1, x_28);
|
||||
return x_29;
|
||||
x_30 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_30, 0, x_28);
|
||||
lean_ctor_set(x_30, 1, x_29);
|
||||
return x_30;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31; lean_object* x_32;
|
||||
x_30 = l_Lean_Syntax_getId(x_7);
|
||||
x_31 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabLetDeclAux___lambda__5), 11, 3);
|
||||
lean_closure_set(x_31, 0, x_7);
|
||||
lean_closure_set(x_31, 1, x_8);
|
||||
lean_closure_set(x_31, 2, x_9);
|
||||
lean_object* x_31; lean_object* x_32; lean_object* x_33;
|
||||
x_31 = l_Lean_Syntax_getId(x_7);
|
||||
x_32 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabLetDeclAux___lambda__5), 11, 3);
|
||||
lean_closure_set(x_32, 0, x_7);
|
||||
lean_closure_set(x_32, 1, x_8);
|
||||
lean_closure_set(x_32, 2, x_9);
|
||||
lean_inc(x_16);
|
||||
lean_inc(x_15);
|
||||
lean_inc(x_14);
|
||||
|
|
@ -24577,21 +24579,21 @@ lean_inc(x_12);
|
|||
lean_inc(x_11);
|
||||
lean_inc(x_4);
|
||||
lean_inc(x_5);
|
||||
x_32 = l_Lean_Meta_withLetDecl___at_Lean_Elab_Term_elabLetDeclAux___spec__2___rarg(x_30, x_5, x_4, x_31, x_11, x_12, x_13, x_14, x_15, x_16, x_17);
|
||||
if (lean_obj_tag(x_32) == 0)
|
||||
x_33 = l_Lean_Meta_withLetDecl___at_Lean_Elab_Term_elabLetDeclAux___spec__2___rarg(x_31, x_5, x_4, x_32, x_11, x_12, x_13, x_14, x_15, x_16, x_17);
|
||||
if (lean_obj_tag(x_33) == 0)
|
||||
{
|
||||
lean_object* x_33; lean_object* x_34; lean_object* x_35;
|
||||
x_33 = lean_ctor_get(x_32, 0);
|
||||
lean_inc(x_33);
|
||||
x_34 = lean_ctor_get(x_32, 1);
|
||||
lean_object* x_34; lean_object* x_35; lean_object* x_36;
|
||||
x_34 = lean_ctor_get(x_33, 0);
|
||||
lean_inc(x_34);
|
||||
lean_dec(x_32);
|
||||
x_35 = l_Lean_Elab_Term_elabLetDeclAux___lambda__4(x_1, x_2, x_3, x_4, x_5, x_33, x_11, x_12, x_13, x_14, x_15, x_16, x_34);
|
||||
return x_35;
|
||||
x_35 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_35);
|
||||
lean_dec(x_33);
|
||||
x_36 = l_Lean_Elab_Term_elabLetDeclAux___lambda__4(x_1, x_2, x_3, x_4, x_5, x_34, x_11, x_12, x_13, x_14, x_15, x_16, x_35);
|
||||
return x_36;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_36;
|
||||
uint8_t x_37;
|
||||
lean_dec(x_16);
|
||||
lean_dec(x_15);
|
||||
lean_dec(x_14);
|
||||
|
|
@ -24602,23 +24604,23 @@ lean_dec(x_5);
|
|||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
x_36 = !lean_is_exclusive(x_32);
|
||||
if (x_36 == 0)
|
||||
x_37 = !lean_is_exclusive(x_33);
|
||||
if (x_37 == 0)
|
||||
{
|
||||
return x_32;
|
||||
return x_33;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_37; lean_object* x_38; lean_object* x_39;
|
||||
x_37 = lean_ctor_get(x_32, 0);
|
||||
x_38 = lean_ctor_get(x_32, 1);
|
||||
lean_object* x_38; lean_object* x_39; lean_object* x_40;
|
||||
x_38 = lean_ctor_get(x_33, 0);
|
||||
x_39 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_39);
|
||||
lean_inc(x_38);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_32);
|
||||
x_39 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_39, 0, x_37);
|
||||
lean_ctor_set(x_39, 1, x_38);
|
||||
return x_39;
|
||||
lean_dec(x_33);
|
||||
x_40 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_40, 0, x_38);
|
||||
lean_ctor_set(x_40, 1, x_39);
|
||||
return x_40;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26058,7 +26060,7 @@ x_6 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_5, x_1);
|
|||
return x_6;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5652_(lean_object* x_1) {
|
||||
lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5654_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
|
|
@ -26612,7 +26614,7 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabLetDelayedDecl___closed__
|
|||
res = l___regBuiltin_Lean_Elab_Term_elabLetDelayedDecl(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5652_(lean_io_mk_world());
|
||||
res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5654_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
|
|
|
|||
758
stage0/stdlib/Lean/Elab/Command.c
generated
758
stage0/stdlib/Lean/Elab/Command.c
generated
|
|
@ -137,6 +137,7 @@ lean_object* l_Lean_Elab_Command_runTermElabM___rarg___lambda__1(lean_object*, l
|
|||
lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Elab_Command_0__Lean_Elab_Command_addTraceAsMessagesCore___spec__12(lean_object*, lean_object*, size_t, size_t, lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_liftEIO(lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_addLinter(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_withScope_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Command_elabCommand___spec__2___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_checkIfShadowingStructureField___at_Lean_Elab_Command_expandDeclId___spec__3(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_throwAlreadyDeclaredUniverseLevel___at_Lean_Elab_Command_addUnivLevel___spec__1___closed__4;
|
||||
|
|
@ -203,6 +204,7 @@ lean_object* l_Lean_Syntax_hasMissing(lean_object*);
|
|||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Command_liftTermElabM___spec__6(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Command_liftTermElabM___rarg___closed__5;
|
||||
lean_object* l_Lean_Elab_Command_withScope_match__1(lean_object*);
|
||||
lean_object* l___private_Lean_Elab_Command_0__Lean_Elab_Command_getVarDecls(lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_getLevelNames___rarg___boxed(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Command_commandElabAttribute___closed__13;
|
||||
|
|
@ -466,6 +468,7 @@ lean_object* l_Lean_Elab_Command_Context_ref___default;
|
|||
lean_object* l_Lean_Elab_Command_instMonadLogCommandElabM___lambda__2(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_getMainModule___rarg___boxed(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Command_getBracketedBinderIds___closed__6;
|
||||
lean_object* l_Lean_Elab_Command_withScope___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Command_commandElabAttribute___closed__9;
|
||||
lean_object* l_Lean_Elab_Command_addUnivLevel(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabCommandTopLevel___spec__5(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -537,6 +540,7 @@ static lean_object* l_Lean_Elab_Command_Scope_varDecls___default___closed__1;
|
|||
static lean_object* l_Lean_Elab_Command_State_infoState___default___closed__3;
|
||||
lean_object* l_Lean_Elab_Command_runTermElabM_match__1(lean_object*);
|
||||
lean_object* l___private_Lean_Elab_Command_0__Lean_Elab_Command_mkTermContext___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_withScope(lean_object*);
|
||||
extern lean_object* l_Lean_Elab_pp_macroStack;
|
||||
lean_object* l_Lean_Elab_Command_getMainModule___rarg(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Command_instMonadLiftTIOCommandElabM(lean_object*);
|
||||
|
|
@ -18923,6 +18927,760 @@ lean_dec(x_2);
|
|||
return x_5;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Command_withScope_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
if (lean_obj_tag(x_1) == 0)
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5;
|
||||
lean_dec(x_3);
|
||||
x_4 = lean_box(0);
|
||||
x_5 = lean_apply_1(x_2, x_4);
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
lean_dec(x_2);
|
||||
x_6 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_6);
|
||||
x_7 = lean_ctor_get(x_1, 1);
|
||||
lean_inc(x_7);
|
||||
lean_dec(x_1);
|
||||
x_8 = lean_apply_2(x_3, x_6, x_7);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Command_withScope_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_Elab_Command_withScope_match__1___rarg), 3, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Command_withScope___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
x_6 = lean_st_ref_get(x_4, x_5);
|
||||
x_7 = lean_ctor_get(x_6, 0);
|
||||
lean_inc(x_7);
|
||||
x_8 = lean_ctor_get(x_7, 2);
|
||||
lean_inc(x_8);
|
||||
lean_dec(x_7);
|
||||
if (lean_obj_tag(x_8) == 0)
|
||||
{
|
||||
lean_object* x_9; lean_object* x_10;
|
||||
lean_dec(x_1);
|
||||
x_9 = lean_ctor_get(x_6, 1);
|
||||
lean_inc(x_9);
|
||||
lean_dec(x_6);
|
||||
x_10 = lean_apply_3(x_2, x_3, x_4, x_9);
|
||||
return x_10;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_11; uint8_t x_12;
|
||||
x_11 = lean_ctor_get(x_6, 1);
|
||||
lean_inc(x_11);
|
||||
lean_dec(x_6);
|
||||
x_12 = !lean_is_exclusive(x_8);
|
||||
if (x_12 == 0)
|
||||
{
|
||||
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18;
|
||||
x_13 = lean_ctor_get(x_8, 0);
|
||||
x_14 = lean_ctor_get(x_8, 1);
|
||||
x_15 = lean_st_ref_take(x_4, x_11);
|
||||
x_16 = lean_ctor_get(x_15, 0);
|
||||
lean_inc(x_16);
|
||||
x_17 = lean_ctor_get(x_15, 1);
|
||||
lean_inc(x_17);
|
||||
lean_dec(x_15);
|
||||
x_18 = !lean_is_exclusive(x_16);
|
||||
if (x_18 == 0)
|
||||
{
|
||||
lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23;
|
||||
x_19 = lean_ctor_get(x_16, 2);
|
||||
lean_dec(x_19);
|
||||
lean_inc(x_13);
|
||||
x_20 = lean_apply_1(x_1, x_13);
|
||||
lean_inc(x_14);
|
||||
lean_ctor_set(x_8, 0, x_20);
|
||||
lean_ctor_set(x_16, 2, x_8);
|
||||
x_21 = lean_st_ref_set(x_4, x_16, x_17);
|
||||
x_22 = lean_ctor_get(x_21, 1);
|
||||
lean_inc(x_22);
|
||||
lean_dec(x_21);
|
||||
lean_inc(x_4);
|
||||
x_23 = lean_apply_3(x_2, x_3, x_4, x_22);
|
||||
if (lean_obj_tag(x_23) == 0)
|
||||
{
|
||||
lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29;
|
||||
x_24 = lean_ctor_get(x_23, 0);
|
||||
lean_inc(x_24);
|
||||
x_25 = lean_ctor_get(x_23, 1);
|
||||
lean_inc(x_25);
|
||||
lean_dec(x_23);
|
||||
x_26 = lean_st_ref_take(x_4, x_25);
|
||||
x_27 = lean_ctor_get(x_26, 0);
|
||||
lean_inc(x_27);
|
||||
x_28 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_28);
|
||||
lean_dec(x_26);
|
||||
x_29 = !lean_is_exclusive(x_27);
|
||||
if (x_29 == 0)
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33;
|
||||
x_30 = lean_ctor_get(x_27, 2);
|
||||
lean_dec(x_30);
|
||||
x_31 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_31, 0, x_13);
|
||||
lean_ctor_set(x_31, 1, x_14);
|
||||
lean_ctor_set(x_27, 2, x_31);
|
||||
x_32 = lean_st_ref_set(x_4, x_27, x_28);
|
||||
lean_dec(x_4);
|
||||
x_33 = !lean_is_exclusive(x_32);
|
||||
if (x_33 == 0)
|
||||
{
|
||||
lean_object* x_34;
|
||||
x_34 = lean_ctor_get(x_32, 0);
|
||||
lean_dec(x_34);
|
||||
lean_ctor_set(x_32, 0, x_24);
|
||||
return x_32;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_35; lean_object* x_36;
|
||||
x_35 = lean_ctor_get(x_32, 1);
|
||||
lean_inc(x_35);
|
||||
lean_dec(x_32);
|
||||
x_36 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_36, 0, x_24);
|
||||
lean_ctor_set(x_36, 1, x_35);
|
||||
return x_36;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50;
|
||||
x_37 = lean_ctor_get(x_27, 0);
|
||||
x_38 = lean_ctor_get(x_27, 1);
|
||||
x_39 = lean_ctor_get(x_27, 3);
|
||||
x_40 = lean_ctor_get(x_27, 4);
|
||||
x_41 = lean_ctor_get(x_27, 5);
|
||||
x_42 = lean_ctor_get(x_27, 6);
|
||||
x_43 = lean_ctor_get(x_27, 7);
|
||||
x_44 = lean_ctor_get(x_27, 8);
|
||||
lean_inc(x_44);
|
||||
lean_inc(x_43);
|
||||
lean_inc(x_42);
|
||||
lean_inc(x_41);
|
||||
lean_inc(x_40);
|
||||
lean_inc(x_39);
|
||||
lean_inc(x_38);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_27);
|
||||
x_45 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_45, 0, x_13);
|
||||
lean_ctor_set(x_45, 1, x_14);
|
||||
x_46 = lean_alloc_ctor(0, 9, 0);
|
||||
lean_ctor_set(x_46, 0, x_37);
|
||||
lean_ctor_set(x_46, 1, x_38);
|
||||
lean_ctor_set(x_46, 2, x_45);
|
||||
lean_ctor_set(x_46, 3, x_39);
|
||||
lean_ctor_set(x_46, 4, x_40);
|
||||
lean_ctor_set(x_46, 5, x_41);
|
||||
lean_ctor_set(x_46, 6, x_42);
|
||||
lean_ctor_set(x_46, 7, x_43);
|
||||
lean_ctor_set(x_46, 8, x_44);
|
||||
x_47 = lean_st_ref_set(x_4, x_46, x_28);
|
||||
lean_dec(x_4);
|
||||
x_48 = lean_ctor_get(x_47, 1);
|
||||
lean_inc(x_48);
|
||||
if (lean_is_exclusive(x_47)) {
|
||||
lean_ctor_release(x_47, 0);
|
||||
lean_ctor_release(x_47, 1);
|
||||
x_49 = x_47;
|
||||
} else {
|
||||
lean_dec_ref(x_47);
|
||||
x_49 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_49)) {
|
||||
x_50 = lean_alloc_ctor(0, 2, 0);
|
||||
} else {
|
||||
x_50 = x_49;
|
||||
}
|
||||
lean_ctor_set(x_50, 0, x_24);
|
||||
lean_ctor_set(x_50, 1, x_48);
|
||||
return x_50;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; uint8_t x_56;
|
||||
x_51 = lean_ctor_get(x_23, 0);
|
||||
lean_inc(x_51);
|
||||
x_52 = lean_ctor_get(x_23, 1);
|
||||
lean_inc(x_52);
|
||||
lean_dec(x_23);
|
||||
x_53 = lean_st_ref_take(x_4, x_52);
|
||||
x_54 = lean_ctor_get(x_53, 0);
|
||||
lean_inc(x_54);
|
||||
x_55 = lean_ctor_get(x_53, 1);
|
||||
lean_inc(x_55);
|
||||
lean_dec(x_53);
|
||||
x_56 = !lean_is_exclusive(x_54);
|
||||
if (x_56 == 0)
|
||||
{
|
||||
lean_object* x_57; lean_object* x_58; lean_object* x_59; uint8_t x_60;
|
||||
x_57 = lean_ctor_get(x_54, 2);
|
||||
lean_dec(x_57);
|
||||
x_58 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_58, 0, x_13);
|
||||
lean_ctor_set(x_58, 1, x_14);
|
||||
lean_ctor_set(x_54, 2, x_58);
|
||||
x_59 = lean_st_ref_set(x_4, x_54, x_55);
|
||||
lean_dec(x_4);
|
||||
x_60 = !lean_is_exclusive(x_59);
|
||||
if (x_60 == 0)
|
||||
{
|
||||
lean_object* x_61;
|
||||
x_61 = lean_ctor_get(x_59, 0);
|
||||
lean_dec(x_61);
|
||||
lean_ctor_set_tag(x_59, 1);
|
||||
lean_ctor_set(x_59, 0, x_51);
|
||||
return x_59;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_62; lean_object* x_63;
|
||||
x_62 = lean_ctor_get(x_59, 1);
|
||||
lean_inc(x_62);
|
||||
lean_dec(x_59);
|
||||
x_63 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_63, 0, x_51);
|
||||
lean_ctor_set(x_63, 1, x_62);
|
||||
return x_63;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77;
|
||||
x_64 = lean_ctor_get(x_54, 0);
|
||||
x_65 = lean_ctor_get(x_54, 1);
|
||||
x_66 = lean_ctor_get(x_54, 3);
|
||||
x_67 = lean_ctor_get(x_54, 4);
|
||||
x_68 = lean_ctor_get(x_54, 5);
|
||||
x_69 = lean_ctor_get(x_54, 6);
|
||||
x_70 = lean_ctor_get(x_54, 7);
|
||||
x_71 = lean_ctor_get(x_54, 8);
|
||||
lean_inc(x_71);
|
||||
lean_inc(x_70);
|
||||
lean_inc(x_69);
|
||||
lean_inc(x_68);
|
||||
lean_inc(x_67);
|
||||
lean_inc(x_66);
|
||||
lean_inc(x_65);
|
||||
lean_inc(x_64);
|
||||
lean_dec(x_54);
|
||||
x_72 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_72, 0, x_13);
|
||||
lean_ctor_set(x_72, 1, x_14);
|
||||
x_73 = lean_alloc_ctor(0, 9, 0);
|
||||
lean_ctor_set(x_73, 0, x_64);
|
||||
lean_ctor_set(x_73, 1, x_65);
|
||||
lean_ctor_set(x_73, 2, x_72);
|
||||
lean_ctor_set(x_73, 3, x_66);
|
||||
lean_ctor_set(x_73, 4, x_67);
|
||||
lean_ctor_set(x_73, 5, x_68);
|
||||
lean_ctor_set(x_73, 6, x_69);
|
||||
lean_ctor_set(x_73, 7, x_70);
|
||||
lean_ctor_set(x_73, 8, x_71);
|
||||
x_74 = lean_st_ref_set(x_4, x_73, x_55);
|
||||
lean_dec(x_4);
|
||||
x_75 = lean_ctor_get(x_74, 1);
|
||||
lean_inc(x_75);
|
||||
if (lean_is_exclusive(x_74)) {
|
||||
lean_ctor_release(x_74, 0);
|
||||
lean_ctor_release(x_74, 1);
|
||||
x_76 = x_74;
|
||||
} else {
|
||||
lean_dec_ref(x_74);
|
||||
x_76 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_76)) {
|
||||
x_77 = lean_alloc_ctor(1, 2, 0);
|
||||
} else {
|
||||
x_77 = x_76;
|
||||
lean_ctor_set_tag(x_77, 1);
|
||||
}
|
||||
lean_ctor_set(x_77, 0, x_51);
|
||||
lean_ctor_set(x_77, 1, x_75);
|
||||
return x_77;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90;
|
||||
x_78 = lean_ctor_get(x_16, 0);
|
||||
x_79 = lean_ctor_get(x_16, 1);
|
||||
x_80 = lean_ctor_get(x_16, 3);
|
||||
x_81 = lean_ctor_get(x_16, 4);
|
||||
x_82 = lean_ctor_get(x_16, 5);
|
||||
x_83 = lean_ctor_get(x_16, 6);
|
||||
x_84 = lean_ctor_get(x_16, 7);
|
||||
x_85 = lean_ctor_get(x_16, 8);
|
||||
lean_inc(x_85);
|
||||
lean_inc(x_84);
|
||||
lean_inc(x_83);
|
||||
lean_inc(x_82);
|
||||
lean_inc(x_81);
|
||||
lean_inc(x_80);
|
||||
lean_inc(x_79);
|
||||
lean_inc(x_78);
|
||||
lean_dec(x_16);
|
||||
lean_inc(x_13);
|
||||
x_86 = lean_apply_1(x_1, x_13);
|
||||
lean_inc(x_14);
|
||||
lean_ctor_set(x_8, 0, x_86);
|
||||
x_87 = lean_alloc_ctor(0, 9, 0);
|
||||
lean_ctor_set(x_87, 0, x_78);
|
||||
lean_ctor_set(x_87, 1, x_79);
|
||||
lean_ctor_set(x_87, 2, x_8);
|
||||
lean_ctor_set(x_87, 3, x_80);
|
||||
lean_ctor_set(x_87, 4, x_81);
|
||||
lean_ctor_set(x_87, 5, x_82);
|
||||
lean_ctor_set(x_87, 6, x_83);
|
||||
lean_ctor_set(x_87, 7, x_84);
|
||||
lean_ctor_set(x_87, 8, x_85);
|
||||
x_88 = lean_st_ref_set(x_4, x_87, x_17);
|
||||
x_89 = lean_ctor_get(x_88, 1);
|
||||
lean_inc(x_89);
|
||||
lean_dec(x_88);
|
||||
lean_inc(x_4);
|
||||
x_90 = lean_apply_3(x_2, x_3, x_4, x_89);
|
||||
if (lean_obj_tag(x_90) == 0)
|
||||
{
|
||||
lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110;
|
||||
x_91 = lean_ctor_get(x_90, 0);
|
||||
lean_inc(x_91);
|
||||
x_92 = lean_ctor_get(x_90, 1);
|
||||
lean_inc(x_92);
|
||||
lean_dec(x_90);
|
||||
x_93 = lean_st_ref_take(x_4, x_92);
|
||||
x_94 = lean_ctor_get(x_93, 0);
|
||||
lean_inc(x_94);
|
||||
x_95 = lean_ctor_get(x_93, 1);
|
||||
lean_inc(x_95);
|
||||
lean_dec(x_93);
|
||||
x_96 = lean_ctor_get(x_94, 0);
|
||||
lean_inc(x_96);
|
||||
x_97 = lean_ctor_get(x_94, 1);
|
||||
lean_inc(x_97);
|
||||
x_98 = lean_ctor_get(x_94, 3);
|
||||
lean_inc(x_98);
|
||||
x_99 = lean_ctor_get(x_94, 4);
|
||||
lean_inc(x_99);
|
||||
x_100 = lean_ctor_get(x_94, 5);
|
||||
lean_inc(x_100);
|
||||
x_101 = lean_ctor_get(x_94, 6);
|
||||
lean_inc(x_101);
|
||||
x_102 = lean_ctor_get(x_94, 7);
|
||||
lean_inc(x_102);
|
||||
x_103 = lean_ctor_get(x_94, 8);
|
||||
lean_inc(x_103);
|
||||
if (lean_is_exclusive(x_94)) {
|
||||
lean_ctor_release(x_94, 0);
|
||||
lean_ctor_release(x_94, 1);
|
||||
lean_ctor_release(x_94, 2);
|
||||
lean_ctor_release(x_94, 3);
|
||||
lean_ctor_release(x_94, 4);
|
||||
lean_ctor_release(x_94, 5);
|
||||
lean_ctor_release(x_94, 6);
|
||||
lean_ctor_release(x_94, 7);
|
||||
lean_ctor_release(x_94, 8);
|
||||
x_104 = x_94;
|
||||
} else {
|
||||
lean_dec_ref(x_94);
|
||||
x_104 = lean_box(0);
|
||||
}
|
||||
x_105 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_105, 0, x_13);
|
||||
lean_ctor_set(x_105, 1, x_14);
|
||||
if (lean_is_scalar(x_104)) {
|
||||
x_106 = lean_alloc_ctor(0, 9, 0);
|
||||
} else {
|
||||
x_106 = x_104;
|
||||
}
|
||||
lean_ctor_set(x_106, 0, x_96);
|
||||
lean_ctor_set(x_106, 1, x_97);
|
||||
lean_ctor_set(x_106, 2, x_105);
|
||||
lean_ctor_set(x_106, 3, x_98);
|
||||
lean_ctor_set(x_106, 4, x_99);
|
||||
lean_ctor_set(x_106, 5, x_100);
|
||||
lean_ctor_set(x_106, 6, x_101);
|
||||
lean_ctor_set(x_106, 7, x_102);
|
||||
lean_ctor_set(x_106, 8, x_103);
|
||||
x_107 = lean_st_ref_set(x_4, x_106, x_95);
|
||||
lean_dec(x_4);
|
||||
x_108 = lean_ctor_get(x_107, 1);
|
||||
lean_inc(x_108);
|
||||
if (lean_is_exclusive(x_107)) {
|
||||
lean_ctor_release(x_107, 0);
|
||||
lean_ctor_release(x_107, 1);
|
||||
x_109 = x_107;
|
||||
} else {
|
||||
lean_dec_ref(x_107);
|
||||
x_109 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_109)) {
|
||||
x_110 = lean_alloc_ctor(0, 2, 0);
|
||||
} else {
|
||||
x_110 = x_109;
|
||||
}
|
||||
lean_ctor_set(x_110, 0, x_91);
|
||||
lean_ctor_set(x_110, 1, x_108);
|
||||
return x_110;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130;
|
||||
x_111 = lean_ctor_get(x_90, 0);
|
||||
lean_inc(x_111);
|
||||
x_112 = lean_ctor_get(x_90, 1);
|
||||
lean_inc(x_112);
|
||||
lean_dec(x_90);
|
||||
x_113 = lean_st_ref_take(x_4, x_112);
|
||||
x_114 = lean_ctor_get(x_113, 0);
|
||||
lean_inc(x_114);
|
||||
x_115 = lean_ctor_get(x_113, 1);
|
||||
lean_inc(x_115);
|
||||
lean_dec(x_113);
|
||||
x_116 = lean_ctor_get(x_114, 0);
|
||||
lean_inc(x_116);
|
||||
x_117 = lean_ctor_get(x_114, 1);
|
||||
lean_inc(x_117);
|
||||
x_118 = lean_ctor_get(x_114, 3);
|
||||
lean_inc(x_118);
|
||||
x_119 = lean_ctor_get(x_114, 4);
|
||||
lean_inc(x_119);
|
||||
x_120 = lean_ctor_get(x_114, 5);
|
||||
lean_inc(x_120);
|
||||
x_121 = lean_ctor_get(x_114, 6);
|
||||
lean_inc(x_121);
|
||||
x_122 = lean_ctor_get(x_114, 7);
|
||||
lean_inc(x_122);
|
||||
x_123 = lean_ctor_get(x_114, 8);
|
||||
lean_inc(x_123);
|
||||
if (lean_is_exclusive(x_114)) {
|
||||
lean_ctor_release(x_114, 0);
|
||||
lean_ctor_release(x_114, 1);
|
||||
lean_ctor_release(x_114, 2);
|
||||
lean_ctor_release(x_114, 3);
|
||||
lean_ctor_release(x_114, 4);
|
||||
lean_ctor_release(x_114, 5);
|
||||
lean_ctor_release(x_114, 6);
|
||||
lean_ctor_release(x_114, 7);
|
||||
lean_ctor_release(x_114, 8);
|
||||
x_124 = x_114;
|
||||
} else {
|
||||
lean_dec_ref(x_114);
|
||||
x_124 = lean_box(0);
|
||||
}
|
||||
x_125 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_125, 0, x_13);
|
||||
lean_ctor_set(x_125, 1, x_14);
|
||||
if (lean_is_scalar(x_124)) {
|
||||
x_126 = lean_alloc_ctor(0, 9, 0);
|
||||
} else {
|
||||
x_126 = x_124;
|
||||
}
|
||||
lean_ctor_set(x_126, 0, x_116);
|
||||
lean_ctor_set(x_126, 1, x_117);
|
||||
lean_ctor_set(x_126, 2, x_125);
|
||||
lean_ctor_set(x_126, 3, x_118);
|
||||
lean_ctor_set(x_126, 4, x_119);
|
||||
lean_ctor_set(x_126, 5, x_120);
|
||||
lean_ctor_set(x_126, 6, x_121);
|
||||
lean_ctor_set(x_126, 7, x_122);
|
||||
lean_ctor_set(x_126, 8, x_123);
|
||||
x_127 = lean_st_ref_set(x_4, x_126, x_115);
|
||||
lean_dec(x_4);
|
||||
x_128 = lean_ctor_get(x_127, 1);
|
||||
lean_inc(x_128);
|
||||
if (lean_is_exclusive(x_127)) {
|
||||
lean_ctor_release(x_127, 0);
|
||||
lean_ctor_release(x_127, 1);
|
||||
x_129 = x_127;
|
||||
} else {
|
||||
lean_dec_ref(x_127);
|
||||
x_129 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_129)) {
|
||||
x_130 = lean_alloc_ctor(1, 2, 0);
|
||||
} else {
|
||||
x_130 = x_129;
|
||||
lean_ctor_set_tag(x_130, 1);
|
||||
}
|
||||
lean_ctor_set(x_130, 0, x_111);
|
||||
lean_ctor_set(x_130, 1, x_128);
|
||||
return x_130;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; lean_object* x_150;
|
||||
x_131 = lean_ctor_get(x_8, 0);
|
||||
x_132 = lean_ctor_get(x_8, 1);
|
||||
lean_inc(x_132);
|
||||
lean_inc(x_131);
|
||||
lean_dec(x_8);
|
||||
x_133 = lean_st_ref_take(x_4, x_11);
|
||||
x_134 = lean_ctor_get(x_133, 0);
|
||||
lean_inc(x_134);
|
||||
x_135 = lean_ctor_get(x_133, 1);
|
||||
lean_inc(x_135);
|
||||
lean_dec(x_133);
|
||||
x_136 = lean_ctor_get(x_134, 0);
|
||||
lean_inc(x_136);
|
||||
x_137 = lean_ctor_get(x_134, 1);
|
||||
lean_inc(x_137);
|
||||
x_138 = lean_ctor_get(x_134, 3);
|
||||
lean_inc(x_138);
|
||||
x_139 = lean_ctor_get(x_134, 4);
|
||||
lean_inc(x_139);
|
||||
x_140 = lean_ctor_get(x_134, 5);
|
||||
lean_inc(x_140);
|
||||
x_141 = lean_ctor_get(x_134, 6);
|
||||
lean_inc(x_141);
|
||||
x_142 = lean_ctor_get(x_134, 7);
|
||||
lean_inc(x_142);
|
||||
x_143 = lean_ctor_get(x_134, 8);
|
||||
lean_inc(x_143);
|
||||
if (lean_is_exclusive(x_134)) {
|
||||
lean_ctor_release(x_134, 0);
|
||||
lean_ctor_release(x_134, 1);
|
||||
lean_ctor_release(x_134, 2);
|
||||
lean_ctor_release(x_134, 3);
|
||||
lean_ctor_release(x_134, 4);
|
||||
lean_ctor_release(x_134, 5);
|
||||
lean_ctor_release(x_134, 6);
|
||||
lean_ctor_release(x_134, 7);
|
||||
lean_ctor_release(x_134, 8);
|
||||
x_144 = x_134;
|
||||
} else {
|
||||
lean_dec_ref(x_134);
|
||||
x_144 = lean_box(0);
|
||||
}
|
||||
lean_inc(x_131);
|
||||
x_145 = lean_apply_1(x_1, x_131);
|
||||
lean_inc(x_132);
|
||||
x_146 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_146, 0, x_145);
|
||||
lean_ctor_set(x_146, 1, x_132);
|
||||
if (lean_is_scalar(x_144)) {
|
||||
x_147 = lean_alloc_ctor(0, 9, 0);
|
||||
} else {
|
||||
x_147 = x_144;
|
||||
}
|
||||
lean_ctor_set(x_147, 0, x_136);
|
||||
lean_ctor_set(x_147, 1, x_137);
|
||||
lean_ctor_set(x_147, 2, x_146);
|
||||
lean_ctor_set(x_147, 3, x_138);
|
||||
lean_ctor_set(x_147, 4, x_139);
|
||||
lean_ctor_set(x_147, 5, x_140);
|
||||
lean_ctor_set(x_147, 6, x_141);
|
||||
lean_ctor_set(x_147, 7, x_142);
|
||||
lean_ctor_set(x_147, 8, x_143);
|
||||
x_148 = lean_st_ref_set(x_4, x_147, x_135);
|
||||
x_149 = lean_ctor_get(x_148, 1);
|
||||
lean_inc(x_149);
|
||||
lean_dec(x_148);
|
||||
lean_inc(x_4);
|
||||
x_150 = lean_apply_3(x_2, x_3, x_4, x_149);
|
||||
if (lean_obj_tag(x_150) == 0)
|
||||
{
|
||||
lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170;
|
||||
x_151 = lean_ctor_get(x_150, 0);
|
||||
lean_inc(x_151);
|
||||
x_152 = lean_ctor_get(x_150, 1);
|
||||
lean_inc(x_152);
|
||||
lean_dec(x_150);
|
||||
x_153 = lean_st_ref_take(x_4, x_152);
|
||||
x_154 = lean_ctor_get(x_153, 0);
|
||||
lean_inc(x_154);
|
||||
x_155 = lean_ctor_get(x_153, 1);
|
||||
lean_inc(x_155);
|
||||
lean_dec(x_153);
|
||||
x_156 = lean_ctor_get(x_154, 0);
|
||||
lean_inc(x_156);
|
||||
x_157 = lean_ctor_get(x_154, 1);
|
||||
lean_inc(x_157);
|
||||
x_158 = lean_ctor_get(x_154, 3);
|
||||
lean_inc(x_158);
|
||||
x_159 = lean_ctor_get(x_154, 4);
|
||||
lean_inc(x_159);
|
||||
x_160 = lean_ctor_get(x_154, 5);
|
||||
lean_inc(x_160);
|
||||
x_161 = lean_ctor_get(x_154, 6);
|
||||
lean_inc(x_161);
|
||||
x_162 = lean_ctor_get(x_154, 7);
|
||||
lean_inc(x_162);
|
||||
x_163 = lean_ctor_get(x_154, 8);
|
||||
lean_inc(x_163);
|
||||
if (lean_is_exclusive(x_154)) {
|
||||
lean_ctor_release(x_154, 0);
|
||||
lean_ctor_release(x_154, 1);
|
||||
lean_ctor_release(x_154, 2);
|
||||
lean_ctor_release(x_154, 3);
|
||||
lean_ctor_release(x_154, 4);
|
||||
lean_ctor_release(x_154, 5);
|
||||
lean_ctor_release(x_154, 6);
|
||||
lean_ctor_release(x_154, 7);
|
||||
lean_ctor_release(x_154, 8);
|
||||
x_164 = x_154;
|
||||
} else {
|
||||
lean_dec_ref(x_154);
|
||||
x_164 = lean_box(0);
|
||||
}
|
||||
x_165 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_165, 0, x_131);
|
||||
lean_ctor_set(x_165, 1, x_132);
|
||||
if (lean_is_scalar(x_164)) {
|
||||
x_166 = lean_alloc_ctor(0, 9, 0);
|
||||
} else {
|
||||
x_166 = x_164;
|
||||
}
|
||||
lean_ctor_set(x_166, 0, x_156);
|
||||
lean_ctor_set(x_166, 1, x_157);
|
||||
lean_ctor_set(x_166, 2, x_165);
|
||||
lean_ctor_set(x_166, 3, x_158);
|
||||
lean_ctor_set(x_166, 4, x_159);
|
||||
lean_ctor_set(x_166, 5, x_160);
|
||||
lean_ctor_set(x_166, 6, x_161);
|
||||
lean_ctor_set(x_166, 7, x_162);
|
||||
lean_ctor_set(x_166, 8, x_163);
|
||||
x_167 = lean_st_ref_set(x_4, x_166, x_155);
|
||||
lean_dec(x_4);
|
||||
x_168 = lean_ctor_get(x_167, 1);
|
||||
lean_inc(x_168);
|
||||
if (lean_is_exclusive(x_167)) {
|
||||
lean_ctor_release(x_167, 0);
|
||||
lean_ctor_release(x_167, 1);
|
||||
x_169 = x_167;
|
||||
} else {
|
||||
lean_dec_ref(x_167);
|
||||
x_169 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_169)) {
|
||||
x_170 = lean_alloc_ctor(0, 2, 0);
|
||||
} else {
|
||||
x_170 = x_169;
|
||||
}
|
||||
lean_ctor_set(x_170, 0, x_151);
|
||||
lean_ctor_set(x_170, 1, x_168);
|
||||
return x_170;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_171; lean_object* x_172; lean_object* x_173; lean_object* x_174; lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; lean_object* x_181; lean_object* x_182; lean_object* x_183; lean_object* x_184; lean_object* x_185; lean_object* x_186; lean_object* x_187; lean_object* x_188; lean_object* x_189; lean_object* x_190;
|
||||
x_171 = lean_ctor_get(x_150, 0);
|
||||
lean_inc(x_171);
|
||||
x_172 = lean_ctor_get(x_150, 1);
|
||||
lean_inc(x_172);
|
||||
lean_dec(x_150);
|
||||
x_173 = lean_st_ref_take(x_4, x_172);
|
||||
x_174 = lean_ctor_get(x_173, 0);
|
||||
lean_inc(x_174);
|
||||
x_175 = lean_ctor_get(x_173, 1);
|
||||
lean_inc(x_175);
|
||||
lean_dec(x_173);
|
||||
x_176 = lean_ctor_get(x_174, 0);
|
||||
lean_inc(x_176);
|
||||
x_177 = lean_ctor_get(x_174, 1);
|
||||
lean_inc(x_177);
|
||||
x_178 = lean_ctor_get(x_174, 3);
|
||||
lean_inc(x_178);
|
||||
x_179 = lean_ctor_get(x_174, 4);
|
||||
lean_inc(x_179);
|
||||
x_180 = lean_ctor_get(x_174, 5);
|
||||
lean_inc(x_180);
|
||||
x_181 = lean_ctor_get(x_174, 6);
|
||||
lean_inc(x_181);
|
||||
x_182 = lean_ctor_get(x_174, 7);
|
||||
lean_inc(x_182);
|
||||
x_183 = lean_ctor_get(x_174, 8);
|
||||
lean_inc(x_183);
|
||||
if (lean_is_exclusive(x_174)) {
|
||||
lean_ctor_release(x_174, 0);
|
||||
lean_ctor_release(x_174, 1);
|
||||
lean_ctor_release(x_174, 2);
|
||||
lean_ctor_release(x_174, 3);
|
||||
lean_ctor_release(x_174, 4);
|
||||
lean_ctor_release(x_174, 5);
|
||||
lean_ctor_release(x_174, 6);
|
||||
lean_ctor_release(x_174, 7);
|
||||
lean_ctor_release(x_174, 8);
|
||||
x_184 = x_174;
|
||||
} else {
|
||||
lean_dec_ref(x_174);
|
||||
x_184 = lean_box(0);
|
||||
}
|
||||
x_185 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_185, 0, x_131);
|
||||
lean_ctor_set(x_185, 1, x_132);
|
||||
if (lean_is_scalar(x_184)) {
|
||||
x_186 = lean_alloc_ctor(0, 9, 0);
|
||||
} else {
|
||||
x_186 = x_184;
|
||||
}
|
||||
lean_ctor_set(x_186, 0, x_176);
|
||||
lean_ctor_set(x_186, 1, x_177);
|
||||
lean_ctor_set(x_186, 2, x_185);
|
||||
lean_ctor_set(x_186, 3, x_178);
|
||||
lean_ctor_set(x_186, 4, x_179);
|
||||
lean_ctor_set(x_186, 5, x_180);
|
||||
lean_ctor_set(x_186, 6, x_181);
|
||||
lean_ctor_set(x_186, 7, x_182);
|
||||
lean_ctor_set(x_186, 8, x_183);
|
||||
x_187 = lean_st_ref_set(x_4, x_186, x_175);
|
||||
lean_dec(x_4);
|
||||
x_188 = lean_ctor_get(x_187, 1);
|
||||
lean_inc(x_188);
|
||||
if (lean_is_exclusive(x_187)) {
|
||||
lean_ctor_release(x_187, 0);
|
||||
lean_ctor_release(x_187, 1);
|
||||
x_189 = x_187;
|
||||
} else {
|
||||
lean_dec_ref(x_187);
|
||||
x_189 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_189)) {
|
||||
x_190 = lean_alloc_ctor(1, 2, 0);
|
||||
} else {
|
||||
x_190 = x_189;
|
||||
lean_ctor_set_tag(x_190, 1);
|
||||
}
|
||||
lean_ctor_set(x_190, 0, x_171);
|
||||
lean_ctor_set(x_190, 1, x_188);
|
||||
return x_190;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Command_withScope(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_Elab_Command_withScope___rarg), 5, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Command_getLevelNames___rarg(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
|
|
|
|||
4
stage0/stdlib/Lean/Elab/Inductive.c
generated
4
stage0/stdlib/Lean/Elab/Inductive.c
generated
|
|
@ -370,6 +370,7 @@ static lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_Inductive_
|
|||
lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at___private_Lean_Elab_Inductive_0__Lean_Elab_Command_replaceIndFVarsWithConsts___spec__1(lean_object*, lean_object*, lean_object*, size_t, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Command_accLevelAtCtor___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*);
|
||||
uint8_t l_Array_contains___at___private_Lean_Elab_PreDefinition_Structural_FindRecArg_0__Lean_Elab_Structural_hasBadIndexDep_x3f___spec__1(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
extern uint8_t l_instInhabitedBool;
|
||||
lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_Inductive_0__Lean_Elab_Command_mkAuxConstructions___spec__8___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -461,7 +462,6 @@ lean_object* l___private_Lean_Elab_Inductive_0__Lean_Elab_Command_checkUnsafe___
|
|||
uint8_t l_Array_anyMUnsafe_any___at___private_Lean_Elab_Inductive_0__Lean_Elab_Command_applyDerivingHandlers___spec__1(lean_object*, lean_object*, size_t, size_t);
|
||||
lean_object* l_Lean_Meta_forallTelescopeCompatibleAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Command_checkValidCtorModifier___rarg___lambda__2___closed__2;
|
||||
uint8_t l_Array_contains___at_Lean_Meta_getElimInfo___spec__4(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_Inductive_0__Lean_Elab_Command_elabHeaderAux_match__1(lean_object*);
|
||||
lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_Inductive_0__Lean_Elab_Command_mkAuxConstructions___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_Inductive_0__Lean_Elab_Command_collectUniversesFromCtorType___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -4802,7 +4802,7 @@ _start:
|
|||
{
|
||||
lean_object* x_9; uint8_t x_10;
|
||||
x_9 = l_Lean_Expr_getAppFn(x_3);
|
||||
x_10 = l_Array_contains___at_Lean_Meta_getElimInfo___spec__4(x_1, x_9);
|
||||
x_10 = l_Array_contains___at___private_Lean_Elab_PreDefinition_Structural_FindRecArg_0__Lean_Elab_Structural_hasBadIndexDep_x3f___spec__1(x_1, x_9);
|
||||
lean_dec(x_1);
|
||||
if (x_10 == 0)
|
||||
{
|
||||
|
|
|
|||
20827
stage0/stdlib/Lean/Elab/PreDefinition/Structural.c
generated
20827
stage0/stdlib/Lean/Elab/PreDefinition/Structural.c
generated
File diff suppressed because it is too large
Load diff
8299
stage0/stdlib/Lean/Elab/PreDefinition/Structural/BRecOn.c
generated
Normal file
8299
stage0/stdlib/Lean/Elab/PreDefinition/Structural/BRecOn.c
generated
Normal file
File diff suppressed because it is too large
Load diff
623
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Basic.c
generated
Normal file
623
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Basic.c
generated
Normal file
|
|
@ -0,0 +1,623 @@
|
|||
// Lean compiler output
|
||||
// Module: Lean.Elab.PreDefinition.Structural.Basic
|
||||
// Imports: Init Lean.Meta.Basic Lean.Meta.ForEachExpr
|
||||
#include <lean/lean.h>
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-label"
|
||||
#elif defined(__GNUC__) && !defined(__CLANG__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-label"
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
lean_object* l_Lean_Elab_Structural_recArgHasLooseBVarsAt___lambda__1___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_stringToMessageData(lean_object*);
|
||||
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn(lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Elab_Structural_recArgHasLooseBVarsAt___lambda__1(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_Meta_setInlineAttribute___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__4;
|
||||
static lean_object* l_Lean_Elab_Structural_instInhabitedM___closed__3;
|
||||
lean_object* lean_st_ref_get(lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Elab_Structural_recArgHasLooseBVarsAt(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___lambda__1___boxed(lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Expr_isAppOf(lean_object*, lean_object*);
|
||||
lean_object* lean_array_get_size(lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1(lean_object*);
|
||||
lean_object* l_Lean_Expr_getRevArg_x21(lean_object*, lean_object*);
|
||||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_forEachExpr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_nat_sub(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_instInhabitedM___closed__2;
|
||||
static lean_object* l_Lean_Elab_Structural_instInhabitedM___closed__1;
|
||||
lean_object* l_Lean_Elab_Structural_State_matcherBelowDep___default;
|
||||
lean_object* lean_st_mk_ref(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_ensureNoRecFn(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__3;
|
||||
lean_object* l_Lean_Elab_Structural_recArgHasLooseBVarsAt___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___boxed(lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Expr_isConstOf(lean_object*, lean_object*);
|
||||
extern lean_object* l_Lean_NameSet_empty;
|
||||
extern lean_object* l_Lean_Expr_FindImpl_initCache;
|
||||
lean_object* l_Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__2;
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___lambda__1(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_State_addMatchers___default;
|
||||
lean_object* l_Lean_Elab_Structural_run(lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__1;
|
||||
lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Expr_hasLooseBVars(lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_run___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_FindImpl_findM_x3f_visit(lean_object*, size_t, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_indentExpr(lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_instInhabitedM(lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_State_addMatchers___default___closed__1;
|
||||
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
|
||||
static lean_object* _init_l_Lean_Elab_Structural_State_matcherBelowDep___default() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = l_Lean_NameSet_empty;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_State_addMatchers___default___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = lean_unsigned_to_nat(0u);
|
||||
x_2 = lean_mk_empty_array_with_capacity(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_State_addMatchers___default() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = l_Lean_Elab_Structural_State_addMatchers___default___closed__1;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8; lean_object* x_9; uint8_t x_10;
|
||||
x_8 = lean_ctor_get(x_5, 3);
|
||||
x_9 = l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(x_1, x_3, x_4, x_5, x_6, x_7);
|
||||
x_10 = !lean_is_exclusive(x_9);
|
||||
if (x_10 == 0)
|
||||
{
|
||||
lean_object* x_11; lean_object* x_12;
|
||||
x_11 = lean_ctor_get(x_9, 0);
|
||||
lean_inc(x_8);
|
||||
x_12 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_12, 0, x_8);
|
||||
lean_ctor_set(x_12, 1, x_11);
|
||||
lean_ctor_set_tag(x_9, 1);
|
||||
lean_ctor_set(x_9, 0, x_12);
|
||||
return x_9;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
|
||||
x_13 = lean_ctor_get(x_9, 0);
|
||||
x_14 = lean_ctor_get(x_9, 1);
|
||||
lean_inc(x_14);
|
||||
lean_inc(x_13);
|
||||
lean_dec(x_9);
|
||||
lean_inc(x_8);
|
||||
x_15 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_15, 0, x_8);
|
||||
lean_ctor_set(x_15, 1, x_13);
|
||||
x_16 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_16, 0, x_15);
|
||||
lean_ctor_set(x_16, 1, x_14);
|
||||
return x_16;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg___boxed), 7, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_instInhabitedM___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("failed");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_instInhabitedM___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Elab_Structural_instInhabitedM___closed__1;
|
||||
x_2 = l_Lean_stringToMessageData(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_instInhabitedM___closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Elab_Structural_instInhabitedM___closed__2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg___boxed), 7, 1);
|
||||
lean_closure_set(x_2, 0, x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_instInhabitedM(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_Elab_Structural_instInhabitedM___closed__3;
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8;
|
||||
x_8 = l_Lean_throwError___at_Lean_Elab_Structural_instInhabitedM___spec__1___rarg(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_run___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
|
||||
x_8 = lean_st_ref_get(x_6, x_7);
|
||||
x_9 = lean_ctor_get(x_8, 1);
|
||||
lean_inc(x_9);
|
||||
lean_dec(x_8);
|
||||
x_10 = lean_st_mk_ref(x_2, x_9);
|
||||
x_11 = lean_ctor_get(x_10, 0);
|
||||
lean_inc(x_11);
|
||||
x_12 = lean_ctor_get(x_10, 1);
|
||||
lean_inc(x_12);
|
||||
lean_dec(x_10);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_11);
|
||||
x_13 = lean_apply_6(x_1, x_11, x_3, x_4, x_5, x_6, x_12);
|
||||
if (lean_obj_tag(x_13) == 0)
|
||||
{
|
||||
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19;
|
||||
x_14 = lean_ctor_get(x_13, 0);
|
||||
lean_inc(x_14);
|
||||
x_15 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_15);
|
||||
lean_dec(x_13);
|
||||
x_16 = lean_st_ref_get(x_6, x_15);
|
||||
lean_dec(x_6);
|
||||
x_17 = lean_ctor_get(x_16, 1);
|
||||
lean_inc(x_17);
|
||||
lean_dec(x_16);
|
||||
x_18 = lean_st_ref_get(x_11, x_17);
|
||||
lean_dec(x_11);
|
||||
x_19 = !lean_is_exclusive(x_18);
|
||||
if (x_19 == 0)
|
||||
{
|
||||
lean_object* x_20; lean_object* x_21;
|
||||
x_20 = lean_ctor_get(x_18, 0);
|
||||
x_21 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_21, 0, x_14);
|
||||
lean_ctor_set(x_21, 1, x_20);
|
||||
lean_ctor_set(x_18, 0, x_21);
|
||||
return x_18;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25;
|
||||
x_22 = lean_ctor_get(x_18, 0);
|
||||
x_23 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_23);
|
||||
lean_inc(x_22);
|
||||
lean_dec(x_18);
|
||||
x_24 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_24, 0, x_14);
|
||||
lean_ctor_set(x_24, 1, x_22);
|
||||
x_25 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_25, 0, x_24);
|
||||
lean_ctor_set(x_25, 1, x_23);
|
||||
return x_25;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_26;
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_6);
|
||||
x_26 = !lean_is_exclusive(x_13);
|
||||
if (x_26 == 0)
|
||||
{
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_27; lean_object* x_28; lean_object* x_29;
|
||||
x_27 = lean_ctor_get(x_13, 0);
|
||||
x_28 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_28);
|
||||
lean_inc(x_27);
|
||||
lean_dec(x_13);
|
||||
x_29 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_29, 0, x_27);
|
||||
lean_ctor_set(x_29, 1, x_28);
|
||||
return x_29;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_run(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_run___rarg), 7, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Elab_Structural_recArgHasLooseBVarsAt___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_4;
|
||||
x_4 = l_Lean_Expr_isAppOf(x_3, x_1);
|
||||
if (x_4 == 0)
|
||||
{
|
||||
uint8_t x_5;
|
||||
x_5 = 0;
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; uint8_t x_8;
|
||||
x_6 = lean_unsigned_to_nat(0u);
|
||||
x_7 = l_Lean_Expr_getAppNumArgsAux(x_3, x_6);
|
||||
x_8 = lean_nat_dec_lt(x_2, x_7);
|
||||
if (x_8 == 0)
|
||||
{
|
||||
uint8_t x_9;
|
||||
lean_dec(x_7);
|
||||
x_9 = 0;
|
||||
return x_9;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14;
|
||||
x_10 = lean_nat_sub(x_7, x_2);
|
||||
lean_dec(x_7);
|
||||
x_11 = lean_unsigned_to_nat(1u);
|
||||
x_12 = lean_nat_sub(x_10, x_11);
|
||||
lean_dec(x_10);
|
||||
x_13 = l_Lean_Expr_getRevArg_x21(x_3, x_12);
|
||||
x_14 = l_Lean_Expr_hasLooseBVars(x_13);
|
||||
lean_dec(x_13);
|
||||
return x_14;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Elab_Structural_recArgHasLooseBVarsAt(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; size_t x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
|
||||
x_4 = lean_ctor_get(x_2, 0);
|
||||
x_5 = lean_array_get_size(x_4);
|
||||
x_6 = lean_ctor_get(x_2, 2);
|
||||
x_7 = lean_nat_add(x_5, x_6);
|
||||
lean_dec(x_5);
|
||||
x_8 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_recArgHasLooseBVarsAt___lambda__1___boxed), 3, 2);
|
||||
lean_closure_set(x_8, 0, x_1);
|
||||
lean_closure_set(x_8, 1, x_7);
|
||||
x_9 = 8192;
|
||||
x_10 = l_Lean_Expr_FindImpl_initCache;
|
||||
x_11 = l_Lean_Expr_FindImpl_findM_x3f_visit(x_8, x_9, x_3, x_10);
|
||||
x_12 = lean_ctor_get(x_11, 0);
|
||||
lean_inc(x_12);
|
||||
lean_dec(x_11);
|
||||
if (lean_obj_tag(x_12) == 0)
|
||||
{
|
||||
uint8_t x_13;
|
||||
x_13 = 0;
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_14;
|
||||
lean_dec(x_12);
|
||||
x_14 = 1;
|
||||
return x_14;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_recArgHasLooseBVarsAt___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_4; lean_object* x_5;
|
||||
x_4 = l_Lean_Elab_Structural_recArgHasLooseBVarsAt___lambda__1(x_1, x_2, x_3);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_5 = lean_box(x_4);
|
||||
return x_5;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_recArgHasLooseBVarsAt___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_4; lean_object* x_5;
|
||||
x_4 = l_Lean_Elab_Structural_recArgHasLooseBVarsAt(x_1, x_2, x_3);
|
||||
lean_dec(x_2);
|
||||
x_5 = lean_box(x_4);
|
||||
return x_5;
|
||||
}
|
||||
}
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___lambda__1(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3;
|
||||
x_3 = l_Lean_Expr_isConstOf(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; size_t x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
|
||||
x_3 = lean_alloc_closure((void*)(l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___lambda__1___boxed), 2, 1);
|
||||
lean_closure_set(x_3, 0, x_1);
|
||||
x_4 = 8192;
|
||||
x_5 = l_Lean_Expr_FindImpl_initCache;
|
||||
x_6 = l_Lean_Expr_FindImpl_findM_x3f_visit(x_3, x_4, x_2, x_5);
|
||||
x_7 = lean_ctor_get(x_6, 0);
|
||||
lean_inc(x_7);
|
||||
lean_dec(x_6);
|
||||
if (lean_obj_tag(x_7) == 0)
|
||||
{
|
||||
uint8_t x_8;
|
||||
x_8 = 0;
|
||||
return x_8;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_9;
|
||||
lean_dec(x_7);
|
||||
x_9 = 1;
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___lambda__1___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3; lean_object* x_4;
|
||||
x_3 = l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___lambda__1(x_1, x_2);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_4 = lean_box(x_3);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3; lean_object* x_4;
|
||||
x_3 = l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn(x_1, x_2);
|
||||
x_4 = lean_box(x_3);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("unexpected occurrence of recursive application");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__1;
|
||||
x_2 = l_Lean_stringToMessageData(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__4() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__3;
|
||||
x_2 = l_Lean_stringToMessageData(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_8;
|
||||
x_8 = l_Lean_Expr_isAppOf(x_2, x_1);
|
||||
if (x_8 == 0)
|
||||
{
|
||||
lean_object* x_9; lean_object* x_10;
|
||||
lean_dec(x_2);
|
||||
x_9 = lean_box(0);
|
||||
x_10 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_10, 0, x_9);
|
||||
lean_ctor_set(x_10, 1, x_7);
|
||||
return x_10;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
|
||||
x_11 = l_Lean_indentExpr(x_2);
|
||||
x_12 = l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__2;
|
||||
x_13 = lean_alloc_ctor(10, 2, 0);
|
||||
lean_ctor_set(x_13, 0, x_12);
|
||||
lean_ctor_set(x_13, 1, x_11);
|
||||
x_14 = l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__4;
|
||||
x_15 = lean_alloc_ctor(10, 2, 0);
|
||||
lean_ctor_set(x_15, 0, x_13);
|
||||
lean_ctor_set(x_15, 1, x_14);
|
||||
x_16 = l_Lean_throwError___at_Lean_Meta_setInlineAttribute___spec__1(x_15, x_3, x_4, x_5, x_6, x_7);
|
||||
return x_16;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_ensureNoRecFn(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_8;
|
||||
lean_inc(x_2);
|
||||
lean_inc(x_1);
|
||||
x_8 = l___private_Lean_Elab_PreDefinition_Structural_Basic_0__Lean_Elab_Structural_containsRecFn(x_1, x_2);
|
||||
if (x_8 == 0)
|
||||
{
|
||||
lean_object* x_9;
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_9 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_9, 0, x_2);
|
||||
lean_ctor_set(x_9, 1, x_7);
|
||||
return x_9;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_10; lean_object* x_11;
|
||||
x_10 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___boxed), 7, 1);
|
||||
lean_closure_set(x_10, 0, x_1);
|
||||
lean_inc(x_2);
|
||||
x_11 = l_Lean_Meta_forEachExpr(x_2, x_10, x_3, x_4, x_5, x_6, x_7);
|
||||
if (lean_obj_tag(x_11) == 0)
|
||||
{
|
||||
uint8_t x_12;
|
||||
x_12 = !lean_is_exclusive(x_11);
|
||||
if (x_12 == 0)
|
||||
{
|
||||
lean_object* x_13;
|
||||
x_13 = lean_ctor_get(x_11, 0);
|
||||
lean_dec(x_13);
|
||||
lean_ctor_set(x_11, 0, x_2);
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_14; lean_object* x_15;
|
||||
x_14 = lean_ctor_get(x_11, 1);
|
||||
lean_inc(x_14);
|
||||
lean_dec(x_11);
|
||||
x_15 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_15, 0, x_2);
|
||||
lean_ctor_set(x_15, 1, x_14);
|
||||
return x_15;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_16;
|
||||
lean_dec(x_2);
|
||||
x_16 = !lean_is_exclusive(x_11);
|
||||
if (x_16 == 0)
|
||||
{
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_17; lean_object* x_18; lean_object* x_19;
|
||||
x_17 = lean_ctor_get(x_11, 0);
|
||||
x_18 = lean_ctor_get(x_11, 1);
|
||||
lean_inc(x_18);
|
||||
lean_inc(x_17);
|
||||
lean_dec(x_11);
|
||||
x_19 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_19, 0, x_17);
|
||||
lean_ctor_set(x_19, 1, x_18);
|
||||
return x_19;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8;
|
||||
x_8 = l_Lean_Elab_Structural_ensureNoRecFn___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
lean_object* initialize_Init(lean_object*);
|
||||
lean_object* initialize_Lean_Meta_Basic(lean_object*);
|
||||
lean_object* initialize_Lean_Meta_ForEachExpr(lean_object*);
|
||||
static bool _G_initialized = false;
|
||||
lean_object* initialize_Lean_Elab_PreDefinition_Structural_Basic(lean_object* w) {
|
||||
lean_object * res;
|
||||
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
|
||||
_G_initialized = true;
|
||||
res = initialize_Init(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Meta_Basic(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Meta_ForEachExpr(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
l_Lean_Elab_Structural_State_matcherBelowDep___default = _init_l_Lean_Elab_Structural_State_matcherBelowDep___default();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_State_matcherBelowDep___default);
|
||||
l_Lean_Elab_Structural_State_addMatchers___default___closed__1 = _init_l_Lean_Elab_Structural_State_addMatchers___default___closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_State_addMatchers___default___closed__1);
|
||||
l_Lean_Elab_Structural_State_addMatchers___default = _init_l_Lean_Elab_Structural_State_addMatchers___default();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_State_addMatchers___default);
|
||||
l_Lean_Elab_Structural_instInhabitedM___closed__1 = _init_l_Lean_Elab_Structural_instInhabitedM___closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_instInhabitedM___closed__1);
|
||||
l_Lean_Elab_Structural_instInhabitedM___closed__2 = _init_l_Lean_Elab_Structural_instInhabitedM___closed__2();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_instInhabitedM___closed__2);
|
||||
l_Lean_Elab_Structural_instInhabitedM___closed__3 = _init_l_Lean_Elab_Structural_instInhabitedM___closed__3();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_instInhabitedM___closed__3);
|
||||
l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__1 = _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__1);
|
||||
l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__2 = _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__2();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__2);
|
||||
l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__3 = _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__3();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__3);
|
||||
l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__4 = _init_l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__4();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_ensureNoRecFn___lambda__1___closed__4);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
328
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Eqns.c
generated
Normal file
328
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Eqns.c
generated
Normal file
|
|
@ -0,0 +1,328 @@
|
|||
// Lean compiler output
|
||||
// Module: Lean.Elab.PreDefinition.Structural.Eqns
|
||||
// Imports: Init Lean.Elab.PreDefinition.Basic Lean.Elab.PreDefinition.Structural.Basic
|
||||
#include <lean/lean.h>
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-label"
|
||||
#elif defined(__GNUC__) && !defined(__CLANG__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-label"
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_stringToMessageData(lean_object*);
|
||||
lean_object* lean_name_mk_string(lean_object*, lean_object*);
|
||||
lean_object* lean_st_ref_get(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__10;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__1;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__8;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__4;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__9;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__7;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__3;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__5;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__12;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__6;
|
||||
lean_object* l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__13;
|
||||
lean_object* l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__2;
|
||||
static lean_object* l_Lean_Elab_Structural_mkEqns___closed__11;
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Eqns___hyg_80_(lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_9; lean_object* x_10;
|
||||
x_9 = lean_box(0);
|
||||
x_10 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_10, 0, x_9);
|
||||
lean_ctor_set(x_10, 1, x_8);
|
||||
return x_10;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("Elab");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_Elab_Structural_mkEqns___closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("definition");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__4() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Elab_Structural_mkEqns___closed__2;
|
||||
x_2 = l_Lean_Elab_Structural_mkEqns___closed__3;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__5() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("structural");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__6() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Elab_Structural_mkEqns___closed__4;
|
||||
x_2 = l_Lean_Elab_Structural_mkEqns___closed__5;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__7() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("eqns");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__8() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Elab_Structural_mkEqns___closed__6;
|
||||
x_2 = l_Lean_Elab_Structural_mkEqns___closed__7;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__9() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_mkEqns___lambda__1___boxed), 8, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__10() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("mkEqns:\n");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__11() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Elab_Structural_mkEqns___closed__10;
|
||||
x_2 = l_Lean_stringToMessageData(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__12() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_mkEqns___closed__13() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Elab_Structural_mkEqns___closed__12;
|
||||
x_2 = l_Lean_stringToMessageData(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_9; uint8_t x_10; lean_object* x_11; lean_object* x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29;
|
||||
x_9 = l_Lean_Elab_Structural_mkEqns___closed__8;
|
||||
x_26 = lean_st_ref_get(x_7, x_8);
|
||||
x_27 = lean_ctor_get(x_26, 0);
|
||||
lean_inc(x_27);
|
||||
x_28 = lean_ctor_get(x_27, 3);
|
||||
lean_inc(x_28);
|
||||
lean_dec(x_27);
|
||||
x_29 = lean_ctor_get_uint8(x_28, sizeof(void*)*1);
|
||||
lean_dec(x_28);
|
||||
if (x_29 == 0)
|
||||
{
|
||||
lean_object* x_30; uint8_t x_31;
|
||||
x_30 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_30);
|
||||
lean_dec(x_26);
|
||||
x_31 = 0;
|
||||
x_10 = x_31;
|
||||
x_11 = x_30;
|
||||
goto block_25;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36;
|
||||
x_32 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_32);
|
||||
lean_dec(x_26);
|
||||
x_33 = l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(x_9, x_2, x_3, x_4, x_5, x_6, x_7, x_32);
|
||||
x_34 = lean_ctor_get(x_33, 0);
|
||||
lean_inc(x_34);
|
||||
x_35 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_35);
|
||||
lean_dec(x_33);
|
||||
x_36 = lean_unbox(x_34);
|
||||
lean_dec(x_34);
|
||||
x_10 = x_36;
|
||||
x_11 = x_35;
|
||||
goto block_25;
|
||||
}
|
||||
block_25:
|
||||
{
|
||||
lean_object* x_12;
|
||||
x_12 = l_Lean_Elab_Structural_mkEqns___closed__9;
|
||||
if (x_10 == 0)
|
||||
{
|
||||
lean_object* x_13; lean_object* x_14;
|
||||
x_13 = lean_box(0);
|
||||
x_14 = lean_apply_8(x_12, x_13, x_2, x_3, x_4, x_5, x_6, x_7, x_11);
|
||||
return x_14;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24;
|
||||
x_15 = lean_ctor_get(x_1, 5);
|
||||
lean_inc(x_15);
|
||||
x_16 = lean_alloc_ctor(2, 1, 0);
|
||||
lean_ctor_set(x_16, 0, x_15);
|
||||
x_17 = l_Lean_Elab_Structural_mkEqns___closed__11;
|
||||
x_18 = lean_alloc_ctor(10, 2, 0);
|
||||
lean_ctor_set(x_18, 0, x_17);
|
||||
lean_ctor_set(x_18, 1, x_16);
|
||||
x_19 = l_Lean_Elab_Structural_mkEqns___closed__13;
|
||||
x_20 = lean_alloc_ctor(10, 2, 0);
|
||||
lean_ctor_set(x_20, 0, x_18);
|
||||
lean_ctor_set(x_20, 1, x_19);
|
||||
x_21 = l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(x_9, x_20, x_2, x_3, x_4, x_5, x_6, x_7, x_11);
|
||||
x_22 = lean_ctor_get(x_21, 0);
|
||||
lean_inc(x_22);
|
||||
x_23 = lean_ctor_get(x_21, 1);
|
||||
lean_inc(x_23);
|
||||
lean_dec(x_21);
|
||||
x_24 = lean_apply_8(x_12, x_22, x_2, x_3, x_4, x_5, x_6, x_7, x_23);
|
||||
return x_24;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_9;
|
||||
x_9 = l_Lean_Elab_Structural_mkEqns___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_mkEqns___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_9;
|
||||
x_9 = l_Lean_Elab_Structural_mkEqns(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
|
||||
lean_dec(x_1);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Eqns___hyg_80_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = l_Lean_Elab_Structural_mkEqns___closed__8;
|
||||
x_3 = l_Lean_registerTraceClass(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* initialize_Init(lean_object*);
|
||||
lean_object* initialize_Lean_Elab_PreDefinition_Basic(lean_object*);
|
||||
lean_object* initialize_Lean_Elab_PreDefinition_Structural_Basic(lean_object*);
|
||||
static bool _G_initialized = false;
|
||||
lean_object* initialize_Lean_Elab_PreDefinition_Structural_Eqns(lean_object* w) {
|
||||
lean_object * res;
|
||||
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
|
||||
_G_initialized = true;
|
||||
res = initialize_Init(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Elab_PreDefinition_Basic(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Elab_PreDefinition_Structural_Basic(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__1 = _init_l_Lean_Elab_Structural_mkEqns___closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__1);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__2 = _init_l_Lean_Elab_Structural_mkEqns___closed__2();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__2);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__3 = _init_l_Lean_Elab_Structural_mkEqns___closed__3();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__3);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__4 = _init_l_Lean_Elab_Structural_mkEqns___closed__4();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__4);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__5 = _init_l_Lean_Elab_Structural_mkEqns___closed__5();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__5);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__6 = _init_l_Lean_Elab_Structural_mkEqns___closed__6();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__6);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__7 = _init_l_Lean_Elab_Structural_mkEqns___closed__7();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__7);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__8 = _init_l_Lean_Elab_Structural_mkEqns___closed__8();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__8);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__9 = _init_l_Lean_Elab_Structural_mkEqns___closed__9();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__9);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__10 = _init_l_Lean_Elab_Structural_mkEqns___closed__10();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__10);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__11 = _init_l_Lean_Elab_Structural_mkEqns___closed__11();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__11);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__12 = _init_l_Lean_Elab_Structural_mkEqns___closed__12();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__12);
|
||||
l_Lean_Elab_Structural_mkEqns___closed__13 = _init_l_Lean_Elab_Structural_mkEqns___closed__13();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_mkEqns___closed__13);
|
||||
res = l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Eqns___hyg_80_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
3763
stage0/stdlib/Lean/Elab/PreDefinition/Structural/FindRecArg.c
generated
Normal file
3763
stage0/stdlib/Lean/Elab/PreDefinition/Structural/FindRecArg.c
generated
Normal file
File diff suppressed because it is too large
Load diff
5438
stage0/stdlib/Lean/Elab/PreDefinition/Structural/IndPred.c
generated
Normal file
5438
stage0/stdlib/Lean/Elab/PreDefinition/Structural/IndPred.c
generated
Normal file
File diff suppressed because it is too large
Load diff
2801
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c
generated
Normal file
2801
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c
generated
Normal file
File diff suppressed because it is too large
Load diff
200
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Preprocess.c
generated
Normal file
200
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Preprocess.c
generated
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
// Lean compiler output
|
||||
// Module: Lean.Elab.PreDefinition.Structural.Preprocess
|
||||
// Imports: Init Lean.Meta.Transform
|
||||
#include <lean/lean.h>
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-label"
|
||||
#elif defined(__GNUC__) && !defined(__CLANG__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-label"
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___lambda__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Structural_preprocess(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_headBeta(lean_object*);
|
||||
uint8_t l_Lean_Expr_isHeadBetaTarget(lean_object*);
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___lambda__1(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Structural_preprocess___closed__1;
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Expr_isConstOf(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
extern lean_object* l_Lean_Expr_FindImpl_initCache;
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_FindImpl_findM_x3f_visit(lean_object*, size_t, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_getAppFn(lean_object*);
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___lambda__1(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3;
|
||||
x_3 = l_Lean_Expr_isConstOf(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
uint8_t l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3;
|
||||
x_3 = l_Lean_Expr_isHeadBetaTarget(x_1);
|
||||
if (x_3 == 0)
|
||||
{
|
||||
uint8_t x_4;
|
||||
lean_dec(x_2);
|
||||
x_4 = 0;
|
||||
return x_4;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_5; lean_object* x_6; size_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
|
||||
x_5 = lean_alloc_closure((void*)(l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___lambda__1___boxed), 2, 1);
|
||||
lean_closure_set(x_5, 0, x_2);
|
||||
x_6 = l_Lean_Expr_getAppFn(x_1);
|
||||
x_7 = 8192;
|
||||
x_8 = l_Lean_Expr_FindImpl_initCache;
|
||||
x_9 = l_Lean_Expr_FindImpl_findM_x3f_visit(x_5, x_7, x_6, x_8);
|
||||
x_10 = lean_ctor_get(x_9, 0);
|
||||
lean_inc(x_10);
|
||||
lean_dec(x_9);
|
||||
if (lean_obj_tag(x_10) == 0)
|
||||
{
|
||||
uint8_t x_11;
|
||||
x_11 = 0;
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_12;
|
||||
lean_dec(x_10);
|
||||
x_12 = 1;
|
||||
return x_12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___lambda__1___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3; lean_object* x_4;
|
||||
x_3 = l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___lambda__1(x_1, x_2);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_4 = lean_box(x_3);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_3; lean_object* x_4;
|
||||
x_3 = l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce(x_1, x_2);
|
||||
lean_dec(x_1);
|
||||
x_4 = lean_box(x_3);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_6;
|
||||
x_6 = l___private_Lean_Elab_PreDefinition_Structural_Preprocess_0__Lean_Elab_Structural_shouldBetaReduce(x_2, x_1);
|
||||
if (x_6 == 0)
|
||||
{
|
||||
lean_object* x_7; lean_object* x_8;
|
||||
x_7 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_7, 0, x_2);
|
||||
x_8 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_8, 0, x_7);
|
||||
lean_ctor_set(x_8, 1, x_5);
|
||||
return x_8;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_9; lean_object* x_10; lean_object* x_11;
|
||||
x_9 = l_Lean_Expr_headBeta(x_2);
|
||||
x_10 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_10, 0, x_9);
|
||||
x_11 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_11, 0, x_10);
|
||||
lean_ctor_set(x_11, 1, x_5);
|
||||
return x_11;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_5; lean_object* x_6;
|
||||
x_5 = lean_alloc_ctor(0, 1, 0);
|
||||
lean_ctor_set(x_5, 0, x_1);
|
||||
x_6 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_6, 0, x_5);
|
||||
lean_ctor_set(x_6, 1, x_4);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Structural_preprocess___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_preprocess___lambda__2___boxed), 4, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_preprocess(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
x_6 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_preprocess___lambda__1___boxed), 5, 1);
|
||||
lean_closure_set(x_6, 0, x_2);
|
||||
x_7 = l_Lean_Elab_Structural_preprocess___closed__1;
|
||||
x_8 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_1, x_6, x_7, x_3, x_4, x_5);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_6;
|
||||
x_6 = l_Lean_Elab_Structural_preprocess___lambda__1(x_1, x_2, x_3, x_4, x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Structural_preprocess___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_5;
|
||||
x_5 = l_Lean_Elab_Structural_preprocess___lambda__2(x_1, x_2, x_3, x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
return x_5;
|
||||
}
|
||||
}
|
||||
lean_object* initialize_Init(lean_object*);
|
||||
lean_object* initialize_Lean_Meta_Transform(lean_object*);
|
||||
static bool _G_initialized = false;
|
||||
lean_object* initialize_Lean_Elab_PreDefinition_Structural_Preprocess(lean_object* w) {
|
||||
lean_object * res;
|
||||
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
|
||||
_G_initialized = true;
|
||||
res = initialize_Init(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Meta_Transform(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
l_Lean_Elab_Structural_preprocess___closed__1 = _init_l_Lean_Elab_Structural_preprocess___closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Structural_preprocess___closed__1);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
2868
stage0/stdlib/Lean/Elab/PreDefinition/Structural/SmartUnfolding.c
generated
Normal file
2868
stage0/stdlib/Lean/Elab/PreDefinition/Structural/SmartUnfolding.c
generated
Normal file
File diff suppressed because it is too large
Load diff
169
stage0/stdlib/Lean/Expr.c
generated
169
stage0/stdlib/Lean/Expr.c
generated
|
|
@ -201,6 +201,7 @@ lean_object* l_Lean_Expr_isLet_match__1(lean_object*);
|
|||
lean_object* lean_array_push(lean_object*, lean_object*);
|
||||
lean_object* lean_array_get_size(lean_object*);
|
||||
lean_object* lean_expr_lift_loose_bvars(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_mkLetFunAnnotation(lean_object*);
|
||||
uint8_t lean_expr_has_level_mvar(lean_object*);
|
||||
static lean_object* l_Lean_ExprStructEq_instBEqExprStructEq___closed__1;
|
||||
static lean_object* l_Lean_Expr_updateForall_x21___closed__1;
|
||||
|
|
@ -208,7 +209,6 @@ static lean_object* l_Lean_ExprStructEq_instHashableExprStructEq___closed__1;
|
|||
static lean_object* l_Lean_Expr_appFn_x21___closed__3;
|
||||
lean_object* l_Lean_Expr_isNatLit_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_getOptParamDefault_x3f(lean_object*);
|
||||
lean_object* l_Lean_isLHSGoal_x3f_match__1(lean_object*);
|
||||
lean_object* l_Lean_Expr_getRevArgD(lean_object*, lean_object*, lean_object*);
|
||||
uint64_t l_List_foldl___at_Lean_mkConst___spec__1(uint64_t, lean_object*);
|
||||
lean_object* l_List_mapTRAux___at_Lean_Expr_instantiateLevelParams___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -284,6 +284,7 @@ lean_object* l_Lean_mkLet___boxed(lean_object*, lean_object*, lean_object*, lean
|
|||
lean_object* l_Lean_BinderInfo_noConfusion___rarg(uint8_t, uint8_t, lean_object*);
|
||||
lean_object* lean_expr_lower_loose_bvars(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_setOption___at_Lean_Expr_setPPExplicit___spec__1(lean_object*, lean_object*, uint8_t);
|
||||
lean_object* l_Lean_letFunAnnotation_x3f(lean_object*);
|
||||
lean_object* l_Lean_Expr_isMVar___boxed(lean_object*);
|
||||
lean_object* l___private_Lean_Expr_0__Lean_beqBinderInfo____x40_Lean_Expr___hyg_309____boxed(lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Expr_Data_hasExprMVar(uint64_t);
|
||||
|
|
@ -314,6 +315,7 @@ static lean_object* l_Lean_Expr_updateForall_x21___closed__2;
|
|||
static lean_object* l_Lean_Expr_updateLambdaE_x21___closed__2;
|
||||
lean_object* l_Lean_mkProj(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_instReprFVarId___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_isLetFun_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Expr_getOptParamDefault_x3f___closed__2;
|
||||
lean_object* l_Lean_BinderInfo_noConfusion___rarg___lambda__1___boxed(lean_object*);
|
||||
lean_object* l_Lean_Expr_inferImplicit_match__1___rarg(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -363,6 +365,7 @@ static uint64_t l_Lean_Expr_mkData___closed__2;
|
|||
lean_object* lean_level_update_max(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_mkAnnotation(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_isLit_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_letFunAnnotation_x3f___boxed(lean_object*);
|
||||
lean_object* l_Lean_Name_toString(lean_object*, uint8_t);
|
||||
lean_object* l_Lean_Expr_isHeadBetaTargetFn_match__1(lean_object*);
|
||||
uint8_t l_Lean_BinderInfo_isStrictImplicit(uint8_t);
|
||||
|
|
@ -399,6 +402,7 @@ static lean_object* l___private_Lean_Expr_0__Lean_reprBinderInfo____x40_Lean_Exp
|
|||
lean_object* l_Lean_Expr_isFVar___boxed(lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Expr_setAppPPExplicitForExposingMVars___spec__1(size_t, size_t, lean_object*);
|
||||
uint64_t l_Lean_Name_hash(lean_object*);
|
||||
lean_object* l_Lean_isLetFun_match__1(lean_object*);
|
||||
lean_object* l_Nat_repr(lean_object*);
|
||||
lean_object* l___private_Lean_Expr_0__Lean_Expr_getParamSubst_match__1(lean_object*);
|
||||
uint8_t l_Lean_Expr_Data_hasFVar(uint64_t);
|
||||
|
|
@ -466,6 +470,7 @@ lean_object* l_Lean_Expr_mkDataForLet___boxed(lean_object*, lean_object*, lean_o
|
|||
uint64_t l___private_Lean_Level_0__Lean_hashMVarId____x40_Lean_Level___hyg_205_(lean_object*);
|
||||
lean_object* l_Lean_Expr_instantiate___boxed(lean_object*, lean_object*);
|
||||
uint8_t l___private_Lean_Expr_0__Lean_beqLiteral____x40_Lean_Expr___hyg_30_(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_isLetFun___boxed(lean_object*);
|
||||
static lean_object* l_Lean_mkSimpleThunk___closed__1;
|
||||
lean_object* l___private_Lean_Expr_0__Lean_reprLiteral____x40_Lean_Expr___hyg_98__match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Expr_appFn_x21___closed__1;
|
||||
|
|
@ -478,6 +483,7 @@ uint8_t l_Lean_Expr_isConstOf(lean_object*, lean_object*);
|
|||
static lean_object* l_Lean_Expr_fvarId_x21___closed__3;
|
||||
lean_object* l_Lean_Expr_instantiateRange___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_hasFVar___boxed(lean_object*);
|
||||
uint8_t l_Lean_isLetFun(lean_object*);
|
||||
lean_object* l_Lean_mkLambda(lean_object*, uint8_t, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_instBEqData__1___boxed(lean_object*, lean_object*);
|
||||
uint8_t l_Lean_BinderInfo_isAuxDecl(uint8_t);
|
||||
|
|
@ -668,7 +674,6 @@ lean_object* l_Lean_Expr_quickLt___boxed(lean_object*, lean_object*);
|
|||
lean_object* l_Lean_Expr_instToStringExpr;
|
||||
static lean_object* l_Lean_mkEM___closed__4;
|
||||
lean_object* l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux_match__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_isLHSGoal_x3f_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_isFVar_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
uint64_t l_UInt32_toUInt64(uint32_t);
|
||||
lean_object* l_Lean_ExprStructEq_instToStringExprStructEq___boxed(lean_object*);
|
||||
|
|
@ -794,6 +799,7 @@ lean_object* l_Lean_instBEqLiteral;
|
|||
lean_object* l_Lean_Expr_getArgD___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_instDecidableLt(lean_object*, lean_object*);
|
||||
static lean_object* l___private_Lean_Expr_0__Lean_reprBinderInfo____x40_Lean_Expr___hyg_324____closed__8;
|
||||
static lean_object* l_Lean_mkLetFunAnnotation___closed__2;
|
||||
lean_object* l___private_Lean_Expr_0__Lean_reprBinderInfo____x40_Lean_Expr___hyg_324__match__1___rarg(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_instBEqBinderInfo___closed__1;
|
||||
lean_object* l___private_Lean_Expr_0__Lean_beqLiteral____x40_Lean_Expr___hyg_30__match__1(lean_object*);
|
||||
|
|
@ -820,6 +826,7 @@ lean_object* l_Lean_Expr_bindingBody_x21(lean_object*);
|
|||
lean_object* l_Lean_Expr_equal___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_updateLet_x21(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Literal_lt(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_mkLetFunAnnotation___closed__1;
|
||||
lean_object* l_Lean_Expr_updateForall___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_bindingInfo_x21___boxed(lean_object*);
|
||||
|
|
@ -16762,6 +16769,129 @@ lean_dec(x_1);
|
|||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_mkLetFunAnnotation___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("let_fun");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_mkLetFunAnnotation___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_mkLetFunAnnotation___closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_mkLetFunAnnotation(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = l_Lean_mkLetFunAnnotation___closed__2;
|
||||
x_3 = l_Lean_mkAnnotation(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_letFunAnnotation_x3f(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = l_Lean_mkLetFunAnnotation___closed__2;
|
||||
x_3 = l_Lean_annotation_x3f(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_letFunAnnotation_x3f___boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_letFunAnnotation_x3f(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_isLetFun_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
if (lean_obj_tag(x_1) == 0)
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5;
|
||||
lean_dec(x_3);
|
||||
x_4 = lean_box(0);
|
||||
x_5 = lean_apply_1(x_2, x_4);
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7;
|
||||
lean_dec(x_2);
|
||||
x_6 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_6);
|
||||
lean_dec(x_1);
|
||||
x_7 = lean_apply_1(x_3, x_6);
|
||||
return x_7;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_isLetFun_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_isLetFun_match__1___rarg), 3, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_isLetFun(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_letFunAnnotation_x3f(x_1);
|
||||
if (lean_obj_tag(x_2) == 0)
|
||||
{
|
||||
uint8_t x_3;
|
||||
x_3 = 0;
|
||||
return x_3;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_4; uint8_t x_5;
|
||||
x_4 = lean_ctor_get(x_2, 0);
|
||||
lean_inc(x_4);
|
||||
lean_dec(x_2);
|
||||
x_5 = l_Lean_Expr_isApp(x_4);
|
||||
if (x_5 == 0)
|
||||
{
|
||||
uint8_t x_6;
|
||||
lean_dec(x_4);
|
||||
x_6 = 0;
|
||||
return x_6;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_7; uint8_t x_8;
|
||||
x_7 = l_Lean_Expr_appFn_x21(x_4);
|
||||
lean_dec(x_4);
|
||||
x_8 = l_Lean_Expr_isLambda(x_7);
|
||||
lean_dec(x_7);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_isLetFun___boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_2; lean_object* x_3;
|
||||
x_2 = l_Lean_isLetFun(x_1);
|
||||
lean_dec(x_1);
|
||||
x_3 = lean_box(x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_mkLHSGoal___closed__1() {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -16789,37 +16919,6 @@ x_3 = l_Lean_mkAnnotation(x_2, x_1);
|
|||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_isLHSGoal_x3f_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
if (lean_obj_tag(x_1) == 0)
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5;
|
||||
lean_dec(x_3);
|
||||
x_4 = lean_box(0);
|
||||
x_5 = lean_apply_1(x_2, x_4);
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7;
|
||||
lean_dec(x_2);
|
||||
x_6 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_6);
|
||||
lean_dec(x_1);
|
||||
x_7 = lean_apply_1(x_3, x_6);
|
||||
return x_7;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_isLHSGoal_x3f_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_isLHSGoal_x3f_match__1___rarg), 3, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_isLHSGoal_x3f___closed__1() {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -17588,6 +17687,10 @@ l_Lean_Expr_setPPUniverses___closed__2 = _init_l_Lean_Expr_setPPUniverses___clos
|
|||
lean_mark_persistent(l_Lean_Expr_setPPUniverses___closed__2);
|
||||
l_Lean_mkAnnotation___closed__1 = _init_l_Lean_mkAnnotation___closed__1();
|
||||
lean_mark_persistent(l_Lean_mkAnnotation___closed__1);
|
||||
l_Lean_mkLetFunAnnotation___closed__1 = _init_l_Lean_mkLetFunAnnotation___closed__1();
|
||||
lean_mark_persistent(l_Lean_mkLetFunAnnotation___closed__1);
|
||||
l_Lean_mkLetFunAnnotation___closed__2 = _init_l_Lean_mkLetFunAnnotation___closed__2();
|
||||
lean_mark_persistent(l_Lean_mkLetFunAnnotation___closed__2);
|
||||
l_Lean_mkLHSGoal___closed__1 = _init_l_Lean_mkLHSGoal___closed__1();
|
||||
lean_mark_persistent(l_Lean_mkLHSGoal___closed__1);
|
||||
l_Lean_mkLHSGoal___closed__2 = _init_l_Lean_mkLHSGoal___closed__2();
|
||||
|
|
|
|||
117
stage0/stdlib/Lean/Meta/AppBuilder.c
generated
117
stage0/stdlib/Lean/Meta/AppBuilder.c
generated
|
|
@ -76,6 +76,7 @@ lean_object* lean_environment_find(lean_object*, lean_object*);
|
|||
lean_object* l_Lean_getConstInfo___at_Lean_Meta_mkConstWithFreshMVarLevels___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkSorry___closed__4;
|
||||
lean_object* l_Lean_Meta_isMonad_x3f_match__1(lean_object*);
|
||||
lean_object* l_Lean_Meta_mkLetCongr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_mkProjection_match__5(lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkEqOfHEq___closed__4;
|
||||
static lean_object* l_Lean_Meta_mkPure___closed__1;
|
||||
|
|
@ -86,6 +87,7 @@ lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Meta_AppBuilder_0__Le
|
|||
lean_object* l_Lean_Meta_mkCongrFun(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkFalseElim___closed__3;
|
||||
static lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkAppOptMAux___closed__5;
|
||||
lean_object* l_Lean_Meta_mkLetBodyCongr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_mkEqRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkId___closed__2;
|
||||
lean_object* l_Lean_Meta_mkProjection_match__4(lean_object*);
|
||||
|
|
@ -118,10 +120,12 @@ lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_throwAppBuilderExcept
|
|||
lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkAppMFinal___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkNoConfusion___closed__9;
|
||||
lean_object* l_Lean_getProjFnForField_x3f(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkLetBodyCongr___closed__2;
|
||||
static lean_object* l_Lean_Meta_mkDecide___closed__1;
|
||||
static lean_object* l_Lean_Meta_mkProjection___closed__4;
|
||||
static lean_object* l_Lean_Meta_mkSorry___closed__9;
|
||||
uint8_t l_USize_decLt(size_t, size_t);
|
||||
static lean_object* l_Lean_Meta_mkLetBodyCongr___closed__1;
|
||||
lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkAppMArgs_loop_match__1___rarg(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkCongrArg___closed__2;
|
||||
lean_object* l_Lean_Meta_mkAppOptM(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -159,6 +163,7 @@ lean_object* lean_expr_instantiate_rev_range(lean_object*, lean_object*, lean_ob
|
|||
lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkAppMArgs_loop_match__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkFalseElim___closed__4;
|
||||
lean_object* l_Lean_Meta_mkLetValCongr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkDecide___closed__3;
|
||||
lean_object* l_Lean_Meta_mkSorry(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkEqFalse___closed__2;
|
||||
|
|
@ -191,11 +196,13 @@ lean_object* l_Lean_Meta_mkEqTrans_match__1___rarg(lean_object*, lean_object*, l
|
|||
static lean_object* l_Lean_Meta_mkEqNDRec___closed__6;
|
||||
lean_object* l_Lean_Name_toString(lean_object*, uint8_t);
|
||||
static lean_object* l_Lean_Meta_mkNoConfusion___closed__1;
|
||||
static lean_object* l_Lean_Meta_mkLetValCongr___closed__2;
|
||||
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkFun___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkNumeral___closed__2;
|
||||
lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkAppOptMAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkAppOptMAux_match__2(lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkLetValCongr___closed__1;
|
||||
lean_object* l_List_mapM___at___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkFun___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkNoConfusion___closed__4;
|
||||
lean_object* l_Lean_Meta_mkEqSymm_match__1(lean_object*);
|
||||
|
|
@ -218,9 +225,11 @@ static lean_object* l_Lean_Meta_mkHEqRefl___closed__1;
|
|||
lean_object* l_Lean_Meta_mkArrayLit(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_mkAbsurd(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkEqTrans___closed__1;
|
||||
static lean_object* l_Lean_Meta_mkLetCongr___closed__1;
|
||||
lean_object* l_Lean_Meta_mkProjection___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkEqRec___closed__1;
|
||||
static lean_object* l_Lean_Meta_mkProjection___lambda__1___closed__1;
|
||||
static lean_object* l_Lean_Meta_mkLetCongr___closed__2;
|
||||
static lean_object* l_Lean_Meta_mkProjection___lambda__1___closed__3;
|
||||
lean_object* l_Lean_Meta_mkProjection_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_mkFalseElim___closed__2;
|
||||
|
|
@ -352,7 +361,7 @@ static lean_object* l_Lean_Meta_mkEqOfHEq___closed__3;
|
|||
static lean_object* l_Lean_Meta_mkProjection___lambda__1___closed__9;
|
||||
static lean_object* l_Lean_Meta_mkEqMPR___closed__1;
|
||||
lean_object* lean_infer_type(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_AppBuilder___hyg_4527_(lean_object*);
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_AppBuilder___hyg_4572_(lean_object*);
|
||||
lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Basic_0__Lean_Meta_mkFreshExprMVarImpl(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_withNewMCtxDepth___at___private_Lean_Meta_Instances_0__Lean_Meta_mkInstanceKey___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -12284,6 +12293,96 @@ x_10 = l_Lean_Meta_mkAppM(x_9, x_8, x_2, x_3, x_4, x_5, x_6);
|
|||
return x_10;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkLetCongr___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("let_congr");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkLetCongr___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_Meta_mkLetCongr___closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_mkLetCongr(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
|
||||
x_8 = l_Lean_Meta_mkEqMP___closed__3;
|
||||
x_9 = lean_array_push(x_8, x_1);
|
||||
x_10 = lean_array_push(x_9, x_2);
|
||||
x_11 = l_Lean_Meta_mkLetCongr___closed__2;
|
||||
x_12 = l_Lean_Meta_mkAppM(x_11, x_10, x_3, x_4, x_5, x_6, x_7);
|
||||
return x_12;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkLetValCongr___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("let_val_congr");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkLetValCongr___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_Meta_mkLetValCongr___closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_mkLetValCongr(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
|
||||
x_8 = l_Lean_Meta_mkEqMP___closed__3;
|
||||
x_9 = lean_array_push(x_8, x_1);
|
||||
x_10 = lean_array_push(x_9, x_2);
|
||||
x_11 = l_Lean_Meta_mkLetValCongr___closed__2;
|
||||
x_12 = l_Lean_Meta_mkAppM(x_11, x_10, x_3, x_4, x_5, x_6, x_7);
|
||||
return x_12;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkLetBodyCongr___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("let_body_congr");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkLetBodyCongr___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_Meta_mkLetBodyCongr___closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_mkLetBodyCongr(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
|
||||
x_8 = l_Lean_Meta_mkEqMP___closed__3;
|
||||
x_9 = lean_array_push(x_8, x_1);
|
||||
x_10 = lean_array_push(x_9, x_2);
|
||||
x_11 = l_Lean_Meta_mkLetBodyCongr___closed__2;
|
||||
x_12 = l_Lean_Meta_mkAppM(x_11, x_10, x_3, x_4, x_5, x_6, x_7);
|
||||
return x_12;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_mkOfEqTrue___closed__1() {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -13148,7 +13247,7 @@ x_10 = l___private_Lean_Meta_AppBuilder_0__Lean_Meta_mkBinaryOp(x_8, x_9, x_1, x
|
|||
return x_10;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_AppBuilder___hyg_4527_(lean_object* x_1) {
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_AppBuilder___hyg_4572_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
|
|
@ -13524,6 +13623,18 @@ l_Lean_Meta_mkPropExt___closed__1 = _init_l_Lean_Meta_mkPropExt___closed__1();
|
|||
lean_mark_persistent(l_Lean_Meta_mkPropExt___closed__1);
|
||||
l_Lean_Meta_mkPropExt___closed__2 = _init_l_Lean_Meta_mkPropExt___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_mkPropExt___closed__2);
|
||||
l_Lean_Meta_mkLetCongr___closed__1 = _init_l_Lean_Meta_mkLetCongr___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_mkLetCongr___closed__1);
|
||||
l_Lean_Meta_mkLetCongr___closed__2 = _init_l_Lean_Meta_mkLetCongr___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_mkLetCongr___closed__2);
|
||||
l_Lean_Meta_mkLetValCongr___closed__1 = _init_l_Lean_Meta_mkLetValCongr___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_mkLetValCongr___closed__1);
|
||||
l_Lean_Meta_mkLetValCongr___closed__2 = _init_l_Lean_Meta_mkLetValCongr___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_mkLetValCongr___closed__2);
|
||||
l_Lean_Meta_mkLetBodyCongr___closed__1 = _init_l_Lean_Meta_mkLetBodyCongr___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_mkLetBodyCongr___closed__1);
|
||||
l_Lean_Meta_mkLetBodyCongr___closed__2 = _init_l_Lean_Meta_mkLetBodyCongr___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_mkLetBodyCongr___closed__2);
|
||||
l_Lean_Meta_mkOfEqTrue___closed__1 = _init_l_Lean_Meta_mkOfEqTrue___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_mkOfEqTrue___closed__1);
|
||||
l_Lean_Meta_mkOfEqTrue___closed__2 = _init_l_Lean_Meta_mkOfEqTrue___closed__2();
|
||||
|
|
@ -13588,7 +13699,7 @@ l_Lean_Meta_mkMul___closed__3 = _init_l_Lean_Meta_mkMul___closed__3();
|
|||
lean_mark_persistent(l_Lean_Meta_mkMul___closed__3);
|
||||
l_Lean_Meta_mkMul___closed__4 = _init_l_Lean_Meta_mkMul___closed__4();
|
||||
lean_mark_persistent(l_Lean_Meta_mkMul___closed__4);
|
||||
res = l_Lean_Meta_initFn____x40_Lean_Meta_AppBuilder___hyg_4527_(lean_io_mk_world());
|
||||
res = l_Lean_Meta_initFn____x40_Lean_Meta_AppBuilder___hyg_4572_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
|
|
|
|||
400
stage0/stdlib/Lean/Meta/Match/Match.c
generated
400
stage0/stdlib/Lean/Meta/Match/Match.c
generated
|
|
@ -113,7 +113,7 @@ lean_object* l_Lean_Meta_forallTelescopeReducing___at_Lean_Meta_getParamNames___
|
|||
lean_object* l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_mkMatcher___lambda__4___closed__2;
|
||||
static lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_throwInductiveTypeExpected___rarg___closed__3;
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_extract___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_process_search(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_EnvExtensionInterfaceUnsafe_registerExt___rarg(lean_object*, lean_object*);
|
||||
|
|
@ -233,7 +233,7 @@ lean_object* l_List_mapTRAux___at___private_Lean_Meta_Match_Match_0__Lean_Meta_M
|
|||
lean_object* l_List_foldr___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_hasVarPattern___spec__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_traceStep(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_hasValPattern_match__1(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_getMkMatcherInputInContext___lambda__3___closed__4;
|
||||
lean_object* l_Lean_Meta_Match_getMkMatcherInputInContext___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_matcherExt___closed__2;
|
||||
|
|
@ -268,7 +268,7 @@ lean_object* l_Lean_mkAppN(lean_object*, lean_object*);
|
|||
static lean_object* l_List_filterMapM_loop___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___spec__1___closed__2;
|
||||
static lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_withAlts_loop___rarg___closed__3;
|
||||
size_t l_UInt64_toUSize(uint64_t);
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Match_Match___hyg_9482_(lean_object*);
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Match_Match___hyg_9460_(lean_object*);
|
||||
uint8_t l_Lean_Environment_hasUnsafe(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_checkNextPatternTypes(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcher_match__2(lean_object*);
|
||||
|
|
@ -452,7 +452,7 @@ static lean_object* l_Lean_Meta_Match_initFn____x40_Lean_Meta_Match_Match___hyg_
|
|||
lean_object* l_List_foldr___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_isConstructorTransition___spec__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_List_moveToFront___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_moveToFront___spec__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_process_checkVarDeps_match__1(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processAsPattern___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_array_to_list(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_expandVarIntoArrayLit_loop_match__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -623,7 +623,7 @@ static lean_object* l_Lean_Meta_Match_initFn____x40_Lean_Meta_Match_Match___hyg_
|
|||
lean_object* l_Lean_Name_append(lean_object*, lean_object*);
|
||||
static lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_process_tryToProcess___lambda__1___closed__1;
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processSkipInaccessible_match__2___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processAsPattern___closed__3;
|
||||
lean_object* l_Lean_Meta_FVarSubst_insert(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_isCurrVarInductive(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -773,7 +773,7 @@ lean_object* l_Lean_indentD(lean_object*);
|
|||
static lean_object* l_Lean_Meta_Match_State_used___default___closed__1;
|
||||
lean_object* l_List_mapTRAux___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_expandVarIntoCtor_x3f___spec__4___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_initFn____x40_Lean_Meta_Match_Match___hyg_7282____lambda__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_List_filterMapM_loop___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processConstructor___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_examplesToMessageData(lean_object*);
|
||||
lean_object* l_Lean_Expr_FindImpl_findM_x3f_visit(lean_object*, size_t, lean_object*, lean_object*);
|
||||
|
|
@ -799,7 +799,6 @@ lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_inLocalDecls__
|
|||
lean_object* l_Lean_Meta_Match_mkMatcher_match__3___rarg(lean_object*, lean_object*);
|
||||
static lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processVariable___closed__1;
|
||||
lean_object* l_Lean_Meta_setInlineAttribute(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processValue(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_mkMatcher___lambda__5___closed__3;
|
||||
static lean_object* l_Lean_Meta_Match_mkMatcher___lambda__5___closed__7;
|
||||
|
|
@ -845,7 +844,6 @@ lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_hasNonTrivialE
|
|||
lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_isVariableTransition___boxed(lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Meta_Match_mkMatcher___spec__2(size_t, size_t, lean_object*);
|
||||
lean_object* l_Std_HashSetImp_moveEntries___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processLeaf___spec__5(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_indentExpr(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_MatcherApp_addArg___lambda__2___closed__2;
|
||||
|
|
@ -24126,84 +24124,7 @@ x_6 = l_Std_PersistentHashMap_insert___rarg(x_1, x_2, x_5, x_3, x_4);
|
|||
return x_6;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15;
|
||||
x_12 = lean_st_ref_take(x_10, x_11);
|
||||
x_13 = lean_ctor_get(x_12, 0);
|
||||
lean_inc(x_13);
|
||||
x_14 = lean_ctor_get(x_12, 1);
|
||||
lean_inc(x_14);
|
||||
lean_dec(x_12);
|
||||
x_15 = !lean_is_exclusive(x_13);
|
||||
if (x_15 == 0)
|
||||
{
|
||||
lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; uint8_t x_24; lean_object* x_25;
|
||||
x_16 = lean_ctor_get(x_13, 0);
|
||||
lean_inc(x_4);
|
||||
x_17 = lean_alloc_closure((void*)(l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__1), 5, 4);
|
||||
lean_closure_set(x_17, 0, x_1);
|
||||
lean_closure_set(x_17, 1, x_2);
|
||||
lean_closure_set(x_17, 2, x_3);
|
||||
lean_closure_set(x_17, 3, x_4);
|
||||
x_18 = l_Lean_Meta_Match_matcherExt;
|
||||
x_19 = l_Lean_EnvExtensionInterfaceUnsafe_imp___elambda__2___rarg(x_18, x_16, x_17);
|
||||
lean_ctor_set(x_13, 0, x_19);
|
||||
x_20 = lean_st_ref_set(x_10, x_13, x_14);
|
||||
x_21 = lean_ctor_get(x_20, 1);
|
||||
lean_inc(x_21);
|
||||
lean_dec(x_20);
|
||||
lean_inc(x_4);
|
||||
x_22 = l_Lean_Meta_Match_addMatcherInfo(x_4, x_5, x_7, x_8, x_9, x_10, x_21);
|
||||
x_23 = lean_ctor_get(x_22, 1);
|
||||
lean_inc(x_23);
|
||||
lean_dec(x_22);
|
||||
x_24 = 0;
|
||||
x_25 = l_Lean_Meta_setInlineAttribute(x_4, x_24, x_7, x_8, x_9, x_10, x_23);
|
||||
return x_25;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; uint8_t x_38; lean_object* x_39;
|
||||
x_26 = lean_ctor_get(x_13, 0);
|
||||
x_27 = lean_ctor_get(x_13, 1);
|
||||
x_28 = lean_ctor_get(x_13, 2);
|
||||
x_29 = lean_ctor_get(x_13, 3);
|
||||
lean_inc(x_29);
|
||||
lean_inc(x_28);
|
||||
lean_inc(x_27);
|
||||
lean_inc(x_26);
|
||||
lean_dec(x_13);
|
||||
lean_inc(x_4);
|
||||
x_30 = lean_alloc_closure((void*)(l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__1), 5, 4);
|
||||
lean_closure_set(x_30, 0, x_1);
|
||||
lean_closure_set(x_30, 1, x_2);
|
||||
lean_closure_set(x_30, 2, x_3);
|
||||
lean_closure_set(x_30, 3, x_4);
|
||||
x_31 = l_Lean_Meta_Match_matcherExt;
|
||||
x_32 = l_Lean_EnvExtensionInterfaceUnsafe_imp___elambda__2___rarg(x_31, x_26, x_30);
|
||||
x_33 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_33, 0, x_32);
|
||||
lean_ctor_set(x_33, 1, x_27);
|
||||
lean_ctor_set(x_33, 2, x_28);
|
||||
lean_ctor_set(x_33, 3, x_29);
|
||||
x_34 = lean_st_ref_set(x_10, x_33, x_14);
|
||||
x_35 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_35);
|
||||
lean_dec(x_34);
|
||||
lean_inc(x_4);
|
||||
x_36 = l_Lean_Meta_Match_addMatcherInfo(x_4, x_5, x_7, x_8, x_9, x_10, x_35);
|
||||
x_37 = lean_ctor_get(x_36, 1);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_36);
|
||||
x_38 = 0;
|
||||
x_39 = l_Lean_Meta_setInlineAttribute(x_4, x_38, x_7, x_8, x_9, x_10, x_37);
|
||||
return x_39;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, uint8_t x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, uint8_t x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_13;
|
||||
|
|
@ -24212,76 +24133,230 @@ lean_inc(x_1);
|
|||
x_13 = l_Lean_addDecl___at_Lean_Meta_mkAuxDefinition___spec__1(x_1, x_8, x_9, x_10, x_11, x_12);
|
||||
if (lean_obj_tag(x_13) == 0)
|
||||
{
|
||||
if (x_6 == 0)
|
||||
{
|
||||
lean_object* x_14; lean_object* x_15; lean_object* x_16;
|
||||
lean_dec(x_1);
|
||||
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18;
|
||||
x_14 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_14);
|
||||
lean_dec(x_13);
|
||||
x_15 = lean_box(0);
|
||||
x_16 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(x_2, x_3, x_4, x_5, x_7, x_15, x_8, x_9, x_10, x_11, x_14);
|
||||
return x_16;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_17; lean_object* x_18;
|
||||
x_17 = lean_ctor_get(x_13, 1);
|
||||
x_15 = lean_st_ref_take(x_11, x_14);
|
||||
x_16 = lean_ctor_get(x_15, 0);
|
||||
lean_inc(x_16);
|
||||
x_17 = lean_ctor_get(x_15, 1);
|
||||
lean_inc(x_17);
|
||||
lean_dec(x_13);
|
||||
lean_dec(x_15);
|
||||
x_18 = !lean_is_exclusive(x_16);
|
||||
if (x_18 == 0)
|
||||
{
|
||||
lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27; lean_object* x_28;
|
||||
x_19 = lean_ctor_get(x_16, 0);
|
||||
lean_inc(x_5);
|
||||
x_20 = lean_alloc_closure((void*)(l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__1), 5, 4);
|
||||
lean_closure_set(x_20, 0, x_2);
|
||||
lean_closure_set(x_20, 1, x_3);
|
||||
lean_closure_set(x_20, 2, x_4);
|
||||
lean_closure_set(x_20, 3, x_5);
|
||||
x_21 = l_Lean_Meta_Match_matcherExt;
|
||||
x_22 = l_Lean_EnvExtensionInterfaceUnsafe_imp___elambda__2___rarg(x_21, x_19, x_20);
|
||||
lean_ctor_set(x_16, 0, x_22);
|
||||
x_23 = lean_st_ref_set(x_11, x_16, x_17);
|
||||
x_24 = lean_ctor_get(x_23, 1);
|
||||
lean_inc(x_24);
|
||||
lean_dec(x_23);
|
||||
lean_inc(x_5);
|
||||
x_25 = l_Lean_Meta_Match_addMatcherInfo(x_5, x_7, x_8, x_9, x_10, x_11, x_24);
|
||||
x_26 = lean_ctor_get(x_25, 1);
|
||||
lean_inc(x_26);
|
||||
lean_dec(x_25);
|
||||
x_27 = 0;
|
||||
lean_inc(x_11);
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
x_18 = l_Lean_compileDecl___at_Lean_Meta_mkAuxDefinition___spec__3(x_1, x_8, x_9, x_10, x_11, x_17);
|
||||
if (lean_obj_tag(x_18) == 0)
|
||||
x_28 = l_Lean_Meta_setInlineAttribute(x_5, x_27, x_8, x_9, x_10, x_11, x_26);
|
||||
if (lean_obj_tag(x_28) == 0)
|
||||
{
|
||||
lean_object* x_19; lean_object* x_20; lean_object* x_21;
|
||||
x_19 = lean_ctor_get(x_18, 0);
|
||||
lean_inc(x_19);
|
||||
x_20 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_20);
|
||||
lean_dec(x_18);
|
||||
x_21 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(x_2, x_3, x_4, x_5, x_7, x_19, x_8, x_9, x_10, x_11, x_20);
|
||||
lean_dec(x_19);
|
||||
return x_21;
|
||||
}
|
||||
else
|
||||
if (x_6 == 0)
|
||||
{
|
||||
uint8_t x_22;
|
||||
uint8_t x_29;
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
x_22 = !lean_is_exclusive(x_18);
|
||||
if (x_22 == 0)
|
||||
lean_dec(x_1);
|
||||
x_29 = !lean_is_exclusive(x_28);
|
||||
if (x_29 == 0)
|
||||
{
|
||||
return x_18;
|
||||
lean_object* x_30; lean_object* x_31;
|
||||
x_30 = lean_ctor_get(x_28, 0);
|
||||
lean_dec(x_30);
|
||||
x_31 = lean_box(0);
|
||||
lean_ctor_set(x_28, 0, x_31);
|
||||
return x_28;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_23; lean_object* x_24; lean_object* x_25;
|
||||
x_23 = lean_ctor_get(x_18, 0);
|
||||
x_24 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_24);
|
||||
lean_inc(x_23);
|
||||
lean_dec(x_18);
|
||||
x_25 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_25, 0, x_23);
|
||||
lean_ctor_set(x_25, 1, x_24);
|
||||
return x_25;
|
||||
lean_object* x_32; lean_object* x_33; lean_object* x_34;
|
||||
x_32 = lean_ctor_get(x_28, 1);
|
||||
lean_inc(x_32);
|
||||
lean_dec(x_28);
|
||||
x_33 = lean_box(0);
|
||||
x_34 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_34, 0, x_33);
|
||||
lean_ctor_set(x_34, 1, x_32);
|
||||
return x_34;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_35; lean_object* x_36;
|
||||
x_35 = lean_ctor_get(x_28, 1);
|
||||
lean_inc(x_35);
|
||||
lean_dec(x_28);
|
||||
x_36 = l_Lean_compileDecl___at_Lean_Meta_mkAuxDefinition___spec__3(x_1, x_8, x_9, x_10, x_11, x_35);
|
||||
return x_36;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_37;
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_1);
|
||||
x_37 = !lean_is_exclusive(x_28);
|
||||
if (x_37 == 0)
|
||||
{
|
||||
return x_28;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_38; lean_object* x_39; lean_object* x_40;
|
||||
x_38 = lean_ctor_get(x_28, 0);
|
||||
x_39 = lean_ctor_get(x_28, 1);
|
||||
lean_inc(x_39);
|
||||
lean_inc(x_38);
|
||||
lean_dec(x_28);
|
||||
x_40 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_40, 0, x_38);
|
||||
lean_ctor_set(x_40, 1, x_39);
|
||||
return x_40;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_26;
|
||||
lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; uint8_t x_53; lean_object* x_54;
|
||||
x_41 = lean_ctor_get(x_16, 0);
|
||||
x_42 = lean_ctor_get(x_16, 1);
|
||||
x_43 = lean_ctor_get(x_16, 2);
|
||||
x_44 = lean_ctor_get(x_16, 3);
|
||||
lean_inc(x_44);
|
||||
lean_inc(x_43);
|
||||
lean_inc(x_42);
|
||||
lean_inc(x_41);
|
||||
lean_dec(x_16);
|
||||
lean_inc(x_5);
|
||||
x_45 = lean_alloc_closure((void*)(l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__1), 5, 4);
|
||||
lean_closure_set(x_45, 0, x_2);
|
||||
lean_closure_set(x_45, 1, x_3);
|
||||
lean_closure_set(x_45, 2, x_4);
|
||||
lean_closure_set(x_45, 3, x_5);
|
||||
x_46 = l_Lean_Meta_Match_matcherExt;
|
||||
x_47 = l_Lean_EnvExtensionInterfaceUnsafe_imp___elambda__2___rarg(x_46, x_41, x_45);
|
||||
x_48 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_48, 0, x_47);
|
||||
lean_ctor_set(x_48, 1, x_42);
|
||||
lean_ctor_set(x_48, 2, x_43);
|
||||
lean_ctor_set(x_48, 3, x_44);
|
||||
x_49 = lean_st_ref_set(x_11, x_48, x_17);
|
||||
x_50 = lean_ctor_get(x_49, 1);
|
||||
lean_inc(x_50);
|
||||
lean_dec(x_49);
|
||||
lean_inc(x_5);
|
||||
x_51 = l_Lean_Meta_Match_addMatcherInfo(x_5, x_7, x_8, x_9, x_10, x_11, x_50);
|
||||
x_52 = lean_ctor_get(x_51, 1);
|
||||
lean_inc(x_52);
|
||||
lean_dec(x_51);
|
||||
x_53 = 0;
|
||||
lean_inc(x_11);
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
x_54 = l_Lean_Meta_setInlineAttribute(x_5, x_53, x_8, x_9, x_10, x_11, x_52);
|
||||
if (lean_obj_tag(x_54) == 0)
|
||||
{
|
||||
if (x_6 == 0)
|
||||
{
|
||||
lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58;
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_1);
|
||||
x_55 = lean_ctor_get(x_54, 1);
|
||||
lean_inc(x_55);
|
||||
if (lean_is_exclusive(x_54)) {
|
||||
lean_ctor_release(x_54, 0);
|
||||
lean_ctor_release(x_54, 1);
|
||||
x_56 = x_54;
|
||||
} else {
|
||||
lean_dec_ref(x_54);
|
||||
x_56 = lean_box(0);
|
||||
}
|
||||
x_57 = lean_box(0);
|
||||
if (lean_is_scalar(x_56)) {
|
||||
x_58 = lean_alloc_ctor(0, 2, 0);
|
||||
} else {
|
||||
x_58 = x_56;
|
||||
}
|
||||
lean_ctor_set(x_58, 0, x_57);
|
||||
lean_ctor_set(x_58, 1, x_55);
|
||||
return x_58;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_59; lean_object* x_60;
|
||||
x_59 = lean_ctor_get(x_54, 1);
|
||||
lean_inc(x_59);
|
||||
lean_dec(x_54);
|
||||
x_60 = l_Lean_compileDecl___at_Lean_Meta_mkAuxDefinition___spec__3(x_1, x_8, x_9, x_10, x_11, x_59);
|
||||
return x_60;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64;
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_1);
|
||||
x_61 = lean_ctor_get(x_54, 0);
|
||||
lean_inc(x_61);
|
||||
x_62 = lean_ctor_get(x_54, 1);
|
||||
lean_inc(x_62);
|
||||
if (lean_is_exclusive(x_54)) {
|
||||
lean_ctor_release(x_54, 0);
|
||||
lean_ctor_release(x_54, 1);
|
||||
x_63 = x_54;
|
||||
} else {
|
||||
lean_dec_ref(x_54);
|
||||
x_63 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_63)) {
|
||||
x_64 = lean_alloc_ctor(1, 2, 0);
|
||||
} else {
|
||||
x_64 = x_63;
|
||||
}
|
||||
lean_ctor_set(x_64, 0, x_61);
|
||||
lean_ctor_set(x_64, 1, x_62);
|
||||
return x_64;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_65;
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
|
|
@ -24292,34 +24367,34 @@ lean_dec(x_4);
|
|||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_26 = !lean_is_exclusive(x_13);
|
||||
if (x_26 == 0)
|
||||
x_65 = !lean_is_exclusive(x_13);
|
||||
if (x_65 == 0)
|
||||
{
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_27; lean_object* x_28; lean_object* x_29;
|
||||
x_27 = lean_ctor_get(x_13, 0);
|
||||
x_28 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_28);
|
||||
lean_inc(x_27);
|
||||
lean_object* x_66; lean_object* x_67; lean_object* x_68;
|
||||
x_66 = lean_ctor_get(x_13, 0);
|
||||
x_67 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_67);
|
||||
lean_inc(x_66);
|
||||
lean_dec(x_13);
|
||||
x_29 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_29, 0, x_27);
|
||||
lean_ctor_set(x_29, 1, x_28);
|
||||
return x_29;
|
||||
x_68 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_68, 0, x_66);
|
||||
lean_ctor_set(x_68, 1, x_67);
|
||||
return x_68;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, uint8_t x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, uint8_t x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23;
|
||||
x_14 = lean_box(x_6);
|
||||
lean_inc(x_5);
|
||||
x_15 = lean_alloc_closure((void*)(l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3___boxed), 12, 6);
|
||||
x_15 = lean_alloc_closure((void*)(l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2___boxed), 12, 6);
|
||||
lean_closure_set(x_15, 0, x_1);
|
||||
lean_closure_set(x_15, 1, x_2);
|
||||
lean_closure_set(x_15, 2, x_3);
|
||||
|
|
@ -24345,7 +24420,7 @@ lean_ctor_set(x_23, 1, x_13);
|
|||
return x_23;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__5(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_11; lean_object* x_12; uint8_t x_13; uint8_t x_14; lean_object* x_15;
|
||||
|
|
@ -24504,7 +24579,7 @@ lean_dec(x_33);
|
|||
lean_dec(x_25);
|
||||
lean_dec(x_4);
|
||||
x_46 = lean_box(0);
|
||||
x_47 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_43, x_28, x_29, x_27, x_3, x_13, x_16, x_46, x_6, x_7, x_8, x_9, x_45);
|
||||
x_47 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(x_43, x_28, x_29, x_27, x_3, x_13, x_16, x_46, x_6, x_7, x_8, x_9, x_45);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
|
|
@ -24548,7 +24623,7 @@ lean_inc(x_61);
|
|||
x_62 = lean_ctor_get(x_60, 1);
|
||||
lean_inc(x_62);
|
||||
lean_dec(x_60);
|
||||
x_63 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_43, x_28, x_29, x_27, x_3, x_13, x_16, x_61, x_6, x_7, x_8, x_9, x_62);
|
||||
x_63 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(x_43, x_28, x_29, x_27, x_3, x_13, x_16, x_61, x_6, x_7, x_8, x_9, x_62);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
|
|
@ -24725,7 +24800,7 @@ lean_dec(x_101);
|
|||
lean_dec(x_93);
|
||||
lean_dec(x_4);
|
||||
x_114 = lean_box(0);
|
||||
x_115 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_111, x_96, x_97, x_95, x_3, x_13, x_16, x_114, x_6, x_7, x_8, x_9, x_113);
|
||||
x_115 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(x_111, x_96, x_97, x_95, x_3, x_13, x_16, x_114, x_6, x_7, x_8, x_9, x_113);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
|
|
@ -24769,7 +24844,7 @@ lean_inc(x_129);
|
|||
x_130 = lean_ctor_get(x_128, 1);
|
||||
lean_inc(x_130);
|
||||
lean_dec(x_128);
|
||||
x_131 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_111, x_96, x_97, x_95, x_3, x_13, x_16, x_129, x_6, x_7, x_8, x_9, x_130);
|
||||
x_131 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(x_111, x_96, x_97, x_95, x_3, x_13, x_16, x_129, x_6, x_7, x_8, x_9, x_130);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
|
|
@ -24902,7 +24977,7 @@ if (x_10 == 0)
|
|||
{
|
||||
lean_object* x_12; lean_object* x_13;
|
||||
x_12 = lean_box(0);
|
||||
x_13 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__5(x_2, x_3, x_1, x_9, x_12, x_4, x_5, x_6, x_7, x_11);
|
||||
x_13 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_2, x_3, x_1, x_9, x_12, x_4, x_5, x_6, x_7, x_11);
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
|
|
@ -24944,7 +25019,7 @@ lean_inc(x_27);
|
|||
x_28 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_28);
|
||||
lean_dec(x_26);
|
||||
x_29 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__5(x_2, x_3, x_1, x_9, x_27, x_4, x_5, x_6, x_7, x_28);
|
||||
x_29 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_2, x_3, x_1, x_9, x_27, x_4, x_5, x_6, x_7, x_28);
|
||||
return x_29;
|
||||
}
|
||||
}
|
||||
|
|
@ -24960,32 +25035,23 @@ lean_dec(x_1);
|
|||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_12;
|
||||
x_12 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
lean_dec(x_6);
|
||||
return x_12;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_13; lean_object* x_14;
|
||||
x_13 = lean_unbox(x_6);
|
||||
lean_dec(x_6);
|
||||
x_14 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(x_1, x_2, x_3, x_4, x_5, x_13, x_7, x_8, x_9, x_10, x_11, x_12);
|
||||
x_14 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__2(x_1, x_2, x_3, x_4, x_5, x_13, x_7, x_8, x_9, x_10, x_11, x_12);
|
||||
return x_14;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
|
||||
lean_object* l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_14; lean_object* x_15;
|
||||
x_14 = lean_unbox(x_6);
|
||||
lean_dec(x_6);
|
||||
x_15 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__4(x_1, x_2, x_3, x_4, x_5, x_14, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
|
||||
x_15 = l_Lean_Meta_Match_mkMatcherAuxDefinition___lambda__3(x_1, x_2, x_3, x_4, x_5, x_14, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
|
|
@ -30204,7 +30270,7 @@ lean_dec(x_9);
|
|||
return x_15;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Match_Match___hyg_9482_(lean_object* x_1) {
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Match_Match___hyg_9460_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
|
|
@ -30800,7 +30866,7 @@ l_Lean_Meta_MatcherApp_addArg___lambda__4___closed__3 = _init_l_Lean_Meta_Matche
|
|||
lean_mark_persistent(l_Lean_Meta_MatcherApp_addArg___lambda__4___closed__3);
|
||||
l_Lean_Meta_MatcherApp_addArg___lambda__4___closed__4 = _init_l_Lean_Meta_MatcherApp_addArg___lambda__4___closed__4();
|
||||
lean_mark_persistent(l_Lean_Meta_MatcherApp_addArg___lambda__4___closed__4);
|
||||
res = l_Lean_Meta_initFn____x40_Lean_Meta_Match_Match___hyg_9482_(lean_io_mk_world());
|
||||
res = l_Lean_Meta_initFn____x40_Lean_Meta_Match_Match___hyg_9460_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
|
|
|
|||
412
stage0/stdlib/Lean/Meta/Match/MatcherInfo.c
generated
412
stage0/stdlib/Lean/Meta/Match/MatcherInfo.c
generated
|
|
@ -16,6 +16,8 @@ extern "C" {
|
|||
lean_object* l_List_reverse___rarg(lean_object*);
|
||||
size_t l_USize_add(size_t, size_t);
|
||||
lean_object* l_Lean_Meta_getMatcherInfo_x3f___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1;
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
|
||||
lean_object* l_Lean_mkSort(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__3;
|
||||
|
|
@ -25,80 +27,87 @@ lean_object* lean_name_mk_string(lean_object*, lean_object*);
|
|||
uint8_t l_USize_decEq(size_t, size_t);
|
||||
lean_object* lean_array_uget(lean_object*, size_t);
|
||||
lean_object* l_Lean_Meta_isMatcherCore___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_match__1(lean_object*);
|
||||
static lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___closed__1;
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_SimplePersistentEnvExtension_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__1___boxed(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___closed__1;
|
||||
lean_object* l_Array_extract___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_EnvExtensionInterfaceUnsafe_registerExt___rarg(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__7;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__5;
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_st_ref_get(lean_object*, lean_object*);
|
||||
extern lean_object* l_Lean_instHashableName;
|
||||
uint8_t lean_name_eq(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__1;
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__2(lean_object*, size_t, size_t, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getMotivePos(lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherApp___rarg___lambda__1(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3___closed__4;
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getFirstDiscrPos(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__3___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_array_push(lean_object*, lean_object*);
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_matchMatcherApp_x3f___rarg___lambda__1___closed__1;
|
||||
lean_object* lean_array_get_size(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_instInhabitedState___closed__2;
|
||||
lean_object* lean_string_append(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__2;
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_State_map___default;
|
||||
lean_object* l_Lean_SMap_switch___at_Lean_Meta_Match_Extension_State_switch___spec__1(lean_object*);
|
||||
static lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__1;
|
||||
lean_object* l_Lean_Meta_getMatcherInfo_x3f___rarg___lambda__1(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f_match__2(lean_object*);
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__2(lean_object*, size_t, size_t, lean_object*);
|
||||
lean_object* l_Lean_SMap_insert___at_Lean_Meta_Match_Extension_State_addEntry___spec__1(lean_object*, lean_object*, lean_object*);
|
||||
static uint32_t l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__1;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__2;
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getFirstDiscrPos___boxed(lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___boxed(lean_object*);
|
||||
extern lean_object* l_Lean_levelZero;
|
||||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5(lean_object*, lean_object*);
|
||||
extern lean_object* l___private_Lean_Environment_0__Lean_EnvExtensionInterfaceUnsafe_invalidExtMsg;
|
||||
lean_object* l_Lean_mkAppN(lean_object*, lean_object*);
|
||||
size_t l_UInt64_toUSize(uint64_t);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1;
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_HashMap_insert___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__3(lean_object*, size_t, size_t, lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___closed__1;
|
||||
lean_object* l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_array_fget(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__3(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__1(lean_object*, lean_object*);
|
||||
lean_object* lean_st_ref_take(lean_object*, lean_object*);
|
||||
lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_nat_sub(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___boxed(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_State_map___default___closed__2;
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___closed__1;
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__3(lean_object*, size_t, size_t, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__6;
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcher___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_State_addEntry(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Name_toString(lean_object*, uint8_t);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_instInhabitedState___closed__1;
|
||||
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Meta_isMatcherAppCore(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_SimplePersistentEnvExtension_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__1(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_mkHashMapImp___rarg(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__1;
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__2;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_State_map___default___closed__1;
|
||||
uint64_t l_Lean_Name_hash(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_State_map___default___closed__4;
|
||||
lean_object* l_Nat_repr(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_State_switch(lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__1;
|
||||
lean_object* l_Std_HashMapImp_find_x3f___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__5(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension;
|
||||
uint8_t l_Lean_Meta_isMatcherCore(lean_object*, lean_object*);
|
||||
uint8_t lean_is_matcher(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__4;
|
||||
lean_object* l_Lean_Meta_isMatcher(lean_object*);
|
||||
lean_object* l_Std_PersistentHashMap_mkEmptyEntriesArray(lean_object*, lean_object*);
|
||||
lean_object* l_Std_mkHashMap___at_Lean_Meta_Match_Extension_State_map___default___spec__1(lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__2;
|
||||
lean_object* lean_array_to_list(lean_object*, lean_object*);
|
||||
extern lean_object* l_Lean_persistentEnvExtensionsRef;
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f_match__2___rarg(lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -108,11 +117,11 @@ size_t lean_usize_modn(size_t, lean_object*);
|
|||
lean_object* l___private_Init_Util_0__mkPanicMessageWithDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_Expr_isConst(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__4;
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_addMatcherInfo(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getMotivePos___boxed(lean_object*);
|
||||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3___closed__5;
|
||||
lean_object* l_Std_PersistentHashMap_insert___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__6;
|
||||
lean_object* l_Lean_PersistentEnvExtension_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__2___boxed(lean_object*, lean_object*);
|
||||
size_t lean_usize_of_nat(lean_object*);
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f___rarg(lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -120,79 +129,74 @@ lean_object* l_Lean_PersistentEnvExtension_addEntry___rarg(lean_object*, lean_ob
|
|||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3___closed__3;
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__4___rarg(lean_object*);
|
||||
lean_object* l_Lean_EnvExtensionInterfaceUnsafe_instInhabitedExt___lambda__1(lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1;
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__4(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_addMatcherInfo___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_getMatcherInfo_x3f(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__3;
|
||||
static lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__2;
|
||||
lean_object* l_List_redLength___rarg(lean_object*);
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f(lean_object*);
|
||||
lean_object* l_Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2;
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f_match__1(lean_object*);
|
||||
lean_object* lean_list_to_array(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137_(lean_object*);
|
||||
lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__1(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148_(lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherApp___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__3(lean_object*, lean_object*);
|
||||
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_mkApp(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__1___boxed(lean_object*);
|
||||
lean_object* lean_panic_fn(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__1(lean_object*);
|
||||
lean_object* l_Lean_Meta_MatcherApp_toExpr(lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__2(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_getMatcherInfoCore_x3f(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3___boxed(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3___closed__1;
|
||||
lean_object* l_Lean_Meta_Match_Extension_instInhabitedState;
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__2(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__4___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherApp(lean_object*);
|
||||
lean_object* l_Array_ofSubarray___rarg(lean_object*);
|
||||
uint8_t l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6(lean_object*, lean_object*, size_t, size_t);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_instInhabitedPersistentEnvExtensionState___rarg(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__4;
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__3(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3___closed__2;
|
||||
lean_object* l_List_toArrayAux___rarg(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_SMap_find_x3f___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__4(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_arity(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__6;
|
||||
lean_object* lean_mk_array(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__1;
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_matchMatcherApp_x3f_match__1(lean_object*);
|
||||
static lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__2;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_State_map___default___closed__5;
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__3;
|
||||
lean_object* l_Std_mkHashMap___at_Lean_Meta_Match_Extension_State_map___default___spec__1___boxed(lean_object*);
|
||||
lean_object* l_Std_AssocList_find_x3f___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__6(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_State_map___default___closed__3;
|
||||
lean_object* l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_List_lengthTRAux___rarg(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherApp___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_getAppFn(lean_object*);
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_PersistentHashMap_find_x3f___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_numAlts(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____lambda__1(lean_object*);
|
||||
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__3;
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____lambda__1(lean_object*);
|
||||
lean_object* l_EStateM_pure___rarg(lean_object*, lean_object*);
|
||||
uint32_t lean_uint32_of_nat(lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__5;
|
||||
lean_object* l_Lean_Meta_Match_Extension_getMatcherInfo_x3f(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___boxed(lean_object*);
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__2___boxed(lean_object*);
|
||||
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Expr_constName_x21(lean_object*);
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_Match_Extension_extension___closed__5;
|
||||
lean_object* l_Lean_Meta_Match_Extension_extension___elambda__2(lean_object*);
|
||||
lean_object* l_Std_AssocList_find_x3f___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__6___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__3(lean_object*, lean_object*);
|
||||
lean_object* l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_PersistentEnvExtension_getState___at_Lean_Meta_Match_Extension_getMatcherInfo_x3f___spec__2(lean_object*, lean_object*);
|
||||
uint8_t l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6(lean_object*, lean_object*, size_t, size_t);
|
||||
lean_object* l_Lean_Meta_isMatcher___rarg___lambda__1(lean_object*, lean_object*, lean_object*);
|
||||
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
|
||||
extern lean_object* l_Lean_Name_instBEqName;
|
||||
|
|
@ -240,6 +244,25 @@ lean_dec(x_1);
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getFirstDiscrPos(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_2 = lean_ctor_get(x_1, 0);
|
||||
x_3 = lean_unsigned_to_nat(1u);
|
||||
x_4 = lean_nat_add(x_2, x_3);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getFirstDiscrPos___boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_Meta_Match_MatcherInfo_getFirstDiscrPos(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_MatcherInfo_getMotivePos(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -503,7 +526,7 @@ x_2 = l_Lean_SMap_switch___at_Lean_Meta_Match_Extension_State_switch___spec__1(x
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__2(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__2(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_5;
|
||||
|
|
@ -525,7 +548,7 @@ return x_4;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__3(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__3(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_5;
|
||||
|
|
@ -563,7 +586,7 @@ size_t x_15; size_t x_16; lean_object* x_17;
|
|||
x_15 = 0;
|
||||
x_16 = lean_usize_of_nat(x_7);
|
||||
lean_dec(x_7);
|
||||
x_17 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__2(x_6, x_15, x_16, x_4);
|
||||
x_17 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__2(x_6, x_15, x_16, x_4);
|
||||
lean_dec(x_6);
|
||||
x_2 = x_11;
|
||||
x_4 = x_17;
|
||||
|
|
@ -577,7 +600,7 @@ return x_4;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__1(lean_object* x_1, lean_object* x_2) {
|
||||
lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__1(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; uint8_t x_5;
|
||||
|
|
@ -606,14 +629,14 @@ size_t x_7; size_t x_8; lean_object* x_9;
|
|||
x_7 = 0;
|
||||
x_8 = lean_usize_of_nat(x_3);
|
||||
lean_dec(x_3);
|
||||
x_9 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__3(x_2, x_7, x_8, x_1);
|
||||
x_9 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__3(x_2, x_7, x_8, x_1);
|
||||
lean_dec(x_2);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
uint8_t l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4) {
|
||||
uint8_t l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_5;
|
||||
|
|
@ -651,7 +674,7 @@ return x_14;
|
|||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1() {
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
|
|
@ -660,11 +683,11 @@ x_2 = lean_mk_empty_array_with_capacity(x_1);
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1(lean_object* x_1, lean_object* x_2) {
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5;
|
||||
x_3 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1;
|
||||
x_3 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1;
|
||||
x_4 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_4, 0, x_3);
|
||||
lean_ctor_set(x_4, 1, x_1);
|
||||
|
|
@ -674,15 +697,15 @@ lean_ctor_set(x_5, 1, x_2);
|
|||
return x_5;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___closed__1() {
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1), 2, 0);
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1), 2, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
|
||||
|
|
@ -699,7 +722,7 @@ lean_inc(x_8);
|
|||
x_9 = lean_ctor_get(x_1, 5);
|
||||
lean_inc(x_9);
|
||||
lean_dec(x_1);
|
||||
x_10 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___closed__1;
|
||||
x_10 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___closed__1;
|
||||
x_11 = lean_alloc_closure((void*)(l_EStateM_bind___rarg), 3, 2);
|
||||
lean_closure_set(x_11, 0, x_5);
|
||||
lean_closure_set(x_11, 1, x_10);
|
||||
|
|
@ -780,7 +803,7 @@ return x_30;
|
|||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1() {
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -788,7 +811,7 @@ x_1 = lean_mk_string("invalid environment extension, '");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2() {
|
||||
static lean_object* _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -796,7 +819,7 @@ x_1 = lean_mk_string("' has already been used");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5(lean_object* x_1, lean_object* x_2) {
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; uint8_t x_5;
|
||||
|
|
@ -818,7 +841,7 @@ lean_dec(x_8);
|
|||
lean_free_object(x_4);
|
||||
lean_dec(x_6);
|
||||
x_11 = lean_box(0);
|
||||
x_12 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_11, x_7);
|
||||
x_12 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_11, x_7);
|
||||
return x_12;
|
||||
}
|
||||
else
|
||||
|
|
@ -832,7 +855,7 @@ lean_dec(x_8);
|
|||
lean_free_object(x_4);
|
||||
lean_dec(x_6);
|
||||
x_14 = lean_box(0);
|
||||
x_15 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_14, x_7);
|
||||
x_15 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_14, x_7);
|
||||
return x_15;
|
||||
}
|
||||
else
|
||||
|
|
@ -841,14 +864,14 @@ size_t x_16; size_t x_17; uint8_t x_18;
|
|||
x_16 = 0;
|
||||
x_17 = lean_usize_of_nat(x_8);
|
||||
lean_dec(x_8);
|
||||
x_18 = l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6(x_1, x_6, x_16, x_17);
|
||||
x_18 = l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6(x_1, x_6, x_16, x_17);
|
||||
lean_dec(x_6);
|
||||
if (x_18 == 0)
|
||||
{
|
||||
lean_object* x_19; lean_object* x_20;
|
||||
lean_free_object(x_4);
|
||||
x_19 = lean_box(0);
|
||||
x_20 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_19, x_7);
|
||||
x_20 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_19, x_7);
|
||||
return x_20;
|
||||
}
|
||||
else
|
||||
|
|
@ -859,10 +882,10 @@ lean_inc(x_21);
|
|||
lean_dec(x_1);
|
||||
x_22 = 1;
|
||||
x_23 = l_Lean_Name_toString(x_21, x_22);
|
||||
x_24 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1;
|
||||
x_24 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1;
|
||||
x_25 = lean_string_append(x_24, x_23);
|
||||
lean_dec(x_23);
|
||||
x_26 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2;
|
||||
x_26 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2;
|
||||
x_27 = lean_string_append(x_25, x_26);
|
||||
x_28 = lean_alloc_ctor(18, 1, 0);
|
||||
lean_ctor_set(x_28, 0, x_27);
|
||||
|
|
@ -890,7 +913,7 @@ lean_object* x_34; lean_object* x_35;
|
|||
lean_dec(x_31);
|
||||
lean_dec(x_29);
|
||||
x_34 = lean_box(0);
|
||||
x_35 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_34, x_30);
|
||||
x_35 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_34, x_30);
|
||||
return x_35;
|
||||
}
|
||||
else
|
||||
|
|
@ -903,7 +926,7 @@ lean_object* x_37; lean_object* x_38;
|
|||
lean_dec(x_31);
|
||||
lean_dec(x_29);
|
||||
x_37 = lean_box(0);
|
||||
x_38 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_37, x_30);
|
||||
x_38 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_37, x_30);
|
||||
return x_38;
|
||||
}
|
||||
else
|
||||
|
|
@ -912,13 +935,13 @@ size_t x_39; size_t x_40; uint8_t x_41;
|
|||
x_39 = 0;
|
||||
x_40 = lean_usize_of_nat(x_31);
|
||||
lean_dec(x_31);
|
||||
x_41 = l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6(x_1, x_29, x_39, x_40);
|
||||
x_41 = l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6(x_1, x_29, x_39, x_40);
|
||||
lean_dec(x_29);
|
||||
if (x_41 == 0)
|
||||
{
|
||||
lean_object* x_42; lean_object* x_43;
|
||||
x_42 = lean_box(0);
|
||||
x_43 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_42, x_30);
|
||||
x_43 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_42, x_30);
|
||||
return x_43;
|
||||
}
|
||||
else
|
||||
|
|
@ -929,10 +952,10 @@ lean_inc(x_44);
|
|||
lean_dec(x_1);
|
||||
x_45 = 1;
|
||||
x_46 = l_Lean_Name_toString(x_44, x_45);
|
||||
x_47 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1;
|
||||
x_47 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1;
|
||||
x_48 = lean_string_append(x_47, x_46);
|
||||
lean_dec(x_46);
|
||||
x_49 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2;
|
||||
x_49 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2;
|
||||
x_50 = lean_string_append(x_48, x_49);
|
||||
x_51 = lean_alloc_ctor(18, 1, 0);
|
||||
lean_ctor_set(x_51, 0, x_50);
|
||||
|
|
@ -946,7 +969,7 @@ return x_52;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
|
|
@ -960,7 +983,7 @@ lean_ctor_set(x_8, 1, x_5);
|
|||
return x_8;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_4;
|
||||
|
|
@ -1005,7 +1028,7 @@ return x_15;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__3(lean_object* x_1, lean_object* x_2) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__3(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
|
||||
|
|
@ -1020,7 +1043,7 @@ x_6 = lean_apply_1(x_3, x_5);
|
|||
return x_6;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__1() {
|
||||
static lean_object* _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1028,17 +1051,17 @@ x_1 = lean_mk_string("number of local entries: ");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__2() {
|
||||
static lean_object* _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__1;
|
||||
x_1 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__1;
|
||||
x_2 = lean_alloc_ctor(2, 1, 0);
|
||||
lean_ctor_set(x_2, 0, x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4(lean_object* x_1) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
|
|
@ -1048,22 +1071,22 @@ x_4 = l_List_lengthTRAux___rarg(x_2, x_3);
|
|||
x_5 = l_Nat_repr(x_4);
|
||||
x_6 = lean_alloc_ctor(2, 1, 0);
|
||||
lean_ctor_set(x_6, 0, x_5);
|
||||
x_7 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__2;
|
||||
x_7 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__2;
|
||||
x_8 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_8, 0, x_7);
|
||||
lean_ctor_set(x_8, 1, x_6);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___closed__1() {
|
||||
static lean_object* _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___boxed), 1, 0);
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___boxed), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4(lean_object* x_1, lean_object* x_2) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
|
||||
|
|
@ -1072,7 +1095,7 @@ lean_inc(x_3);
|
|||
x_4 = lean_ctor_get(x_1, 2);
|
||||
lean_inc(x_4);
|
||||
x_5 = lean_box(0);
|
||||
x_6 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1;
|
||||
x_6 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1;
|
||||
lean_inc(x_4);
|
||||
x_7 = lean_apply_1(x_4, x_6);
|
||||
x_8 = lean_alloc_ctor(0, 2, 0);
|
||||
|
|
@ -1080,15 +1103,15 @@ lean_ctor_set(x_8, 0, x_5);
|
|||
lean_ctor_set(x_8, 1, x_7);
|
||||
x_9 = lean_alloc_closure((void*)(l_EStateM_pure___rarg), 2, 1);
|
||||
lean_closure_set(x_9, 0, x_8);
|
||||
x_10 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__1___boxed), 5, 2);
|
||||
x_10 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__1___boxed), 5, 2);
|
||||
lean_closure_set(x_10, 0, x_4);
|
||||
lean_closure_set(x_10, 1, x_5);
|
||||
lean_inc(x_1);
|
||||
x_11 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__2), 3, 1);
|
||||
x_11 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__2), 3, 1);
|
||||
lean_closure_set(x_11, 0, x_1);
|
||||
x_12 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__3), 2, 1);
|
||||
x_12 = lean_alloc_closure((void*)(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__3), 2, 1);
|
||||
lean_closure_set(x_12, 0, x_1);
|
||||
x_13 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___closed__1;
|
||||
x_13 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___closed__1;
|
||||
x_14 = lean_alloc_ctor(0, 6, 0);
|
||||
lean_ctor_set(x_14, 0, x_3);
|
||||
lean_ctor_set(x_14, 1, x_9);
|
||||
|
|
@ -1096,21 +1119,21 @@ lean_ctor_set(x_14, 2, x_10);
|
|||
lean_ctor_set(x_14, 3, x_11);
|
||||
lean_ctor_set(x_14, 4, x_12);
|
||||
lean_ctor_set(x_14, 5, x_13);
|
||||
x_15 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5(x_14, x_2);
|
||||
x_15 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5(x_14, x_2);
|
||||
return x_15;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____lambda__1(lean_object* x_1) {
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____lambda__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_2 = l_Lean_Meta_Match_Extension_instInhabitedState___closed__2;
|
||||
x_3 = l_Lean_mkStateFromImportedEntries___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__1(x_2, x_1);
|
||||
x_3 = l_Lean_mkStateFromImportedEntries___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__1(x_2, x_1);
|
||||
x_4 = l_Lean_SMap_switch___at_Lean_Meta_Match_Extension_State_switch___spec__1(x_3);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__1() {
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1118,17 +1141,17 @@ x_1 = lean_mk_string("matcher");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__2() {
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__1;
|
||||
x_2 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__3() {
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1137,7 +1160,7 @@ lean_closure_set(x_1, 0, lean_box(0));
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__4() {
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__4() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1145,22 +1168,22 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Meta_Match_Extension_State_addEntry), 2,
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__5() {
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__5() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____lambda__1), 1, 0);
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____lambda__1), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__6() {
|
||||
static lean_object* _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__6() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
|
||||
x_1 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__2;
|
||||
x_2 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__4;
|
||||
x_3 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__5;
|
||||
x_4 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__3;
|
||||
x_1 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__2;
|
||||
x_2 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__4;
|
||||
x_3 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__5;
|
||||
x_4 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__3;
|
||||
x_5 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_5, 0, x_1);
|
||||
lean_ctor_set(x_5, 1, x_2);
|
||||
|
|
@ -1169,16 +1192,16 @@ lean_ctor_set(x_5, 3, x_4);
|
|||
return x_5;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137_(lean_object* x_1) {
|
||||
lean_object* l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__6;
|
||||
x_3 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4(x_2, x_1);
|
||||
x_2 = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__6;
|
||||
x_3 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
size_t x_5; size_t x_6; lean_object* x_7;
|
||||
|
|
@ -1186,12 +1209,12 @@ x_5 = lean_unbox_usize(x_2);
|
|||
lean_dec(x_2);
|
||||
x_6 = lean_unbox_usize(x_3);
|
||||
lean_dec(x_3);
|
||||
x_7 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__2(x_1, x_5, x_6, x_4);
|
||||
x_7 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__2(x_1, x_5, x_6, x_4);
|
||||
lean_dec(x_1);
|
||||
return x_7;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
size_t x_5; size_t x_6; lean_object* x_7;
|
||||
|
|
@ -1199,12 +1222,12 @@ x_5 = lean_unbox_usize(x_2);
|
|||
lean_dec(x_2);
|
||||
x_6 = lean_unbox_usize(x_3);
|
||||
lean_dec(x_3);
|
||||
x_7 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__3(x_1, x_5, x_6, x_4);
|
||||
x_7 = l_Array_foldlMUnsafe_fold___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__3(x_1, x_5, x_6, x_4);
|
||||
lean_dec(x_1);
|
||||
return x_7;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
lean_object* l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
size_t x_5; size_t x_6; uint8_t x_7; lean_object* x_8;
|
||||
|
|
@ -1212,36 +1235,36 @@ x_5 = lean_unbox_usize(x_3);
|
|||
lean_dec(x_3);
|
||||
x_6 = lean_unbox_usize(x_4);
|
||||
lean_dec(x_4);
|
||||
x_7 = l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__6(x_1, x_2, x_5, x_6);
|
||||
x_7 = l_Array_anyMUnsafe_any___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__6(x_1, x_2, x_5, x_6);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_8 = lean_box(x_7);
|
||||
return x_8;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_4;
|
||||
x_4 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2(x_1, x_2, x_3);
|
||||
x_4 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2(x_1, x_2, x_3);
|
||||
lean_dec(x_2);
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_6;
|
||||
x_6 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__1(x_1, x_2, x_3, x_4, x_5);
|
||||
x_6 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__1(x_1, x_2, x_3, x_4, x_5);
|
||||
lean_dec(x_4);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___boxed(lean_object* x_1) {
|
||||
lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4(x_1);
|
||||
x_2 = l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
}
|
||||
|
|
@ -1258,7 +1281,7 @@ lean_object* l_Lean_Meta_Match_Extension_extension___elambda__2(lean_object* x_1
|
|||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1;
|
||||
x_2 = l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1;
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
|
|
@ -1840,7 +1863,7 @@ x_2 = lean_alloc_closure((void*)(l_Lean_Meta_getMatcherInfo_x3f___rarg), 3, 0);
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Meta_isMatcherCore(lean_object* x_1, lean_object* x_2) {
|
||||
uint8_t lean_is_matcher(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3;
|
||||
|
|
@ -1864,7 +1887,7 @@ lean_object* l_Lean_Meta_isMatcherCore___boxed(lean_object* x_1, lean_object* x_
|
|||
_start:
|
||||
{
|
||||
uint8_t x_3; lean_object* x_4;
|
||||
x_3 = l_Lean_Meta_isMatcherCore(x_1, x_2);
|
||||
x_3 = lean_is_matcher(x_1, x_2);
|
||||
x_4 = lean_box(x_3);
|
||||
return x_4;
|
||||
}
|
||||
|
|
@ -1879,7 +1902,7 @@ lean_dec(x_1);
|
|||
x_5 = lean_ctor_get(x_4, 1);
|
||||
lean_inc(x_5);
|
||||
lean_dec(x_4);
|
||||
x_6 = l_Lean_Meta_isMatcherCore(x_3, x_2);
|
||||
x_6 = lean_is_matcher(x_3, x_2);
|
||||
x_7 = lean_box(x_6);
|
||||
x_8 = lean_apply_2(x_5, lean_box(0), x_7);
|
||||
return x_8;
|
||||
|
|
@ -1909,7 +1932,7 @@ x_2 = lean_alloc_closure((void*)(l_Lean_Meta_isMatcher___rarg), 3, 0);
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
if (lean_obj_tag(x_1) == 0)
|
||||
|
|
@ -1931,15 +1954,15 @@ return x_6;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_match__1(lean_object* x_1) {
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_isMatcherAppCore_match__1___rarg), 3, 0);
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_isMatcherAppCore_x3f_match__1___rarg), 3, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Meta_isMatcherAppCore(lean_object* x_1, lean_object* x_2) {
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; uint8_t x_4;
|
||||
|
|
@ -1947,10 +1970,10 @@ x_3 = l_Lean_Expr_getAppFn(x_2);
|
|||
x_4 = l_Lean_Expr_isConst(x_3);
|
||||
if (x_4 == 0)
|
||||
{
|
||||
uint8_t x_5;
|
||||
lean_object* x_5;
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_5 = 0;
|
||||
x_5 = lean_box(0);
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
|
|
@ -1961,25 +1984,94 @@ lean_dec(x_3);
|
|||
x_7 = l_Lean_Meta_Match_Extension_getMatcherInfo_x3f(x_1, x_6);
|
||||
if (lean_obj_tag(x_7) == 0)
|
||||
{
|
||||
uint8_t x_8;
|
||||
x_8 = 0;
|
||||
lean_object* x_8;
|
||||
x_8 = lean_box(0);
|
||||
return x_8;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; uint8_t x_13;
|
||||
x_9 = lean_ctor_get(x_7, 0);
|
||||
lean_inc(x_9);
|
||||
lean_dec(x_7);
|
||||
x_10 = l_Lean_Meta_Match_MatcherInfo_arity(x_9);
|
||||
lean_dec(x_9);
|
||||
x_11 = lean_unsigned_to_nat(0u);
|
||||
x_12 = l_Lean_Expr_getAppNumArgsAux(x_2, x_11);
|
||||
x_13 = lean_nat_dec_le(x_10, x_12);
|
||||
lean_dec(x_12);
|
||||
uint8_t x_9;
|
||||
x_9 = !lean_is_exclusive(x_7);
|
||||
if (x_9 == 0)
|
||||
{
|
||||
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14;
|
||||
x_10 = lean_ctor_get(x_7, 0);
|
||||
x_11 = l_Lean_Meta_Match_MatcherInfo_arity(x_10);
|
||||
x_12 = lean_unsigned_to_nat(0u);
|
||||
x_13 = l_Lean_Expr_getAppNumArgsAux(x_2, x_12);
|
||||
x_14 = lean_nat_dec_le(x_11, x_13);
|
||||
lean_dec(x_13);
|
||||
lean_dec(x_11);
|
||||
if (x_14 == 0)
|
||||
{
|
||||
lean_object* x_15;
|
||||
lean_free_object(x_7);
|
||||
lean_dec(x_10);
|
||||
return x_13;
|
||||
x_15 = lean_box(0);
|
||||
return x_15;
|
||||
}
|
||||
else
|
||||
{
|
||||
return x_7;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20;
|
||||
x_16 = lean_ctor_get(x_7, 0);
|
||||
lean_inc(x_16);
|
||||
lean_dec(x_7);
|
||||
x_17 = l_Lean_Meta_Match_MatcherInfo_arity(x_16);
|
||||
x_18 = lean_unsigned_to_nat(0u);
|
||||
x_19 = l_Lean_Expr_getAppNumArgsAux(x_2, x_18);
|
||||
x_20 = lean_nat_dec_le(x_17, x_19);
|
||||
lean_dec(x_19);
|
||||
lean_dec(x_17);
|
||||
if (x_20 == 0)
|
||||
{
|
||||
lean_object* x_21;
|
||||
lean_dec(x_16);
|
||||
x_21 = lean_box(0);
|
||||
return x_21;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_22;
|
||||
x_22 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_22, 0, x_16);
|
||||
return x_22;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_isMatcherAppCore_x3f___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3;
|
||||
x_3 = l_Lean_Meta_isMatcherAppCore_x3f(x_1, x_2);
|
||||
lean_dec(x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Meta_isMatcherAppCore(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3;
|
||||
x_3 = l_Lean_Meta_isMatcherAppCore_x3f(x_1, x_2);
|
||||
if (lean_obj_tag(x_3) == 0)
|
||||
{
|
||||
uint8_t x_4;
|
||||
x_4 = 0;
|
||||
return x_4;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_5;
|
||||
lean_dec(x_3);
|
||||
x_5 = 1;
|
||||
return x_5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2446,32 +2538,32 @@ l_Lean_Meta_Match_Extension_instInhabitedState___closed__2 = _init_l_Lean_Meta_M
|
|||
lean_mark_persistent(l_Lean_Meta_Match_Extension_instInhabitedState___closed__2);
|
||||
l_Lean_Meta_Match_Extension_instInhabitedState = _init_l_Lean_Meta_Match_Extension_instInhabitedState();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_instInhabitedState);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__1___closed__1);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___closed__1 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___lambda__2___closed__1);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__1);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__5___closed__2);
|
||||
l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__1 = _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__1);
|
||||
l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__2 = _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__2();
|
||||
lean_mark_persistent(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___lambda__4___closed__2);
|
||||
l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___closed__1 = _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____spec__4___closed__1);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__1 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__1);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__2 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__2);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__3 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__3();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__3);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__4 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__4();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__4);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__5 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__5();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__5);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__6 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__6();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137____closed__6);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__1___closed__1);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___closed__1 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___lambda__2___closed__1);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__1);
|
||||
l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2 = _init_l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2();
|
||||
lean_mark_persistent(l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__5___closed__2);
|
||||
l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__1 = _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__1);
|
||||
l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__2 = _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__2();
|
||||
lean_mark_persistent(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___lambda__4___closed__2);
|
||||
l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___closed__1 = _init_l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___closed__1();
|
||||
lean_mark_persistent(l_Lean_registerSimplePersistentEnvExtension___at_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____spec__4___closed__1);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__1 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__1);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__2 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__2);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__3 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__3();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__3);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__4 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__4();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__4);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__5 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__5();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__5);
|
||||
l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__6 = _init_l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__6();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148____closed__6);
|
||||
l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__1 = _init_l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__1();
|
||||
l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__2 = _init_l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_extension___elambda__4___rarg___closed__2);
|
||||
|
|
@ -2491,7 +2583,7 @@ l_Lean_Meta_Match_Extension_extension___closed__6 = _init_l_Lean_Meta_Match_Exte
|
|||
lean_mark_persistent(l_Lean_Meta_Match_Extension_extension___closed__6);
|
||||
l_Lean_Meta_Match_Extension_extension___closed__7 = _init_l_Lean_Meta_Match_Extension_extension___closed__7();
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_extension___closed__7);
|
||||
res = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_137_(lean_io_mk_world());
|
||||
res = l_Lean_Meta_Match_Extension_initFn____x40_Lean_Meta_Match_MatcherInfo___hyg_148_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
l_Lean_Meta_Match_Extension_extension = lean_io_result_get_value(res);
|
||||
lean_mark_persistent(l_Lean_Meta_Match_Extension_extension);
|
||||
|
|
|
|||
4958
stage0/stdlib/Lean/Meta/Tactic/Simp/Main.c
generated
4958
stage0/stdlib/Lean/Meta/Tactic/Simp/Main.c
generated
File diff suppressed because it is too large
Load diff
1360
stage0/stdlib/Lean/Meta/Tactic/Split.c
generated
1360
stage0/stdlib/Lean/Meta/Tactic/Split.c
generated
File diff suppressed because it is too large
Load diff
132
stage0/stdlib/Lean/Meta/Tactic/SplitIf.c
generated
132
stage0/stdlib/Lean/Meta/Tactic/SplitIf.c
generated
|
|
@ -21,7 +21,6 @@ static lean_object* l_Lean_Meta_SplitIf_discharge_x3f___closed__2;
|
|||
lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*);
|
||||
static lean_object* l_Array_findSomeRevM_x3f_find___at_Lean_Meta_SplitIf_discharge_x3f___spec__3___closed__2;
|
||||
lean_object* l_Lean_stringToMessageData(lean_object*);
|
||||
static lean_object* l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__2;
|
||||
lean_object* l_Lean_Meta_simpIfLocalDecl_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_Lean_LocalDecl_isAuxDecl(lean_object*);
|
||||
lean_object* lean_name_mk_string(lean_object*, lean_object*);
|
||||
|
|
@ -75,7 +74,6 @@ lean_object* lean_nat_sub(lean_object*, lean_object*);
|
|||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_SplitIf_getSimpContext___spec__2___closed__1;
|
||||
lean_object* l_Lean_addTrace___at_Lean_Meta_mkCongrLemma___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_PersistentArray_findSomeRevM_x3f___at_Lean_Meta_SplitIf_discharge_x3f___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3;
|
||||
static lean_object* l_Lean_EnvExtensionInterfaceUnsafe_getState___at_Lean_Meta_SplitIf_getSimpContext___spec__2___closed__3;
|
||||
lean_object* l_Array_findSomeRevM_x3f_find___at_Lean_Meta_SplitIf_discharge_x3f___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_LocalContext_findDeclRevM_x3f___at_Lean_Meta_SplitIf_discharge_x3f___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -110,7 +108,7 @@ lean_object* l_Lean_LocalDecl_toExpr(lean_object*);
|
|||
uint8_t l_Lean_Expr_isConstOf(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_SplitIf_discharge_x3f_match__1(lean_object*);
|
||||
lean_object* l_Lean_commitWhenSome_x3f___at_Lean_Meta_splitIfLocalDecl_x3f___spec__1___at_Lean_Meta_splitIfLocalDecl_x3f___spec__2___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_1016_(lean_object*);
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_1020_(lean_object*);
|
||||
static lean_object* l_Lean_Meta_SplitIf_discharge_x3f___lambda__2___closed__7;
|
||||
lean_object* l_Lean_Meta_SplitIf_ext___elambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_simpIfTarget___closed__5;
|
||||
|
|
@ -128,6 +126,7 @@ lean_object* l_Lean_Meta_SavedState_restore(lean_object*, lean_object*, lean_obj
|
|||
static lean_object* l_Lean_Meta_SplitIf_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_4____lambda__1___closed__2;
|
||||
extern lean_object* l_Std_PersistentHashMap_empty___at_Lean_Meta_Instances_instanceNames___default___spec__1;
|
||||
lean_object* l_Lean_Meta_withMVarContext___at___private_Lean_Meta_SynthInstance_0__Lean_Meta_synthPendingImp___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__1;
|
||||
static lean_object* l_Lean_Meta_SplitIf_ext___closed__4;
|
||||
static lean_object* l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__2___closed__2;
|
||||
lean_object* l_Lean_EnvExtensionInterfaceUnsafe_instInhabitedExt___lambda__1(lean_object*);
|
||||
|
|
@ -182,6 +181,7 @@ static lean_object* l_Lean_Meta_SplitIf_initFn____x40_Lean_Meta_Tactic_SplitIf__
|
|||
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_SimpLemmas_addConst(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_SplitIf_discharge_x3f___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2;
|
||||
lean_object* l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Meta_SplitIf_ext___closed__1;
|
||||
lean_object* l_Lean_registerLazyInitExtension___rarg(lean_object*, lean_object*);
|
||||
|
|
@ -3370,45 +3370,7 @@ x_2 = lean_alloc_closure((void*)(l_Lean_Meta_SplitIf_findIfToSplit_x3f_match__1_
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_2;
|
||||
x_2 = l_Lean_Expr_hasLooseBVars(x_1);
|
||||
if (x_2 == 0)
|
||||
{
|
||||
uint8_t x_3;
|
||||
x_3 = l_Lean_Expr_isIte(x_1);
|
||||
if (x_3 == 0)
|
||||
{
|
||||
uint8_t x_4;
|
||||
x_4 = l_Lean_Expr_isDIte(x_1);
|
||||
return x_4;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_5;
|
||||
x_5 = 1;
|
||||
return x_5;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_6;
|
||||
x_6 = 0;
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___boxed), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__2() {
|
||||
static lean_object* _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
|
|
@ -3418,16 +3380,82 @@ x_3 = lean_nat_sub(x_1, x_2);
|
|||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3() {
|
||||
static lean_object* _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__2;
|
||||
x_1 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__1;
|
||||
x_2 = lean_unsigned_to_nat(1u);
|
||||
x_3 = lean_nat_sub(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
uint8_t l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_2;
|
||||
x_2 = l_Lean_Expr_isIte(x_1);
|
||||
if (x_2 == 0)
|
||||
{
|
||||
uint8_t x_3;
|
||||
x_3 = l_Lean_Expr_isDIte(x_1);
|
||||
if (x_3 == 0)
|
||||
{
|
||||
uint8_t x_4;
|
||||
x_4 = 0;
|
||||
return x_4;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_5; lean_object* x_6; uint8_t x_7;
|
||||
x_5 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2;
|
||||
x_6 = l_Lean_Expr_getRevArg_x21(x_1, x_5);
|
||||
x_7 = l_Lean_Expr_hasLooseBVars(x_6);
|
||||
lean_dec(x_6);
|
||||
if (x_7 == 0)
|
||||
{
|
||||
uint8_t x_8;
|
||||
x_8 = 1;
|
||||
return x_8;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_9;
|
||||
x_9 = 0;
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_10; lean_object* x_11; uint8_t x_12;
|
||||
x_10 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2;
|
||||
x_11 = l_Lean_Expr_getRevArg_x21(x_1, x_10);
|
||||
x_12 = l_Lean_Expr_hasLooseBVars(x_11);
|
||||
lean_dec(x_11);
|
||||
if (x_12 == 0)
|
||||
{
|
||||
uint8_t x_13;
|
||||
x_13 = 1;
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_14;
|
||||
x_14 = 0;
|
||||
return x_14;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___boxed), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_SplitIf_findIfToSplit_x3f(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -3453,7 +3481,7 @@ if (x_8 == 0)
|
|||
{
|
||||
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
|
||||
x_9 = lean_ctor_get(x_6, 0);
|
||||
x_10 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3;
|
||||
x_10 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2;
|
||||
x_11 = l_Lean_Expr_getRevArg_x21(x_9, x_10);
|
||||
lean_dec(x_9);
|
||||
lean_inc(x_11);
|
||||
|
|
@ -3491,7 +3519,7 @@ lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
|
|||
x_16 = lean_ctor_get(x_6, 0);
|
||||
lean_inc(x_16);
|
||||
lean_dec(x_6);
|
||||
x_17 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3;
|
||||
x_17 = l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2;
|
||||
x_18 = l_Lean_Expr_getRevArg_x21(x_16, x_17);
|
||||
lean_dec(x_16);
|
||||
lean_inc(x_18);
|
||||
|
|
@ -6391,7 +6419,7 @@ x_10 = l_Lean_commitWhenSome_x3f___at_Lean_Meta_splitIfLocalDecl_x3f___spec__1__
|
|||
return x_10;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_1016_(lean_object* x_1) {
|
||||
lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_1020_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
|
|
@ -6538,12 +6566,12 @@ l_Lean_Meta_SplitIf_discharge_x3f___closed__14 = _init_l_Lean_Meta_SplitIf_disch
|
|||
lean_mark_persistent(l_Lean_Meta_SplitIf_discharge_x3f___closed__14);
|
||||
l_Lean_Meta_SplitIf_discharge_x3f___closed__15 = _init_l_Lean_Meta_SplitIf_discharge_x3f___closed__15();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_discharge_x3f___closed__15);
|
||||
l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__1 = _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__1);
|
||||
l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2 = _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_findIfToSplit_x3f___lambda__1___closed__2);
|
||||
l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__1 = _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__1);
|
||||
l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__2 = _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__2();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__2);
|
||||
l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3 = _init_l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_findIfToSplit_x3f___closed__3);
|
||||
l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__2___closed__1 = _init_l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__2___closed__1();
|
||||
lean_mark_persistent(l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__2___closed__1);
|
||||
l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__2___closed__2 = _init_l_Lean_Meta_SplitIf_splitIfAt_x3f___lambda__2___closed__2();
|
||||
|
|
@ -6570,7 +6598,7 @@ l_Lean_Meta_simpIfLocalDecl___closed__3 = _init_l_Lean_Meta_simpIfLocalDecl___cl
|
|||
lean_mark_persistent(l_Lean_Meta_simpIfLocalDecl___closed__3);
|
||||
l_Lean_Meta_simpIfLocalDecl___closed__4 = _init_l_Lean_Meta_simpIfLocalDecl___closed__4();
|
||||
lean_mark_persistent(l_Lean_Meta_simpIfLocalDecl___closed__4);
|
||||
res = l_Lean_Meta_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_1016_(lean_io_mk_world());
|
||||
res = l_Lean_Meta_initFn____x40_Lean_Meta_Tactic_SplitIf___hyg_1020_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
|
|
|
|||
1442
stage0/stdlib/Lean/PrettyPrinter/Delaborator/Builtins.c
generated
1442
stage0/stdlib/Lean/PrettyPrinter/Delaborator/Builtins.c
generated
File diff suppressed because it is too large
Load diff
6
stage0/stdlib/Lean/Server/Completion.c
generated
6
stage0/stdlib/Lean/Server/Completion.c
generated
|
|
@ -188,7 +188,7 @@ lean_object* lean_st_mk_ref(lean_object*, lean_object*);
|
|||
static lean_object* l___private_Lean_Server_Completion_0__Lean_Server_Completion_dotCompletion___lambda__2___closed__4;
|
||||
lean_object* l___private_Lean_Server_Completion_0__Lean_Server_Completion_idCompletionCore___lambda__4(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Syntax_getId(lean_object*);
|
||||
uint8_t l_Lean_Meta_isMatcherCore(lean_object*, lean_object*);
|
||||
uint8_t lean_is_matcher(lean_object*, lean_object*);
|
||||
lean_object* lean_format_pretty(lean_object*, lean_object*);
|
||||
lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Server_Completion_0__Lean_Server_Completion_getDotCompletionTypeNames_visit___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_PersistentHashMap_mkEmptyEntriesArray(lean_object*, lean_object*);
|
||||
|
|
@ -666,7 +666,7 @@ x_9 = lean_ctor_get(x_7, 0);
|
|||
x_10 = lean_ctor_get(x_9, 0);
|
||||
lean_inc(x_10);
|
||||
lean_dec(x_9);
|
||||
x_11 = l_Lean_Meta_isMatcherCore(x_10, x_1);
|
||||
x_11 = lean_is_matcher(x_10, x_1);
|
||||
x_12 = lean_box(x_11);
|
||||
lean_ctor_set(x_7, 0, x_12);
|
||||
return x_7;
|
||||
|
|
@ -682,7 +682,7 @@ lean_dec(x_7);
|
|||
x_15 = lean_ctor_get(x_13, 0);
|
||||
lean_inc(x_15);
|
||||
lean_dec(x_13);
|
||||
x_16 = l_Lean_Meta_isMatcherCore(x_15, x_1);
|
||||
x_16 = lean_is_matcher(x_15, x_1);
|
||||
x_17 = lean_box(x_16);
|
||||
x_18 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_18, 0, x_17);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue