chore: update stage0

This commit is contained in:
Gabriel Ebner 2022-09-14 14:07:26 +02:00 committed by Leonardo de Moura
parent e04cecc496
commit b0e059318f
119 changed files with 81081 additions and 170662 deletions

View file

@ -155,11 +155,6 @@ theorem mapTRAux_eq (f : α → β) (as : List α) (bs : List β) : mapTRAux f a
funext fun α => funext fun β => funext fun f => funext fun as => by
simp [mapTR, mapTRAux_eq]
@[specialize] def map₂ (f : α → β → γ) : List α → List β → List γ
| [], _ => []
| _, [] => []
| a::as, b::bs => f a b :: map₂ f as bs
def join : List (List α) → List α
| [] => []
| a :: as => a ++ join as
@ -367,7 +362,7 @@ def or (bs : List Bool) : Bool := bs.any id
def and (bs : List Bool) : Bool := bs.all id
def zipWith (f : α → β → γ) : List α → List β → List γ
@[specialize] def zipWith (f : α → β → γ) : List α → List β → List γ
| x::xs, y::ys => f x y :: zipWith f xs ys
| _, _ => []
@ -409,11 +404,6 @@ def enumFrom : Nat → List α → List (Nat × α)
def enum : List α → List (Nat × α) := enumFrom 0
def init : List α → List α
| [] => []
| [_] => []
| a::l => a::init l
def intersperse (sep : α) : List α → List α
| [] => []
| [x] => [x]

View file

@ -10,31 +10,46 @@ prelude
import Init.Data.List
namespace Std
universe u v w
/--
A functional queue data structure, using two back-to-back lists.
If we think of the queue as having elements pushed on the front and
popped from the back, then the queue itself is effectively `eList ++ dList.reverse`.
-/
structure Queue (α : Type u) where
/-- The enqueue list, which stores elements that have just been pushed
(with the most recently enqueued elements at the head). -/
eList : List α := []
/-- The dequeue list, which buffers elements ready to be dequeued
(with the head being the next item to be yielded by `dequeue?`). -/
dList : List α := []
namespace Queue
variable {α : Type u}
def empty : Queue α :=
{ eList := [], dList := [] }
/-- `O(1)`. The empty queue. -/
def empty : Queue α := {}
instance : EmptyCollection (Queue α) := ⟨.empty⟩
instance : Inhabited (Queue α) := ⟨∅⟩
/-- `O(1)`. Is the queue empty? -/
def isEmpty (q : Queue α) : Bool :=
q.dList.isEmpty && q.eList.isEmpty
/-- `O(1)`. Push an element on the front of the queue. -/
def enqueue (v : α) (q : Queue α) : Queue α :=
{ q with eList := v::q.eList }
/-- `O(|vs|)`. Push a list of elements `vs` on the front of the queue. -/
def enqueueAll (vs : List α) (q : Queue α) : Queue α :=
{ q with eList := vs ++ q.eList }
/--
`O(1)` amortized, `O(n)` worst case. Pop an element from the back of the queue,
returning the element and the new queue.
-/
def dequeue? (q : Queue α) : Option (α × Queue α) :=
match q.dList with
| d::ds => some (d, { q with dList := ds })
@ -45,6 +60,3 @@ def dequeue? (q : Queue α) : Option (α × Queue α) :=
def toArray (q : Queue α) : Array α :=
q.dList.toArray ++ q.eList.toArray.reverse
end Queue
end Std

View file

@ -257,6 +257,7 @@ namespace Syntax
deriving instance Repr for Syntax.Preresolved
deriving instance Repr for Syntax
deriving instance Repr for TSyntax
abbrev Term := TSyntax `term
abbrev Command := TSyntax `command

View file

@ -2169,7 +2169,7 @@ Folds a function over a list from the left:
`foldl f z [a, b, c] = f (f (f z a) b) c`
-/
@[specialize]
def List.foldl {α β} (f : α → β → α) : (init : α) → List β → α
def List.foldl {α : Type u} {β : Type v} (f : α → β → α) : (init : α) → List β → α
| a, nil => a
| a, cons b l => foldl f (f a b) l

View file

@ -18,3 +18,6 @@ import Lean.Compiler.LCNF.ToLCNF
import Lean.Compiler.LCNF.Types
import Lean.Compiler.LCNF.Util
import Lean.Compiler.LCNF.Main
import Lean.Compiler.LCNF.Testing
import Lean.Compiler.LCNF.FixedArgs
import Lean.Compiler.LCNF.SpecInfo

View file

@ -20,6 +20,7 @@ structure Param where
fvarId : FVarId
binderName : Name
type : Expr
borrow : Bool
deriving Inhabited, BEq
def Param.toExpr (p : Param) : Expr :=
@ -35,7 +36,6 @@ structure LetDecl where
binderName : Name
type : Expr
value : Expr
pure : Bool
deriving Inhabited, BEq
structure FunDeclCore (Code : Type) where
@ -79,10 +79,6 @@ inductive CodeDecl where
def CodeDecl.fvarId : CodeDecl → FVarId
| .let decl | .fun decl | .jp decl => decl.fvarId
def CodeDecl.isPure : CodeDecl → Bool
| .let decl => decl.pure
| .fun .. | .jp .. => true
mutual
private unsafe def eqImp (c₁ c₂ : Code) : Bool :=
if ptrEq c₁ c₂ then
@ -130,6 +126,11 @@ def AltCore.getCode : Alt → Code
| .default k => k
| .alt _ _ k => k
def AltCore.forCodeM [Monad m] (alt : Alt) (f : Code → m Unit) : m Unit := do
match alt with
| .default k => f k
| .alt _ _ k => f k
private unsafe def updateAltCodeImp (alt : Alt) (k' : Code) : Alt :=
match alt with
| .default k => if ptrEq k k' then alt else .default k'
@ -251,6 +252,9 @@ def CasesCore.extractAlt! (cases : Cases) (ctorName : Name) : Alt × Cases :=
else
unreachable!
def AltCore.mapCodeM [Monad m] (alt : Alt) (f : Code → m Code) : m Alt := do
return alt.updateCode (← f alt.getCode)
def Code.isDecl : Code → Bool
| .let .. | .fun .. | .jp .. => true
| _ => false

View file

@ -49,16 +49,13 @@ where
match code with
| .let decl k =>
let decl ← normLetDecl decl
if decl.pure then
-- We only apply CSE to pure code
match (← get).map.find? decl.value with
| some fvarId' =>
replaceFVar decl.fvarId fvarId'
go k
| none =>
addEntry decl.value decl.fvarId
return code.updateLet! decl (← go k)
else
-- We only apply CSE to pure code
match (← get).map.find? decl.value with
| some fvarId' =>
replaceFVar decl.fvarId fvarId'
go k
| none =>
addEntry decl.value decl.fvarId
return code.updateLet! decl (← go k)
| .fun decl k =>
let decl ← goFunDecl decl
@ -100,7 +97,7 @@ def Decl.cse (decl : Decl) : CompilerM Decl := do
return { decl with value }
def cse : Pass :=
.mkPerDeclaration `cse Decl.cse
.mkPerDeclaration `cse Decl.cse .base
builtin_initialize
registerTraceClass `Compiler.cse (inherited := true)

View file

@ -54,7 +54,7 @@ def checkAppArgs (f : Expr) (args : Array Expr) : CheckM Unit := do
let expectedType := d.instantiateRevRange j i args
unless compatibleTypes argType expectedType do
throwError "type mismatch at LCNF application{indentExpr (mkAppN f args)}\nargument {arg} has type{indentExpr argType}\nbut is expected to have type{indentExpr expectedType}"
unless isTypeFormerType expectedType || expectedType.erased do
unless maybeTypeFormerType expectedType || expectedType.isErased do
unless arg.isFVar do
throwError "invalid LCNF application{indentExpr (mkAppN f args)}\nargument{indentExpr arg}\nmust be a free variable"
checkFVar arg.fvarId!

View file

@ -196,15 +196,15 @@ where
Helper functions for creating LCNF local declarations.
-/
def mkParam (binderName : Name) (type : Expr) : CompilerM Param := do
def mkParam (binderName : Name) (type : Expr) (borrow : Bool) : CompilerM Param := do
let fvarId ← mkFreshFVarId
modifyLCtx fun lctx => lctx.addLocalDecl fvarId binderName type
return { fvarId, binderName, type }
return { fvarId, binderName, type, borrow }
def mkLetDecl (binderName : Name) (type : Expr) (value : Expr) (pure := true) : CompilerM LetDecl := do
def mkLetDecl (binderName : Name) (type : Expr) (value : Expr) : CompilerM LetDecl := do
let fvarId ← mkFreshFVarId
modifyLCtx fun lctx => lctx.addLetDecl fvarId binderName type value
return { fvarId, binderName, type, value, pure }
return { fvarId, binderName, type, value }
def mkFunDecl (binderName : Name) (type : Expr) (params : Array Param) (value : Code) : CompilerM FunDecl := do
let fvarId ← mkFreshFVarId
@ -307,8 +307,8 @@ def replaceFVar (code : Code) (fvarId fvarId' : FVarId) : CompilerM Code :=
def mkFreshJpName : CompilerM Name := do
mkFreshBinderName `_jp
def mkAuxParam (type : Expr) : CompilerM Param := do
mkParam (← mkFreshBinderName `_y) type
def mkAuxParam (type : Expr) (borrow := false) : CompilerM Param := do
mkParam (← mkFreshBinderName `_y) type borrow
/--
Create a fresh local context and internalize the given decls.

View file

@ -46,7 +46,7 @@ partial def elimDead (code : Code) : M Code := do
match code with
| .let decl k =>
let k ← elimDead k
if !decl.pure || (← get).contains decl.fvarId then
if (← get).contains decl.fvarId then
/- Remark: we don't need to collect `decl.type` because LCNF local declarations do not occur in types. -/
collectExprM decl.value
return code.updateCont! k

View file

@ -0,0 +1,59 @@
/-
Copyright (c) 2022 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Compiler.LCNF.Basic
import Lean.Compiler.LCNF.Types
namespace Lean.Compiler.LCNF
private abbrev Visitor := NameMap (Array Bool) → NameMap (Array Bool)
private partial def updateMap (decls : Array Decl) (code : Code) : Visitor :=
go code
where
goLetDecl (letDecl : LetDecl) : Visitor := fun s => Id.run do
let .const declName _ := letDecl.value.getAppFn | return s
let some mask := s.find? declName | return s
for decl in decls do
if decl.name == declName then
-- Recall that mask.size == decl.params.size
let mut mask := mask
let args := letDecl.value.getAppArgs
let sz := Nat.min args.size decl.params.size
for i in [:sz] do
let arg := args[i]!
let param := decl.params[i]!
unless arg.isFVarOf param.fvarId || (arg.isErased && param.type.isErased) do
mask := mask.set! i false
-- If the declaration is partially applied, we assume the missing arguments are not fixed
for i in [args.size:decl.params.size] do
mask := mask.set! i false
return s.insert decl.name mask
return s
go (code : Code) : Visitor :=
match code with
| .let decl k => go k ∘ goLetDecl decl
| .fun decl k | .jp decl k => go k ∘ go decl.value
| .cases c => fun s => c.alts.foldl (init := s) fun s alt => go alt.getCode s
| .unreach .. | .jmp .. | .return .. => id
/--
Given the (potentially mutually) recursive declarations `decls`,
return a map from declaration name `decl.name` to a bit-mask `m` where `m[i]` is true
iff the `decl.params[i]` is a fixed argument. That is, it does not change in recursive
applications.
The function assumes that if a function `f` was declared in a mutual block, then `decls`
contains all (computationally relevant) functions in the mutual block.
-/
def mkFixedArgMap (decls : Array Decl) : NameMap (Array Bool) := Id.run do
let mut m := {}
for decl in decls do
m := m.insert decl.name (mkArray decl.params.size true)
for decl in decls do
m := updateMap decls decl.value m
return m
end Lean.Compiler.LCNF

View file

@ -91,30 +91,34 @@ mutual
partial def inferProjType (structName : Name) (idx : Nat) (s : Expr) : InferTypeM Expr := do
let failed {α} : Unit → InferTypeM α := fun _ =>
throwError "invalid projection{indentExpr (mkProj structName idx s)}"
let structType ← inferType s
matchConstStruct structType.getAppFn failed fun structVal structLvls ctorVal =>
let n := structVal.numParams
let structParams := structType.getAppArgs
if n != structParams.size then
failed ()
else do
let mut ctorType ← inferAppType (mkAppN (mkConst ctorVal.name structLvls) structParams)
for _ in [:idx] do
let structType := (← inferType s).headBeta
if structType.isAnyType then
/- TODO: after we erase universe variables, we can just extract a better type using just `structName` and `idx`. -/
return anyTypeExpr
else
matchConstStruct structType.getAppFn failed fun structVal structLvls ctorVal =>
let n := structVal.numParams
let structParams := structType.getAppArgs
if n != structParams.size then
failed ()
else do
let mut ctorType ← inferAppType (mkAppN (mkConst ctorVal.name structLvls) structParams)
for _ in [:idx] do
match ctorType with
| .forallE _ _ body _ =>
if body.hasLooseBVars then
-- This can happen when one of the fields is a type or type former.
ctorType := body.instantiate1 anyTypeExpr
else
ctorType := body
| _ =>
if ctorType.isAnyType then return anyTypeExpr
failed ()
match ctorType with
| .forallE _ _ body _ =>
if body.hasLooseBVars then
-- This can happen when one of the fields is a type or type former.
ctorType := body.instantiate1 anyTypeExpr
else
ctorType := body
| .forallE _ d _ _ => return d
| _ =>
if ctorType.isAnyType then return anyTypeExpr
failed ()
match ctorType with
| .forallE _ d _ _ => return d
| _ =>
if ctorType.isAnyType then return anyTypeExpr
failed ()
partial def getLevel? (type : Expr) : InferTypeM (Option Level) := do
match (← inferType type) with
@ -206,7 +210,7 @@ def mkAuxJpDecl (params : Array Param) (code : Code) (prefixName := `_jp) : Comp
def mkAuxJpDecl' (fvarId : FVarId) (code : Code) (prefixName := `_jp) : CompilerM FunDecl := do
let localDecl ← getLocalDecl fvarId
let params := #[{ fvarId, binderName := localDecl.userName, type := localDecl.type }]
let params := #[{ fvarId, binderName := localDecl.userName, type := localDecl.type, borrow := false }]
mkAuxFunDecl params code prefixName
def instantiateForall (type : Expr) (params : Array Param) : CoreM Expr :=

View file

@ -3,187 +3,253 @@ Copyright (c) 2022 Henrik Böving. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Henrik Böving
-/
#exit -- TODO: port to new LCNF
import Lean.Compiler.CompilerM
import Lean.Compiler.LCNF.CompilerM
import Lean.Compiler.LCNF.PassManager
namespace Lean.Compiler
def jpArity (jp : LocalDecl) : Nat :=
getLambdaArity jp.value
namespace JoinPoints
section Visitors
variable {m : Type → Type} [Monad m] [MonadLiftT CompilerM m] [VisitLet m] [MonadFunctorT CompilerM m]
partial def forEachFVar (e : Expr) (f : FVarId → m Unit) : m Unit := do
let e := e.consumeMData
match e with
| .proj _ _ struct => forEachFVar struct f
| .lam .. =>
withNewScope do
let (_, body) ← visitLambda e
forEachFVar body f
| .letE .. =>
withNewScope do
let body ← visitLet e (fun _ e => do forEachFVar e f; pure e)
forEachFVar body f
| .app fn arg =>
forEachFVar fn f
forEachFVar arg f
| .fvar fvarId => f fvarId
| .sort .. | .forallE .. | .const .. | .lit .. => return ()
| .bvar .. | .mvar .. | .mdata .. => unreachable!
mutual
variable (tailAppFvarVisitor : FVarId → Expr → m Unit) (valueValidator : Expr → m Unit) (letValueVisitor : Name → Expr → m Expr)
private partial def visitLambda (e : Expr) : m Unit := do
withNewScope do
let (_, body) ← Compiler.visitLambda e
visitTails body
private partial def visitTails (e : Expr) : m Unit := do
let e := e.consumeMData
match e with
| .letE .. =>
withNewScope do
let body ← visitLet e letValueVisitor
visitTails body
| .app (.fvar fvarId) arg =>
tailAppFvarVisitor fvarId e
valueValidator arg
| .app .. =>
if let some casesInfo ← (isCasesApp? e : CompilerM (Option CasesInfo)) then
withNewScope do
let (motive, discrs, arms) ← visitMatch e casesInfo
valueValidator motive
discrs.forM valueValidator
arms.forM visitTails
else
valueValidator e
| .proj .. | .lam .. => valueValidator e
| .fvar .. | .sort .. | .forallE .. | .const .. | .lit .. => return ()
| .bvar .. | .mvar .. | .mdata .. => unreachable!
end
end Visitors
namespace Lean.Compiler.LCNF
namespace JoinPointFinder
/--
Info about a join point candidate (a `fun` declaration) during the find phase.
-/
structure CandidateInfo where
/--
The arity of the candidate
-/
arity : Nat
associated : Std.HashSet Name
/--
The set of candidates that rely on this candidate to be a join point.
For a more detailed explanation see the documentation of `find`
-/
associated : Std.HashSet FVarId
deriving Inhabited
abbrev M := ReaderT (Option Name) StateRefT (Std.HashMap Name CandidateInfo) CompilerM
/--
The state for the join point candidate finder.
-/
structure FindState where
/--
All current join point candidates accessible by their `FVarId`.
-/
candidates : Std.HashMap FVarId CandidateInfo := .empty
/--
The `FVarId`s of all `fun` declarations that were declared within the
current `fun`.
-/
scope : Std.HashSet FVarId := .empty
private def findCandidate? (name : Name) : M (Option CandidateInfo) := do
return (← get).find? name
abbrev ReplaceCtx := Std.HashMap FVarId Name
private partial def eraseCandidate (name : Name) : M Unit := do
if let some info ← findCandidate? name then
modify (fun candidates => candidates.erase name)
abbrev FindM := ReaderT (Option FVarId) StateRefT FindState CompilerM
abbrev ReplaceM := ReaderT ReplaceCtx CompilerM
/--
Attempt to find a join point candidate by its `FVarId`.
-/
private def findCandidate? (fvarId : FVarId) : FindM (Option CandidateInfo) := do
return (← get).candidates.find? fvarId
/--
Erase a join point candidate as well as all the ones that depend on it
by its `FVarId`, no error is thrown is the candidate does not exist.
-/
private partial def eraseCandidate (fvarId : FVarId) : FindM Unit := do
if let some info ← findCandidate? fvarId then
modify (fun state => { state with candidates := state.candidates.erase fvarId })
info.associated.forM eraseCandidate
private partial def removeCandidatesContainedIn (e : Expr) : M Unit := do
let remover := fun fvarId => do
let some decl ← findDecl? fvarId | unreachable!
eraseCandidate decl.userName
forEachFVar e remover
/--
Combinator for modifying the candidates in `FindM`.
-/
private def modifyCandidates (f : Std.HashMap FVarId CandidateInfo → Std.HashMap FVarId CandidateInfo) : FindM Unit :=
modify (fun state => {state with candidates := f state.candidates })
private def addCandidate (name : Name) (arity : Nat) : M Unit := do
/--
Remove all join point candidates contained in `e`.
-/
private partial def removeCandidatesContainedIn (e : Expr) : FindM Unit := do
match e with
| .proj _ _ struct => removeCandidatesContainedIn struct
| .app fn arg =>
removeCandidatesContainedIn fn
removeCandidatesContainedIn arg
| .fvar fvarId => eraseCandidate fvarId
-- These cannot occur in (computationally relevant) LCNF
| .bvar .. | .lam .. | .sort .. | .forallE .. | .letE .. => return
-- These we just don't care about
| .mdata .. | .const .. | .lit .. => return
| .mvar .. => unreachable!
/--
Add a new join point candidate to the state.
-/
private def addCandidate (fvarId : FVarId) (arity : Nat) : FindM Unit := do
let cinfo := { arity, associated := .empty }
modify (fun cs => cs.insert name cinfo)
modifyCandidates (fun cs => cs.insert fvarId cinfo )
private def addDependency (src : Name) (target : Name) : M Unit := do
/--
Add a new join point dependency from `src` to `dst`.
-/
private def addDependency (src : FVarId) (target : FVarId) : FindM Unit := do
if let some targetInfo ← findCandidate? target then
modify (fun cs => cs.insert target { targetInfo with associated := targetInfo.associated.insert src })
modifyCandidates (fun cs => cs.insert target { targetInfo with associated := targetInfo.associated.insert src })
else
eraseCandidate src
def declIsInScope (decl : LocalDecl) : CompilerM Bool := do
let fvars := (←getThe CompilerM.State).letFVars
fvars.anyM (fun fvar => do
let scopeDecl := (←findDecl? fvar.fvarId!).get!
return scopeDecl.userName == decl.userName
)
/--
Clear the current scope for the monadic action `x`, afterwards continuing
with the old one.
-/
private def withNewScope (x : FindM α) : FindM α := do
let scope := (← get).scope
modify fun s => { s with scope := {} }
try x finally modify fun s => { s with scope }
/--
Return a set of let declaration names inside of `e` that qualify as a join
point that is:
1. Are always used in tail position
2. Are always fully applied
Since declaration names are unique inside of LCNF the let bindings and
call sites can be uniquely identified by this.
Check whether `fvarId` is in the current scope, that is, was declared within
the current `fun` declaration that is being processed.
-/
partial def findJoinPoints (e : Expr) : CompilerM (Array Name) := do
let (_, state) ← visitLambda goTailApp removeCandidatesContainedIn goLetValue e |>.run none |>.run .empty
return state.toArray.map Prod.fst
where
goLetValue (userName : Name) (value : Expr) : M Expr := do
match value with
| .lam .. => withNewScope do
let (vars, body) ← Compiler.visitLambda value
addCandidate userName vars.size
withReader (fun _ => some userName) do
visitTails goTailApp removeCandidatesContainedIn goLetValue body
| _ => removeCandidatesContainedIn value
return value
private def isInScope (fvarId : FVarId) : FindM Bool := do
let scope := (← get).scope
return scope.contains fvarId
goTailApp (fvarId : FVarId) (e : Expr) : M Unit := do
let some decl ← findDecl? fvarId | unreachable!
if let some candidateInfo ← findCandidate? decl.userName then
let args := e.getAppNumArgs
if args != candidateInfo.arity then
eraseCandidate decl.userName
else if let some upperCandidate ← read then
if !(←declIsInScope decl) then
addDependency decl.userName upperCandidate
/--
Add a new `FVarId` to the current scope.
-/
private def addToScope (fvarId : FVarId) : FindM Unit :=
modify fun state => { state with scope := state.scope.insert fvarId }
/--
Find all `fun` declarations that qualify as a join point, that is:
- are always fully applied
- are always called in tail position
Where a `fun` `f` is in tail position iff it is called as follows:
```
let res := f arg
res
```
The majority (if not all) tail calls will be brought into this form
by the simplifier pass.
Furthermore a `fun` disqualifies as a join point if turning it into a join
point would turn a call to it into an out of scope join point.
This can happen if we have something like:
```
def test (b : Bool) (x y : Nat) : Nat :=
fun myjp x => Nat.add x (Nat.add x x)
fun f y =>
let x := Nat.add y y
myjp x
fun f y =>
let x := Nat.mul y y
myjp x
cases b (f x) (g y)
```
`f` and `g` can be detected as a join point right away, however
`myjp` can only ever be detected as a join point after we have established
this. This is because otherwise the calls to `myjp` in `f` and `g` would
produce out of scope join point jumps.
-/
partial def find (decl : Decl) : CompilerM FindState := do
let (_, candidates) ← go decl.value |>.run none |>.run {}
return candidates
where
go : Code → FindM Unit
| .let decl k => do
match k, decl.value, decl.value.getAppFn with
| .return valId, .app .., .fvar fvarId =>
decl.value.getAppArgs.forM removeCandidatesContainedIn
if let some candidateInfo ← findCandidate? fvarId then
-- Erase candidate that are not fully applied or applied outside of tail position
if valId != decl.fvarId || decl.value.getAppNumArgs != candidateInfo.arity then
eraseCandidate fvarId
-- Out of scope join point candidate handling
else if let some upperCandidate ← read then
if !(←isInScope fvarId) then
addDependency fvarId upperCandidate
else
eraseCandidate fvarId
| _, _, _ =>
removeCandidatesContainedIn decl.value
go k
| .fun decl k => do
withReader (fun _ => some decl.fvarId) do
withNewScope do
go decl.value
addCandidate decl.fvarId decl.getArity
addToScope decl.fvarId
go k
| .jp decl k => do
go decl.value
go k
| .jmp _ args => args.forM removeCandidatesContainedIn
| .return val => eraseCandidate val
| .cases c => do
eraseCandidate c.discr
c.alts.forM (·.forCodeM go)
| .unreach .. => return ()
/--
Replace all join point candidate `fun` declarations with `jp` ones
and all calls to them with `jmp`s.
-/
partial def replace (decl : Decl) (state : FindState) : CompilerM Decl := do
let mapper := fun acc cname _ => do return acc.insert cname (←mkFreshJpName)
let replaceCtx : ReplaceCtx ← state.candidates.foldM (init := .empty) mapper
let newValue ← go decl.value |>.run replaceCtx
return { decl with value := newValue }
where
go (code : Code) : ReplaceM Code := do
match code with
| .let decl k =>
match k, decl.value, decl.value.getAppFn with
| .return valId, .app .., (.fvar fvarId) =>
if valId == decl.fvarId then
let localDecl := (← get).lctx.localDecls.find! fvarId
if (← read).contains localDecl.fvarId then
modifyLCtx (.eraseLocal decl.fvarId)
return .jmp fvarId decl.value.getAppArgs
else
return code
else
return code
| _, _, _ => return Code.updateLet! code decl (←go k)
| .fun decl k =>
if let some replacement := (← read).find? decl.fvarId then
let newDecl := { decl with
binderName := replacement,
value := (←go decl.value)
}
modifyLCtx fun lctx => lctx.addFunDecl newDecl
return .jp newDecl (←go k)
else
let newDecl ← decl.updateValue (←go decl.value)
return Code.updateFun! code newDecl (←go k)
| .jp decl k =>
let newDecl ← decl.updateValue (←go decl.value)
return Code.updateFun! code newDecl (←go k)
| .cases cs =>
return Code.updateCases! code cs.resultType cs.discr (←cs.alts.mapM (·.mapCodeM go))
| .jmp .. | .return .. | .unreach .. =>
return code
end JoinPointFinder
namespace JoinPointChecker
/--
Throws an exception if `e` contains a join point.
Find all `fun` declarations in `decl` that qualify as join points then replace
their definitions and call sites with `jp`/`jmp`.
-/
def containsNoJp (e : Expr) : CompilerM Unit := do
let checker := fun fvarId => do
let some decl ← findDecl? fvarId | unreachable!
if decl.isJp then
throwError s!"Join point {decl.userName} in forbidden position"
forEachFVar e checker
def Decl.findJoinPoints (decl : Decl) : CompilerM Decl := do
let findResult ← JoinPointFinder.find decl
trace[Compiler.findJoinPoints] s!"Found: {findResult.candidates.size} jp candidates"
JoinPointFinder.replace decl findResult
/--
Check whether all join points in `e` are in a valid position that is:
1. Fully applied
2. In tail position inside of `e`
-/
partial def checkJoinPoints (e : Expr) : CompilerM Unit := do
visitLambda goTailApp containsNoJp goLetValue e
def findJoinPoints : Pass :=
.mkPerDeclaration `findJoinPoints Decl.findJoinPoints .base
where
goLetValue (_userName : Name) (value : Expr) : CompilerM Expr := do
match value with
| .lam .. => visitLambda goTailApp containsNoJp goLetValue value
| _ => containsNoJp value
return value
builtin_initialize
registerTraceClass `Compiler.findJoinPoints (inherited := true)
goTailApp (fvarId : FVarId) (e : Expr) := do
let some decl ← findDecl? fvarId | unreachable!
if decl.isJp then
let args := e.getAppNumArgs
let jpArity := jpArity decl
if args != jpArity then
throwError s!"Join point {decl.userName} : {decl.type} is not fully applied in {e}"
end JoinPointChecker
end JoinPoints
end Lean.Compiler
end Lean.Compiler.LCNF

View file

@ -60,7 +60,7 @@ def run (declNames : Array Name) : CompilerM (Array Decl) := do
let declNames ← declNames.filterM (shouldGenerateCode ·)
if declNames.isEmpty then return #[]
let mut decls ← declNames.mapM toDecl
let mut manager := { passes := #[{ name := `init, run := pure }] }
let mut manager := { passes := #[{ name := `init, run := pure, phase := .base }] }
let installers := PassInstaller.passInstallerExt.getState (←getEnv)
manager ← installers.foldlM (init := manager) PassInstaller.runFromDecl
for pass in manager.passes do

View file

@ -11,27 +11,118 @@ import Lean.Compiler.LCNF.CompilerM
namespace Lean.Compiler.LCNF
/--
The pipeline phase a certain `Pass` is supposed to happen in.
-/
inductive Phase where
| /-- Here we still carry most of the original type information, most
of the dependent portion is already (partially) erased though. -/
base
| /-- In this phase polymorphism has been eliminated. -/
mono
| /-- In this phase impure stuff such as RC or efficient BaseIO transformations happen. -/
impure
deriving Inhabited
/--
A single compiler `Pass`, consisting of the actual pass function operating
on the `Decl`s as well as meta information.
-/
structure Pass where
/--
Which occurence of the pass in the pipeline this is.
Some passes, like simp, can occur multiple times in the pipeline.
For most passes this value does not matter.
-/
occurence : Nat := 0
/--
Which phase this `Pass` is supposed to run in
-/
phase : Phase
/--
The name of the `Pass`
-/
name : Name
/--
The actual pass function, operating on the `Decl`s.
-/
run : Array Decl → CompilerM (Array Decl)
deriving Inhabited
/--
Can be used to install, remove, replace etc. passes by tagging a declaration
of type `PassInstaller` with the `cpass` attribute.
-/
structure PassInstaller where
/--
When the installer is run this function will receive a list of all
current `Pass`es and return a new one, this can modify the list (and
the `Pass`es contained within) in any way it wants.
-/
install : Array Pass → CompilerM (Array Pass)
deriving Inhabited
/--
The `PassManager` used to store all `Pass`es that will be run within
pipeline.
-/
structure PassManager where
passes : Array Pass
deriving Inhabited
namespace Phase
def toNat : Phase → Nat
| .base => 0
| .mono => 1
| .impure => 2
instance : LT Phase where
lt l r := l.toNat < r.toNat
instance : LE Phase where
le l r := l.toNat ≤ r.toNat
instance {p1 p2 : Phase} : Decidable (p1 < p2) := Nat.decLt p1.toNat p2.toNat
instance {p1 p2 : Phase} : Decidable (p1 ≤ p2) := Nat.decLe p1.toNat p2.toNat
instance : ToString Phase where
toString
| .base => "base"
| .mono => "mono"
| .impure => "impure"
end Phase
namespace Pass
def mkPerDeclaration (name : Name) (run : Decl → CompilerM Decl) : Pass where
def mkPerDeclaration (name : Name) (run : Decl → CompilerM Decl) (phase : Phase) (occurence : Nat := 0) : Pass where
occurence := occurence
phase := phase
name := name
run := fun xs => xs.mapM run
end Pass
namespace PassManager
def validate (manager : PassManager) : CompilerM Unit := do
let mut current := .base
for pass in manager.passes do
if ¬(current ≤ pass.phase) then
throwError s!"{pass.name} has phase {pass.phase} but should at least have {current}"
current := pass.phase
def findHighestOccurence (targetName : Name) (passes : Array Pass) : CompilerM Nat := do
let mut highest := none
for pass in passes do
if pass.name == targetName then
highest := some pass.occurence
let some val := highest | throwError s!"Could not find any occurence of {targetName}"
return val
end PassManager
namespace PassInstaller
def installAtEnd (p : Pass) : PassInstaller where
@ -40,27 +131,46 @@ def installAtEnd (p : Pass) : PassInstaller where
def append (passesNew : Array Pass) : PassInstaller where
install passes := return passes ++ passesNew
def installAfter (targetName : Name) (p : Pass) : PassInstaller where
install passes :=
if let some idx := passes.findIdx? (·.name == targetName) then
return passes.insertAt (idx + 1) p
else
throwError s!"Tried to insert pass {p.name} after {targetName} but {targetName} is not in the pass list"
def installBefore (targetName : Name) (p : Pass) : PassInstaller where
install passes :=
if let some idx := passes.findIdx? (·.name == targetName) then
return passes.insertAt idx p
else
throwError s!"Tried to insert pass {p.name} after {targetName} but {targetName} is not in the pass list"
def replacePass (targetName : Name) (p : Pass → CompilerM Pass) : PassInstaller where
def withEachOccurence (targetName : Name) (f : Nat → PassInstaller) : PassInstaller where
install passes := do
let some idx := passes.findIdx? (·.name == targetName) | throwError s!"Tried to replace {targetName} but {targetName} is not in the pass list"
let highestOccurence ← PassManager.findHighestOccurence targetName passes
let mut passes := passes
for occurence in [0:highestOccurence+1] do
passes ← f occurence |>.install passes
return passes
def installAfter (targetName : Name) (p : Pass → Pass) (occurence : Nat := 0) : PassInstaller where
install passes :=
if let some idx := passes.findIdx? (fun p => p.name == targetName && p.occurence == occurence) then
let passUnderTest := passes[idx]!
return passes.insertAt (idx + 1) (p passUnderTest)
else
throwError s!"Tried to insert pass after {targetName}, occurence {occurence} but {targetName} is not in the pass list"
def installAfterEach (targetName : Name) (p : Pass → Pass) : PassInstaller :=
withEachOccurence targetName (installAfter targetName p ·)
def installBefore (targetName : Name) (p : Pass → Pass) (occurence : Nat := 0): PassInstaller where
install passes :=
if let some idx := passes.findIdx? (fun p => p.name == targetName && p.occurence == occurence) then
let passUnderTest := passes[idx]!
return passes.insertAt idx (p passUnderTest)
else
throwError s!"Tried to insert pass after {targetName}, occurence {occurence} but {targetName} is not in the pass list"
def installBeforeEachOccurence (targetName : Name) (p : Pass → Pass) : PassInstaller :=
withEachOccurence targetName (installBefore targetName p ·)
def replacePass (targetName : Name) (p : Pass → Pass) (occurence : Nat := 0) : PassInstaller where
install passes := do
let some idx := passes.findIdx? (fun p => p.name == targetName && p.occurence == occurence) | throwError s!"Tried to replace {targetName}, occurence {occurence} but {targetName} is not in the pass list"
let target := passes[idx]!
let replacement ← p target
let replacement := p target
return passes.set! idx replacement
def replaceEachOccurence (targetName : Name) (p : Pass → Pass) : PassInstaller :=
withEachOccurence targetName (replacePass targetName p ·)
def run (manager : PassManager) (installer : PassInstaller) : CompilerM PassManager := do
return { manager with passes := (←installer.install manager.passes) }
@ -98,12 +208,10 @@ private opaque getPassInstaller (declName : Name) : MetaM PassInstaller
def runFromDecl (manager : PassManager) (declName : Name) : CompilerM PassManager := do
let installer ← getPassInstaller declName |>.run'
installer.run manager
let newState ← installer.run manager
newState.validate
return newState
end PassInstaller
namespace PassManager
end PassManager
end Lean.Compiler.LCNF

View file

@ -9,10 +9,21 @@ import Lean.Compiler.LCNF.CSE
import Lean.Compiler.LCNF.Simp
import Lean.Compiler.LCNF.PullFunDecls
import Lean.Compiler.LCNF.ReduceJpArity
import Lean.Compiler.LCNF.JoinPoints
import Lean.Compiler.LCNF.Specialize
namespace Lean.Compiler.LCNF
@[cpass] def builtin : PassInstaller :=
.append #[pullInstances, cse, simp, pullFunDecls, reduceJpArity, simp { etaPoly := true, inlinePartial := true, implementedBy := true }]
.append #[
pullInstances,
cse,
simp,
pullFunDecls,
findJoinPoints,
reduceJpArity,
simp { etaPoly := true, inlinePartial := true, implementedBy := true } (occurence := 1),
specialize
]
end Lean.Compiler.LCNF

View file

@ -58,10 +58,11 @@ def ppValue (e : Expr) : M Format := do
| _ => ppExpr e
def ppParam (param : Param) : M Format := do
let borrow := if param.borrow then "@&" else ""
if pp.funBinderTypes.get (← getOptions) then
return Format.paren f!"{param.binderName} : {← ppExpr param.type}"
return Format.paren f!"{param.binderName} : {borrow}{← ppExpr param.type}"
else
return format param.binderName
return format s!"{borrow}{param.binderName}"
def ppParams (params : Array Param) : M Format := do
prefixJoin " " params ppParam

View file

@ -24,56 +24,49 @@ The `PullM` state contains the local function declarations and join points being
-/
abbrev PullM := StateRefT (List ToPull) CompilerM
/--
Sort local function declarations and join points being pulled.
We use an order with the following properties.
- If `p₁` depends on `p₂`, then `p₁` is smaller than `p₂`.
- Local function declarations are smaller than join points.
- We break ties using the free variable id.
If the output is of the form `#[p₁, p₂, ...]`, and we have code `c`,
we construct code of the form `... fun p₂.decl <| fun p₁.decl c`
-/
def sortDeps (ps : List ToPull) : Array ToPull :=
let ps := ps.toArray
ps.qsort fun p₁ p₂ =>
if p₂.used.contains p₁.decl.fvarId then
/- p₂ depends on p₁ -/
false
else if p₁.used.contains p₂.decl.fvarId then
/- p₁ depends on p₂ -/
true
else if !p₁.isFun && p₂.isFun then
/- We want join points to occur before local function declarations whenever possible. -/
false
else if p₁.isFun && !p₂.isFun then
true
else
/- Use free variable id as tie breaker. -/
Name.quickLt p₁.decl.fvarId.name p₂.decl.fvarId.name
/--
Extract from the state any local function declarations that depends on the given
free variable. The idea is that we have to stop pulling these declarations because they
depend on `fvarId`.
-/
def findFVarDeps (fvarId : FVarId) : PullM (List ToPull) := do
def findFVarDirectDeps (fvarId : FVarId) : PullM (List ToPull) := do
let s ← get
unless s.any fun info => info.used.contains fvarId do
return []
let (s₁, s₂) := go s [] []
let (s₁, s₂) ← go s [] []
set s₁
return s₂
where
go (as keep dep : List ToPull) : List ToPull × List ToPull :=
go (as keep dep : List ToPull) : CoreM (List ToPull × List ToPull) := do
match as with
| [] => (keep ,dep)
| [] => return (keep, dep)
| a :: as =>
if a.used.contains fvarId then
go as keep (a :: dep)
else
go as (a :: keep) dep
partial def findFVarDepsFixpoint (todo : List ToPull) (acc : Array ToPull := #[]) : PullM (Array ToPull) := do
match todo with
| [] => return acc
| p :: ps =>
let psNew ← findFVarDirectDeps p.decl.fvarId
findFVarDepsFixpoint (psNew ++ ps) (acc.push p)
partial def findFVarDeps (fvarId : FVarId) : PullM (Array ToPull) := do
let ps ← findFVarDirectDeps fvarId
findFVarDepsFixpoint ps
/--
Similar to `findFVarDeps`. Extract from the state any local function declarations that depends on the given
parameters.
-/
def findParamsDeps (params : Array Param) : PullM (Array ToPull) := do
let mut acc := #[]
for param in params do
acc := acc ++ (← findFVarDeps param.fvarId)
return acc
/--
Construct the code `fun p.decl k` or `jp p.decl k`.
-/
@ -83,48 +76,39 @@ def ToPull.attach (p : ToPull) (k : Code) : Code :=
else
.jp p.decl k
mutual
/--
Attach the given array of local function declarations and join points to `k`.
-/
partial def attach (ps : Array ToPull) (k : Code) : Code := Id.run do
let visited := ps.map fun _ => false
let (_, (k, _)) := go |>.run (k, visited)
return k
where
go : StateM (Code × Array Bool) Unit := do
for i in [:ps.size] do
visit i
visited (i : Nat) : StateM (Code × Array Bool) Bool :=
return (← get).2[i]!
visit (i : Nat) : StateM (Code × Array Bool) Unit := do
unless (← visited i) do
modify fun (k, visited) => (k, visited.set! i true)
let pi := ps[i]!
for j in [:ps.size] do
unless (← visited j) do
let pj := ps[j]!
if pj.used.contains pi.decl.fvarId then
visit j
modify fun (k, visited) => (pi.attach k, visited)
/--
Extract from the state any local function declarations that depends on the given
free variable, **and** attach to code `k`.
-/
partial def attachFVarDeps (fvarId : FVarId) (k : Code) : PullM Code := do
let ps ← findFVarDeps fvarId
attach ps k
/--
Attach the given list of local function declarations and join points to `k`.
We also attach any declaration on the state that depends on a `p` in `ps`.
-/
partial def attach (ps : List ToPull) (k : Code) : PullM Code := do
let mut k := k
for p in sortDeps ps do
k ← attachFVarDeps p.decl.fvarId k
k := p.attach k
return k
end
/--
Similar to `findFVarDeps`. Extract from the state any local function declarations that depends on the given
parameters.
-/
def findParamsDeps (params : Array Param) : PullM (List ToPull) := do
let s ← get
unless s.any fun info => params.any fun p => info.used.contains p.fvarId do
return []
let (s₁, s₂) := go s [] []
set s₁
return s₂
where
go (as keep dep : List ToPull) : List ToPull × List ToPull :=
match as with
| [] => (keep ,dep)
| a :: as =>
if params.any fun p => a.used.contains p.fvarId then
go as keep (a :: dep)
else
go as (a :: keep) dep
return attach ps k
/--
Similar to `attachFVarDeps`. Extract from the state any local function declarations that depends on the given
@ -132,12 +116,13 @@ parameters, **and** attach to code `k`.
-/
def attachParamsDeps (params : Array Param) (k : Code) : PullM Code := do
let ps ← findParamsDeps params
attach ps k
return attach ps k
def attachJps (k : Code) : PullM Code := do
let jps := (← get).filter fun info => !info.isFun
modify fun s => s.filter fun info => info.isFun
attach jps k
let jps ← findFVarDepsFixpoint jps
return attach jps k
mutual
/--
@ -187,11 +172,11 @@ Pull local function declarations and join points in the given declaration.
-/
def Decl.pullFunDecls (decl : Decl) : CompilerM Decl := do
let (value, ps) ← pull decl.value |>.run []
let value ← attach ps value |>.run' []
let value := attach ps.toArray value
return { decl with value }
def pullFunDecls : Pass :=
.mkPerDeclaration `pullFunDecls Decl.pullFunDecls
.mkPerDeclaration `pullFunDecls Decl.pullFunDecls .base
builtin_initialize
registerTraceClass `Compiler.pullFunDecls (inherited := true)

View file

@ -109,7 +109,7 @@ def Decl.pullInstances (decl : Decl) : CompilerM Decl :=
return false
def pullInstances : Pass :=
.mkPerDeclaration `pullInstances Decl.pullInstances
.mkPerDeclaration `pullInstances Decl.pullInstances .base
builtin_initialize
registerTraceClass `Compiler.pullInstances (inherited := true)

View file

@ -71,9 +71,9 @@ def Decl.reduceJpArity (decl : Decl) : CompilerM Decl := do
return { decl with value }
def reduceJpArity : Pass :=
.mkPerDeclaration `reduceJpArity Decl.reduceJpArity
.mkPerDeclaration `reduceJpArity Decl.reduceJpArity .base
builtin_initialize
registerTraceClass `Compiler.reduceJpArity (inherited := true)
end Lean.Compiler.LCNF
end Lean.Compiler.LCNF

View file

@ -147,11 +147,20 @@ structure Config where
inlinePartial := false
/--
If `implementedBy` is `true`, we apply the `implementedBy` replacements.
Remark: we only apply `casesOn` replacements at phase 2 because `cases` constructor
may not have enough information for reconstructing the original `casesOn` application at
phase 1.
-/
implementedBy := false
deriving Inhabited
structure Context where
/--
Name of the declaration being simplified.
We currently use this information because we are generating phase1 declarations on demand,
and it may trigger non-termination when trying to access the phase1 declaration.
-/
declName : Name
config : Config := {}
discrCtorMap : FVarIdMap Expr := {}
@ -193,6 +202,16 @@ abbrev SimpM := ReaderT Context $ StateRefT State CompilerM
instance : MonadFVarSubst SimpM where
getSubst := return (← get).subst
/--
Use `findExpr`, and if the result is a free variable, check whether it is in the map `discrCtorMap`.
We use this method when simplifying projections and cases-constructor.
-/
def findCtor (e : Expr) : SimpM Expr := do
let e ← findExpr e
let .fvar fvarId := e | return e
let some ctor := (← read).discrCtorMap.find? fvarId | return e
return ctor
/--
Execute `x` with the information that `discr = ctorName ctorFields`.
We use this information to simplify nested cases on the same discriminant.
@ -308,40 +327,80 @@ structure InlineCandidateInfo where
params : Array Param
/-- Value (lambda expression) of the function to be inlined. -/
value : Code
f : Expr
args : Array Expr
/-- The arity (aka number of parameters) of the function to be inlined. -/
def InlineCandidateInfo.arity : InlineCandidateInfo → Nat
| { params, .. } => params.size
/--
Return `some i` if `decl` is of the form
```
def f (a_0 ... a_i ...) :=
...
cases a_i
| ...
| ...
```
That is, `f` is a sequence of declarations followed by a `cases` on the parameter `i`.
We use this function to decide whether we should inline a declaration tagged with
`[inlineIfReduce]` or not.
-/
def isCasesOnParam? (decl : Decl) : Option Nat :=
go decl.value
where
go (code : Code) : Option Nat :=
match code with
| .let _ k | .jp _ k | .fun _ k => go k
| .cases c => decl.params.findIdx? fun param => param.fvarId == c.discr
| _ => none
/--
Return `some info` if `e` should be inlined.
-/
def inlineCandidate? (e : Expr) : SimpM (Option InlineCandidateInfo) := do
let mut e := e
let mut mustInline := false
if e.isAppOfArity ``inline 2 then
e ← findExpr e.appArg!
mustInline := true
let numArgs := e.getAppNumArgs
let f := e.getAppFn
if let .const declName us ← findExpr f then
unless hasInlineAttribute (← getEnv) declName do return none
if declName == (← read).declName then return none -- TODO: remove after we start storing phase1 code in .olean files
let inlineIfReduce := hasInlineIfReduceAttribute (← getEnv) declName
unless mustInline || hasInlineAttribute (← getEnv) declName || inlineIfReduce do return none
-- TODO: check whether function is recursive or not.
-- We can skip the test and store function inline so far.
let some decl ← getStage1Decl? declName | return none
let arity := decl.getArity
let inlinePartial := (← read).config.inlinePartial
if !inlinePartial && numArgs < arity then return none
if !mustInline && !inlinePartial && numArgs < arity then return none
if inlineIfReduce then
let some paramIdx := isCasesOnParam? decl | return none
unless paramIdx < numArgs do return none
let arg ← findCtor (e.getArg! paramIdx)
unless arg.isConstructorApp (← getEnv) do return none
let params := decl.instantiateParamsLevelParams us
let value := decl.instantiateValueLevelParams us
incInline
return some {
isLocal := false
f := e.getAppFn
args := e.getAppArgs
params, value
}
else if let some decl ← findFunDecl? f then
unless numArgs > 0 do return none -- It is not worth to inline a local function that does not take any arguments
unless (← shouldInlineLocal decl) do return none
unless mustInline || (← shouldInlineLocal decl) do return none
-- Remark: we inline local function declarations even if they are partial applied
incInlineLocal
modify fun s => { s with inlineLocal := s.inlineLocal + 1 }
return some {
isLocal := true
f := e.getAppFn
args := e.getAppArgs
params := decl.params
value := decl.value
}
@ -389,15 +448,15 @@ def betaReduce (params : Array Param) (code : Code) (args : Array Expr) (mustInl
return code
/--
Create a new local function declaration when `args.size < info.params.size`.
Create a new local function declaration when `info.args.size < info.params.size`.
We use this function to inline/specialize a partial application of a local function.
-/
def specializePartialApp (info : InlineCandidateInfo) (args : Array Expr) : SimpM FunDecl := do
def specializePartialApp (info : InlineCandidateInfo) : SimpM FunDecl := do
let mut subst := {}
for param in info.params, arg in args do
for param in info.params, arg in info.args do
subst := subst.insert param.fvarId arg
let mut paramsNew := #[]
for param in info.params[args.size:] do
for param in info.params[info.args.size:] do
let type ← replaceExprFVars param.type subst
let paramNew ← mkAuxParam type
paramsNew := paramsNew.push paramNew
@ -407,27 +466,23 @@ def specializePartialApp (info : InlineCandidateInfo) (args : Array Expr) : Simp
mkAuxFunDecl paramsNew code
/--
If `e` is an application that can be inlined, inline it.
If the value of the given let-declaration is an application that can be inlined, inline it.
`k?` is the optional "continuation" for `e`, and it may contain loose bound variables
that need to instantiated with `xs`. That is, if `k? = some k`, then `k.instantiateRev xs`
is an expression without loose bound variables.
`k` is the "continuation" for the let declaration.
-/
partial def inlineApp? (letDecl : LetDecl) (k : Code) : SimpM (Option Code) := do
if k matches .unreach .. then return some k
let e := letDecl.value
let some info ← inlineCandidate? e | return none
let some info ← inlineCandidate? letDecl.value | return none
markSimplified
let args := e.getAppArgs
let numArgs := args.size
trace[Compiler.simp.inline] "inlining {e}"
let numArgs := info.args.size
trace[Compiler.simp.inline] "inlining {letDecl.value}"
let fvarId := letDecl.fvarId
if numArgs < info.arity then
let funDecl ← specializePartialApp info args
let funDecl ← specializePartialApp info
addSubst letDecl.fvarId (.fvar funDecl.fvarId)
return some (.fun funDecl k)
else
let code ← betaReduce info.params info.value args[:info.arity]
let code ← betaReduce info.params info.value info.args[:info.arity]
if k.isReturnOf fvarId && numArgs == info.arity then
/- Easy case, the continuation `k` is just returning the result of the application. -/
return code
@ -439,7 +494,7 @@ partial def inlineApp? (letDecl : LetDecl) (k : Code) : SimpM (Option Code) := d
code.bind fun fvarId' => do
/- fvarId' is the result of the computation -/
if numArgs > info.arity then
let decl ← mkAuxLetDecl (mkAppN (.fvar fvarId') args[info.arity:])
let decl ← mkAuxLetDecl (mkAppN (.fvar fvarId') info.args[info.arity:])
let k ← replaceFVar k fvarId decl.fvarId
return .let decl k
else
@ -449,9 +504,9 @@ partial def inlineApp? (letDecl : LetDecl) (k : Code) : SimpM (Option Code) := d
`code` has multiple exit points, and the continuation is non-trivial
Thus, we create an auxiliary join point.
-/
let jpParam ← mkAuxParam (← inferType (mkAppN e.getAppFn args[:info.arity]))
let jpParam ← mkAuxParam (← inferType (mkAppN info.f info.args[:info.arity]))
let jpValue ← if numArgs > info.arity then
let decl ← mkAuxLetDecl (mkAppN (.fvar jpParam.fvarId) args[info.arity:])
let decl ← mkAuxLetDecl (mkAppN (.fvar jpParam.fvarId) info.args[info.arity:])
let k ← replaceFVar k fvarId decl.fvarId
pure <| .let decl k
else
@ -531,7 +586,7 @@ where
go (i : Nat) (code : Code) : SimpM Code := do
if i > 0 then
let decl := decls[i-1]!
if !decl.isPure || (← isUsed decl.fvarId) then
if (← isUsed decl.fvarId) then
match decl with
| .let decl => markUsedLetDecl decl; go (i-1) (.let decl code)
| .fun decl => markUsedFunDecl decl; go (i-1) (.fun decl code)
@ -736,16 +791,6 @@ private def addDefault (alts : Array Alt) : SimpM (Array Alt) := do
altsNew := altsNew.push alt
return altsNew.push (.default max.getCode)
/--
Use `findExpr`, and if the result is a free variable, check whether it is in the map `discrCtorMap`.
We use this method when simplifying projections and cases-constructor.
-/
def findCtor (e : Expr) : SimpM Expr := do
let e ← findExpr e
let .fvar fvarId := e | return e
let some ctor := (← read).discrCtorMap.find? fvarId | return e
return ctor
/--
Try to simplify projections `.proj _ i s` where `s` is constructor.
-/
@ -832,7 +877,7 @@ Try to simplify `cases` of `constructor`
partial def simpCasesOnCtor? (cases : Cases) : SimpM (Option Code) := do
let discr ← normFVar cases.discr
let discrExpr ← findCtor (.fvar discr)
let some (ctorVal, ctorArgs) := discrExpr.constructorApp? (← getEnv) | return none
let some (ctorVal, ctorArgs) := discrExpr.constructorApp? (← getEnv) (useRaw := true) | return none
let (alt, cases) := cases.extractAlt! ctorVal.name
eraseFVarsAt (.cases cases)
markSimplified
@ -840,11 +885,22 @@ partial def simpCasesOnCtor? (cases : Cases) : SimpM (Option Code) := do
| .default k => simp k
| .alt _ params k =>
let fields := ctorArgs[ctorVal.numParams:]
let mut auxDecls := #[]
for param in params, field in fields do
addSubst param.fvarId field
/-
`field` may not be a free variable. Recall that `constructorApp?` has special support for numerals,
and `ctorArgs` contains a numeral if `discrExpr` is a numeral. We may have other cases in the future.
To make the code robust, we add auxiliary declarations whenever the `field` is not a free variable.
-/
if field.isFVar then
addSubst param.fvarId field
else
let auxDecl ← mkAuxLetDecl field
auxDecls := auxDecls.push (CodeDecl.let auxDecl)
addSubst param.fvarId (.fvar auxDecl.fvarId)
let k ← simp k
eraseParams params
return k
attachCodeDecls auxDecls k
/--
Simplify `code`
@ -873,7 +929,7 @@ partial def simp (code : Code) : SimpM Code := withIncRecDepth do
attachCodeDecls decls k
else
let k ← simp k
if !decl.pure || (← isUsed decl.fvarId) then
if (← isUsed decl.fvarId) then
markUsedLetDecl decl
return code.updateLet! decl k
else
@ -974,21 +1030,21 @@ partial def Decl.simp (decl : Decl) (config : Config) : CompilerM Decl := do
/-
We do not eta-expand or inline partial applications in template like code.
Recall we don't want to generate code for them.
Remark: by eta-expanding partial applications in instaces, we also make the simplifier
Remark: by eta-expanding partial applications in instances, we also make the simplifier
work harder when inlining instance projections.
-/
config := { config with etaPoly := false, inlinePartial := false }
go decl config
where
go (decl : Decl) (config : Config) : CompilerM Decl := do
if let some decl ← decl.simp? |>.run { config } |>.run' {} then
if let some decl ← decl.simp? |>.run { config, declName := decl.name } |>.run' {} then
-- TODO: bound number of steps?
go decl config
else
return decl
def simp (config : Config := {}) : Pass :=
.mkPerDeclaration `simp (Decl.simp · config)
def simp (config : Config := {}) (occurence : Nat := 0) : Pass :=
.mkPerDeclaration `simp (Decl.simp · config) .base (occurence := occurence)
builtin_initialize
registerTraceClass `Compiler.simp (inherited := true)

View file

@ -0,0 +1,162 @@
/-
Copyright (c) 2022 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Compiler.Specialize
import Lean.Compiler.LCNF.FixedArgs
import Lean.Compiler.LCNF.InferType
namespace Lean.Compiler.LCNF
/--
Each parameter is associated with a `SpecParamInfo`. This information is used by `LCNF/Specialize.lean`.
-/
inductive SpecParamInfo where
| /--
A parameter that is an type class instance (or an arrow that produces a type class instance),
and is fixed in recursive declarations. By default, Lean always specializes this kind of argument.
-/
fixedInst
| /--
A parameter that is a function and is fixed in recursive declarations. If the user tags a declaration
with `@[specialize]` without specifying which arguments should be specialized, Lean will specialize
`.fixedHO` arguments in addition to `.fixedInst`.
-/
fixedHO
| /--
Computationally irrelevant parameters that are fixed in recursive declarations.
-/
fixedNeutral
| /--
An argument that has been specified in the `@[specialize]` attribute. Lean specializes it even if it is
not fixed in recursive declarations. Non-termination can happen, and Lean interrupts it with an error message
based on the stack depth.
-/
user
| /--
Parameter is not going to be specialized.
-/
other
deriving Inhabited, Repr
instance : ToMessageData SpecParamInfo where
toMessageData
| .fixedInst => "I"
| .fixedHO => "H"
| .fixedNeutral => "N"
| .user => "U"
| .other => "O"
structure SpecState where
specInfo : SMap Name (Array SpecParamInfo) := {}
deriving Inhabited
structure SpecEntry where
declName : Name
paramsInfo : Array SpecParamInfo
deriving Inhabited
namespace SpecState
def addEntry (s : SpecState) (e : SpecEntry) : SpecState :=
match s with
| { specInfo } => { specInfo := specInfo.insert e.declName e.paramsInfo }
def switch : SpecState → SpecState
| { specInfo } => { specInfo := specInfo.switch }
end SpecState
/--
Extension for storing `SpecParamInfo` for declarations being compiled.
Remark: we only store information for declarations that will be specialized.
-/
builtin_initialize specExtension : SimplePersistentEnvExtension SpecEntry SpecState ←
registerSimplePersistentEnvExtension {
name := `specInfoExt
addEntryFn := SpecState.addEntry
addImportedFn := fun es => mkStateFromImportedEntries SpecState.addEntry {} es |>.switch
}
/--
Return `true` if `type` is a type tagged with `@[nospecialize]` or an arrow that produces this kind of type.
For example, this function returns true for `Inhabited Nat`, and `Nat → Inhabited Nat`.
-/
private def isNoSpecType (env : Environment) (type : Expr) : Bool :=
match type with
| .forallE _ _ b _ => isNoSpecType env b
| _ =>
if let .const declName _ := type.getAppFn then
hasNospecializeAttribute env declName
else
false
/--
Save parameter information for `decls`.
Remark: this function, similarly to `mkFixedArgMap`,
assumes that if a function `f` was declared in a mutual block, then `decls`
contains all (computationally relevant) functions in the mutual block.
-/
def saveSpecParamInfo (decls : Array Decl) : CompilerM Unit := do
let mut declsInfo := #[]
for decl in decls do
if hasNospecializeAttribute (← getEnv) decl.name then
declsInfo := declsInfo.push (mkArray decl.params.size .other)
else
let specArgs? := getSpecializationArgs? (← getEnv) decl.name
let contains (i : Nat) : Bool := specArgs?.getD #[] |>.contains i
let mut paramsInfo : Array SpecParamInfo := #[]
for i in [:decl.params.size] do
let param := decl.params[i]!
let info ←
if contains i then
pure .user
/-
If the user tagged class (e.g., `Inhabited`) with the `@[nospecialize]` attribute,
then parameters of this type should not be considered for specialization.
-/
else if isNoSpecType (← getEnv) param.type then
pure .other
else if isTypeFormerType param.type then
pure .fixedNeutral
else if (← isArrowClass? param.type).isSome then
pure .fixedInst
/-
Recall that if `specArgs? == some #[]`, then user annotated function with `@[specialize]`, but did not
specify which arguments must be specialized besides instances. In this case, we try to specialize
any "fixed higher-order argument"
-/
else if specArgs? == some #[] && param.type matches .forallE .. then
pure .fixedHO
else
pure .other
paramsInfo := paramsInfo.push info
pure ()
declsInfo := declsInfo.push paramsInfo
if declsInfo.any fun paramsInfo => paramsInfo.any (· matches .user | .fixedInst | .fixedHO) then
let m := mkFixedArgMap decls
for i in [:decls.size] do
let decl := decls[i]!
let paramsInfo := declsInfo[i]!
let some mask := m.find? decl.name | unreachable!
let paramsInfo := paramsInfo.zipWith mask fun info mask => if mask || info matches .user then info else .other
if paramsInfo.any fun info => info matches .fixedInst | .fixedHO | .user then
trace[Compiler.specialize.info] "{decl.name} {paramsInfo}"
modifyEnv fun env => specExtension.addEntry env { declName := decl.name, paramsInfo }
def getSpecParamInfoCore? (env : Environment) (declName : Name) : Option (Array SpecParamInfo) :=
(specExtension.getState env).specInfo.find? declName
def getSpecParamInfo? [Monad m] [MonadEnv m] (declName : Name) : m (Option (Array SpecParamInfo)) :=
return (specExtension.getState (← getEnv)).specInfo.find? declName
def isSpecCandidate [Monad m] [MonadEnv m] (declName : Name) : m Bool :=
return (specExtension.getState (← getEnv)).specInfo.contains declName
builtin_initialize
registerTraceClass `Compiler.specialize.info
end Lean.Compiler.LCNF

View file

@ -0,0 +1,104 @@
/-
Copyright (c) 2022 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Compiler.Specialize
import Lean.Compiler.LCNF.Simp
import Lean.Compiler.LCNF.SpecInfo
namespace Lean.Compiler.LCNF
namespace Specialize
structure Context where
/--
Set of free variables in scope.
-/
scope : FVarIdSet := {}
/--
Set of let-declarations in scope that do not depend on parameters.
-/
ground : FVarIdSet := {}
structure State where
decls : Array Decl := #[]
abbrev SpecializeM := ReaderT Context $ StateRefT State CompilerM
@[inline] def withParams (ps : Array Param) (x : SpecializeM α) : SpecializeM α :=
withReader (fun ctx => { ctx with scope := ps.foldl (init := ctx.scope) fun s p => s.insert p.fvarId }) x
@[inline] def withFVar (fvarId : FVarId) (x : SpecializeM α) : SpecializeM α :=
withReader (fun ctx => { ctx with scope := ctx.scope.insert fvarId }) x
def isGround (e : Expr) : SpecializeM Bool := do
let s := (← read).ground
return !e.hasAnyFVar (!s.contains ·)
@[inline] def withLetDecl (decl : LetDecl) (x : SpecializeM α) : SpecializeM α := do
let grd ← isGround decl.value
let fvarId := decl.fvarId
withReader (fun { scope, ground } => { scope := scope.insert fvarId, ground := if grd then ground.insert fvarId else ground }) x
def specializeApp? (letDecl : LetDecl) (_k : Code) : SpecializeM (Option Code) := do
unless letDecl.value.isApp do return none
let .const declName _us := letDecl.value.getAppFn | return none
let some paramsInfo ← getSpecParamInfo? declName | return none
let some _decl ← getStage1Decl? declName | return none
trace[Compiler.specialize.candidate] "{letDecl.value}, {paramsInfo}, {← letDecl.value.getAppArgs.mapM isGround}"
-- TODO
return none
mutual
partial def visitFunDecl (funDecl : FunDecl) : SpecializeM FunDecl := do
let value ← withParams funDecl.params <| visitCode funDecl.value
funDecl.update' funDecl.type value
partial def visitCode (code : Code) : SpecializeM Code := do
match code with
| .let decl k =>
if let some k ← specializeApp? decl k then
visitCode k
else
let k ← withLetDecl decl <| visitCode k
return code.updateLet! decl k
| .fun decl k | .jp decl k =>
let decl ← visitFunDecl decl
let k ← withFVar decl.fvarId <| visitCode k
return code.updateFun! decl k
| .cases c =>
let alts ← c.alts.mapMonoM fun alt =>
match alt with
| .default k => return alt.updateCode (← visitCode k)
| .alt _ ps k => withParams ps do return alt.updateCode (← visitCode k)
return code.updateAlts! alts
| .unreach .. | .jmp .. | .return .. => return code
end
def main (decl : Decl) : SpecializeM Decl := do
if (← isTemplateLike decl) then
return decl
else
let value ← withParams decl.params <| visitCode decl.value
return { decl with value }
end Specialize
partial def Decl.specialize (decl : Decl) : CompilerM (Array Decl) := do
let (decl, s) ← Specialize.main decl |>.run {} |>.run {}
return s.decls.push decl
def specialize : Pass where
phase := .base
name := `specialize
run := fun decls => do
saveSpecParamInfo decls
decls.foldlM (init := #[]) fun decls decl => return decls ++ (← decl.specialize)
builtin_initialize
registerTraceClass `Compiler.specialize (inherited := true)
registerTraceClass `Compiler.specialize.candidate
end Lean.Compiler.LCNF

View file

@ -14,67 +14,158 @@ partial def Code.containsConst (constName : Name) (code : Code) : Bool :=
| .fun decl k => containsConst constName decl.value || containsConst constName k
| .jp decl k => containsConst constName decl.value || containsConst constName k
| .jmp _ args => args.any goExpr
| .cases cs => cs.alts.any goAlt
| .cases cs => cs.alts.any fun alt => containsConst constName alt.getCode
| .return .. | .unreach .. => false
where
goAlt (alt : Alt) : Bool :=
match alt with
| .alt _ _ body | .default body => containsConst constName body
goExpr (e : Expr) : Bool :=
match e with
| .const name .. => name == constName
| .app fn arg .. => goExpr fn || goExpr arg
| .lam _ _ body .. => goExpr body
| .letE _ _ value body .. => goExpr value || goExpr body
| .proj _ _ struct .. => goExpr struct
| .letE .. => unreachable! -- not possible in LCNF
| _ => false
namespace Testing
structure TestInstallerContext where
passUnderTestName : Name
testName : Name
structure TestContext where
passUnderTest : Pass
testName : Name
structure SimpleAssertionContext where
decls : Array Decl
structure InOutAssertionContext where
input : Array Decl
output : Array Decl
abbrev TestInstallerM := ReaderM TestInstallerContext
abbrev TestInstaller := TestInstallerM PassInstaller
abbrev TestM := ReaderT TestContext CompilerM
abbrev SimpleAssertionM := ReaderT SimpleAssertionContext TestM
abbrev InOutAssertionM := ReaderT InOutAssertionContext TestM
abbrev SimpleTest := SimpleAssertionM Unit
abbrev InOutTest := InOutAssertionM Unit
def TestInstaller.install (x : TestInstaller) (passUnderTestName testName : Name) : PassInstaller :=
x { passUnderTestName, testName }
def TestM.run (x : TestM α) (passUnderTest : Pass) (testName : Name) : CompilerM α :=
x { passUnderTest, testName }
def SimpleAssertionM.run (x : SimpleAssertionM α) (decls : Array Decl) (passUnderTest : Pass) (testName : Name) : CompilerM α :=
x { decls } { passUnderTest, testName }
def InOutAssertionM.run (x : InOutAssertionM α) (input output : Array Decl) (passUnderTest : Pass) (testName : Name) : CompilerM α :=
x { input, output } { passUnderTest, testName }
def getTestName : TestM Name := do
return (←read).testName
def getPassUnderTest : TestM Pass := do
return (←read).passUnderTest
def getDecls : SimpleAssertionM (Array Decl) := do
return (←read).decls
def getInputDecls : InOutAssertionM (Array Decl) := do
return (←read).input
def getOutputDecls : InOutAssertionM (Array Decl) := do
return (←read).output
/--
If `property` is `false` throw an exception with `msg`.
-/
def assert (property : Bool) (msg : String) : CompilerM Unit := do
def assert (property : Bool) (msg : String) : TestM Unit := do
unless property do
throwError msg
/--
Install an assertion pass right after a pass.
-/
def assertConditionAfter (passUnderTestName : Name) (testName : Name) (assertion : Array Decl → CompilerM Unit) : PassInstaller :=
let assertion := {
private def assertAfterTest (test : SimpleTest) : TestInstallerM (Pass → Pass) := do
let testName := (←read).testName
return fun passUnderTest => {
phase := passUnderTest.phase
name := testName
run := fun decls => do
trace[Compiler.test] s!"Starting post condition test {testName} for {passUnderTestName}"
assertion decls
trace[Compiler.test] s!"Post condition test {testName} for {passUnderTestName} successful"
trace[Compiler.test] s!"Starting post condition test {testName} for {passUnderTest.name} occurence {passUnderTest.occurence}"
test.run decls passUnderTest testName
trace[Compiler.test] s!"Post condition test {testName} for {passUnderTest.name} occurence {passUnderTest.occurence} successful"
return decls
}
.installAfter passUnderTestName assertion
def assertForEachDeclAfterM (passUnderTestName : Name) (testName : Name) (assertion : Decl → CompilerM Unit) : PassInstaller :=
assertConditionAfter passUnderTestName testName (·.forM assertion)
def assertForEachDeclAfter (passUnderTestName : Name) (testName : Name) (assertion : Decl → Bool) (msg : String) : PassInstaller :=
assertConditionAfter passUnderTestName testName (Array.forM (fun decl => assert (assertion decl) msg))
/--
Replace a pass with a wrapper one that allows the user to provide an assertion which
takes into account both the declarations that were sent to and produced by the pass
under test.
Install an assertion pass right after a specific occurence of a pass,
default is first.
-/
def assertConditionAround (passUnderTestName : Name) (testName : Name) (assertion : Array Decl → Array Decl → CompilerM Unit) : PassInstaller :=
let assertion := fun passUnderTest => pure {
name := passUnderTestName
def assertAfter (test : SimpleTest) (occurence : Nat := 0): TestInstaller := do
let passUnderTestName := (←read).passUnderTestName
let assertion ← assertAfterTest test
return .installAfter passUnderTestName assertion occurence
/--
Install an assertion pass right after each occurence of a pass.
-/
def assertAfterEachOccurence (test : SimpleTest) : TestInstaller := do
let passUnderTestName := (←read).passUnderTestName
let assertion ← assertAfterTest test
return .installAfterEach passUnderTestName assertion
/--
Install an assertion pass right after a specific occurence of a pass,
default is first. The assertion operates on a per declaration basis.
-/
def assertForEachDeclAfter (assertion : Pass → Decl → Bool) (msg : String) (occurence : Nat := 0) : TestInstaller :=
let assertion := do
let pass ← getPassUnderTest
(←getDecls).forM (fun decl => assert (assertion pass decl) msg)
assertAfter assertion occurence
/--
Install an assertion pass right after the each occurence of a pass. The
assertion operates on a per declaration basis.
-/
def assertForEachDeclAfterEachOccurence (assertion : Pass → Decl → Bool) (msg : String) : TestInstaller :=
assertAfterEachOccurence <| do
let pass ← getPassUnderTest
(←getDecls).forM (fun decl => assert (assertion pass decl) msg)
private def assertAroundTest (test : InOutTest) : TestInstallerM (Pass → Pass) := do
let testName := (←read).testName
return fun passUnderTest => {
phase := passUnderTest.phase
name := passUnderTest.name
run := fun decls => do
trace[Compiler.test] s!"Starting condition test {testName} for {passUnderTestName}"
trace[Compiler.test] s!"Starting wrapper test {testName} for {passUnderTest.name} occurence {passUnderTest.occurence}"
let newDecls ← passUnderTest.run decls
assertion decls newDecls
trace[Compiler.test] s!"Condition test {testName} for {passUnderTestName} successful"
test.run decls newDecls passUnderTest testName
trace[Compiler.test] s!"Wrapper test {testName} for {passUnderTest.name} occurence {passUnderTest.occurence} successful"
return newDecls
}
.replacePass passUnderTestName assertion
/--
Replace a specific occurence, default is first, of a pass with a wrapper one that allows
the user to provide an assertion which takes into account both the
declarations that were sent to and produced by the pass under test.
-/
def assertAround (test : InOutTest) (occurence : Nat := 0) : TestInstaller := do
let passUnderTestName := (←read).passUnderTestName
let assertion ← assertAroundTest test
return .replacePass passUnderTestName assertion occurence
/--
Replace all occurences of a pass with a wrapper one that allows
the user to provide an assertion which takes into account both the
declarations that were sent to and produced by the pass under test.
-/
def assertAroundEachOccurence (test : InOutTest) : TestInstaller := do
let passUnderTestName := (←read).passUnderTestName
let assertion ← assertAroundTest test
return .replaceEachOccurence passUnderTestName assertion
private def throwFixPointError (err : String) (firstResult secondResult : Array Decl) : CompilerM Unit := do
let mut err := err
@ -90,65 +181,57 @@ Insert a pass after `passUnderTestName`, that ensures, that if
`passUnderTestName` is executed twice in a row, no change in the resulting
expression will occur, i.e. the pass is at a fix point.
-/
def assertIsAtFixPoint (passUnderTestName : Name) : PassInstaller where
install passes := do
let some idx := passes.findIdx? (·.name == passUnderTestName) | throwError s!"{passUnderTestName} not found in pass list"
let passUnderTest := passes[idx]!
let assertion : Pass := {
name := passUnderTestName.append `isFixPoint
run := fun decls => do
trace[Compiler.test] s!"Running fixpoint test for {passUnderTestName}"
let secondResult ← passUnderTest.run decls
if decls.size < secondResult.size then
let err := s!"Pass {passUnderTestName} did not reach a fixpoint, it added declarations on further runs:\n"
throwFixPointError err decls secondResult
else if decls.size > secondResult.size then
let err := s!"Pass {passUnderTestName} did not reach a fixpoint, it removed declarations on further runs:\n"
throwFixPointError err decls secondResult
else if decls != secondResult then
let err := s!"Pass {passUnderTestName} did not reach a fixpoint, it either changed declarations or their order:\n"
throwFixPointError err decls secondResult
trace[Compiler.test] s!"Fixpoint test for {passUnderTestName} successful"
return decls
}
return passes.insertAt (idx + 1) assertion
/--
Compare the overall sizes of the input and output of `passUnderTest` with `assertion`.
-/
def assertSizeM (passUnderTestName : Name) (testName : Name) (assertion : Nat → Nat → CompilerM Unit) : PassInstaller :=
let sumDeclSizes := fun decls => decls.map Decl.size |>.foldl (init := 0) (· + ·)
assertConditionAround passUnderTestName testName (fun inp out => assertion (sumDeclSizes inp) (sumDeclSizes out))
def assertIsAtFixPoint : TestInstaller :=
let test := do
let passUnderTest ← getPassUnderTest
let decls ← getDecls
let secondResult ← passUnderTest.run decls
if decls.size < secondResult.size then
let err := s!"Pass {passUnderTest.name} did not reach a fixpoint, it added declarations on further runs:\n"
throwFixPointError err decls secondResult
else if decls.size > secondResult.size then
let err := s!"Pass {passUnderTest.name} did not reach a fixpoint, it removed declarations on further runs:\n"
throwFixPointError err decls secondResult
else if decls != secondResult then
let err := s!"Pass {passUnderTest.name} did not reach a fixpoint, it either changed declarations or their order:\n"
throwFixPointError err decls secondResult
assertAfterEachOccurence test
/--
Compare the overall sizes of the input and output of `passUnderTest` with `assertion`.
If `assertion inputSize outputSize` is `false` throw an exception with `msg`.
-/
def assertSize (passUnderTestName : Name) (testName : Name) (assertion : Nat → Nat → Bool) (msg : String) : PassInstaller :=
assertSizeM passUnderTestName testName (fun beforeS afterS => Testing.assert (assertion afterS beforeS) msg)
def assertSize (assertion : Nat → Nat → Bool) (msg : String) : TestInstaller :=
let sumDeclSizes := fun decls => decls.map Decl.size |>.foldl (init := 0) (· + ·)
let assertion := (fun inputS outputS => Testing.assert (assertion inputS outputS) s!"{msg}: input size {inputS} output size {outputS}")
assertAroundEachOccurence (do assertion (sumDeclSizes (←getInputDecls)) (sumDeclSizes (←getOutputDecls)))
/--
Assert that the overall size of the `Decl`s in the compilation pipeline does not change
after `passUnderTestName`.
-/
def assertPreservesSize (passUnderTestName : Name) (testName : Name) (msg : String) : PassInstaller :=
assertSize passUnderTestName testName (· == ·) msg
def assertPreservesSize (msg : String) : TestInstaller :=
assertSize (· == ·) msg
/--
Assert that the overall size of the `Decl`s in the compilation pipeline gets reduced by `passUnderTestName`.
-/
def assertReducesSize (passUnderTestName : Name) (testName : Name) (msg : String) : PassInstaller :=
assertSize passUnderTestName testName (· < ·) msg
def assertReducesSize (msg : String) : TestInstaller :=
assertSize (· > ·) msg
/--
Assert that the overall size of the `Decl`s in the compilation pipeline gets reduced or stays unchanged
by `passUnderTestName`.
-/
def assertReducesOrPreservesSize (passUnderTestName : Name) (testName : Name) (msg : String) : PassInstaller :=
assertSize passUnderTestName testName (· ≤ ·) msg
def assertReducesOrPreservesSize (msg : String) : TestInstaller :=
assertSize (· ≥ ·) msg
def assertDoesNotContainConstAfter (passUnderTestName : Name) (testName : Name) (constName : Name) (msg : String) : PassInstaller :=
assertForEachDeclAfter passUnderTestName testName (fun decl => !decl.value.containsConst constName) msg
/--
Assert that the pass under test produces `Decl`s that do not contain
`Expr.const constName` in their `Code.let` values anymore.
-/
def assertDoesNotContainConstAfter (constName : Name) (msg : String) : TestInstaller :=
assertForEachDeclAfterEachOccurence (fun _ decl => !decl.value.containsConst constName) msg
end Testing
end Lean.Compiler.LCNF

View file

@ -61,31 +61,6 @@ partial def inlineMatchers (e : Expr) : CoreM Expr :=
Meta.mkLetFVars letFVars value
return .visit (← inlineMatcher 0 args #[])
/--
Apply `[implementedBy]` to `casesOn`.
We apply them eagerly because we have a `cases` constructor in LCNF.
We do not replace other `[implementedBy]` annotations because they disrupt
the effectiveness of theorems provided by users (this feature has not been implemented yet).
This is not an issue for `casesOn` since it is very unlikely an user will define
a theorem / rewriting rule with `casesOn` on the right-hand side.
-/
def applyCasesOnImplementedBy (e : Expr) : CoreM Expr := do
let env ← getEnv
if !hasImplementedByCasesOn env e then
return e
else
Meta.MetaM.run' <| Meta.transform e fun e => do
let .const declName us := e | return .continue
unless isCasesOnRecursor env declName do return .continue
let some declName' := getImplementedBy? env declName | return .continue
return .done (.const declName' us)
where
hasImplementedByCasesOn (env : Environment) (e : Expr) : Bool :=
Option.isSome <| e.find? fun
| .const declName _ => isCasesOnRecursor env declName || (getImplementedBy? env declName).isSome
| _ => false
/--
Replace nested occurrences of `unsafeRec` names with the safe ones.
-/
@ -118,7 +93,11 @@ def toDecl (declName : Name) : CompilerM Decl := do
let value ← replaceUnsafeRecNames value
let value ← macroInline value
let value ← inlineMatchers value
let value ← applyCasesOnImplementedBy value
/-
Remark: we have disabled the following transformation, we will perform it at phase 2, after code specialization.
It prevents many optimizations (e.g., "cases-of-ctor").
-/
-- let value ← applyCasesOnImplementedBy value
return (type, value)
let value ← toLCNF value
if let .fun decl (.return _) := value then

View file

@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.ProjFns
import Lean.Compiler.BorrowedAnnotation
import Lean.Compiler.LCNF.Types
import Lean.Compiler.LCNF.Bind
import Lean.Compiler.LCNF.InferType
@ -36,12 +37,11 @@ inductive Element where
| unreach (fvarId : FVarId)
deriving Inhabited
/-- State for `BindCasesM` monad -/
structure BindCasesM.State where
/-- New auxiliary join points. -/
jps : Array FunDecl := #[]
/-- Mapping from `_alt.<idx>` variables to new join points -/
map : FVarIdMap FVarId := {}
/--
State for `BindCasesM` monad
Mapping from `_alt.<idx>` variables to new join points
-/
abbrev BindCasesM.State := FVarIdMap FunDecl
/-- Auxiliary monad for implementing `bindCases` -/
abbrev BindCasesM := StateRefT BindCasesM.State CompilerM
@ -60,9 +60,8 @@ That is, our goal is to try to promote the pre join points `_alt.<idx>` into a p
partial def bindCases (jpDecl : FunDecl) (cases : Cases) : CompilerM Code := do
let (alts, s) ← visitAlts cases.alts |>.run {}
let resultType ← mkCasesResultType alts
let mut result := .cases { cases with alts, resultType }
for decl in s.jps do
result := .jp decl result
let result := .cases { cases with alts, resultType }
let result := s.fold (init := result) fun result _ altJp => .jp altJp result
return .jp jpDecl result
where
visitAlts (alts : Array Alt) : BindCasesM (Array Alt) :=
@ -95,9 +94,9 @@ where
if let some funDecl ← findFun? f then
let args := decl.value.getAppArgs
eraseFVar decl.fvarId
if let some altJp := (← get).map.find? f then
if let some altJp := (← get).find? f then
/- We already have an auxiliary join point for `f`, then, we just use it. -/
return .jmp altJp args
return .jmp altJp.fvarId args
else
/-
We have not created a join point for `f` yet.
@ -123,12 +122,15 @@ where
let letDecl ← mkAuxLetDecl (mkAppN decl.value.getAppFn jpArgs)
let jpValue := .let letDecl (.jmp jpDecl.fvarId #[.fvar letDecl.fvarId])
let altJp ← mkAuxJpDecl jpParams jpValue
modify fun { jps, map } => {
jps := jps.push altJp
map := map.insert f altJp.fvarId
}
modify fun map => map.insert f altJp
return .jmp altJp.fvarId args
return .let decl (← go k)
let k ← go k
if let some altJp := (← get).find? decl.fvarId then
-- The new join point depends on this variable. Thus, we must insert it here
modify fun s => s.erase decl.fvarId
return .let decl (.jp altJp k)
else
return .let decl k
| .fun decl k => return .fun decl (← go k)
| .jp decl k =>
let value ← go decl.value
@ -286,8 +288,9 @@ def cleanupBinderName (binderName : Name) : CompilerM Name :=
/-- Create a new local declaration using a Lean regular type. -/
def mkParam (binderName : Name) (type : Expr) : M Param := do
let binderName ← cleanupBinderName binderName
let borrow := isMarkedBorrowed type
let type' ← toLCNFType type
let param ← LCNF.mkParam binderName type'
let param ← LCNF.mkParam binderName type' borrow
modify fun s => { s with lctx := s.lctx.mkLocalDecl param.fvarId binderName type .default }
return param

View file

@ -3,7 +3,6 @@ Copyright (c) 2022 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Compiler.BorrowedAnnotation
import Lean.Meta.InferType
namespace Lean.Compiler.LCNF
@ -22,7 +21,7 @@ def anyTypeExpr := mkConst ``lcAny
def _root_.Lean.Expr.isAnyType (e : Expr) :=
e.isConstOf ``lcAny
def _root_.Lean.Expr.erased (e : Expr) :=
def _root_.Lean.Expr.isErased (e : Expr) :=
e.isConstOf ``lcErased
/-!
@ -109,7 +108,7 @@ partial def toLCNFType (type : Expr) : MetaM Expr := do
withLocalDecl n bi d fun x => do
let d ← toLCNFType d
let b ← toLCNFType (b.instantiate1 x)
if b.isAnyType || b.erased then
if b.isAnyType || b.isErased then
return b
else
return (Expr.lam n d (b.abstract #[x]) bi).eta
@ -123,10 +122,7 @@ where
| .forallE n d b bi =>
let d := d.instantiateRev xs
withLocalDecl n bi d fun x => do
let borrowed := isMarkedBorrowed d
let mut d := (← toLCNFType d).abstract xs
if borrowed then
d := markBorrowed d
let d := (← toLCNFType d).abstract xs
return .forallE n d (← visitForall b (xs.push x)) bi
| _ =>
let e ← toLCNFType (e.instantiateRev xs)
@ -205,9 +201,11 @@ partial def compatibleTypes (a b : Expr) : Bool :=
if a.isAnyType || b.isAnyType then
true
else
let a := a.headBeta
let b := b.headBeta
if a == b then
let a' := a.headBeta
let b' := b.headBeta
if a != a' || b != b' then
compatibleTypes a' b'
else if a == b then
true
else
match a, b with
@ -231,7 +229,7 @@ partial def joinTypes? (a b : Expr) : Option Expr := do
if a.isAnyType then return a
else if b.isAnyType then return b
else if a == b then return a
else if a.erased || b.erased then failure
else if a.isErased || b.isErased then failure
else
let a' := a.headBeta
let b' := b.headBeta
@ -267,6 +265,18 @@ def isTypeFormerType (type : Expr) : Bool :=
match type with
| .sort .. => true
| .forallE _ _ b _ => isTypeFormerType b
| _ => false
/--
Return `true` if `type` is a LCNF type former type or it is an "any" type.
This function is similar to `isTypeFormerType`, but more liberal.
For example, `isTypeFormerType` returns false for `lcAny` and `Nat → lcAny`, but
this function returns true.
-/
def maybeTypeFormerType (type : Expr) : Bool :=
match type with
| .sort .. => true
| .forallE _ _ b _ => maybeTypeFormerType b
| _ => type.isAnyType
/--
@ -279,6 +289,15 @@ def isClass? (type : Expr) : CoreM (Option Name) := do
else
return none
/--
`isArrowClass? type` return `some ClsName` if the LCNF `type` is an instance of the class `ClsName`, or
if it is arrow producing an instance of the class `ClsName`.
-/
def isArrowClass? (type : Expr) : CoreM (Option Name) := do
match type with
| .forallE _ _ b _ => isArrowClass? b
| _ => isClass? type
def getArrowArity (e : Expr) :=
match e with
| .forallE _ _ b _ => getArrowArity b + 1

View file

@ -24,6 +24,7 @@ def isLcCast? (e : Expr) : Option Expr :=
some e.appArg!
else
none
/--
Store information about `casesOn` declarations.

View file

@ -14,12 +14,12 @@ private builtin_initialize docStringExt : MapDeclarationExtension String ← mkM
private def findLeadingSpacesSize (s : String) : Nat :=
let it := s.iter
let it := it.find (· == '\n') |>.next
let (min, it) := it.foldUntil 0 fun num c => if c == ' ' || c == '\t' then some (num + 1) else none
findNextLine it min
consumeSpaces it 0 s.length
where
consumeSpaces (it : String.Iterator) (curr min : Nat) : Nat :=
if it.atEnd then min
else if it.curr == ' ' || it.curr == '\t' then consumeSpaces it.next (curr + 1) min
else if it.curr == '\n' then findNextLine it.next min
else findNextLine it.next (Nat.min curr min)
findNextLine (it : String.Iterator) (min : Nat) : Nat :=
if it.atEnd then min
@ -44,7 +44,7 @@ termination_by
consumeSpaces n it r => (it, 1)
saveLine it r => (it, 0)
private def removeLeadingSpaces (s : String) : String :=
def removeLeadingSpaces (s : String) : String :=
let n := findLeadingSpacesSize s
if n == 0 then s else removeNumLeadingSpaces n s
@ -92,4 +92,10 @@ def getDocStringText [Monad m] [MonadError m] [MonadRef m] (stx : TSyntax `Lean.
| Syntax.atom _ val => return val.extract 0 (val.endPos - ⟨2⟩)
| _ => throwErrorAt stx "unexpected doc string{indentD stx.raw[1]}"
def TSyntax.getDocString (stx : TSyntax `Lean.Parser.Command.docComment) : String :=
match stx.raw[1] with
| Syntax.atom _ val => val.extract 0 (val.endPos - ⟨2⟩)
| Syntax.missing => ""
| _ => panic! s!"unexpected doc string\n{stx.raw[1]}"
end Lean

View file

@ -315,10 +315,17 @@ private def withLocalIdentFor (stx : Term) (e : Expr) (k : Term → TermElabM Ex
if badMotive?.isSome || !(← isTypeCorrect motive) then
-- Before failing try tos use `subst`
if ← (isSubstCandidate lhs rhs <||> isSubstCandidate rhs lhs) then
withLocalIdentFor heqStx heq fun heqStx =>
withLocalIdentFor hStx h fun hStx => do
let stxNew ← `(by subst $heqStx; exact $hStx)
withMacroExpansion stx stxNew (elabTerm stxNew expectedType)
withLocalIdentFor heqStx heq fun heqStx => do
let h ← instantiateMVars h
if h.hasMVar then
-- If `h` has metavariables, we try to elaborate `hStx` again after we substitute `heqStx`
-- Remark: re-elaborating `hStx` may be problematic if `hStx` contains the `lhs` of `heqStx` which will be eliminated by `subst`
let stxNew ← `(by subst $heqStx; exact $hStx)
withMacroExpansion stx stxNew (elabTerm stxNew expectedType)
else
withLocalIdentFor hStx h fun hStx => do
let stxNew ← `(by subst $heqStx; exact $hStx)
withMacroExpansion stx stxNew (elabTerm stxNew expectedType)
else
throwError "invalid `▸` notation, failed to compute motive for the substitution"
else

View file

@ -145,29 +145,27 @@ private def inductiveSyntaxToView (modifiers : Modifiers) (decl : Syntax) : Comm
let ⟨name, declName, levelNames⟩ ← expandDeclId declId modifiers
addDeclarationRanges declName decl
let ctors ← decl[4].getArgs.mapM fun ctor => withRef ctor do
-- def ctor := leading_parser " | " >> declModifiers >> ident >> optDeclSig
let ctorModifiers ← elabModifiers ctor[1]
-- def ctor := leading_parser optional docComment >> "\n| " >> declModifiers >> rawIdent >> optDeclSig
let mut ctorModifiers ← elabModifiers ctor[2]
if let some leadingDocComment := ctor[0].getOptional? then
if ctorModifiers.docString?.isSome then
logErrorAt leadingDocComment "duplicate doc string"
ctorModifiers := { ctorModifiers with docString? := TSyntax.getDocString ⟨leadingDocComment⟩ }
if ctorModifiers.isPrivate && modifiers.isPrivate then
throwError "invalid 'private' constructor in a 'private' inductive datatype"
if ctorModifiers.isProtected && modifiers.isPrivate then
throwError "invalid 'protected' constructor in a 'private' inductive datatype"
checkValidCtorModifier ctorModifiers
let ctorName := ctor.getIdAt 2
let ctorName := ctor.getIdAt 3
let ctorName := declName ++ ctorName
let ctorName ← withRef ctor[2] <| applyVisibility ctorModifiers.visibility ctorName
let (binders, type?) := expandOptDeclSig ctor[3]
let ctorName ← withRef ctor[3] <| applyVisibility ctorModifiers.visibility ctorName
let (binders, type?) := expandOptDeclSig ctor[4]
addDocString' ctorName ctorModifiers.docString?
addAuxDeclarationRanges ctorName ctor ctor[2]
addAuxDeclarationRanges ctorName ctor ctor[3]
return { ref := ctor, modifiers := ctorModifiers, declName := ctorName, binders := binders, type? := type? : CtorView }
let mut computedFields := #[]
let mut classes := #[]
if decl.getNumArgs == 6 then
-- TODO: remove after stage0 update
classes ← getOptDerivingClasses decl[5]
else
computedFields ← (decl[5].getOptional?.map (·[1].getArgs) |>.getD #[]).mapM fun cf => withRef cf do
return { ref := cf, modifiers := cf[0], fieldId := cf[1].getId, type := ⟨cf[3]⟩, matchAlts := ⟨cf[4]⟩ }
classes ← getOptDerivingClasses decl[6]
let computedFields ← (decl[5].getOptional?.map (·[1].getArgs) |>.getD #[]).mapM fun cf => withRef cf do
return { ref := cf, modifiers := cf[0], fieldId := cf[1].getId, type := ⟨cf[3]⟩, matchAlts := ⟨cf[4]⟩ }
let classes ← getOptDerivingClasses decl[6]
return {
ref := decl
shortDeclName := name

View file

@ -137,11 +137,11 @@ def mkDefViewOfOpaque (modifiers : Modifiers) (stx : Syntax) : CommandElabM DefV
def mkDefViewOfExample (modifiers : Modifiers) (stx : Syntax) : DefView :=
-- leading_parser "example " >> declSig >> declVal
let (binders, type) := expandDeclSig stx[1]
let (binders, type) := expandOptDeclSig stx[1]
let id := mkIdentFrom stx `_example
let declId := mkNode ``Parser.Command.declId #[id, mkNullNode]
{ ref := stx, kind := DefKind.example, modifiers := modifiers,
declId := declId, binders := binders, type? := some type, value := stx[2] }
declId := declId, binders := binders, type? := type, value := stx[2] }
def isDefLike (stx : Syntax) : Bool :=
let declKind := stx.getKind

View file

@ -86,15 +86,14 @@ structure ExplicitSourceInfo where
structName : Name
deriving Inhabited
inductive Source where
| none -- structure instance source has not been provieded
| implicit (stx : Syntax) -- `..`
| explicit (sources : Array ExplicitSourceInfo) -- `s₁ ... sₙ with`
structure Source where
explicit : Array ExplicitSourceInfo -- `s₁ ... sₙ with`
implicit : Option Syntax -- `..`
deriving Inhabited
def Source.isNone : Source → Bool
| .none => true
| _ => false
| { explicit := #[], implicit := none } => true
| _ => false
/-- `optional (atomic (sepBy1 termParser ", " >> " with ")` -/
private def mkSourcesWithSyntax (sources : Array Syntax) : Syntax :=
@ -106,21 +105,18 @@ private def getStructSource (structStx : Syntax) : TermElabM Source :=
withRef structStx do
let explicitSource := structStx[1]
let implicitSource := structStx[3]
if explicitSource.isNone && implicitSource[0].isNone then
return .none
else if explicitSource.isNone then
return .implicit implicitSource
else if implicitSource[0].isNone then
let sources ← explicitSource[0].getSepArgs.mapM fun stx => do
let explicit ← if explicitSource.isNone then
pure #[]
else
explicitSource[0].getSepArgs.mapM fun stx => do
let some src ← isLocalIdent? stx | unreachable!
addTermInfo' stx src
let srcType ← whnf (← inferType src)
tryPostponeIfMVar srcType
let structName ← getStructureName srcType
return { stx, structName }
return .explicit sources
else
throwError "invalid structure instance `with` and `..` cannot be used together"
let implicit := if implicitSource[0].isNone then none else implicitSource
return { explicit, implicit }
/--
We say a `{ ... }` notation is a `modifyOp` if it contains only one
@ -197,13 +193,11 @@ private def elabModifyOp (stx modifyOp : Syntax) (sources : Array ExplicitSource
private def getStructName (expectedType? : Option Expr) (sourceView : Source) : TermElabM Name := do
tryPostponeIfNoneOrMVar expectedType?
let useSource : Unit → TermElabM Name := fun _ => do
match sourceView, expectedType? with
| .explicit sources, _ =>
if sources.size > 1 then
throwErrorAt sources[1]!.stx "invalid \{...} notation, expected type is not known, using the type of the first source, extra sources are not needed"
return sources[0]!.structName
| _, some expectedType => throwUnexpectedExpectedType expectedType
| _, none => throwUnknownExpectedType
unless sourceView.explicit.isEmpty do
return sourceView.explicit[0]!.structName
match expectedType? with
| some expectedType => throwUnexpectedExpectedType expectedType
| none => throwUnknownExpectedType
match expectedType? with
| none => useSource ()
| some expectedType =>
@ -292,10 +286,11 @@ def formatField (formatStruct : Struct → Format) (field : Field Struct) : Form
partial def formatStruct : Struct → Format
| ⟨_, _, _, fields, source⟩ =>
let fieldsFmt := Format.joinSep (fields.map (formatField formatStruct)) ", "
match source with
| .none => "{" ++ fieldsFmt ++ "}"
| .implicit _ => "{" ++ fieldsFmt ++ " .. }"
| .explicit sources => "{" ++ format (sources.map (·.stx)) ++ " with " ++ fieldsFmt ++ "}"
let implicitFmt := if source.implicit.isSome then " .. " else ""
if source.explicit.isEmpty then
"{" ++ fieldsFmt ++ implicitFmt ++ "}"
else
"{" ++ format (source.explicit.map (·.stx)) ++ " with " ++ fieldsFmt ++ implicitFmt ++ "}"
instance : ToFormat Struct := ⟨formatStruct⟩
instance : ToString Struct := ⟨toString ∘ format⟩
@ -487,15 +482,10 @@ mutual
pure { field with lhs := [field.lhs.head!], val := FieldVal.nested substruct }
| none =>
let updateSource (structStx : Syntax) : TermElabM Syntax := do
match s.source with
| .none => return (structStx.setArg 1 mkNullNode).setArg 3 mkNullNode
| .implicit stx => return (structStx.setArg 1 mkNullNode).setArg 3 stx
| .explicit sources =>
let sourcesNew ← sources.filterMapM fun source => mkProjStx? source.stx source.structName fieldName
if sourcesNew.isEmpty then
return (structStx.setArg 1 mkNullNode).setArg 3 mkNullNode
else
return (structStx.setArg 1 (mkSourcesWithSyntax sourcesNew)).setArg 3 mkNullNode
let sourcesNew ← s.source.explicit.filterMapM fun source => mkProjStx? source.stx source.structName fieldName
let explicitSourceStx := if sourcesNew.isEmpty then mkNullNode else mkSourcesWithSyntax sourcesNew
let implicitSourceStx := s.source.implicit.getD mkNullNode
return (structStx.setArg 1 explicitSourceStx).setArg 3 implicitSourceStx
let valStx := s.ref -- construct substructure syntax using s.ref as template
let valStx := valStx.setArg 4 mkNullNode -- erase optional expected type
let args := substructFields.toArray.map (·.toSyntax)
@ -516,28 +506,20 @@ mutual
return { ref, lhs := [FieldLHS.fieldName ref fieldName], val := val } :: fields
match Lean.isSubobjectField? env s.structName fieldName with
| some substructName =>
let addSubstruct : TermElabM Fields := do
-- If one of the sources has the subobject field, use it
if let some val ← s.source.explicit.findSomeM? fun source => mkProjStx? source.stx source.structName fieldName then
addField (FieldVal.term val)
else
let substruct := Struct.mk ref substructName #[] [] s.source
let substruct ← expandStruct substruct
addField (FieldVal.nested substruct)
match s.source with
| .none => addSubstruct
| .implicit _ => addSubstruct
| .explicit sources =>
-- If one of the sources has the subobject field, use it
if let some val ← sources.findSomeM? fun source => mkProjStx? source.stx source.structName fieldName then
addField (FieldVal.term val)
else
addSubstruct
| none =>
match s.source with
| .none => addField FieldVal.default
| .implicit _ => addField (FieldVal.term (mkHole ref))
| .explicit sources =>
if let some val ← sources.findSomeM? fun source => mkProjStx? source.stx source.structName fieldName then
addField (FieldVal.term val)
else
addField FieldVal.default
if let some val ← s.source.explicit.findSomeM? fun source => mkProjStx? source.stx source.structName fieldName then
addField (FieldVal.term val)
else if s.source.implicit.isSome then
addField (FieldVal.term (mkHole ref))
else
addField FieldVal.default
return s.setFields fields.reverse
private partial def expandStruct (s : Struct) : TermElabM Struct := do
@ -711,15 +693,28 @@ partial def getHierarchyDepth (struct : Struct) : Nat :=
| .nested struct => Nat.max max (getHierarchyDepth struct + 1)
| _ => max
def isDefaultMissing? [Monad m] [MonadMCtx m] (field : Field Struct) : m Bool := do
if let some expr := field.expr? then
if let some (.mvar mvarId) := defaultMissing? expr then
unless (← mvarId.isAssigned) do
return true
return false
partial def findDefaultMissing? [Monad m] [MonadMCtx m] (struct : Struct) : m (Option (Field Struct)) :=
struct.fields.findSomeM? fun field => do
match field.val with
| .nested struct => findDefaultMissing? struct
| _ => match field.expr? with
| none => unreachable!
| some expr => match defaultMissing? expr with
| some (.mvar mvarId) => return if (← mvarId.isAssigned) then none else some field
| _ => return none
| _ => return if (← isDefaultMissing? field) then field else none
partial def allDefaultMissing [Monad m] [MonadMCtx m] (struct : Struct) : m (Array (Field Struct)) :=
go struct *> get |>.run' #[]
where
go (struct : Struct) : StateT (Array (Field Struct)) m Unit :=
for field in struct.fields do
if let .nested struct := field.val then
go struct
else if (← isDefaultMissing? field) then
modify (·.push field)
def getFieldName (field : Field Struct) : Name :=
match field.lhs with
@ -854,7 +849,15 @@ partial def propagateLoop (hierarchyDepth : Nat) (d : Nat) (struct : Struct) : M
| some field =>
trace[Elab.struct] "propagate [{d}] [field := {field}]: {struct}"
if d > hierarchyDepth then
throwErrorAt field.ref "field '{getFieldName field}' is missing"
let missingFields := (← allDefaultMissing struct).map getFieldName
let missingFieldsWithoutDefault :=
let env := (← getEnv)
let structs := (← read).allStructNames
missingFields.filter fun fieldName => structs.all fun struct =>
(getDefaultFnForField? env struct fieldName).isNone
let fieldsToReport :=
if missingFieldsWithoutDefault.isEmpty then missingFields else missingFieldsWithoutDefault
throwErrorAt field.ref "fields missing: {fieldsToReport.toList.map (s!"'{·}'") |> ", ".intercalate}"
else withReader (fun ctx => { ctx with maxDistance := d }) do
modify fun _ => { progress := false }
step struct
@ -901,10 +904,12 @@ private def elabStructInstAux (stx : Syntax) (expectedType? : Option Expr) (sour
| some stxNew => withMacroExpansion stx stxNew <| elabTerm stxNew expectedType?
| none =>
let sourceView ← getStructSource stx
match (← isModifyOp? stx), sourceView with
| some modifyOp, .explicit sources => elabModifyOp stx modifyOp sources expectedType?
| some _, _ => throwError "invalid \{...} notation, explicit source is required when using '[<index>] := <value>'"
| _, _ => elabStructInstAux stx expectedType? sourceView
if let some modifyOp ← isModifyOp? stx then
if sourceView.explicit.isEmpty then
throwError "invalid \{...} notation, explicit source is required when using '[<index>] := <value>'"
elabModifyOp stx modifyOp sourceView.explicit expectedType?
else
elabStructInstAux stx expectedType? sourceView
builtin_initialize registerTraceClass `Elab.struct

View file

@ -325,7 +325,7 @@ mutual
/--
Try to synthesize a term `val` using the tactic code `tacticCode`, and then assign `mvarId := val`.
-/
partial def runTactic (mvarId : MVarId) (tacticCode : Syntax) : TermElabM Unit := do
partial def runTactic (mvarId : MVarId) (tacticCode : Syntax) : TermElabM Unit := withoutAutoBoundImplicit do
/- Recall, `tacticCode` is the whole `by ...` expression. -/
let code := tacticCode[1]
instantiateMVarDeclMVars mvarId

View file

@ -19,7 +19,7 @@ macro (name := configElab) doc?:(docComment)? "declare_config_elab" elabName:ide
if optConfig.isNone then
return { : $type }
else
let c ← withoutModifyingState <| withLCtx {} {} <| withSaveInfoContext <| Term.withSynthesize do
let c ← withoutModifyingStateWithInfoAndMessages <| withLCtx {} {} <| withSaveInfoContext <| Term.withSynthesize do
let c ← Term.elabTermEnsuringType optConfig[0][3] (Lean.mkConst ``$type)
Term.synthesizeSyntheticMVarsNoPostponing
instantiateMVars c

View file

@ -11,7 +11,7 @@ open Meta
@[builtinTactic Lean.Parser.Tactic.Conv.change] def evalChange : Tactic := fun stx => do
match stx with
| `(conv| change $e) => do
| `(conv| change $e) => withMainContext do
let lhs ← getLhs
let mvarCounterSaved := (← getMCtx).mvarCounter
let r ← elabTermEnsuringType e (← inferType lhs)

View file

@ -801,6 +801,17 @@ def isConstOf : Expr → Name → Bool
| const n .., m => n == m
| _, _ => false
/--
Return `true` if the given expression is a free variable with the given id.
Examples:
- `isFVarOf (.fvar id) id` is `true`
- ``isFVarOf (.fvar id) id'`` is `false`
- ``isFVarOf (.sort levelZero) id`` is `false`
-/
def isFVarOf : Expr → FVarId → Bool
| .fvar fvarId, fvarId' => fvarId == fvarId'
| _, _ => false
/-- Return `true` if the given expression is a forall-expression aka (dependent) arrow. -/
def isForall : Expr → Bool
| forallE .. => true

View file

@ -136,9 +136,9 @@ def checkDecl : SimpleHandler := fun stx => do
lintDeclHead k rest[1][0]
if k == ``«inductive» || k == ``classInductive then
for stx in rest[4].getArgs do
let head := stx[1]
if declModifiersPubNoDoc head then
lintField rest[1][0] stx[2] "public constructor"
let head := stx[2]
if stx[0].isNone && declModifiersPubNoDoc head then
lintField rest[1][0] stx[3] "public constructor"
unless rest[5].isNone do
for stx in rest[5][0][1].getArgs do
let head := stx[0]

View file

@ -10,6 +10,9 @@ namespace Lean.Meta
unsafe def evalExprCore (α) (value : Expr) (checkType : Expr → MetaM Unit) (safety := DefinitionSafety.safe) : MetaM α :=
withoutModifyingEnv do
let name ← mkFreshUserName `_tmp
let value ← instantiateMVars value
if value.hasMVar then
throwError "failed to evaluate expression, it contains metavariables{indentExpr value}"
let type ← inferType value
checkType type
let decl := Declaration.defnDecl {

View file

@ -9,6 +9,7 @@ import Lean.Meta.DiscrTree
import Lean.Meta.AppBuilder
import Lean.Meta.Eqns
import Lean.Meta.Tactic.AuxLemma
import Lean.DocString
namespace Lean.Meta
/--
@ -415,12 +416,13 @@ def SimpTheoremsArray.isErased (thmsArray : SimpTheoremsArray) (thmId : Name) :
def SimpTheoremsArray.isDeclToUnfold (thmsArray : SimpTheoremsArray) (declName : Name) : Bool :=
thmsArray.any fun thms => thms.isDeclToUnfold declName
macro (name := _root_.Lean.Parser.Command.registerSimpAttr) doc?:(docComment)?
"register_simp_attr" id:ident descr:str : command => do
macro (name := _root_.Lean.Parser.Command.registerSimpAttr) doc:docComment
"register_simp_attr" id:ident : command => do
let str := id.getId.toString
let idParser := mkIdentFrom id (`Parser.Attr ++ id.getId)
`($[$doc?]? initialize ext : SimpExtension ← registerSimpAttr $(quote id.getId) $descr $(quote id.getId)
$[$doc?]? syntax (name := $idParser:ident) $(quote str):str (Parser.Tactic.simpPre <|> Parser.Tactic.simpPost)? (prio)? : attr)
let descr := quote (removeLeadingSpaces doc.getDocString)
`($doc:docComment initialize ext : SimpExtension ← registerSimpAttr $(quote id.getId) $descr $(quote id.getId)
$doc:docComment syntax (name := $idParser:ident) $(quote str):str (Parser.Tactic.simpPre <|> Parser.Tactic.simpPost)? (prio)? : attr)
end Meta

View file

@ -174,10 +174,10 @@ structure ParserState where
namespace ParserState
@[inline] def hasError (s : ParserState) : Bool :=
def hasError (s : ParserState) : Bool :=
s.errorMsg != none
@[inline] def stackSize (s : ParserState) : Nat :=
def stackSize (s : ParserState) : Nat :=
s.stxStack.size
def restore (s : ParserState) (iniStackSz : Nat) (iniPos : String.Pos) : ParserState :=
@ -336,19 +336,19 @@ def dbgTraceState (label : String) (p : Parser) : Parser where
fn := dbgTraceStateFn label p.fn
info := p.info
@[noinline] def epsilonInfo : ParserInfo :=
@[noinline]def epsilonInfo : ParserInfo :=
{ firstTokens := FirstTokens.epsilon }
@[inline] def checkStackTopFn (p : Syntax → Bool) (msg : String) : ParserFn := fun _ s =>
def checkStackTopFn (p : Syntax → Bool) (msg : String) : ParserFn := fun _ s =>
if p s.stxStack.back then s
else s.mkUnexpectedError msg
@[inline] def checkStackTop (p : Syntax → Bool) (msg : String) : Parser := {
def checkStackTop (p : Syntax → Bool) (msg : String) : Parser := {
info := epsilonInfo,
fn := checkStackTopFn p msg
}
@[inline] def andthenFn (p q : ParserFn) : ParserFn := fun c s =>
def andthenFn (p q : ParserFn) : ParserFn := fun c s =>
let s := p c s
if s.hasError then s else q c s
@ -358,7 +358,7 @@ def dbgTraceState (label : String) (p : Parser) : Parser where
firstTokens := p.firstTokens.seq q.firstTokens
}
@[inline] def andthen (p q : Parser) : Parser := {
def andthen (p q : Parser) : Parser := {
info := andthenInfo p.info q.info,
fn := andthenFn p.fn q.fn
}
@ -366,12 +366,12 @@ def dbgTraceState (label : String) (p : Parser) : Parser where
instance : AndThen Parser where
andThen a b := andthen a (b ())
@[inline] def nodeFn (n : SyntaxNodeKind) (p : ParserFn) : ParserFn := fun c s =>
def nodeFn (n : SyntaxNodeKind) (p : ParserFn) : ParserFn := fun c s =>
let iniSz := s.stackSize
let s := p c s
s.mkNode n iniSz
@[inline] def trailingNodeFn (n : SyntaxNodeKind) (p : ParserFn) : ParserFn := fun c s =>
def trailingNodeFn (n : SyntaxNodeKind) (p : ParserFn) : ParserFn := fun c s =>
let iniSz := s.stackSize
let s := p c s
s.mkTrailingNode n iniSz
@ -382,7 +382,7 @@ instance : AndThen Parser where
firstTokens := p.firstTokens
}
@[inline] def node (n : SyntaxNodeKind) (p : Parser) : Parser := {
def node (n : SyntaxNodeKind) (p : Parser) : Parser := {
info := nodeInfo n p.info,
fn := nodeFn n p.fn
}
@ -390,7 +390,7 @@ instance : AndThen Parser where
def errorFn (msg : String) : ParserFn := fun _ s =>
s.mkUnexpectedError msg
@[inline] def error (msg : String) : Parser := {
def error (msg : String) : Parser := {
info := epsilonInfo,
fn := errorFn msg
}
@ -406,7 +406,7 @@ def errorAtSavedPosFn (msg : String) (delta : Bool) : ParserFn := fun c s =>
/-- Generate an error at the position saved with the `withPosition` combinator.
If `delta == true`, then it reports at saved position+1.
This useful to make sure a parser consumed at least one character. -/
@[inline] def errorAtSavedPos (msg : String) (delta : Bool) : Parser := {
def errorAtSavedPos (msg : String) (delta : Bool) : Parser := {
fn := errorAtSavedPosFn msg delta
}
@ -415,7 +415,7 @@ def checkPrecFn (prec : Nat) : ParserFn := fun c s =>
if c.prec <= prec then s
else s.mkUnexpectedError "unexpected token at this precedence level; consider parenthesizing the term"
@[inline] def checkPrec (prec : Nat) : Parser := {
def checkPrec (prec : Nat) : Parser := {
info := epsilonInfo,
fn := checkPrecFn prec
}
@ -425,7 +425,7 @@ def checkLhsPrecFn (prec : Nat) : ParserFn := fun _ s =>
if s.lhsPrec >= prec then s
else s.mkUnexpectedError "unexpected token at this precedence level; consider parenthesizing the term"
@[inline] def checkLhsPrec (prec : Nat) : Parser := {
def checkLhsPrec (prec : Nat) : Parser := {
info := epsilonInfo,
fn := checkLhsPrecFn prec
}
@ -434,7 +434,7 @@ def setLhsPrecFn (prec : Nat) : ParserFn := fun _ s =>
if s.hasError then s
else { s with lhsPrec := prec }
@[inline] def setLhsPrec (prec : Nat) : Parser := {
def setLhsPrec (prec : Nat) : Parser := {
info := epsilonInfo,
fn := setLhsPrecFn prec
}
@ -442,12 +442,12 @@ def setLhsPrecFn (prec : Nat) : ParserFn := fun _ s =>
private def addQuotDepthFn (i : Int) (p : ParserFn) : ParserFn := fun c s =>
p { c with quotDepth := c.quotDepth + i |>.toNat } s
@[inline] def incQuotDepth (p : Parser) : Parser := {
def incQuotDepth (p : Parser) : Parser := {
info := p.info,
fn := addQuotDepthFn 1 p.fn
}
@[inline] def decQuotDepth (p : Parser) : Parser := {
def decQuotDepth (p : Parser) : Parser := {
info := p.info,
fn := addQuotDepthFn (-1) p.fn
}
@ -455,20 +455,20 @@ private def addQuotDepthFn (i : Int) (p : ParserFn) : ParserFn := fun c s =>
def suppressInsideQuotFn (p : ParserFn) : ParserFn := fun c s =>
p { c with suppressInsideQuot := true } s
@[inline] def suppressInsideQuot (p : Parser) : Parser := {
def suppressInsideQuot (p : Parser) : Parser := {
info := p.info,
fn := suppressInsideQuotFn p.fn
}
@[inline] def leadingNode (n : SyntaxNodeKind) (prec : Nat) (p : Parser) : Parser :=
def leadingNode (n : SyntaxNodeKind) (prec : Nat) (p : Parser) : Parser :=
checkPrec prec >> node n p >> setLhsPrec prec
@[inline] def trailingNodeAux (n : SyntaxNodeKind) (p : Parser) : TrailingParser := {
def trailingNodeAux (n : SyntaxNodeKind) (p : Parser) : TrailingParser := {
info := nodeInfo n p.info,
fn := trailingNodeFn n p.fn
}
@[inline] def trailingNode (n : SyntaxNodeKind) (prec lhsPrec : Nat) (p : Parser) : TrailingParser :=
def trailingNode (n : SyntaxNodeKind) (prec lhsPrec : Nat) (p : Parser) : TrailingParser :=
checkPrec prec >> checkLhsPrec lhsPrec >> trailingNodeAux n p >> setLhsPrec prec
def mergeOrElseErrors (s : ParserState) (error1 : Error) (iniPos : String.Pos) (mergeErrors : Bool) : ParserState :=
@ -514,7 +514,7 @@ def orelseFnCore (p q : ParserFn) (antiquotBehavior := OrElseOnAntiquotBehavior.
s := s.mkNode choiceKind iniSz
s
@[inline] def orelseFn (p q : ParserFn) : ParserFn :=
def orelseFn (p q : ParserFn) : ParserFn :=
orelseFnCore p q
@[noinline] def orelseInfo (p q : ParserInfo) : ParserInfo := {
@ -529,7 +529,7 @@ def orelseFnCore (p q : ParserFn) (antiquotBehavior := OrElseOnAntiquotBehavior.
NOTE: In order for the pretty printer to retrace an `orelse`, `p` must be a call to `node` or some other parser
producing a single node kind. Nested `orelse` calls are flattened for this, i.e. `(node k1 p1 <|> node k2 p2) <|> ...`
is fine as well. -/
@[inline] def orelse (p q : Parser) : Parser := {
def orelse (p q : Parser) : Parser := {
info := orelseInfo p.info q.info,
fn := orelseFn p.fn q.fn
}
@ -548,7 +548,7 @@ def atomicFn (p : ParserFn) : ParserFn := fun c s =>
| ⟨stack, lhsPrec, _, cache, some msg⟩ => ⟨stack, lhsPrec, iniPos, cache, some msg⟩
| other => other
@[inline] def atomic (p : Parser) : Parser := {
def atomic (p : Parser) : Parser := {
info := p.info,
fn := atomicFn p.fn
}
@ -566,7 +566,7 @@ def optionalFn (p : ParserFn) : ParserFn := fun c s =>
firstTokens := p.firstTokens.toOptional
}
@[inline] def optionalNoAntiquot (p : Parser) : Parser := {
def optionalNoAntiquot (p : Parser) : Parser := {
info := optionaInfo p.info,
fn := optionalFn p.fn
}
@ -577,7 +577,7 @@ def lookaheadFn (p : ParserFn) : ParserFn := fun c s =>
let s := p c s
if s.hasError then s else s.restore iniSz iniPos
@[inline] def lookahead (p : Parser) : Parser := {
def lookahead (p : Parser) : Parser := {
info := p.info,
fn := lookaheadFn p.fn
}
@ -592,7 +592,7 @@ def notFollowedByFn (p : ParserFn) (msg : String) : ParserFn := fun c s =>
let s := s.restore iniSz iniPos
s.mkUnexpectedError s!"unexpected {msg}"
@[inline] def notFollowedBy (p : Parser) (msg : String) : Parser := {
def notFollowedBy (p : Parser) (msg : String) : Parser := {
fn := notFollowedByFn p.fn msg
}
@ -608,22 +608,22 @@ partial def manyAux (p : ParserFn) : ParserFn := fun c s => Id.run do
s := s.mkNode nullKind iniSz
manyAux p c s
@[inline] def manyFn (p : ParserFn) : ParserFn := fun c s =>
def manyFn (p : ParserFn) : ParserFn := fun c s =>
let iniSz := s.stackSize
let s := manyAux p c s
s.mkNode nullKind iniSz
@[inline] def manyNoAntiquot (p : Parser) : Parser := {
def manyNoAntiquot (p : Parser) : Parser := {
info := noFirstTokenInfo p.info,
fn := manyFn p.fn
}
@[inline] def many1Fn (p : ParserFn) : ParserFn := fun c s =>
def many1Fn (p : ParserFn) : ParserFn := fun c s =>
let iniSz := s.stackSize
let s := andthenFn p (manyAux p) c s
s.mkNode nullKind iniSz
@[inline] def many1NoAntiquot (p : Parser) : Parser := {
def many1NoAntiquot (p : Parser) : Parser := {
info := p.info,
fn := many1Fn p.fn
}
@ -675,12 +675,12 @@ def sepBy1Fn (allowTrailingSep : Bool) (p : ParserFn) (sep : ParserFn) : ParserF
firstTokens := p.firstTokens
}
@[inline] def sepByNoAntiquot (p sep : Parser) (allowTrailingSep : Bool := false) : Parser := {
def sepByNoAntiquot (p sep : Parser) (allowTrailingSep : Bool := false) : Parser := {
info := sepByInfo p.info sep.info,
fn := sepByFn allowTrailingSep p.fn sep.fn
}
@[inline] def sepBy1NoAntiquot (p sep : Parser) (allowTrailingSep : Bool := false) : Parser := {
def sepBy1NoAntiquot (p sep : Parser) (allowTrailingSep : Bool := false) : Parser := {
info := sepBy1Info p.info sep.info,
fn := sepBy1Fn allowTrailingSep p.fn sep.fn
}
@ -698,12 +698,12 @@ def withResultOfFn (p : ParserFn) (f : Syntax → Syntax) : ParserFn := fun c s
collectKinds := p.collectKinds
}
@[inline] def withResultOf (p : Parser) (f : Syntax → Syntax) : Parser := {
def withResultOf (p : Parser) (f : Syntax → Syntax) : Parser := {
info := withResultOfInfo p.info,
fn := withResultOfFn p.fn f
}
@[inline] def many1Unbox (p : Parser) : Parser :=
def many1Unbox (p : Parser) : Parser :=
withResultOf (many1NoAntiquot p) fun stx => if stx.getNumArgs == 1 then stx.getArg 0 else stx
partial def satisfyFn (p : Char → Bool) (errorMsg : String := "unexpected character") : ParserFn := fun c s =>
@ -721,7 +721,7 @@ partial def takeUntilFn (p : Char → Bool) : ParserFn := fun c s =>
def takeWhileFn (p : Char → Bool) : ParserFn :=
takeUntilFn (fun c => !p c)
@[inline] def takeWhile1Fn (p : Char → Bool) (errorMsg : String) : ParserFn :=
def takeWhile1Fn (p : Char → Bool) (errorMsg : String) : ParserFn :=
andthenFn (satisfyFn p errorMsg) (takeWhileFn p)
partial def finishCommentBlock (nesting : Nat) : ParserFn := fun c s =>
@ -796,12 +796,12 @@ private def rawAux (startPos : String.Pos) (trailingWs : Bool) : ParserFn := fun
s.pushSyntax atom
/-- Match an arbitrary Parser and return the consumed String in a `Syntax.atom`. -/
@[inline] def rawFn (p : ParserFn) (trailingWs := false) : ParserFn := fun c s =>
def rawFn (p : ParserFn) (trailingWs := false) : ParserFn := fun c s =>
let startPos := s.pos
let s := p c s
if s.hasError then s else rawAux startPos trailingWs c s
@[inline] def chFn (c : Char) (trailingWs := false) : ParserFn :=
def chFn (c : Char) (trailingWs := false) : ParserFn :=
rawFn (satisfyFn (fun d => c == d) ("'" ++ toString c ++ "'")) trailingWs
def rawCh (c : Char) (trailingWs := false) : Parser :=
@ -1119,7 +1119,7 @@ def rawIdentFn : ParserFn := fun c s =>
if input.atEnd i then s.mkEOIError
else identFnAux i none Name.anonymous c s
@[inline] def satisfySymbolFn (p : String → Bool) (expected : List String) : ParserFn := fun c s =>
def satisfySymbolFn (p : String → Bool) (expected : List String) : ParserFn := fun c s =>
let initStackSz := s.stackSize
let startPos := s.pos
let s := tokenFn expected c s
@ -1138,10 +1138,10 @@ def symbolInfo (sym : String) : ParserInfo := {
firstTokens := FirstTokens.tokens [ sym ]
}
@[inline] def symbolFn (sym : String) : ParserFn :=
def symbolFn (sym : String) : ParserFn :=
symbolFnAux sym ("'" ++ sym ++ "'")
@[inline] def symbolNoAntiquot (sym : String) : Parser :=
def symbolNoAntiquot (sym : String) : Parser :=
let sym := sym.trim
{ info := symbolInfo sym,
fn := symbolFn sym }
@ -1175,7 +1175,7 @@ def nonReservedSymbolFnAux (sym : String) (errorMsg : String) : ParserFn := fun
s.mkErrorAt errorMsg startPos initStackSz
| _ => s.mkErrorAt errorMsg startPos initStackSz
@[inline] def nonReservedSymbolFn (sym : String) : ParserFn :=
def nonReservedSymbolFn (sym : String) : ParserFn :=
nonReservedSymbolFnAux sym ("'" ++ sym ++ "'")
def nonReservedSymbolInfo (sym : String) (includeIdent : Bool) : ParserInfo := {
@ -1186,7 +1186,7 @@ def nonReservedSymbolInfo (sym : String) (includeIdent : Bool) : ParserInfo := {
FirstTokens.tokens [ sym ]
}
@[inline] def nonReservedSymbolNoAntiquot (sym : String) (includeIdent := false) : Parser :=
def nonReservedSymbolNoAntiquot (sym : String) (includeIdent := false) : Parser :=
let sym := sym.trim
{ info := nonReservedSymbolInfo sym includeIdent,
fn := nonReservedSymbolFn sym }
@ -1251,10 +1251,10 @@ def unicodeSymbolInfo (sym asciiSym : String) : ParserInfo := {
firstTokens := FirstTokens.tokens [ sym, asciiSym ]
}
@[inline] def unicodeSymbolFn (sym asciiSym : String) : ParserFn :=
def unicodeSymbolFn (sym asciiSym : String) : ParserFn :=
unicodeSymbolFnAux sym asciiSym ["'" ++ sym ++ "', '" ++ asciiSym ++ "'"]
@[inline] def unicodeSymbolNoAntiquot (sym asciiSym : String) : Parser :=
def unicodeSymbolNoAntiquot (sym asciiSym : String) : Parser :=
let sym := sym.trim
let asciiSym := asciiSym.trim
{ info := unicodeSymbolInfo sym asciiSym,
@ -1270,7 +1270,7 @@ def numLitFn : ParserFn :=
let s := tokenFn ["numeral"] c s
if !s.hasError && !(s.stxStack.back.isOfKind numLitKind) then s.mkErrorAt "numeral" iniPos initStackSz else s
@[inline] def numLitNoAntiquot : Parser := {
def numLitNoAntiquot : Parser := {
fn := numLitFn,
info := mkAtomicInfo "num"
}
@ -1282,7 +1282,7 @@ def scientificLitFn : ParserFn :=
let s := tokenFn ["scientific number"] c s
if !s.hasError && !(s.stxStack.back.isOfKind scientificLitKind) then s.mkErrorAt "scientific number" iniPos initStackSz else s
@[inline] def scientificLitNoAntiquot : Parser := {
def scientificLitNoAntiquot : Parser := {
fn := scientificLitFn,
info := mkAtomicInfo "scientific"
}
@ -1293,7 +1293,7 @@ def strLitFn : ParserFn := fun c s =>
let s := tokenFn ["string literal"] c s
if !s.hasError && !(s.stxStack.back.isOfKind strLitKind) then s.mkErrorAt "string literal" iniPos initStackSz else s
@[inline] def strLitNoAntiquot : Parser := {
def strLitNoAntiquot : Parser := {
fn := strLitFn,
info := mkAtomicInfo "str"
}
@ -1304,7 +1304,7 @@ def charLitFn : ParserFn := fun c s =>
let s := tokenFn ["char literal"] c s
if !s.hasError && !(s.stxStack.back.isOfKind charLitKind) then s.mkErrorAt "character literal" iniPos initStackSz else s
@[inline] def charLitNoAntiquot : Parser := {
def charLitNoAntiquot : Parser := {
fn := charLitFn,
info := mkAtomicInfo "char"
}
@ -1315,7 +1315,7 @@ def nameLitFn : ParserFn := fun c s =>
let s := tokenFn ["Name literal"] c s
if !s.hasError && !(s.stxStack.back.isOfKind nameLitKind) then s.mkErrorAt "Name literal" iniPos initStackSz else s
@[inline] def nameLitNoAntiquot : Parser := {
def nameLitNoAntiquot : Parser := {
fn := nameLitFn,
info := mkAtomicInfo "name"
}
@ -1326,12 +1326,12 @@ def identFn : ParserFn := fun c s =>
let s := tokenFn ["identifier"] c s
if !s.hasError && !(s.stxStack.back.isIdent) then s.mkErrorAt "identifier" iniPos initStackSz else s
@[inline] def identNoAntiquot : Parser := {
def identNoAntiquot : Parser := {
fn := identFn,
info := mkAtomicInfo "ident"
}
@[inline] def rawIdentNoAntiquot : Parser := {
def rawIdentNoAntiquot : Parser := {
fn := rawIdentFn
}
@ -1345,7 +1345,7 @@ def identEqFn (id : Name) : ParserFn := fun c s =>
| Syntax.ident _ _ val _ => if val != id then s.mkErrorAt ("expected identifier '" ++ toString id ++ "'") iniPos initStackSz else s
| _ => s.mkErrorAt "identifier" iniPos initStackSz
@[inline] def identEq (id : Name) : Parser := {
def identEq (id : Name) : Parser := {
fn := identEqFn id,
info := mkAtomicInfo "ident"
}
@ -1467,7 +1467,7 @@ def anyOfFn : List Parser → ParserFn
| [p], c, s => p.fn c s
| p::ps, c, s => orelseFn p.fn (anyOfFn ps) c s
@[inline] def checkColGeFn (errorMsg : String) : ParserFn := fun c s =>
def checkColGeFn (errorMsg : String) : ParserFn := fun c s =>
match c.savedPos? with
| none => s
| some savedPos =>
@ -1476,10 +1476,10 @@ def anyOfFn : List Parser → ParserFn
if pos.column ≥ savedPos.column then s
else s.mkError errorMsg
@[inline] def checkColGe (errorMsg : String := "checkColGe") : Parser :=
def checkColGe (errorMsg : String := "checkColGe") : Parser :=
{ fn := checkColGeFn errorMsg }
@[inline] def checkColGtFn (errorMsg : String) : ParserFn := fun c s =>
def checkColGtFn (errorMsg : String) : ParserFn := fun c s =>
match c.savedPos? with
| none => s
| some savedPos =>
@ -1488,10 +1488,10 @@ def anyOfFn : List Parser → ParserFn
if pos.column > savedPos.column then s
else s.mkError errorMsg
@[inline] def checkColGt (errorMsg : String := "checkColGt") : Parser :=
def checkColGt (errorMsg : String := "checkColGt") : Parser :=
{ fn := checkColGtFn errorMsg }
@[inline] def checkLineEqFn (errorMsg : String) : ParserFn := fun c s =>
def checkLineEqFn (errorMsg : String) : ParserFn := fun c s =>
match c.savedPos? with
| none => s
| some savedPos =>
@ -1500,16 +1500,16 @@ def anyOfFn : List Parser → ParserFn
if pos.line == savedPos.line then s
else s.mkError errorMsg
@[inline] def checkLineEq (errorMsg : String := "checkLineEq") : Parser :=
def checkLineEq (errorMsg : String := "checkLineEq") : Parser :=
{ fn := checkLineEqFn errorMsg }
@[inline] def withPosition (p : Parser) : Parser := {
def withPosition (p : Parser) : Parser := {
info := p.info
fn := fun c s =>
p.fn { c with savedPos? := s.pos } s
}
@[inline] def withPositionAfterLinebreak (p : Parser) : Parser := {
def withPositionAfterLinebreak (p : Parser) : Parser := {
info := p.info
fn := fun c s =>
let prev := s.stxStack.back
@ -1517,17 +1517,17 @@ def anyOfFn : List Parser → ParserFn
p.fn c s
}
@[inline] def withoutPosition (p : Parser) : Parser := {
def withoutPosition (p : Parser) : Parser := {
info := p.info
fn := fun c s => p.fn { c with savedPos? := none } s
}
@[inline] def withForbidden (tk : Token) (p : Parser) : Parser := {
def withForbidden (tk : Token) (p : Parser) : Parser := {
info := p.info
fn := fun c s => p.fn { c with forbiddenTk? := tk } s
}
@[inline] def withoutForbidden (p : Parser) : Parser := {
def withoutForbidden (p : Parser) : Parser := {
info := p.info
fn := fun c s => p.fn { c with forbiddenTk? := none } s
}
@ -1537,7 +1537,7 @@ def eoiFn : ParserFn := fun c s =>
if c.input.atEnd i then s
else s.mkError "expected end of file"
@[inline] def eoi : Parser :=
def eoi : Parser :=
{ fn := eoiFn }
open Std (RBMap RBMap.empty)
@ -1676,7 +1676,7 @@ def categoryParser (catName : Name) (prec : Nat) : Parser := {
}
-- Define `termParser` here because we need it for antiquotations
@[inline] def termParser (prec : Nat := 0) : Parser :=
def termParser (prec : Nat := 0) : Parser :=
categoryParser `term prec
-- ==================
@ -1724,7 +1724,7 @@ def tokenAntiquotFn : ParserFn := fun c s => Id.run do
return s.restore iniSz iniPos
s.mkNode (`token_antiquot) (iniSz - 1)
@[inline] def tokenWithAntiquot (p : Parser) : Parser where
def tokenWithAntiquot (p : Parser) : Parser where
fn c s :=
let s := p.fn c s
-- fast check that is false in most cases
@ -1734,15 +1734,15 @@ def tokenAntiquotFn : ParserFn := fun c s => Id.run do
s
info := p.info
@[inline] def symbol (sym : String) : Parser :=
def symbol (sym : String) : Parser :=
tokenWithAntiquot (symbolNoAntiquot sym)
instance : Coe String Parser := ⟨fun s => symbol s ⟩
@[inline] def nonReservedSymbol (sym : String) (includeIdent := false) : Parser :=
def nonReservedSymbol (sym : String) (includeIdent := false) : Parser :=
tokenWithAntiquot (nonReservedSymbolNoAntiquot sym includeIdent)
@[inline] def unicodeSymbol (sym asciiSym : String) : Parser :=
def unicodeSymbol (sym asciiSym : String) : Parser :=
tokenWithAntiquot (unicodeSymbolNoAntiquot sym asciiSym)
/--
@ -1762,7 +1762,7 @@ def mkAntiquot (name : String) (kind : SyntaxNodeKind) (anonymous := true) (isPs
checkNoWsBefore "no space before spliced term" >> antiquotExpr >>
nameP
@[inline] def withAntiquotFn (antiquotP p : ParserFn) (isCatAntiquot := false) : ParserFn := fun c s =>
def withAntiquotFn (antiquotP p : ParserFn) (isCatAntiquot := false) : ParserFn := fun c s =>
-- fast check that is false in most cases
if c.input.get s.pos == '$' then
-- Do not allow antiquotation choice nodes here as `antiquotP` is the strictly more general
@ -1774,7 +1774,7 @@ def mkAntiquot (name : String) (kind : SyntaxNodeKind) (anonymous := true) (isPs
p c s
/-- Optimized version of `mkAntiquot ... <|> p`. -/
@[inline] def withAntiquot (antiquotP p : Parser) : Parser := {
def withAntiquot (antiquotP p : Parser) : Parser := {
fn := withAntiquotFn antiquotP.fn p.fn,
info := orelseInfo antiquotP.info p.info
}
@ -1800,7 +1800,7 @@ private def withAntiquotSuffixSpliceFn (kind : SyntaxNodeKind) (suffix : ParserF
s.mkNode (kind ++ `antiquot_suffix_splice) (s.stxStack.size - 2)
/-- Parse `suffix` after an antiquotation, e.g. `$x,*`, and put both into a new node. -/
@[inline] def withAntiquotSuffixSplice (kind : SyntaxNodeKind) (p suffix : Parser) : Parser where
def withAntiquotSuffixSplice (kind : SyntaxNodeKind) (p suffix : Parser) : Parser where
info := andthenInfo p.info suffix.info
fn c s :=
let s := p.fn c s
@ -1857,7 +1857,7 @@ def leadingParserAux (kind : Name) (tables : PrattParsingTables) (behavior : Lea
let s := longestMatchFn none ps c s
mkResult s iniSz
@[inline] def leadingParser (kind : Name) (tables : PrattParsingTables) (behavior : LeadingIdentBehavior) (antiquotParser : ParserFn) : ParserFn :=
def leadingParser (kind : Name) (tables : PrattParsingTables) (behavior : LeadingIdentBehavior) (antiquotParser : ParserFn) : ParserFn :=
withAntiquotFn (isCatAntiquot := true) antiquotParser (leadingParserAux kind tables behavior)
def trailingLoopStep (tables : PrattParsingTables) (left : Syntax) (ps : List (Parser × Nat)) : ParserFn := fun c s =>
@ -1904,7 +1904,7 @@ partial def trailingLoop (tables : PrattParsingTables) (c : ParserContext) (s :
`antiquotParser` should be a `mkAntiquot` parser (or always fail) and is tried before all other parsers.
It should not be added to the regular leading parsers because it would heavily
overlap with antiquotation parsers nested inside them. -/
@[inline] def prattParser (kind : Name) (tables : PrattParsingTables) (behavior : LeadingIdentBehavior) (antiquotParser : ParserFn) : ParserFn := fun c s =>
def prattParser (kind : Name) (tables : PrattParsingTables) (behavior : LeadingIdentBehavior) (antiquotParser : ParserFn) : ParserFn := fun c s =>
let s := leadingParser kind tables behavior antiquotParser c s
if s.hasError then
s
@ -1921,13 +1921,13 @@ def fieldIdxFn : ParserFn := fun c s =>
else
s.mkErrorAt "field index" iniPos initStackSz
@[inline] def fieldIdx : Parser :=
def fieldIdx : Parser :=
withAntiquot (mkAntiquot "fieldIdx" `fieldIdx) {
fn := fieldIdxFn,
info := mkAtomicInfo "fieldIdx"
}
@[inline] def skip : Parser := {
def skip : Parser := {
fn := fun _ s => s,
info := epsilonInfo
}
@ -1939,13 +1939,13 @@ namespace Syntax
section
variable {β : Type} {m : Type → Type} [Monad m]
@[inline] def foldArgsM (s : Syntax) (f : Syntax → β → m β) (b : β) : m β :=
def foldArgsM (s : Syntax) (f : Syntax → β → m β) (b : β) : m β :=
s.getArgs.foldlM (flip f) b
@[inline] def foldArgs (s : Syntax) (f : Syntax → β → β) (b : β) : β :=
def foldArgs (s : Syntax) (f : Syntax → β → β) (b : β) : β :=
Id.run (s.foldArgsM f b)
@[inline] def forArgsM (s : Syntax) (f : Syntax → m Unit) : m Unit :=
def forArgsM (s : Syntax) (f : Syntax → m Unit) : m Unit :=
s.foldArgsM (fun s _ => f s) ()
end

View file

@ -60,7 +60,7 @@ def optDeclSig := leading_parser many (ppSpace >> (Term.binderIdent <|> Te
def declValSimple := leading_parser " :=" >> ppHardLineUnlessUngrouped >> termParser >> optional Term.whereDecls
def declValEqns := leading_parser Term.matchAltsWhereDecls
def whereStructField := leading_parser Term.letDecl
def whereStructInst := leading_parser " where" >> sepBy1Indent (ppGroup whereStructField) "; " (allowTrailingSep := true) >> optional Term.whereDecls
def whereStructInst := leading_parser " where" >> sepByIndent (ppGroup whereStructField) "; " (allowTrailingSep := true) >> optional Term.whereDecls
/-
Remark: we should not use `Term.whereDecls` at `declVal` because `Term.whereDecls` is defined using `Term.letRecDecl` which may contain attributes.
Issue #753 showns an example that fails to be parsed when we used `Term.whereDecls`.
@ -76,8 +76,8 @@ def «opaque» := leading_parser "opaque " >> declId >> ppIndent declSig
def «instance» := leading_parser Term.attrKind >> "instance" >> optNamedPrio >> optional (ppSpace >> declId) >> ppIndent declSig >> declVal >> terminationSuffix
def «axiom» := leading_parser "axiom " >> declId >> ppIndent declSig
/- As `declSig` starts with a space, "example" does not need a trailing space. -/
def «example» := leading_parser "example" >> ppIndent declSig >> declVal
def ctor := leading_parser "\n| " >> ppIndent (declModifiers true >> rawIdent >> optDeclSig)
def «example» := leading_parser "example" >> ppIndent optDeclSig >> declVal
def ctor := leading_parser atomic (optional docComment >> "\n| ") >> ppGroup (declModifiers true >> rawIdent >> optDeclSig)
def derivingClasses := sepBy1 (group (ident >> optional (" with " >> Term.structInst))) ", "
def optDeriving := leading_parser optional (ppLine >> atomic ("deriving " >> notSymbol "instance") >> derivingClasses)
def computedField := leading_parser declModifiers true >> ident >> " : " >> termParser >> Term.matchAlts

View file

@ -92,6 +92,12 @@ def doIfCond := withAntiquot (mkAntiquot "doIfCond" `Lean.Parser.Term.doIfCon
>> optional (checkColGe "'else' in 'do' must be indented" >> " else " >> doSeq)
@[builtinDoElemParser] def doUnless := leading_parser "unless " >> withForbidden "do" termParser >> "do " >> doSeq
def doForDecl := leading_parser optional (atomic (ident >> " : ")) >> termParser >> " in " >> withForbidden "do" termParser
/--
`for x in e do s` iterates over `e` assuming `e`'s type has an instance of the `ForIn` typeclass.
`break` and `continue` are supported inside `for` loops.
`for x in e, x2 in e2, ... do s` iterates of the given collections in parallel, until at least one of them is exhausted.
The types of `e2` etc. must implement the `ToStream` typeclass.
-/
@[builtinDoElemParser] def doFor := leading_parser "for " >> sepBy1 doForDecl ", " >> "do " >> doSeq
def doMatchAlts := ppDedent <| matchAlts (rhsParser := doSeq)
@ -102,8 +108,17 @@ def doCatchMatch := leading_parser "catch " >> doMatchAlts
def doFinally := leading_parser "finally " >> doSeq
@[builtinDoElemParser] def doTry := leading_parser "try " >> doSeq >> many (doCatch <|> doCatchMatch) >> optional doFinally
/-- `break` exits the surrounding `for` loop. -/
@[builtinDoElemParser] def doBreak := leading_parser "break"
/-- `continue` skips to the next iteration of the surrounding `for` loop. -/
@[builtinDoElemParser] def doContinue := leading_parser "continue"
/--
`return e` inside of a `do` block makes the surrounding block evaluate to `pure e`, skipping any further statements.
Note that uses of the `do` keyword in other syntax like in `for _ in _ do` do not constitute a surrounding block in this sense;
in supported editors, the corresponding `do` keyword of the surrounding block is highlighted when hovering over `return`.
`return` not followed by a term starting on the same line is equivalent to `return ()`.
-/
@[builtinDoElemParser] def doReturn := leading_parser:leadPrec withPosition ("return " >> optional (checkLineEq >> termParser))
@[builtinDoElemParser] def doDbgTrace := leading_parser:leadPrec "dbg_trace " >> ((interpolatedStr termParser) <|> termParser)
@[builtinDoElemParser] def doAssert := leading_parser:leadPrec "assert! " >> termParser
@ -128,9 +143,14 @@ The second `notFollowedBy` prevents this problem.
@[builtinTermParser] def doElem.quot : Parser := leading_parser "`(doElem|" >> incQuotDepth doElemParser >> ")"
/- macros for using `unless`, `for`, `try`, `return` as terms. They expand into `do unless ...`, `do for ...`, `do try ...`, and `do return ...` -/
/-- `unless e do s` is a nicer way to write `if !e do s`. -/
@[builtinTermParser] def termUnless := leading_parser "unless " >> withForbidden "do" termParser >> "do " >> doSeq
@[builtinTermParser] def termFor := leading_parser "for " >> sepBy1 doForDecl ", " >> "do " >> doSeq
@[builtinTermParser] def termFor := leading_parser "for " >> sepBy1 doForDecl ", " >> "do " >> doSeq
@[builtinTermParser] def termTry := leading_parser "try " >> doSeq >> many (doCatch <|> doCatchMatch) >> optional doFinally
/--
`return` used outside of `do` blocks creates an implicit block around it and thus is equivalent to `pure e`, but helps with
avoiding parentheses.
-/
@[builtinTermParser] def termReturn := leading_parser:leadPrec withPosition ("return " >> optional (checkLineEq >> termParser))
end Term

View file

@ -117,7 +117,16 @@ def isConstructorApp? (env : Environment) (e : Expr) : Option ConstructorVal :=
def isConstructorApp (env : Environment) (e : Expr) : Bool :=
e.isConstructorApp? env |>.isSome
def constructorApp? (env : Environment) (e : Expr) : Option (ConstructorVal × Array Expr) := do
/--
If `e` is a constructor application, return a pair containing the corresponding `ConstructorVal` and the constructor
application arguments.
This function treats numerals as constructors. For example, if `e` is the numeral `2`, the result pair
is `ConstructorVal` for `Nat.succ`, and the array `#[1]`. The parameter `useRaw` controls how the resulting
numeral is represented. If `useRaw := false`, then `mkNatLit` is used, otherwise `mkRawNatLit`.
Recall that `mkNatLit` uses the `OfNat.ofNat` application which is the canonical way of representing numerals
in the elaborator and tactic framework. We `useRaw := false` in the compiler (aka code generator).
-/
def constructorApp? (env : Environment) (e : Expr) (useRaw := false) : Option (ConstructorVal × Array Expr) := do
match e with
| Expr.lit (Literal.natVal n) =>
if n == 0 then do
@ -125,7 +134,7 @@ def constructorApp? (env : Environment) (e : Expr) : Option (ConstructorVal × A
pure (v, #[])
else do
let v ← getConstructorVal? env `Nat.succ
pure (v, #[mkNatLit (n-1)])
pure (v, #[if useRaw then mkRawNatLit (n-1) else mkNatLit (n-1)])
| _ =>
match e.getAppFn with
| Expr.const n _ => do

View file

@ -8,7 +8,7 @@ options get_default_options() {
// switch to `true` for ABI-breaking changes affecting meta code
opts = opts.update({"interpreter", "prefer_native"}, false);
// switch to `true` for changing built-in parsers used in quotations
opts = opts.update({"internal", "parseQuotWithCurrentStage"}, true);
opts = opts.update({"internal", "parseQuotWithCurrentStage"}, false);
opts = opts.update({"pp", "rawOnError"}, true);
#endif
return opts;

View file

@ -27,6 +27,7 @@ lean_object* l_List_get___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_contains(lean_object*);
LEAN_EXPORT lean_object* l_List_notElem___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_any___rarg___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_instLTList(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_mapTRAux(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_foldr___at_List_any___spec__1___rarg(lean_object*, uint8_t, lean_object*);
@ -43,6 +44,7 @@ LEAN_EXPORT uint8_t l_List_notElem___rarg(lean_object*, lean_object*, lean_objec
LEAN_EXPORT lean_object* l_List_minimum_x3f___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_lengthTRAux_match__1_splitter(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_mapTR___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_reverseAux(lean_object*);
LEAN_EXPORT lean_object* l_List_replace___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_isSuffixOf___rarg(lean_object*, lean_object*, lean_object*);
@ -73,7 +75,6 @@ LEAN_EXPORT lean_object* l_List_foldl___at_List_maximum_x3f___spec__2___rarg(lea
LEAN_EXPORT lean_object* l_List_groupBy___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_concat_match__1_splitter___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_instMembershipList(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_init_match__1_splitter(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_filterTRAux___rarg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_join___rarg(lean_object*);
LEAN_EXPORT lean_object* l_List_elem___at_List_instDecidableMemListInstMembershipList___spec__1(lean_object*);
@ -81,7 +82,6 @@ LEAN_EXPORT lean_object* l_max___at_List_maximum_x3f___spec__1(lean_object*, lea
LEAN_EXPORT lean_object* l_List_instLEList(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_pure___rarg(lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_map_u2082___rarg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_drop(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_replicateTR_loop_match__1_splitter___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_erase_match__1_splitter(lean_object*);
@ -109,12 +109,10 @@ LEAN_EXPORT lean_object* l_List_groupByAux___rarg(lean_object*, lean_object*, le
lean_object* lean_nat_sub(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_all___rarg(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_instDecidableMemListInstMembershipList___rarg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_zip___rarg___lambda__1(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_foldr___at_List_or___spec__1(uint8_t, lean_object*);
LEAN_EXPORT lean_object* l_List_instEmptyCollectionList(lean_object*);
LEAN_EXPORT lean_object* l_List_filterMap(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_erase_match__1_splitter___rarg(uint8_t, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_init___rarg(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_length_match__1_splitter___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_isSuffixOf(lean_object*);
LEAN_EXPORT uint8_t l_List_or(lean_object*);
@ -142,18 +140,18 @@ LEAN_EXPORT lean_object* l_List_zipWith(lean_object*, lean_object*, lean_object*
LEAN_EXPORT uint8_t l_List_foldr___at_List_all___spec__1___rarg(lean_object*, uint8_t, lean_object*);
LEAN_EXPORT lean_object* l_List_append___rarg___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_lookup(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_zipWith___at_List_zip___spec__1(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_instForAllListDecidableLeInstLEList___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_takeWhile___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_eraseDupsAux(lean_object*);
LEAN_EXPORT lean_object* l_min___at_List_minimum_x3f___spec__1(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_map_u2082(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_hasDecidableLt(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_beq_match__1_splitter___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_unzip(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_map(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_length_match__1_splitter(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_init_match__1_splitter___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_eraseReps___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_zipWith___at_List_zip___spec__1___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_mapTR(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_removeAll(lean_object*);
LEAN_EXPORT lean_object* l_List_replicateTR_loop(lean_object*);
@ -175,7 +173,6 @@ static lean_object* l_List_partition___rarg___closed__1;
LEAN_EXPORT lean_object* l_List_instBEqList___rarg(lean_object*);
LEAN_EXPORT lean_object* l_List_foldr___at_List_all___spec__1(lean_object*);
LEAN_EXPORT lean_object* l_List_maximum_x3f___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_init(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_replicate_match__1_splitter___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_concat_match__1_splitter(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_find_x3f___rarg(lean_object*, lean_object*);
@ -223,11 +220,12 @@ LEAN_EXPORT lean_object* l_List_rangeAux(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_reverseAux_match__1_splitter(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_foldr___at_List_all___spec__1___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_instDecidableMemListInstMembershipList___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_take___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_take(lean_object*);
LEAN_EXPORT lean_object* l_List_eraseReps(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_init_match__1_splitter___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_isEmpty___rarg(lean_object*);
LEAN_EXPORT lean_object* l_List_zipWith___at_List_zip___spec__1___rarg___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_filterMap___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_groupBy(lean_object*);
static lean_object* l_List_instAppendList___closed__1;
@ -237,9 +235,9 @@ LEAN_EXPORT uint8_t l_List_any___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_instForAllListDecidableLeInstLEList(lean_object*);
LEAN_EXPORT lean_object* l_List_isPrefixOf(lean_object*);
LEAN_EXPORT lean_object* l_List_intercalate(lean_object*);
LEAN_EXPORT lean_object* l_List_zip___rarg___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_beq(lean_object*);
LEAN_EXPORT lean_object* l_List_eraseRepsAux(lean_object*);
static lean_object* l_List_zip___rarg___closed__1;
LEAN_EXPORT lean_object* l_List_intersperse(lean_object*);
LEAN_EXPORT uint8_t l_List_contains___rarg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_appendTR(lean_object*);
@ -950,76 +948,6 @@ lean_dec(x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_List_map_u2082___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
if (lean_obj_tag(x_2) == 0)
{
lean_object* x_4;
lean_dec(x_3);
lean_dec(x_1);
x_4 = lean_box(0);
return x_4;
}
else
{
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_5;
lean_dec(x_2);
lean_dec(x_1);
x_5 = lean_box(0);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; uint8_t x_8;
x_6 = lean_ctor_get(x_2, 0);
lean_inc(x_6);
x_7 = lean_ctor_get(x_2, 1);
lean_inc(x_7);
lean_dec(x_2);
x_8 = !lean_is_exclusive(x_3);
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_3, 0);
x_10 = lean_ctor_get(x_3, 1);
lean_inc(x_1);
x_11 = lean_apply_2(x_1, x_6, x_9);
x_12 = l_List_map_u2082___rarg(x_1, x_7, x_10);
lean_ctor_set(x_3, 1, x_12);
lean_ctor_set(x_3, 0, x_11);
return x_3;
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_13 = lean_ctor_get(x_3, 0);
x_14 = lean_ctor_get(x_3, 1);
lean_inc(x_14);
lean_inc(x_13);
lean_dec(x_3);
lean_inc(x_1);
x_15 = lean_apply_2(x_1, x_6, x_13);
x_16 = l_List_map_u2082___rarg(x_1, x_7, x_14);
x_17 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_17, 0, x_15);
lean_ctor_set(x_17, 1, x_16);
return x_17;
}
}
}
}
}
LEAN_EXPORT lean_object* l_List_map_u2082(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = lean_alloc_closure((void*)(l_List_map_u2082___rarg), 3, 0);
return x_4;
}
}
LEAN_EXPORT lean_object* l_List_join___rarg(lean_object* x_1) {
_start:
{
@ -3507,38 +3435,107 @@ x_4 = lean_alloc_closure((void*)(l_List_zipWith___rarg), 3, 0);
return x_4;
}
}
LEAN_EXPORT lean_object* l_List_zip___rarg___lambda__1(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT lean_object* l_List_zipWith___at_List_zip___spec__1___rarg(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_3;
lean_dec(x_2);
x_3 = lean_box(0);
return x_3;
}
else
{
if (lean_obj_tag(x_2) == 0)
{
lean_object* x_4;
x_4 = lean_box(0);
return x_4;
}
else
{
uint8_t x_5;
x_5 = !lean_is_exclusive(x_2);
if (x_5 == 0)
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_6 = lean_ctor_get(x_1, 0);
x_7 = lean_ctor_get(x_1, 1);
x_8 = lean_ctor_get(x_2, 0);
x_9 = lean_ctor_get(x_2, 1);
lean_inc(x_6);
x_10 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_10, 0, x_6);
lean_ctor_set(x_10, 1, x_8);
x_11 = l_List_zipWith___at_List_zip___spec__1___rarg(x_7, x_9);
lean_ctor_set(x_2, 1, x_11);
lean_ctor_set(x_2, 0, x_10);
return x_2;
}
else
{
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_12 = lean_ctor_get(x_1, 0);
x_13 = lean_ctor_get(x_1, 1);
x_14 = lean_ctor_get(x_2, 0);
x_15 = lean_ctor_get(x_2, 1);
lean_inc(x_15);
lean_inc(x_14);
lean_dec(x_2);
lean_inc(x_12);
x_16 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_16, 0, x_12);
lean_ctor_set(x_16, 1, x_14);
x_17 = l_List_zipWith___at_List_zip___spec__1___rarg(x_13, x_15);
x_18 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_18, 0, x_16);
lean_ctor_set(x_18, 1, x_17);
return x_18;
}
}
}
}
}
LEAN_EXPORT lean_object* l_List_zipWith___at_List_zip___spec__1(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
x_3 = lean_alloc_closure((void*)(l_List_zipWith___at_List_zip___spec__1___rarg___boxed), 2, 0);
return x_3;
}
}
static lean_object* _init_l_List_zip___rarg___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_List_zip___rarg___lambda__1), 2, 0);
return x_1;
}
}
LEAN_EXPORT lean_object* l_List_zip___rarg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4;
x_3 = l_List_zip___rarg___closed__1;
x_4 = l_List_zipWith___rarg(x_3, x_1, x_2);
return x_4;
lean_object* x_3;
x_3 = l_List_zipWith___at_List_zip___spec__1___rarg(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_List_zip(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = lean_alloc_closure((void*)(l_List_zip___rarg), 2, 0);
x_3 = lean_alloc_closure((void*)(l_List_zip___rarg___boxed), 2, 0);
return x_3;
}
}
LEAN_EXPORT lean_object* l_List_zipWith___at_List_zip___spec__1___rarg___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_List_zipWith___at_List_zip___spec__1___rarg(x_1, x_2);
lean_dec(x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_List_zip___rarg___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_List_zip___rarg(x_1, x_2);
lean_dec(x_1);
return x_3;
}
}
@ -3911,68 +3908,6 @@ x_2 = lean_alloc_closure((void*)(l_List_enum___rarg), 1, 0);
return x_2;
}
}
LEAN_EXPORT lean_object* l_List_init___rarg(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2;
x_2 = lean_box(0);
return x_2;
}
else
{
lean_object* x_3;
x_3 = lean_ctor_get(x_1, 1);
lean_inc(x_3);
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_4;
lean_dec(x_1);
x_4 = lean_box(0);
return x_4;
}
else
{
lean_object* x_5; lean_object* x_6; uint8_t x_7;
x_5 = lean_ctor_get(x_1, 0);
lean_inc(x_5);
lean_dec(x_1);
lean_inc(x_3);
x_6 = l_List_init___rarg(x_3);
x_7 = !lean_is_exclusive(x_3);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9;
x_8 = lean_ctor_get(x_3, 1);
lean_dec(x_8);
x_9 = lean_ctor_get(x_3, 0);
lean_dec(x_9);
lean_ctor_set(x_3, 1, x_6);
lean_ctor_set(x_3, 0, x_5);
return x_3;
}
else
{
lean_object* x_10;
lean_dec(x_3);
x_10 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_10, 0, x_5);
lean_ctor_set(x_10, 1, x_6);
return x_10;
}
}
}
}
}
LEAN_EXPORT lean_object* l_List_init(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_List_init___rarg), 1, 0);
return x_2;
}
}
LEAN_EXPORT lean_object* l_List_intersperse___rarg(lean_object* x_1, lean_object* x_2) {
_start:
{
@ -4920,7 +4855,7 @@ x_3 = lean_alloc_closure((void*)(l___private_Init_Data_List_Basic_0__List_set_ma
return x_3;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_init_match__1_splitter___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
if (lean_obj_tag(x_1) == 0)
@ -4958,19 +4893,19 @@ return x_9;
}
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_init_match__1_splitter(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = lean_alloc_closure((void*)(l___private_Init_Data_List_Basic_0__List_init_match__1_splitter___rarg___boxed), 4, 0);
x_3 = lean_alloc_closure((void*)(l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter___rarg___boxed), 4, 0);
return x_3;
}
}
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_init_match__1_splitter___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
LEAN_EXPORT lean_object* l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter___rarg___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___private_Init_Data_List_Basic_0__List_init_match__1_splitter___rarg(x_1, x_2, x_3, x_4);
x_5 = l___private_Init_Data_List_Basic_0__List_intersperse_match__1_splitter___rarg(x_1, x_2, x_3, x_4);
lean_dec(x_2);
return x_5;
}
@ -5299,8 +5234,6 @@ l_List_instAppendList___closed__1 = _init_l_List_instAppendList___closed__1();
lean_mark_persistent(l_List_instAppendList___closed__1);
l_List_partition___rarg___closed__1 = _init_l_List_partition___rarg___closed__1();
lean_mark_persistent(l_List_partition___rarg___closed__1);
l_List_zip___rarg___closed__1 = _init_l_List_zip___rarg___closed__1();
lean_mark_persistent(l_List_zip___rarg___closed__1);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus

2283
stage0/stdlib/Init/Meta.c generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Lean.Compiler.LCNF
// Imports: Init Lean.Compiler.LCNF.Basic Lean.Compiler.LCNF.Bind Lean.Compiler.LCNF.Check Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.ElimDead Lean.Compiler.LCNF.InferType Lean.Compiler.LCNF.LCtx Lean.Compiler.LCNF.Main Lean.Compiler.LCNF.PrettyPrinter Lean.Compiler.LCNF.ToDecl Lean.Compiler.LCNF.ToExpr Lean.Compiler.LCNF.ToLCNF Lean.Compiler.LCNF.Types Lean.Compiler.LCNF.Util Lean.Compiler.LCNF.Main
// Imports: Init Lean.Compiler.LCNF.Basic Lean.Compiler.LCNF.Bind Lean.Compiler.LCNF.Check Lean.Compiler.LCNF.CompilerM Lean.Compiler.LCNF.ElimDead Lean.Compiler.LCNF.InferType Lean.Compiler.LCNF.LCtx Lean.Compiler.LCNF.Main Lean.Compiler.LCNF.PrettyPrinter Lean.Compiler.LCNF.ToDecl Lean.Compiler.LCNF.ToExpr Lean.Compiler.LCNF.ToLCNF Lean.Compiler.LCNF.Types Lean.Compiler.LCNF.Util Lean.Compiler.LCNF.Main Lean.Compiler.LCNF.Testing Lean.Compiler.LCNF.FixedArgs Lean.Compiler.LCNF.SpecInfo
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -29,6 +29,9 @@ lean_object* initialize_Lean_Compiler_LCNF_ToLCNF(uint8_t builtin, lean_object*)
lean_object* initialize_Lean_Compiler_LCNF_Types(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_Util(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_Main(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_Testing(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_FixedArgs(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_SpecInfo(uint8_t builtin, lean_object*);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Lean_Compiler_LCNF(uint8_t builtin, lean_object* w) {
lean_object * res;
@ -82,6 +85,15 @@ lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_Main(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_Testing(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_FixedArgs(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_SpecInfo(builtin, 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

View file

@ -20,8 +20,8 @@ size_t lean_usize_add(size_t, size_t);
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___closed__1;
static lean_object* l_Lean_Compiler_LCNF_instInhabitedParam___closed__2;
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateReturnImp(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272____boxed(lean_object*, lean_object*);
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
LEAN_EXPORT lean_object* l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__1___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqAlt___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___closed__4;
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateContImp___closed__1;
@ -35,6 +35,7 @@ LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateContImp(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_instInhabitedParam___closed__1;
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___closed__2;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_forCodeM___rarg(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_instInhabitedLetDecl___closed__1;
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateFunImp___closed__2;
static lean_object* l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___closed__1;
@ -42,22 +43,20 @@ LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_e
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateLetImp(lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateFunImp___closed__1;
LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqCases___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256____boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectParams___spec__1(lean_object*, size_t, size_t, lean_object*);
static lean_object* l_panic___at_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___spec__1___closed__2;
uint8_t lean_name_eq(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__1(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42_(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51_(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_instInhabitedCasesCore(lean_object*);
static lean_object* l_panic___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___spec__3___closed__2;
LEAN_EXPORT uint8_t l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___lambda__1(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_instInhabitedCasesCore___closed__1;
lean_object* lean_array_get_size(lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42____boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_Code_collectUsed___spec__1(lean_object*, size_t, size_t, lean_object*);
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256_(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__1___boxed(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272_(lean_object*, lean_object*);
static lean_object* l_panic___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___spec__3___closed__1;
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805_(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877_(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_size(lean_object*);
LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqAlt___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams(lean_object*, lean_object*);
@ -83,10 +82,10 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_instBEqFunDecl;
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqCases___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateParamCoreImp(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_instInhabitedCode___closed__1;
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51____boxed(lean_object*, lean_object*);
lean_object* l_Std_RBNode_setBlack___rarg(lean_object*);
LEAN_EXPORT uint8_t l_Lean_Compiler_LCNF_Code_isReturnOf(lean_object*, lean_object*);
lean_object* lean_array_fget(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____boxed(lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_instInhabitedParam;
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_Code_sizeLe_go___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -101,6 +100,7 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_getArity(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_instInhabitedCodeDecl___closed__1;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_collectUsedAtExpr(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams_instAlt(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_forCodeM(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectParams(lean_object*, lean_object*);
lean_object* l_instInhabitedForAll__1___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_isFun___boxed(lean_object*);
@ -118,14 +118,17 @@ LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_L
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqImp(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_FunDeclCore_getArity(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___closed__5;
LEAN_EXPORT uint8_t l_Lean_Compiler_LCNF_CodeDecl_isPure(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams_instLetDecl___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_instBEqCode___closed__1;
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateReturnImp___closed__2;
LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateJmpImp___closed__1;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_instBEqParam;
LEAN_EXPORT uint8_t l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__1(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_CodeDecl_fvarId___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_instInhabitedAltCore___rarg(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_forCodeM___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_mapCodeM(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___closed__7;
lean_object* l___private_Init_Util_0__mkPanicMessageWithDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_RBNode_insert___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___spec__1(lean_object*, lean_object*, lean_object*);
@ -150,9 +153,8 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_sizeLe_go(lean_object*, lean_
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_isDecl___boxed(lean_object*);
uint8_t lean_expr_eqv(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_getCode(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateParamsLevelParams___lambda__1(lean_object*, lean_object*, lean_object*);
uint8_t l_Std_RBNode_isRed___rarg(lean_object*);
@ -189,11 +191,11 @@ LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_L
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_FunDeclCore_getArity___rarg___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams_instLetDecl(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams_instParams(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_CodeDecl_isPure___boxed(lean_object*);
LEAN_EXPORT lean_object* l_panic___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___spec__3(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateUnreachImp(lean_object*, lean_object*);
lean_object* l_Array_findIdx_x3f_loop___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_panic___at_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___spec__1(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_mapCodeM___rarg___lambda__1(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqCases(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateParamsLevelParams___lambda__1___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_instantiateLevelParamsCore_visit___at_Lean_Expr_instantiateLevelParams___spec__1(lean_object*, lean_object*, lean_object*);
@ -204,12 +206,14 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams_i
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateReturnImp___closed__1;
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqFunDecl___boxed(lean_object*, lean_object*);
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateCasesImp___closed__1;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_mapCodeM___rarg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqAlt___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_sizeLe___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_size(lean_object*);
LEAN_EXPORT lean_object* l_panic___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___spec__1(lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___lambda__2(lean_object*);
LEAN_EXPORT lean_object* l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_instantiateValueLevelParams_instParams___lambda__1___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExprs(lean_object*, lean_object*);
static lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
@ -228,14 +232,16 @@ return x_2;
static lean_object* _init_l_Lean_Compiler_LCNF_instInhabitedParam___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
lean_object* x_1; lean_object* x_2; uint8_t x_3; lean_object* x_4;
x_1 = lean_box(0);
x_2 = l_Lean_Compiler_LCNF_instInhabitedParam___closed__1;
x_3 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_1);
lean_ctor_set(x_3, 2, x_2);
return x_3;
x_3 = 0;
x_4 = lean_alloc_ctor(0, 3, 1);
lean_ctor_set(x_4, 0, x_1);
lean_ctor_set(x_4, 1, x_1);
lean_ctor_set(x_4, 2, x_2);
lean_ctor_set_uint8(x_4, sizeof(void*)*3, x_3);
return x_4;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_instInhabitedParam() {
@ -246,27 +252,19 @@ x_1 = l_Lean_Compiler_LCNF_instInhabitedParam___closed__2;
return x_1;
}
}
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42_(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51_(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; uint8_t x_9;
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; uint8_t x_10; uint8_t x_11;
x_3 = lean_ctor_get(x_1, 0);
x_4 = lean_ctor_get(x_1, 1);
x_5 = lean_ctor_get(x_1, 2);
x_6 = lean_ctor_get(x_2, 0);
x_7 = lean_ctor_get(x_2, 1);
x_8 = lean_ctor_get(x_2, 2);
x_9 = lean_name_eq(x_3, x_6);
if (x_9 == 0)
{
uint8_t x_10;
x_10 = 0;
return x_10;
}
else
{
uint8_t x_11;
x_11 = lean_name_eq(x_4, x_7);
x_6 = lean_ctor_get_uint8(x_1, sizeof(void*)*3);
x_7 = lean_ctor_get(x_2, 0);
x_8 = lean_ctor_get(x_2, 1);
x_9 = lean_ctor_get(x_2, 2);
x_10 = lean_ctor_get_uint8(x_2, sizeof(void*)*3);
x_11 = lean_name_eq(x_3, x_7);
if (x_11 == 0)
{
uint8_t x_12;
@ -276,17 +274,54 @@ return x_12;
else
{
uint8_t x_13;
x_13 = lean_expr_eqv(x_5, x_8);
return x_13;
x_13 = lean_name_eq(x_4, x_8);
if (x_13 == 0)
{
uint8_t x_14;
x_14 = 0;
return x_14;
}
else
{
uint8_t x_15;
x_15 = lean_expr_eqv(x_5, x_9);
if (x_15 == 0)
{
uint8_t x_16;
x_16 = 0;
return x_16;
}
else
{
if (x_6 == 0)
{
if (x_10 == 0)
{
uint8_t x_17;
x_17 = 1;
return x_17;
}
else
{
uint8_t x_18;
x_18 = 0;
return x_18;
}
}
else
{
return x_10;
}
}
}
}
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42____boxed(lean_object* x_1, lean_object* x_2) {
}
}
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51____boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42_(x_1, x_2);
x_3 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51_(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
@ -297,7 +332,7 @@ static lean_object* _init_l_Lean_Compiler_LCNF_instBEqParam___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42____boxed), 2, 0);
x_1 = lean_alloc_closure((void*)(l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51____boxed), 2, 0);
return x_1;
}
}
@ -353,17 +388,15 @@ return x_2;
static lean_object* _init_l_Lean_Compiler_LCNF_instInhabitedLetDecl___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; uint8_t x_3; lean_object* x_4;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Compiler_LCNF_instInhabitedParam___closed__1;
x_3 = 0;
x_4 = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(x_4, 0, x_1);
lean_ctor_set(x_4, 1, x_1);
lean_ctor_set(x_4, 2, x_2);
lean_ctor_set(x_4, 3, x_2);
lean_ctor_set_uint8(x_4, sizeof(void*)*4, x_3);
return x_4;
x_3 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_1);
lean_ctor_set(x_3, 2, x_2);
lean_ctor_set(x_3, 3, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_instInhabitedLetDecl() {
@ -374,21 +407,29 @@ x_1 = l_Lean_Compiler_LCNF_instInhabitedLetDecl___closed__1;
return x_1;
}
}
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256_(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272_(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; uint8_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12; uint8_t x_13;
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; uint8_t x_11;
x_3 = lean_ctor_get(x_1, 0);
x_4 = lean_ctor_get(x_1, 1);
x_5 = lean_ctor_get(x_1, 2);
x_6 = lean_ctor_get(x_1, 3);
x_7 = lean_ctor_get_uint8(x_1, sizeof(void*)*4);
x_8 = lean_ctor_get(x_2, 0);
x_9 = lean_ctor_get(x_2, 1);
x_10 = lean_ctor_get(x_2, 2);
x_11 = lean_ctor_get(x_2, 3);
x_12 = lean_ctor_get_uint8(x_2, sizeof(void*)*4);
x_13 = lean_name_eq(x_3, x_8);
x_7 = lean_ctor_get(x_2, 0);
x_8 = lean_ctor_get(x_2, 1);
x_9 = lean_ctor_get(x_2, 2);
x_10 = lean_ctor_get(x_2, 3);
x_11 = lean_name_eq(x_3, x_7);
if (x_11 == 0)
{
uint8_t x_12;
x_12 = 0;
return x_12;
}
else
{
uint8_t x_13;
x_13 = lean_name_eq(x_4, x_8);
if (x_13 == 0)
{
uint8_t x_14;
@ -398,7 +439,7 @@ return x_14;
else
{
uint8_t x_15;
x_15 = lean_name_eq(x_4, x_9);
x_15 = lean_expr_eqv(x_5, x_9);
if (x_15 == 0)
{
uint8_t x_16;
@ -408,55 +449,18 @@ return x_16;
else
{
uint8_t x_17;
x_17 = lean_expr_eqv(x_5, x_10);
if (x_17 == 0)
{
uint8_t x_18;
x_18 = 0;
return x_18;
}
else
{
uint8_t x_19;
x_19 = lean_expr_eqv(x_6, x_11);
if (x_19 == 0)
{
uint8_t x_20;
x_20 = 0;
return x_20;
}
else
{
if (x_7 == 0)
{
if (x_12 == 0)
{
uint8_t x_21;
x_21 = 1;
return x_21;
}
else
{
uint8_t x_22;
x_22 = 0;
return x_22;
}
}
else
{
return x_12;
x_17 = lean_expr_eqv(x_6, x_10);
return x_17;
}
}
}
}
}
}
}
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256____boxed(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272____boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256_(x_1, x_2);
x_3 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272_(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
@ -467,7 +471,7 @@ static lean_object* _init_l_Lean_Compiler_LCNF_instBEqLetDecl___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256____boxed), 2, 0);
x_1 = lean_alloc_closure((void*)(l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272____boxed), 2, 0);
return x_1;
}
}
@ -609,34 +613,6 @@ lean_dec(x_1);
return x_2;
}
}
LEAN_EXPORT uint8_t l_Lean_Compiler_LCNF_CodeDecl_isPure(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; uint8_t x_3;
x_2 = lean_ctor_get(x_1, 0);
x_3 = lean_ctor_get_uint8(x_2, sizeof(void*)*4);
return x_3;
}
else
{
uint8_t x_4;
x_4 = 1;
return x_4;
}
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_CodeDecl_isPure___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3;
x_2 = l_Lean_Compiler_LCNF_CodeDecl_isPure(x_1);
lean_dec(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_eqImp___spec__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) {
_start:
{
@ -701,7 +677,7 @@ lean_inc(x_7);
lean_dec(x_1);
x_8 = lean_ctor_get(x_2, 0);
x_9 = lean_ctor_get(x_2, 1);
x_10 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_256_(x_6, x_8);
x_10 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqLetDecl____x40_Lean_Compiler_LCNF_Basic___hyg_272_(x_6, x_8);
lean_dec(x_6);
if (x_10 == 0)
{
@ -1048,7 +1024,7 @@ else
lean_object* x_10; lean_object* x_11; uint8_t x_12;
x_10 = lean_array_fget(x_4, x_6);
x_11 = lean_array_fget(x_5, x_6);
x_12 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42_(x_10, x_11);
x_12 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51_(x_10, x_11);
lean_dec(x_11);
lean_dec(x_10);
if (x_12 == 0)
@ -1186,7 +1162,7 @@ else
lean_object* x_10; lean_object* x_11; uint8_t x_12;
x_10 = lean_array_fget(x_4, x_6);
x_11 = lean_array_fget(x_5, x_6);
x_12 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42_(x_10, x_11);
x_12 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51_(x_10, x_11);
lean_dec(x_11);
lean_dec(x_10);
if (x_12 == 0)
@ -1470,6 +1446,46 @@ lean_dec(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_forCodeM___rarg(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_3; lean_object* x_4;
x_3 = lean_ctor_get(x_1, 2);
lean_inc(x_3);
lean_dec(x_1);
x_4 = lean_apply_1(x_2, x_3);
return x_4;
}
else
{
lean_object* x_5; lean_object* x_6;
x_5 = lean_ctor_get(x_1, 0);
lean_inc(x_5);
lean_dec(x_1);
x_6 = lean_apply_1(x_2, x_5);
return x_6;
}
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_forCodeM(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = lean_alloc_closure((void*)(l_Lean_Compiler_LCNF_AltCore_forCodeM___rarg), 2, 0);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_forCodeM___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Lean_Compiler_LCNF_AltCore_forCodeM(x_1, x_2);
lean_dec(x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltCodeImp(lean_object* x_1, lean_object* x_2) {
_start:
{
@ -1607,7 +1623,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__2;
x_3 = lean_unsigned_to_nat(143u);
x_3 = lean_unsigned_to_nat(144u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -1738,7 +1754,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltsImp___closed__1;
x_3 = lean_unsigned_to_nat(150u);
x_3 = lean_unsigned_to_nat(151u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -1871,7 +1887,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateCasesImp___closed__1;
x_3 = lean_unsigned_to_nat(157u);
x_3 = lean_unsigned_to_nat(158u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2142,7 +2158,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateLetImp___closed__1;
x_3 = lean_unsigned_to_nat(164u);
x_3 = lean_unsigned_to_nat(165u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2255,7 +2271,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateContImp___closed__1;
x_3 = lean_unsigned_to_nat(173u);
x_3 = lean_unsigned_to_nat(174u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2418,7 +2434,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateFunImp___closed__1;
x_3 = lean_unsigned_to_nat(181u);
x_3 = lean_unsigned_to_nat(182u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2610,7 +2626,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateReturnImp___closed__1;
x_3 = lean_unsigned_to_nat(188u);
x_3 = lean_unsigned_to_nat(189u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2679,7 +2695,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateJmpImp___closed__1;
x_3 = lean_unsigned_to_nat(195u);
x_3 = lean_unsigned_to_nat(196u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2790,7 +2806,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateUnreachImp___closed__1;
x_3 = lean_unsigned_to_nat(202u);
x_3 = lean_unsigned_to_nat(203u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2850,42 +2866,44 @@ return x_11;
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateParamCoreImp(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; size_t x_6; size_t x_7; uint8_t x_8;
lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; size_t x_7; size_t x_8; uint8_t x_9;
x_3 = lean_ctor_get(x_1, 0);
lean_inc(x_3);
x_4 = lean_ctor_get(x_1, 1);
lean_inc(x_4);
x_5 = lean_ctor_get(x_1, 2);
lean_inc(x_5);
x_6 = lean_ptr_addr(x_2);
x_7 = lean_ptr_addr(x_5);
x_6 = lean_ctor_get_uint8(x_1, sizeof(void*)*3);
x_7 = lean_ptr_addr(x_2);
x_8 = lean_ptr_addr(x_5);
lean_dec(x_5);
x_8 = lean_usize_dec_eq(x_6, x_7);
if (x_8 == 0)
{
uint8_t x_9;
x_9 = !lean_is_exclusive(x_1);
x_9 = lean_usize_dec_eq(x_7, x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_10 = lean_ctor_get(x_1, 2);
lean_dec(x_10);
x_11 = lean_ctor_get(x_1, 1);
uint8_t x_10;
x_10 = !lean_is_exclusive(x_1);
if (x_10 == 0)
{
lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_11 = lean_ctor_get(x_1, 2);
lean_dec(x_11);
x_12 = lean_ctor_get(x_1, 0);
x_12 = lean_ctor_get(x_1, 1);
lean_dec(x_12);
x_13 = lean_ctor_get(x_1, 0);
lean_dec(x_13);
lean_ctor_set(x_1, 2, x_2);
return x_1;
}
else
{
lean_object* x_13;
lean_object* x_14;
lean_dec(x_1);
x_13 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_13, 0, x_3);
lean_ctor_set(x_13, 1, x_4);
lean_ctor_set(x_13, 2, x_2);
return x_13;
x_14 = lean_alloc_ctor(0, 3, 1);
lean_ctor_set(x_14, 0, x_3);
lean_ctor_set(x_14, 1, x_4);
lean_ctor_set(x_14, 2, x_2);
lean_ctor_set_uint8(x_14, sizeof(void*)*3, x_6);
return x_14;
}
}
else
@ -2900,7 +2918,7 @@ return x_1;
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateLetDeclCoreImp(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; uint8_t x_8; size_t x_9; size_t x_10; uint8_t x_11;
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; size_t x_8; size_t x_9; uint8_t x_10;
x_4 = lean_ctor_get(x_1, 0);
lean_inc(x_4);
x_5 = lean_ctor_get(x_1, 1);
@ -2909,81 +2927,78 @@ x_6 = lean_ctor_get(x_1, 2);
lean_inc(x_6);
x_7 = lean_ctor_get(x_1, 3);
lean_inc(x_7);
x_8 = lean_ctor_get_uint8(x_1, sizeof(void*)*4);
x_9 = lean_ptr_addr(x_2);
x_10 = lean_ptr_addr(x_6);
x_8 = lean_ptr_addr(x_2);
x_9 = lean_ptr_addr(x_6);
lean_dec(x_6);
x_11 = lean_usize_dec_eq(x_9, x_10);
x_10 = lean_usize_dec_eq(x_8, x_9);
if (x_10 == 0)
{
uint8_t x_11;
lean_dec(x_7);
x_11 = !lean_is_exclusive(x_1);
if (x_11 == 0)
{
uint8_t x_12;
lean_dec(x_7);
x_12 = !lean_is_exclusive(x_1);
if (x_12 == 0)
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
x_13 = lean_ctor_get(x_1, 3);
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
x_12 = lean_ctor_get(x_1, 3);
lean_dec(x_12);
x_13 = lean_ctor_get(x_1, 2);
lean_dec(x_13);
x_14 = lean_ctor_get(x_1, 2);
x_14 = lean_ctor_get(x_1, 1);
lean_dec(x_14);
x_15 = lean_ctor_get(x_1, 1);
x_15 = lean_ctor_get(x_1, 0);
lean_dec(x_15);
x_16 = lean_ctor_get(x_1, 0);
lean_dec(x_16);
lean_ctor_set(x_1, 3, x_3);
lean_ctor_set(x_1, 2, x_2);
return x_1;
}
else
{
lean_object* x_17;
lean_object* x_16;
lean_dec(x_1);
x_17 = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(x_17, 0, x_4);
lean_ctor_set(x_17, 1, x_5);
lean_ctor_set(x_17, 2, x_2);
lean_ctor_set(x_17, 3, x_3);
lean_ctor_set_uint8(x_17, sizeof(void*)*4, x_8);
return x_17;
x_16 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_16, 0, x_4);
lean_ctor_set(x_16, 1, x_5);
lean_ctor_set(x_16, 2, x_2);
lean_ctor_set(x_16, 3, x_3);
return x_16;
}
}
else
{
size_t x_18; size_t x_19; uint8_t x_20;
x_18 = lean_ptr_addr(x_3);
x_19 = lean_ptr_addr(x_7);
size_t x_17; size_t x_18; uint8_t x_19;
x_17 = lean_ptr_addr(x_3);
x_18 = lean_ptr_addr(x_7);
lean_dec(x_7);
x_20 = lean_usize_dec_eq(x_18, x_19);
x_19 = lean_usize_dec_eq(x_17, x_18);
if (x_19 == 0)
{
uint8_t x_20;
x_20 = !lean_is_exclusive(x_1);
if (x_20 == 0)
{
uint8_t x_21;
x_21 = !lean_is_exclusive(x_1);
if (x_21 == 0)
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25;
x_22 = lean_ctor_get(x_1, 3);
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24;
x_21 = lean_ctor_get(x_1, 3);
lean_dec(x_21);
x_22 = lean_ctor_get(x_1, 2);
lean_dec(x_22);
x_23 = lean_ctor_get(x_1, 2);
x_23 = lean_ctor_get(x_1, 1);
lean_dec(x_23);
x_24 = lean_ctor_get(x_1, 1);
x_24 = lean_ctor_get(x_1, 0);
lean_dec(x_24);
x_25 = lean_ctor_get(x_1, 0);
lean_dec(x_25);
lean_ctor_set(x_1, 3, x_3);
lean_ctor_set(x_1, 2, x_2);
return x_1;
}
else
{
lean_object* x_26;
lean_object* x_25;
lean_dec(x_1);
x_26 = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(x_26, 0, x_4);
lean_ctor_set(x_26, 1, x_5);
lean_ctor_set(x_26, 2, x_2);
lean_ctor_set(x_26, 3, x_3);
lean_ctor_set_uint8(x_26, sizeof(void*)*4, x_8);
return x_26;
x_25 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_25, 0, x_4);
lean_ctor_set(x_25, 1, x_5);
lean_ctor_set(x_25, 2, x_2);
lean_ctor_set(x_25, 3, x_3);
return x_25;
}
}
else
@ -3245,7 +3260,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l_Lean_Compiler_LCNF_CasesCore_extractAlt_x21___closed__2;
x_3 = lean_unsigned_to_nat(252u);
x_3 = lean_unsigned_to_nat(253u);
x_4 = lean_unsigned_to_nat(4u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -3537,6 +3552,44 @@ x_3 = lean_box(x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_mapCodeM___rarg___lambda__1(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;
x_4 = lean_ctor_get(x_1, 0);
lean_inc(x_4);
lean_dec(x_1);
x_5 = lean_ctor_get(x_4, 1);
lean_inc(x_5);
lean_dec(x_4);
x_6 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltCodeImp(x_2, x_3);
x_7 = lean_apply_2(x_5, lean_box(0), x_6);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_mapCodeM___rarg(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;
x_4 = lean_ctor_get(x_1, 1);
lean_inc(x_4);
x_5 = l_Lean_Compiler_LCNF_AltCore_getCode(x_2);
x_6 = lean_apply_1(x_3, x_5);
x_7 = lean_alloc_closure((void*)(l_Lean_Compiler_LCNF_AltCore_mapCodeM___rarg___lambda__1), 3, 2);
lean_closure_set(x_7, 0, x_1);
lean_closure_set(x_7, 1, x_2);
x_8 = lean_apply_4(x_4, lean_box(0), lean_box(0), x_6, x_7);
return x_8;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_AltCore_mapCodeM(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_Lean_Compiler_LCNF_AltCore_mapCodeM___rarg), 3, 0);
return x_2;
}
}
LEAN_EXPORT uint8_t l_Lean_Compiler_LCNF_Code_isDecl(lean_object* x_1) {
_start:
{
@ -4252,7 +4305,7 @@ x_1 = l_Lean_Compiler_LCNF_instInhabitedDecl___closed__1;
return x_1;
}
}
LEAN_EXPORT uint8_t l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__1(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT uint8_t l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__1(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
@ -4302,7 +4355,7 @@ goto _start;
}
}
}
LEAN_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__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_EXPORT uint8_t l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__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) {
_start:
{
lean_object* x_7; uint8_t x_8;
@ -4321,7 +4374,7 @@ else
lean_object* x_10; lean_object* x_11; uint8_t x_12;
x_10 = lean_array_fget(x_4, x_6);
x_11 = lean_array_fget(x_5, x_6);
x_12 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_42_(x_10, x_11);
x_12 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqParam____x40_Lean_Compiler_LCNF_Basic___hyg_51_(x_10, x_11);
lean_dec(x_11);
lean_dec(x_10);
if (x_12 == 0)
@ -4344,7 +4397,7 @@ goto _start;
}
}
}
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805_(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT uint8_t l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877_(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; uint8_t x_13;
@ -4379,7 +4432,7 @@ return x_14;
else
{
uint8_t x_15;
x_15 = l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__1(x_4, x_9);
x_15 = l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__1(x_4, x_9);
lean_dec(x_4);
if (x_15 == 0)
{
@ -4423,7 +4476,7 @@ else
{
lean_object* x_23; uint8_t x_24;
x_23 = lean_unsigned_to_nat(0u);
x_24 = l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__2(x_6, x_11, lean_box(0), x_6, x_11, x_23);
x_24 = l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__2(x_6, x_11, lean_box(0), x_6, x_11, x_23);
lean_dec(x_6);
if (x_24 == 0)
{
@ -4444,22 +4497,22 @@ return x_26;
}
}
}
LEAN_EXPORT lean_object* l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__1___boxed(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT lean_object* l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__1___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__1(x_1, x_2);
x_3 = l_List_beq___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__1(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__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_EXPORT lean_object* l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__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) {
_start:
{
uint8_t x_7; lean_object* x_8;
x_7 = l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____spec__2(x_1, x_2, x_3, x_4, x_5, x_6);
x_7 = l_Array_isEqvAux___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____spec__2(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_2);
@ -4468,11 +4521,11 @@ x_8 = lean_box(x_7);
return x_8;
}
}
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____boxed(lean_object* x_1, lean_object* x_2) {
LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805_(x_1, x_2);
x_3 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877_(x_1, x_2);
lean_dec(x_2);
x_4 = lean_box(x_3);
return x_4;
@ -4482,7 +4535,7 @@ static lean_object* _init_l_Lean_Compiler_LCNF_instBEqDecl___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2805____boxed), 2, 0);
x_1 = lean_alloc_closure((void*)(l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_beqDecl____x40_Lean_Compiler_LCNF_Basic___hyg_2877____boxed), 2, 0);
return x_1;
}
}
@ -7852,7 +7905,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__1;
x_2 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_collectExpr___closed__1;
x_3 = lean_unsigned_to_nat(380u);
x_3 = lean_unsigned_to_nat(384u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltImp___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

View file

@ -72,7 +72,7 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_mkNewParams(lean_object*, lean_obj
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_bind_go(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Code_bind_go___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_mapMUnsafe_map___at_Lean_Compiler_LCNF_InferType_mkForallParams___spec__1(size_t, size_t, lean_object*);
lean_object* l_Lean_Compiler_LCNF_mkAuxParam(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Compiler_LCNF_mkAuxParam(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_mkNewParams_go___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_mkNewParams_go___closed__1;
static lean_object* l_Lean_Compiler_LCNF_Code_bind_go___closed__3;
@ -1524,7 +1524,7 @@ _start:
{
if (lean_obj_tag(x_1) == 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; lean_object* x_16; lean_object* x_17;
lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_8 = lean_ctor_get(x_1, 1);
lean_inc(x_8);
x_9 = lean_ctor_get(x_1, 2);
@ -1532,49 +1532,50 @@ lean_inc(x_9);
lean_dec(x_1);
x_10 = lean_expr_instantiate_rev(x_8, x_2);
lean_dec(x_8);
x_11 = l_Lean_Compiler_LCNF_mkAuxParam(x_10, x_4, x_5, x_6, x_7);
x_12 = lean_ctor_get(x_11, 0);
lean_inc(x_12);
x_13 = lean_ctor_get(x_11, 1);
x_11 = 0;
x_12 = l_Lean_Compiler_LCNF_mkAuxParam(x_10, x_11, x_4, x_5, x_6, x_7);
x_13 = lean_ctor_get(x_12, 0);
lean_inc(x_13);
lean_dec(x_11);
x_14 = lean_ctor_get(x_12, 0);
x_14 = lean_ctor_get(x_12, 1);
lean_inc(x_14);
x_15 = l_Lean_Expr_fvar___override(x_14);
x_16 = lean_array_push(x_2, x_15);
x_17 = lean_array_push(x_3, x_12);
lean_dec(x_12);
x_15 = lean_ctor_get(x_13, 0);
lean_inc(x_15);
x_16 = l_Lean_Expr_fvar___override(x_15);
x_17 = lean_array_push(x_2, x_16);
x_18 = lean_array_push(x_3, x_13);
x_1 = x_9;
x_2 = x_16;
x_3 = x_17;
x_7 = x_13;
x_2 = x_17;
x_3 = x_18;
x_7 = x_14;
goto _start;
}
else
{
lean_object* x_19; lean_object* x_20; uint8_t x_21;
x_19 = lean_expr_instantiate_rev(x_1, x_2);
lean_object* x_20; lean_object* x_21; uint8_t x_22;
x_20 = lean_expr_instantiate_rev(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
lean_inc(x_19);
x_20 = l_Lean_Expr_headBeta(x_19);
x_21 = lean_expr_eqv(x_20, x_19);
lean_dec(x_19);
if (x_21 == 0)
lean_inc(x_20);
x_21 = l_Lean_Expr_headBeta(x_20);
x_22 = lean_expr_eqv(x_21, x_20);
lean_dec(x_20);
if (x_22 == 0)
{
lean_object* x_22;
x_22 = l_Lean_Compiler_LCNF_mkNewParams_go___closed__1;
x_1 = x_20;
x_2 = x_22;
lean_object* x_23;
x_23 = l_Lean_Compiler_LCNF_mkNewParams_go___closed__1;
x_1 = x_21;
x_2 = x_23;
goto _start;
}
else
{
lean_object* x_24;
lean_dec(x_20);
x_24 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_24, 0, x_3);
lean_ctor_set(x_24, 1, x_7);
return x_24;
lean_object* x_25;
lean_dec(x_21);
x_25 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_25, 0, x_3);
lean_ctor_set(x_25, 1, x_7);
return x_25;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -39,7 +39,7 @@ static lean_object* l_Lean_throwError___at_Lean_Compiler_LCNF_Check_checkFVar___
LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Compiler_LCNF_Check_checkAppArgs___spec__3___lambda__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_EXPORT lean_object* l_Lean_Compiler_LCNF_Check_checkExpr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Compiler_LCNF_Check_checkAppArgs___spec__3___lambda__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*, lean_object*);
uint8_t l_Lean_Expr_erased(lean_object*);
uint8_t l_Lean_Expr_isErased(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_Check_check___closed__2;
static lean_object* l_Std_Range_forIn_loop___at_Lean_Compiler_LCNF_Check_checkAppArgs___spec__3___lambda__5___closed__1;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_checkDeadLocalDecls_visitParams___boxed(lean_object*, lean_object*);
@ -177,6 +177,7 @@ static lean_object* l_Std_Range_forIn_loop___at_Lean_Compiler_LCNF_Check_checkAp
static lean_object* l_Lean_Compiler_LCNF_Check_checkFVar___closed__2;
size_t lean_usize_of_nat(lean_object*);
extern lean_object* l_Lean_NameSet_empty;
uint8_t l_Lean_Compiler_LCNF_maybeTypeFormerType(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Check_checkParam___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_checkDeadLocalDecls(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Array_forInUnsafe_loop___at_Lean_Compiler_LCNF_Check_checkCases___spec__4___lambda__4___closed__3;
@ -260,7 +261,6 @@ static lean_object* l_Lean_Compiler_LCNF_Check_checkJpInScope___closed__4;
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_checkDeadLocalDecls_visitParams___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Check_checkLetDecl___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_EXPORT lean_object* l_Lean_Compiler_LCNF_Check_checkCases(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Compiler_LCNF_isTypeFormerType(lean_object*);
uint8_t l_Lean_NameSet_contains(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_checkDeadLocalDecls_visitParam(lean_object*, lean_object*);
static lean_object* l_Std_Range_forIn_loop___at_Lean_Compiler_LCNF_Check_checkAppArgs___spec__3___closed__2;
@ -893,11 +893,11 @@ x_17 = lean_alloc_closure((void*)(l_Std_Range_forIn_loop___at_Lean_Compiler_LCNF
lean_closure_set(x_17, 0, x_1);
lean_closure_set(x_17, 1, x_2);
lean_closure_set(x_17, 2, x_3);
x_18 = l_Lean_Compiler_LCNF_isTypeFormerType(x_4);
x_18 = l_Lean_Compiler_LCNF_maybeTypeFormerType(x_4);
if (x_18 == 0)
{
uint8_t x_19;
x_19 = l_Lean_Expr_erased(x_4);
x_19 = l_Lean_Expr_isErased(x_4);
lean_dec(x_4);
if (x_19 == 0)
{

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Lean.Compiler.LCNF.Passes
// Imports: Init Lean.Compiler.LCNF.PassManager Lean.Compiler.LCNF.PullLetDecls Lean.Compiler.LCNF.CSE Lean.Compiler.LCNF.Simp Lean.Compiler.LCNF.PullFunDecls Lean.Compiler.LCNF.ReduceJpArity
// Imports: Init Lean.Compiler.LCNF.PassManager Lean.Compiler.LCNF.PullLetDecls Lean.Compiler.LCNF.CSE Lean.Compiler.LCNF.Simp Lean.Compiler.LCNF.PullFunDecls Lean.Compiler.LCNF.ReduceJpArity Lean.Compiler.LCNF.JoinPoints Lean.Compiler.LCNF.Specialize
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -17,11 +17,14 @@ lean_object* lean_mk_empty_array_with_capacity(lean_object*);
lean_object* lean_array_push(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__12;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__8;
extern lean_object* l_Lean_Compiler_LCNF_findJoinPoints;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__6;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__14;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__5;
extern lean_object* l_Lean_Compiler_LCNF_reduceJpArity;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__2;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__1;
extern lean_object* l_Lean_Compiler_LCNF_specialize;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__9;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__4;
extern lean_object* l_Lean_Compiler_LCNF_pullFunDecls;
@ -29,7 +32,8 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_builtin;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__3;
lean_object* l_Lean_Compiler_LCNF_PassInstaller_append___elambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Compiler_LCNF_pullInstances;
lean_object* l_Lean_Compiler_LCNF_simp(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__13;
lean_object* l_Lean_Compiler_LCNF_simp(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__7;
extern lean_object* l_Lean_Compiler_LCNF_cse;
static lean_object* l_Lean_Compiler_LCNF_builtin___closed__11;
@ -51,10 +55,11 @@ return x_3;
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__1;
x_2 = l_Lean_Compiler_LCNF_simp(x_1);
return x_2;
x_2 = lean_unsigned_to_nat(0u);
x_3 = l_Lean_Compiler_LCNF_simp(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__3() {
@ -74,17 +79,18 @@ return x_3;
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__3;
x_2 = l_Lean_Compiler_LCNF_simp(x_1);
return x_2;
x_2 = lean_unsigned_to_nat(1u);
x_3 = l_Lean_Compiler_LCNF_simp(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = lean_unsigned_to_nat(6u);
x_1 = lean_unsigned_to_nat(8u);
x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
@ -134,7 +140,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__9;
x_2 = l_Lean_Compiler_LCNF_reduceJpArity;
x_2 = l_Lean_Compiler_LCNF_findJoinPoints;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -144,7 +150,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__10;
x_2 = l_Lean_Compiler_LCNF_builtin___closed__4;
x_2 = l_Lean_Compiler_LCNF_reduceJpArity;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -152,8 +158,28 @@ return x_3;
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__12() {
_start:
{
lean_object* x_1; lean_object* x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__11;
x_2 = l_Lean_Compiler_LCNF_builtin___closed__4;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__13() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__12;
x_2 = l_Lean_Compiler_LCNF_specialize;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_builtin___closed__14() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__13;
x_2 = lean_alloc_closure((void*)(l_Lean_Compiler_LCNF_PassInstaller_append___elambda__1___boxed), 6, 1);
lean_closure_set(x_2, 0, x_1);
return x_2;
@ -163,7 +189,7 @@ static lean_object* _init_l_Lean_Compiler_LCNF_builtin() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__12;
x_1 = l_Lean_Compiler_LCNF_builtin___closed__14;
return x_1;
}
}
@ -174,6 +200,8 @@ lean_object* initialize_Lean_Compiler_LCNF_CSE(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_Simp(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_PullFunDecls(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_ReduceJpArity(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_JoinPoints(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_Compiler_LCNF_Specialize(uint8_t builtin, lean_object*);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Lean_Compiler_LCNF_Passes(uint8_t builtin, lean_object* w) {
lean_object * res;
@ -200,6 +228,12 @@ lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_ReduceJpArity(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_JoinPoints(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Compiler_LCNF_Specialize(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Compiler_LCNF_builtin___closed__1 = _init_l_Lean_Compiler_LCNF_builtin___closed__1();
lean_mark_persistent(l_Lean_Compiler_LCNF_builtin___closed__1);
l_Lean_Compiler_LCNF_builtin___closed__2 = _init_l_Lean_Compiler_LCNF_builtin___closed__2();
@ -224,6 +258,10 @@ l_Lean_Compiler_LCNF_builtin___closed__11 = _init_l_Lean_Compiler_LCNF_builtin__
lean_mark_persistent(l_Lean_Compiler_LCNF_builtin___closed__11);
l_Lean_Compiler_LCNF_builtin___closed__12 = _init_l_Lean_Compiler_LCNF_builtin___closed__12();
lean_mark_persistent(l_Lean_Compiler_LCNF_builtin___closed__12);
l_Lean_Compiler_LCNF_builtin___closed__13 = _init_l_Lean_Compiler_LCNF_builtin___closed__13();
lean_mark_persistent(l_Lean_Compiler_LCNF_builtin___closed__13);
l_Lean_Compiler_LCNF_builtin___closed__14 = _init_l_Lean_Compiler_LCNF_builtin___closed__14();
lean_mark_persistent(l_Lean_Compiler_LCNF_builtin___closed__14);
l_Lean_Compiler_LCNF_builtin = _init_l_Lean_Compiler_LCNF_builtin();
lean_mark_persistent(l_Lean_Compiler_LCNF_builtin);
return lean_io_result_mk_ok(lean_box(0));

View file

@ -37,6 +37,7 @@ LEAN_EXPORT lean_object* l___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Co
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PP_ppValue(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PP_run(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_PP_ppExpr___closed__6;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PP_ppFVar(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -44,6 +45,7 @@ static lean_object* l_Lean_Compiler_LCNF_PP_ppArg___closed__3;
uint8_t lean_usize_dec_lt(size_t, size_t);
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_prefixJoin___spec__1___rarg___boxed(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_Compiler_LCNF_PP_ppExpr___closed__12;
static lean_object* l_Lean_Compiler_LCNF_PP_ppParam___closed__10;
extern lean_object* l_Lean_levelZero;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PP_run___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PP_ppCode(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -1536,155 +1538,205 @@ lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_PP_ppParam___closed__10() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("@&", 2);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PP_ppParam(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; lean_object* x_8; uint8_t x_9;
x_7 = lean_ctor_get(x_4, 2);
x_8 = l_Lean_Compiler_LCNF_PP_ppParam___closed__1;
x_9 = l_Lean_Option_get___at_Lean_getSanitizeNames___spec__1(x_7, x_8);
if (x_9 == 0)
uint8_t x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10; lean_object* x_11;
x_7 = lean_ctor_get_uint8(x_1, sizeof(void*)*3);
x_8 = lean_ctor_get(x_4, 2);
x_9 = l_Lean_Compiler_LCNF_PP_ppParam___closed__1;
x_10 = l_Lean_Option_get___at_Lean_getSanitizeNames___spec__1(x_8, x_9);
if (x_7 == 0)
{
lean_object* x_10; uint8_t x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
lean_object* x_76;
x_76 = l_Subarray_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_join___spec__1___rarg___closed__1;
x_11 = x_76;
goto block_75;
}
else
{
lean_object* x_77;
x_77 = l_Lean_Compiler_LCNF_PP_ppParam___closed__10;
x_11 = x_77;
goto block_75;
}
block_75:
{
if (x_10 == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21;
lean_dec(x_2);
x_10 = lean_ctor_get(x_1, 1);
lean_inc(x_10);
lean_dec(x_1);
x_11 = 1;
x_12 = l_Lean_Name_toString(x_10, x_11);
x_13 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_13, 0, x_12);
x_14 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_14, 0, x_13);
lean_ctor_set(x_14, 1, x_6);
return x_14;
}
else
{
lean_object* x_15; lean_object* x_16;
x_15 = lean_ctor_get(x_1, 2);
x_12 = l_Subarray_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_join___spec__1___rarg___closed__1;
x_13 = lean_string_append(x_12, x_11);
lean_dec(x_11);
x_14 = lean_string_append(x_13, x_12);
x_15 = lean_ctor_get(x_1, 1);
lean_inc(x_15);
x_16 = l_Lean_Compiler_LCNF_PP_ppExpr(x_15, x_2, x_3, x_4, x_5, x_6);
if (lean_obj_tag(x_16) == 0)
{
uint8_t x_17;
x_17 = !lean_is_exclusive(x_16);
if (x_17 == 0)
{
lean_object* x_18; lean_object* x_19; uint8_t 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; 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; uint8_t x_35; lean_object* x_36;
x_18 = lean_ctor_get(x_16, 0);
x_19 = lean_ctor_get(x_1, 1);
lean_inc(x_19);
lean_dec(x_1);
x_20 = 1;
x_21 = l_Lean_Name_toString(x_19, x_20);
x_22 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_22, 0, x_21);
x_23 = l_Subarray_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_join___spec__1___rarg___closed__2;
x_24 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_24, 0, x_23);
lean_ctor_set(x_24, 1, x_22);
x_25 = l_Lean_Compiler_LCNF_PP_ppParam___closed__3;
x_26 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_26, 0, x_24);
lean_ctor_set(x_26, 1, x_25);
x_27 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_27, 0, x_26);
lean_ctor_set(x_27, 1, x_18);
x_28 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_28, 0, x_27);
lean_ctor_set(x_28, 1, x_23);
x_29 = l_Lean_Compiler_LCNF_PP_ppParam___closed__7;
x_30 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_30, 0, x_29);
lean_ctor_set(x_30, 1, x_28);
x_31 = l_Lean_Compiler_LCNF_PP_ppParam___closed__9;
x_32 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_32, 0, x_30);
lean_ctor_set(x_32, 1, x_31);
x_33 = l_Lean_Compiler_LCNF_PP_ppParam___closed__6;
x_34 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set(x_34, 0, x_33);
lean_ctor_set(x_34, 1, x_32);
x_35 = 0;
x_36 = lean_alloc_ctor(5, 1, 1);
lean_ctor_set(x_36, 0, x_34);
lean_ctor_set_uint8(x_36, sizeof(void*)*1, x_35);
lean_ctor_set(x_16, 0, x_36);
return x_16;
x_16 = 1;
x_17 = l_Lean_Name_toString(x_15, x_16);
x_18 = lean_string_append(x_14, x_17);
lean_dec(x_17);
x_19 = lean_string_append(x_18, x_12);
x_20 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_20, 0, x_19);
x_21 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_21, 0, x_20);
lean_ctor_set(x_21, 1, x_6);
return x_21;
}
else
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; uint8_t 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; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; uint8_t x_55; lean_object* x_56; lean_object* x_57;
x_37 = lean_ctor_get(x_16, 0);
x_38 = lean_ctor_get(x_16, 1);
lean_inc(x_38);
lean_inc(x_37);
lean_dec(x_16);
x_39 = lean_ctor_get(x_1, 1);
lean_inc(x_39);
lean_object* x_22; lean_object* x_23;
x_22 = lean_ctor_get(x_1, 2);
lean_inc(x_22);
x_23 = l_Lean_Compiler_LCNF_PP_ppExpr(x_22, x_2, x_3, x_4, x_5, x_6);
if (lean_obj_tag(x_23) == 0)
{
uint8_t x_24;
x_24 = !lean_is_exclusive(x_23);
if (x_24 == 0)
{
lean_object* x_25; lean_object* x_26; uint8_t 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; 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; uint8_t x_45; lean_object* x_46;
x_25 = lean_ctor_get(x_23, 0);
x_26 = lean_ctor_get(x_1, 1);
lean_inc(x_26);
lean_dec(x_1);
x_40 = 1;
x_41 = l_Lean_Name_toString(x_39, x_40);
x_42 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_42, 0, x_41);
x_43 = l_Subarray_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_join___spec__1___rarg___closed__2;
x_44 = lean_alloc_ctor(4, 2, 0);
x_27 = 1;
x_28 = l_Lean_Name_toString(x_26, x_27);
x_29 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_29, 0, x_28);
x_30 = l_Subarray_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_join___spec__1___rarg___closed__2;
x_31 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_31, 0, x_30);
lean_ctor_set(x_31, 1, x_29);
x_32 = l_Lean_Compiler_LCNF_PP_ppParam___closed__3;
x_33 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set(x_33, 1, x_32);
x_34 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_34, 0, x_11);
x_35 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_35, 0, x_33);
lean_ctor_set(x_35, 1, x_34);
x_36 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_36, 0, x_35);
lean_ctor_set(x_36, 1, x_30);
x_37 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_37, 0, x_36);
lean_ctor_set(x_37, 1, x_25);
x_38 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_38, 0, x_37);
lean_ctor_set(x_38, 1, x_30);
x_39 = l_Lean_Compiler_LCNF_PP_ppParam___closed__7;
x_40 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_40, 0, x_39);
lean_ctor_set(x_40, 1, x_38);
x_41 = l_Lean_Compiler_LCNF_PP_ppParam___closed__9;
x_42 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_42, 0, x_40);
lean_ctor_set(x_42, 1, x_41);
x_43 = l_Lean_Compiler_LCNF_PP_ppParam___closed__6;
x_44 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set(x_44, 0, x_43);
lean_ctor_set(x_44, 1, x_42);
x_45 = l_Lean_Compiler_LCNF_PP_ppParam___closed__3;
x_46 = lean_alloc_ctor(4, 2, 0);
x_45 = 0;
x_46 = lean_alloc_ctor(5, 1, 1);
lean_ctor_set(x_46, 0, x_44);
lean_ctor_set(x_46, 1, x_45);
x_47 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_47, 0, x_46);
lean_ctor_set(x_47, 1, x_37);
x_48 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_48, 0, x_47);
lean_ctor_set(x_48, 1, x_43);
x_49 = l_Lean_Compiler_LCNF_PP_ppParam___closed__7;
x_50 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_50, 0, x_49);
lean_ctor_set(x_50, 1, x_48);
x_51 = l_Lean_Compiler_LCNF_PP_ppParam___closed__9;
x_52 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_52, 0, x_50);
lean_ctor_set(x_52, 1, x_51);
x_53 = l_Lean_Compiler_LCNF_PP_ppParam___closed__6;
x_54 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set_uint8(x_46, sizeof(void*)*1, x_45);
lean_ctor_set(x_23, 0, x_46);
return x_23;
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49; uint8_t x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; uint8_t x_68; lean_object* x_69; lean_object* x_70;
x_47 = lean_ctor_get(x_23, 0);
x_48 = lean_ctor_get(x_23, 1);
lean_inc(x_48);
lean_inc(x_47);
lean_dec(x_23);
x_49 = lean_ctor_get(x_1, 1);
lean_inc(x_49);
lean_dec(x_1);
x_50 = 1;
x_51 = l_Lean_Name_toString(x_49, x_50);
x_52 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_52, 0, x_51);
x_53 = l_Subarray_forInUnsafe_loop___at___private_Lean_Compiler_LCNF_PrettyPrinter_0__Lean_Compiler_LCNF_PP_join___spec__1___rarg___closed__2;
x_54 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_54, 0, x_53);
lean_ctor_set(x_54, 1, x_52);
x_55 = 0;
x_56 = lean_alloc_ctor(5, 1, 1);
x_55 = l_Lean_Compiler_LCNF_PP_ppParam___closed__3;
x_56 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_56, 0, x_54);
lean_ctor_set_uint8(x_56, sizeof(void*)*1, x_55);
x_57 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_57, 0, x_56);
lean_ctor_set(x_57, 1, x_38);
return x_57;
lean_ctor_set(x_56, 1, x_55);
x_57 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_57, 0, x_11);
x_58 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_58, 0, x_56);
lean_ctor_set(x_58, 1, x_57);
x_59 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_59, 0, x_58);
lean_ctor_set(x_59, 1, x_53);
x_60 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_60, 0, x_59);
lean_ctor_set(x_60, 1, x_47);
x_61 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_61, 0, x_60);
lean_ctor_set(x_61, 1, x_53);
x_62 = l_Lean_Compiler_LCNF_PP_ppParam___closed__7;
x_63 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_63, 0, x_62);
lean_ctor_set(x_63, 1, x_61);
x_64 = l_Lean_Compiler_LCNF_PP_ppParam___closed__9;
x_65 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_65, 0, x_63);
lean_ctor_set(x_65, 1, x_64);
x_66 = l_Lean_Compiler_LCNF_PP_ppParam___closed__6;
x_67 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set(x_67, 0, x_66);
lean_ctor_set(x_67, 1, x_65);
x_68 = 0;
x_69 = lean_alloc_ctor(5, 1, 1);
lean_ctor_set(x_69, 0, x_67);
lean_ctor_set_uint8(x_69, sizeof(void*)*1, x_68);
x_70 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_70, 0, x_69);
lean_ctor_set(x_70, 1, x_48);
return x_70;
}
}
else
{
uint8_t x_58;
uint8_t x_71;
lean_dec(x_11);
lean_dec(x_1);
x_58 = !lean_is_exclusive(x_16);
if (x_58 == 0)
x_71 = !lean_is_exclusive(x_23);
if (x_71 == 0)
{
return x_16;
return x_23;
}
else
{
lean_object* x_59; lean_object* x_60; lean_object* x_61;
x_59 = lean_ctor_get(x_16, 0);
x_60 = lean_ctor_get(x_16, 1);
lean_inc(x_60);
lean_inc(x_59);
lean_dec(x_16);
x_61 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_61, 0, x_59);
lean_ctor_set(x_61, 1, x_60);
return x_61;
lean_object* x_72; lean_object* x_73; lean_object* x_74;
x_72 = lean_ctor_get(x_23, 0);
x_73 = lean_ctor_get(x_23, 1);
lean_inc(x_73);
lean_inc(x_72);
lean_dec(x_23);
x_74 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_74, 0, x_72);
lean_ctor_set(x_74, 1, x_73);
return x_74;
}
}
}
}
@ -3663,6 +3715,8 @@ l_Lean_Compiler_LCNF_PP_ppParam___closed__8 = _init_l_Lean_Compiler_LCNF_PP_ppPa
lean_mark_persistent(l_Lean_Compiler_LCNF_PP_ppParam___closed__8);
l_Lean_Compiler_LCNF_PP_ppParam___closed__9 = _init_l_Lean_Compiler_LCNF_PP_ppParam___closed__9();
lean_mark_persistent(l_Lean_Compiler_LCNF_PP_ppParam___closed__9);
l_Lean_Compiler_LCNF_PP_ppParam___closed__10 = _init_l_Lean_Compiler_LCNF_PP_ppParam___closed__10();
lean_mark_persistent(l_Lean_Compiler_LCNF_PP_ppParam___closed__10);
l_Lean_Compiler_LCNF_PP_ppParams___closed__1 = _init_l_Lean_Compiler_LCNF_PP_ppParams___closed__1();
lean_mark_persistent(l_Lean_Compiler_LCNF_PP_ppParams___closed__1);
l_Lean_Compiler_LCNF_PP_ppLetDecl___closed__1 = _init_l_Lean_Compiler_LCNF_PP_ppLetDecl___closed__1();

File diff suppressed because it is too large Load diff

View file

@ -13,8 +13,8 @@
#ifdef __cplusplus
extern "C" {
#endif
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__1;
size_t lean_usize_add(size_t, size_t);
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__1;
lean_object* l_Lean_registerTraceClass(lean_object*, uint8_t, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_withNewScope(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_pullInstances(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -55,13 +55,13 @@ lean_object* lean_array_fget(lean_object*, lean_object*);
lean_object* lean_st_ref_take(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_Context_included___default;
uint8_t l___private_Lean_Compiler_LCNF_DependsOn_0__Lean_Compiler_LCNF_LetDecl_depOn(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__2;
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__2;
static lean_object* l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___closed__1;
lean_object* lean_array_fset(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_PullLetDecls_pullAlt___spec__1(lean_object*, lean_object*, size_t, size_t, lean_object*);
lean_object* lean_st_mk_ref(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_State_toPull___default;
lean_object* l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(lean_object*, lean_object*);
lean_object* l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(lean_object*, lean_object*, uint8_t, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_withParams___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_pullInstances___closed__4;
lean_object* l_Lean_Compiler_LCNF_isClass_x3f(lean_object*, lean_object*, lean_object*, lean_object*);
@ -74,7 +74,7 @@ size_t lean_usize_of_nat(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_withCheckpoint_go(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_PullLetDecls_pullAlt___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_panic___at___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltsImp___spec__1(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346_(lean_object*);
size_t lean_ptr_addr(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_pullInstances___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_withNewScope___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -90,9 +90,9 @@ lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_PullLetDecls_pullAlt___spec__1___at_Lean_Compiler_LCNF_PullLetDecls_pullAlt___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_PullLetDecls_shouldPull___closed__1;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_pullLetDecls___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_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__3;
LEAN_EXPORT lean_object* l_ReaderT_bind___at_Lean_Compiler_LCNF_PullLetDecls_pullDecls___spec__1(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_PullLetDecls_pullAlt___spec__1___at_Lean_Compiler_LCNF_PullLetDecls_pullAlt___spec__2(lean_object*, size_t, size_t, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__3;
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_PullLetDecls_withFVar(lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Compiler_LCNF_PullLetDecls_withParams___spec__1(lean_object*, size_t, size_t, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_BasicAux_0__mapMonoMImp_go___at_Lean_Compiler_LCNF_PullLetDecls_pullDecls___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -1738,7 +1738,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___lambda__1___closed__1;
x_2 = l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___lambda__1___closed__2;
x_3 = lean_unsigned_to_nat(181u);
x_3 = lean_unsigned_to_nat(182u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___lambda__1___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -2458,7 +2458,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___lambda__1___closed__1;
x_2 = l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___lambda__2___closed__1;
x_3 = lean_unsigned_to_nat(150u);
x_3 = lean_unsigned_to_nat(151u);
x_4 = lean_unsigned_to_nat(9u);
x_5 = l_Lean_Compiler_LCNF_PullLetDecls_pullDecls___lambda__1___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -3454,11 +3454,13 @@ return x_1;
static lean_object* _init_l_Lean_Compiler_LCNF_pullInstances___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
lean_object* x_1; lean_object* x_2; uint8_t x_3; lean_object* x_4; lean_object* x_5;
x_1 = l_Lean_Compiler_LCNF_pullInstances___closed__2;
x_2 = l_Lean_Compiler_LCNF_pullInstances___closed__3;
x_3 = l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(x_1, x_2);
return x_3;
x_3 = 0;
x_4 = lean_unsigned_to_nat(0u);
x_5 = l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(x_1, x_2, x_3, x_4);
return x_5;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_pullInstances() {
@ -3469,7 +3471,7 @@ x_1 = l_Lean_Compiler_LCNF_pullInstances___closed__4;
return x_1;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__1() {
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__1() {
_start:
{
lean_object* x_1;
@ -3477,31 +3479,31 @@ x_1 = lean_mk_string_from_bytes("Compiler", 8);
return x_1;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__2() {
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__1;
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__3() {
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__2;
x_1 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__2;
x_2 = l_Lean_Compiler_LCNF_pullInstances___closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346_(lean_object* x_1) {
_start:
{
lean_object* x_2; uint8_t x_3; lean_object* x_4;
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__3;
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__3;
x_3 = 1;
x_4 = l_Lean_registerTraceClass(x_2, x_3, x_1);
return x_4;
@ -3566,13 +3568,13 @@ l_Lean_Compiler_LCNF_pullInstances___closed__4 = _init_l_Lean_Compiler_LCNF_pull
lean_mark_persistent(l_Lean_Compiler_LCNF_pullInstances___closed__4);
l_Lean_Compiler_LCNF_pullInstances = _init_l_Lean_Compiler_LCNF_pullInstances();
lean_mark_persistent(l_Lean_Compiler_LCNF_pullInstances);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__1 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__1();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__1);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__2 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__2();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__2);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__3 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__3();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345____closed__3);
res = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1345_(lean_io_mk_world());
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__1 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__1();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__1);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__2 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__2();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__2);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__3 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__3();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346____closed__3);
res = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_PullLetDecls___hyg_1346_(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));

View file

@ -22,8 +22,8 @@ static lean_object* l_Lean_Compiler_LCNF_reduceJpArity___closed__3;
uint8_t lean_usize_dec_eq(size_t, size_t);
lean_object* lean_array_uget(lean_object*, size_t);
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__2(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__3;
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__2;
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__3;
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__2;
LEAN_EXPORT lean_object* l_Std_RBNode_find___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__6(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_ReduceJpArity_reduce___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*);
@ -32,7 +32,7 @@ lean_object* lean_array_get_size(lean_object*);
LEAN_EXPORT lean_object* l___private_Init_Data_Array_BasicAux_0__mapMonoMImp___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__7___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Compiler_LCNF_Basic_0__Lean_Compiler_LCNF_updateAltCodeImp(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868_(lean_object*);
static lean_object* l_Lean_Compiler_LCNF_ReduceJpArity_reduce___closed__1;
uint8_t lean_usize_dec_lt(size_t, size_t);
lean_object* l_Lean_Compiler_LCNF_Code_inferType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -47,7 +47,7 @@ LEAN_EXPORT lean_object* l___private_Init_Data_Array_BasicAux_0__mapMonoMImp_go_
uint8_t l_Lean_Name_quickCmp(lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_reduceJpArity___closed__1;
static lean_object* l_Lean_Compiler_LCNF_reduceJpArity___closed__2;
lean_object* l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(lean_object*, lean_object*);
lean_object* l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(lean_object*, lean_object*, uint8_t, lean_object*);
lean_object* l_Array_reverse___rarg(lean_object*);
lean_object* l___private_Lean_Compiler_LCNF_CompilerM_0__Lean_Compiler_LCNF_updateFunDeclImp(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_RBNode_ins___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__5(lean_object*, lean_object*, lean_object*);
@ -68,7 +68,7 @@ LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_ReduceJpArity_reduce(lean_object*,
lean_object* l_Lean_Compiler_LCNF_Code_collectUsed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_Decl_reduceJpArity(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__7(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__1;
static lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__1;
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__2___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__3(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_RBNode_findCore___at_Lean_Compiler_LCNF_ReduceJpArity_reduce___spec__1(lean_object* x_1, lean_object* x_2) {
@ -5020,11 +5020,13 @@ return x_1;
static lean_object* _init_l_Lean_Compiler_LCNF_reduceJpArity___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
lean_object* x_1; lean_object* x_2; uint8_t x_3; lean_object* x_4; lean_object* x_5;
x_1 = l_Lean_Compiler_LCNF_reduceJpArity___closed__2;
x_2 = l_Lean_Compiler_LCNF_reduceJpArity___closed__3;
x_3 = l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(x_1, x_2);
return x_3;
x_3 = 0;
x_4 = lean_unsigned_to_nat(0u);
x_5 = l_Lean_Compiler_LCNF_Pass_mkPerDeclaration(x_1, x_2, x_3, x_4);
return x_5;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_reduceJpArity() {
@ -5035,7 +5037,7 @@ x_1 = l_Lean_Compiler_LCNF_reduceJpArity___closed__4;
return x_1;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__1() {
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__1() {
_start:
{
lean_object* x_1;
@ -5043,31 +5045,31 @@ x_1 = lean_mk_string_from_bytes("Compiler", 8);
return x_1;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__2() {
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__1;
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__3() {
static lean_object* _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__2;
x_1 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__2;
x_2 = l_Lean_Compiler_LCNF_reduceJpArity___closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868_(lean_object* x_1) {
_start:
{
lean_object* x_2; uint8_t x_3; lean_object* x_4;
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__3;
x_2 = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__3;
x_3 = 1;
x_4 = l_Lean_registerTraceClass(x_2, x_3, x_1);
return x_4;
@ -5108,13 +5110,13 @@ l_Lean_Compiler_LCNF_reduceJpArity___closed__4 = _init_l_Lean_Compiler_LCNF_redu
lean_mark_persistent(l_Lean_Compiler_LCNF_reduceJpArity___closed__4);
l_Lean_Compiler_LCNF_reduceJpArity = _init_l_Lean_Compiler_LCNF_reduceJpArity();
lean_mark_persistent(l_Lean_Compiler_LCNF_reduceJpArity);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__1 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__1();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__1);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__2 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__2();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__2);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__3 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__3();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867____closed__3);
res = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_867_(lean_io_mk_world());
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__1 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__1();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__1);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__2 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__2();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__2);
l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__3 = _init_l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__3();
lean_mark_persistent(l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868____closed__3);
res = l_Lean_Compiler_LCNF_initFn____x40_Lean_Compiler_LCNF_ReduceJpArity___hyg_868_(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));

File diff suppressed because it is too large Load diff

5852
stage0/stdlib/Lean/Compiler/LCNF/SpecInfo.c generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -608,7 +608,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Array_mapMUnsafe_map___at_Lean_Compiler_LCNF_getCasesInfo_x3f___spec__2___closed__1;
x_2 = l_Array_mapMUnsafe_map___at_Lean_Compiler_LCNF_getCasesInfo_x3f___spec__2___closed__2;
x_3 = lean_unsigned_to_nat(55u);
x_3 = lean_unsigned_to_nat(56u);
x_4 = lean_unsigned_to_nat(48u);
x_5 = l_Array_mapMUnsafe_map___at_Lean_Compiler_LCNF_getCasesInfo_x3f___spec__2___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -1115,7 +1115,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Array_mapMUnsafe_map___at_Lean_Compiler_LCNF_getCasesInfo_x3f___spec__2___closed__1;
x_2 = l_Lean_Compiler_LCNF_isCasesApp_x3f___closed__4;
x_3 = lean_unsigned_to_nat(62u);
x_3 = lean_unsigned_to_nat(63u);
x_4 = lean_unsigned_to_nat(4u);
x_5 = l_Lean_Compiler_LCNF_isCasesApp_x3f___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

View file

@ -13,10 +13,10 @@
#ifdef __cplusplus
extern "C" {
#endif
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__4;
lean_object* lean_string_push(lean_object*, uint32_t);
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_consumeSpaces___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1;
LEAN_EXPORT lean_object* l_Lean_addMainModuleDoc(lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__2;
static lean_object* l_Lean_addMainModuleDoc___closed__1;
lean_object* l_Lean_stringToMessageData(lean_object*);
extern lean_object* l_String_instInhabitedString;
@ -25,13 +25,15 @@ lean_object* l_Lean_Name_str___override(lean_object*, lean_object*);
lean_object* l_Lean_PersistentEnvExtension_getModuleEntries___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addDocString_x27___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_getDocStringText___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__2;
extern lean_object* l_Std_Format_defWidth;
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_docStringExt;
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces_consumeSpaces(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__1;
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___boxed(lean_object*);
static lean_object* l_Lean_TSyntax_getDocString___closed__3;
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_findNextLine(lean_object*, lean_object*);
lean_object* lean_st_ref_get(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces(lean_object*, lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* lean_string_utf8_extract(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_addDocString___rarg(lean_object*, lean_object*, lean_object*);
uint8_t l_String_Iterator_atEnd(lean_object*);
@ -42,22 +44,24 @@ lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg(lean_object*, le
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_findLeadingSpacesSize(lean_object*);
LEAN_EXPORT lean_object* l_Lean_addDocString(lean_object*);
lean_object* l_Lean_MapDeclarationExtension_find_x3f___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__5;
LEAN_EXPORT lean_object* l_Lean_getDocStringText(lean_object*);
lean_object* l_Lean_MapDeclarationExtension_insert___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* lean_st_ref_take(lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_panic___at_Lean_TSyntax_getString___spec__1(lean_object*);
uint8_t l_Lean_Name_quickCmp(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_removeLeadingSpaces(lean_object*);
lean_object* l_Lean_mkMapDeclarationExtension___rarg(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1(lean_object*);
lean_object* l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(lean_object*, lean_object*, lean_object*);
lean_object* lean_st_mk_ref(lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__6;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__3;
lean_object* lean_format_pretty(lean_object*, lean_object*);
static lean_object* l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces___closed__1;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__5;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_44____closed__2;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__2;
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces_saveLine(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Util_0__mkPanicMessageWithDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_consumeSpaces(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_String_Iterator_find___at___private_Lean_DocString_0__Lean_findLeadingSpacesSize___spec__1(lean_object*);
lean_object* l_String_Iterator_next(lean_object*);
@ -69,40 +73,46 @@ lean_object* l_Lean_PersistentEnvExtension_addEntry___rarg(lean_object*, lean_ob
lean_object* l_Lean_SimplePersistentEnvExtension_getState___rarg(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_getDocStringText___rarg___closed__3;
LEAN_EXPORT lean_object* l_Lean_getDocStringText___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__3;
LEAN_EXPORT lean_object* l_Lean_getMainModuleDoc___boxed(lean_object*);
uint8_t lean_uint32_dec_eq(uint32_t, uint32_t);
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_removeLeadingSpaces(lean_object*);
static lean_object* l_Lean_addDocString___rarg___lambda__1___closed__1;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__6;
static lean_object* l_Lean_getMainModuleDoc___closed__1;
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_moduleDocExt;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_44____closed__1;
lean_object* lean_list_to_array(lean_object*, lean_object*);
static lean_object* l_Lean_getDocStringText___rarg___closed__2;
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___boxed(lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1;
uint32_t l_String_Iterator_curr(lean_object*);
LEAN_EXPORT lean_object* l_Lean_findDocString_x3f(lean_object*, lean_object*, uint8_t, lean_object*);
LEAN_EXPORT lean_object* l_Lean_TSyntax_getDocString(lean_object*);
LEAN_EXPORT lean_object* l_Lean_getModuleDoc_x3f(lean_object*, lean_object*);
static lean_object* l_Lean_getDocStringText___rarg___closed__1;
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1(lean_object*);
LEAN_EXPORT lean_object* l_Lean_addDocString_x27(lean_object*);
lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578_(lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__3;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__2;
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__1;
static lean_object* l_Lean_TSyntax_getDocString___closed__2;
static lean_object* l_Lean_TSyntax_getDocString___closed__1;
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_4_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_44_(lean_object*);
LEAN_EXPORT lean_object* l_Std_RBNode_find___at_Lean_findDocString_x3f___spec__1(lean_object*, lean_object*);
lean_object* lean_string_length(lean_object*);
lean_object* l_Lean_indentD(lean_object*);
LEAN_EXPORT lean_object* l_Lean_addBuiltinDocString(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__4;
lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__3;
LEAN_EXPORT lean_object* l_Lean_TSyntax_getDocString___boxed(lean_object*);
lean_object* l_Nat_min(lean_object*, lean_object*);
lean_object* l_Lean_Environment_getModuleIdx_x3f(lean_object*, lean_object*);
static lean_object* l_Lean_addBuiltinDocString___closed__1;
lean_object* l_Lean_Syntax_formatStxAux(lean_object*, uint8_t, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_RBNode_find___at_Lean_findDocString_x3f___spec__1___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_builtinDocStrings;
LEAN_EXPORT lean_object* l_String_Iterator_foldUntil___at___private_Lean_DocString_0__Lean_findLeadingSpacesSize___spec__2(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_getModuleDoc_x3f___boxed(lean_object*, lean_object*);
static lean_object* l_Lean_getModuleDoc_x3f___closed__1;
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_4_(lean_object* x_1) {
@ -177,23 +187,26 @@ x_8 = 9;
x_9 = lean_uint32_dec_eq(x_5, x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_10 = l_String_Iterator_next(x_1);
x_11 = l_Nat_min(x_2, x_3);
uint32_t x_10; uint8_t x_11;
x_10 = 10;
x_11 = lean_uint32_dec_eq(x_5, x_10);
if (x_11 == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_12 = l_String_Iterator_next(x_1);
x_13 = l_Nat_min(x_2, x_3);
lean_dec(x_3);
lean_dec(x_2);
x_12 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_findNextLine(x_10, x_11);
return x_12;
x_14 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_findNextLine(x_12, x_13);
return x_14;
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15;
x_13 = l_String_Iterator_next(x_1);
x_14 = lean_unsigned_to_nat(1u);
x_15 = lean_nat_add(x_2, x_14);
lean_object* x_15; lean_object* x_16;
lean_dec(x_2);
x_1 = x_13;
x_2 = x_15;
goto _start;
x_15 = l_String_Iterator_next(x_1);
x_16 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_findNextLine(x_15, x_3);
return x_16;
}
}
else
@ -210,9 +223,20 @@ goto _start;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = l_String_Iterator_next(x_1);
x_22 = lean_unsigned_to_nat(1u);
x_23 = lean_nat_add(x_2, x_22);
lean_dec(x_2);
x_1 = x_21;
x_2 = x_23;
goto _start;
}
}
else
{
lean_dec(x_2);
lean_dec(x_1);
lean_inc(x_3);
return x_3;
}
}
@ -241,7 +265,6 @@ lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_9 = l_String_Iterator_next(x_1);
x_10 = lean_unsigned_to_nat(0u);
x_11 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_consumeSpaces(x_9, x_10, x_2);
lean_dec(x_2);
return x_11;
}
}
@ -252,15 +275,6 @@ return x_2;
}
}
}
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_consumeSpaces___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_consumeSpaces(x_1, x_2, x_3);
lean_dec(x_3);
return x_4;
}
}
LEAN_EXPORT lean_object* l_String_Iterator_find___at___private_Lean_DocString_0__Lean_findLeadingSpacesSize___spec__1(lean_object* x_1) {
_start:
{
@ -290,82 +304,21 @@ return x_1;
}
}
}
LEAN_EXPORT lean_object* l_String_Iterator_foldUntil___at___private_Lean_DocString_0__Lean_findLeadingSpacesSize___spec__2(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3;
x_3 = l_String_Iterator_atEnd(x_1);
if (x_3 == 0)
{
uint32_t x_4; uint32_t x_5; uint8_t x_6;
x_4 = l_String_Iterator_curr(x_1);
x_5 = 32;
x_6 = lean_uint32_dec_eq(x_4, x_5);
if (x_6 == 0)
{
uint32_t x_7; uint8_t x_8;
x_7 = 9;
x_8 = lean_uint32_dec_eq(x_4, x_7);
if (x_8 == 0)
{
lean_object* x_9;
x_9 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_9, 0, x_2);
lean_ctor_set(x_9, 1, x_1);
return x_9;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_10 = lean_unsigned_to_nat(1u);
x_11 = lean_nat_add(x_2, x_10);
lean_dec(x_2);
x_12 = l_String_Iterator_next(x_1);
x_1 = x_12;
x_2 = x_11;
goto _start;
}
}
else
{
lean_object* x_14; lean_object* x_15; lean_object* x_16;
x_14 = lean_unsigned_to_nat(1u);
x_15 = lean_nat_add(x_2, x_14);
lean_dec(x_2);
x_16 = l_String_Iterator_next(x_1);
x_1 = x_16;
x_2 = x_15;
goto _start;
}
}
else
{
lean_object* x_18;
x_18 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_18, 0, x_2);
lean_ctor_set(x_18, 1, x_1);
return x_18;
}
}
}
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_findLeadingSpacesSize(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; lean_object* x_9;
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_2 = lean_unsigned_to_nat(0u);
lean_inc(x_1);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
x_4 = l_String_Iterator_find___at___private_Lean_DocString_0__Lean_findLeadingSpacesSize___spec__1(x_3);
x_5 = l_String_Iterator_next(x_4);
x_6 = l_String_Iterator_foldUntil___at___private_Lean_DocString_0__Lean_findLeadingSpacesSize___spec__2(x_5, x_2);
x_7 = lean_ctor_get(x_6, 0);
lean_inc(x_7);
x_8 = lean_ctor_get(x_6, 1);
lean_inc(x_8);
lean_dec(x_6);
x_9 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_findNextLine(x_8, x_7);
return x_9;
x_6 = lean_string_length(x_1);
lean_dec(x_1);
x_7 = l___private_Lean_DocString_0__Lean_findLeadingSpacesSize_consumeSpaces(x_5, x_2, x_6);
return x_7;
}
}
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces_consumeSpaces(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
@ -494,7 +447,7 @@ x_6 = l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces_consumeSpaces(x_
return x_6;
}
}
LEAN_EXPORT lean_object* l___private_Lean_DocString_0__Lean_removeLeadingSpaces(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_removeLeadingSpaces(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; uint8_t x_4;
@ -534,7 +487,7 @@ lean_inc(x_6);
x_7 = lean_ctor_get(x_5, 1);
lean_inc(x_7);
lean_dec(x_5);
x_8 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_8 = l_Lean_removeLeadingSpaces(x_2);
x_9 = l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(x_6, x_1, x_8);
x_10 = lean_st_ref_set(x_4, x_9, x_7);
x_11 = !lean_is_exclusive(x_10);
@ -569,7 +522,7 @@ LEAN_EXPORT lean_object* l_Lean_addDocString___rarg___lambda__1(lean_object* x_1
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_1);
x_4 = l_Lean_removeLeadingSpaces(x_1);
x_5 = l_Lean_addDocString___rarg___lambda__1___closed__1;
x_6 = l_Lean_MapDeclarationExtension_insert___rarg(x_5, x_3, x_2, x_4);
return x_6;
@ -778,7 +731,7 @@ x_6 = l_Lean_findDocString_x3f(x_1, x_2, x_5, x_4);
return x_6;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2;
@ -787,23 +740,23 @@ x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__2() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1;
x_1 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__3() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__3() {
_start:
{
size_t x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_1 = 5;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__2;
x_3 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__2;
x_3 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1;
x_4 = lean_unsigned_to_nat(0u);
x_5 = lean_alloc_ctor(0, 4, sizeof(size_t)*1);
lean_ctor_set(x_5, 0, x_2);
@ -814,15 +767,15 @@ lean_ctor_set_usize(x_5, 4, x_1);
return x_5;
}
}
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__3;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__3;
return x_2;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__1() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__1() {
_start:
{
lean_object* x_1;
@ -830,17 +783,17 @@ x_1 = lean_mk_string_from_bytes("moduleDocExt", 12);
return x_1;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__2() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__1;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__3() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__3() {
_start:
{
lean_object* x_1;
@ -849,7 +802,7 @@ lean_closure_set(x_1, 0, lean_box(0));
return x_1;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__4() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__4() {
_start:
{
lean_object* x_1;
@ -857,22 +810,22 @@ x_1 = lean_alloc_closure((void*)(l_Std_PersistentArray_push___rarg), 2, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__5() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__5() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___boxed), 1, 0);
x_1 = lean_alloc_closure((void*)(l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___boxed), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__6() {
static lean_object* _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____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_initFn____x40_Lean_DocString___hyg_1578____closed__2;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__4;
x_3 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__5;
x_4 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__3;
x_1 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__2;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__4;
x_3 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__5;
x_4 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____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);
@ -881,20 +834,20 @@ lean_ctor_set(x_5, 3, x_4);
return x_5;
}
}
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__6;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__6;
x_3 = l_Lean_registerSimplePersistentEnvExtension___rarg(x_2, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___boxed(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1(x_1);
x_2 = l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1(x_1);
lean_dec(x_1);
return x_2;
}
@ -1100,6 +1053,94 @@ lean_dec(x_3);
return x_5;
}
}
static lean_object* _init_l_Lean_TSyntax_getDocString___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("unexpected doc string\n", 22);
return x_1;
}
}
static lean_object* _init_l_Lean_TSyntax_getDocString___closed__2() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("Lean.DocString", 14);
return x_1;
}
}
static lean_object* _init_l_Lean_TSyntax_getDocString___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("Lean.TSyntax.getDocString", 25);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lean_TSyntax_getDocString(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = lean_unsigned_to_nat(1u);
x_3 = l_Lean_Syntax_getArg(x_1, x_2);
switch (lean_obj_tag(x_3)) {
case 0:
{
lean_object* x_4;
x_4 = l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces___closed__1;
return x_4;
}
case 2:
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
x_5 = lean_ctor_get(x_3, 1);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_string_utf8_byte_size(x_5);
x_7 = lean_unsigned_to_nat(2u);
x_8 = lean_nat_sub(x_6, x_7);
lean_dec(x_6);
x_9 = lean_unsigned_to_nat(0u);
x_10 = lean_string_utf8_extract(x_5, x_9, x_8);
lean_dec(x_8);
lean_dec(x_5);
return x_10;
}
default:
{
lean_object* x_11; uint8_t x_12; lean_object* x_13; 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; lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_11 = lean_box(0);
x_12 = 0;
x_13 = lean_unsigned_to_nat(0u);
x_14 = l_Lean_Syntax_formatStxAux(x_11, x_12, x_13, x_3);
x_15 = l_Std_Format_defWidth;
x_16 = lean_format_pretty(x_14, x_15);
x_17 = l_Lean_TSyntax_getDocString___closed__1;
x_18 = lean_string_append(x_17, x_16);
lean_dec(x_16);
x_19 = l___private_Lean_DocString_0__Lean_removeNumLeadingSpaces___closed__1;
x_20 = lean_string_append(x_18, x_19);
x_21 = l_Lean_TSyntax_getDocString___closed__2;
x_22 = l_Lean_TSyntax_getDocString___closed__3;
x_23 = lean_unsigned_to_nat(99u);
x_24 = lean_unsigned_to_nat(25u);
x_25 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_21, x_22, x_23, x_24, x_20);
lean_dec(x_20);
x_26 = l_panic___at_Lean_TSyntax_getString___spec__1(x_25);
return x_26;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_TSyntax_getDocString___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_TSyntax_getDocString(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* initialize_Init(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_DeclarationRange(uint8_t builtin, lean_object*);
lean_object* initialize_Lean_MonadEnv(uint8_t builtin, lean_object*);
@ -1137,25 +1178,25 @@ l_Lean_addBuiltinDocString___closed__1 = _init_l_Lean_addBuiltinDocString___clos
lean_mark_persistent(l_Lean_addBuiltinDocString___closed__1);
l_Lean_addDocString___rarg___lambda__1___closed__1 = _init_l_Lean_addDocString___rarg___lambda__1___closed__1();
lean_mark_persistent(l_Lean_addDocString___rarg___lambda__1___closed__1);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__1);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__2 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__2();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__2);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__3 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__3();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____lambda__1___closed__3);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__1 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__1();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__1);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__2 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__2();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__2);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__3 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__3();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__3);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__4 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__4();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__4);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__5 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__5();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__5);
l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__6 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__6();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1578____closed__6);
if (builtin) {res = l_Lean_initFn____x40_Lean_DocString___hyg_1578_(lean_io_mk_world());
l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__1);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__2 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__2();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__2);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__3 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__3();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____lambda__1___closed__3);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__1 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__1();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__1);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__2 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__2();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__2);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__3 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__3();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__3);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__4 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__4();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__4);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__5 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__5();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__5);
l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__6 = _init_l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__6();
lean_mark_persistent(l_Lean_initFn____x40_Lean_DocString___hyg_1650____closed__6);
if (builtin) {res = l_Lean_initFn____x40_Lean_DocString___hyg_1650_(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
l___private_Lean_DocString_0__Lean_moduleDocExt = lean_io_result_get_value(res);
lean_mark_persistent(l___private_Lean_DocString_0__Lean_moduleDocExt);
@ -1172,6 +1213,12 @@ l_Lean_getDocStringText___rarg___closed__2 = _init_l_Lean_getDocStringText___rar
lean_mark_persistent(l_Lean_getDocStringText___rarg___closed__2);
l_Lean_getDocStringText___rarg___closed__3 = _init_l_Lean_getDocStringText___rarg___closed__3();
lean_mark_persistent(l_Lean_getDocStringText___rarg___closed__3);
l_Lean_TSyntax_getDocString___closed__1 = _init_l_Lean_TSyntax_getDocString___closed__1();
lean_mark_persistent(l_Lean_TSyntax_getDocString___closed__1);
l_Lean_TSyntax_getDocString___closed__2 = _init_l_Lean_TSyntax_getDocString___closed__2();
lean_mark_persistent(l_Lean_TSyntax_getDocString___closed__2);
l_Lean_TSyntax_getDocString___closed__3 = _init_l_Lean_TSyntax_getDocString___closed__3();
lean_mark_persistent(l_Lean_TSyntax_getDocString___closed__3);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus

View file

@ -183,6 +183,7 @@ static lean_object* l___regBuiltin_Lean_Elab_Command_elabCheck_declRange___close
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabVariable(lean_object*);
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabSection(lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_elabChoice_declRange___closed__3;
LEAN_EXPORT lean_object* l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_addConstInfo___at_Lean_Elab_Command_elabAddDeclDoc___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at___aux__Init__Notation______macroRules__precMax__1___spec__1(lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_elabOpen_declRange___closed__3;
@ -209,7 +210,9 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabSynth___lambda__1(lean_object*,
static lean_object* l_Lean_Elab_Command_elabModuleDoc___closed__1;
static lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_BuiltinCommand_0__Lean_Elab_Command_replaceBinderAnnotation___spec__5___closed__11;
lean_object* l_Lean_MessageData_ofList(lean_object*);
static lean_object* l_Lean_Elab_Command_elabUniverse___closed__1;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabChoice___closed__5;
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Elab_Open_0__Lean_Elab_OpenDecl_resolveNameUsingNamespacesCore___at_Lean_Elab_Command_elabExport___spec__5___lambda__1___closed__4;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabSynth___closed__5;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4(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*);
@ -268,7 +271,6 @@ LEAN_EXPORT lean_object* l_Lean_Elab_OpenDecl_elabOpenDecl___at_Lean_Elab_Comman
static lean_object* l___regBuiltin_Lean_Elab_Command_elabVariable_declRange___closed__6;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabAddDeclDoc_declRange___closed__4;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___at_Lean_Elab_Command_elabUniverse___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__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*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Elab_BuiltinCommand_0__Lean_Elab_Command_mkRunMetaEval___lambda__1___closed__1;
lean_object* lean_nat_add(lean_object*, lean_object*);
@ -359,6 +361,7 @@ static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__24;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabEvalUnsafe(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_elabInitQuot_declRange___closed__2;
static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__20;
LEAN_EXPORT lean_object* l_Lean_Syntax_foldArgsM___at_Lean_Elab_Command_elabUniverse___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Command_elabExport___spec__19___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_elabNamespace_declRange___closed__2;
lean_object* l_Lean_Syntax_isStrLit_x3f(lean_object*);
@ -429,6 +432,7 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabSetOption_declRang
static lean_object* l___regBuiltin_Lean_Elab_Command_elabNonComputableSection_declRange___closed__7;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabModuleDoc___closed__9;
static lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_BuiltinCommand_0__Lean_Elab_Command_replaceBinderAnnotation___spec__5___closed__2;
LEAN_EXPORT lean_object* l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_expandInCmd___closed__2;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabCheck___closed__2;
LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at___private_Lean_Elab_BuiltinCommand_0__Lean_Elab_Command_replaceBinderAnnotation___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
@ -452,13 +456,13 @@ static lean_object* l___regBuiltin_Lean_Elab_Command_elabEnd_declRange___closed_
static lean_object* l___regBuiltin_Lean_Elab_Command_elabInitQuot_declRange___closed__4;
static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__13;
lean_object* l_Lean_Elab_Command_getBracketedBinderIds(lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_format_pretty(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Command_elabEnd___spec__3___closed__1;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabModuleDoc___closed__3;
static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__21;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabModuleDoc___closed__11;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabNamespace___closed__2;
LEAN_EXPORT lean_object* l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__7(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_Elab_Command_runTermElabM___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabVariable___spec__5(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*);
@ -505,6 +509,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabChoice(lean_object*, lean_objec
static lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Command_elabExport___spec__10___closed__2;
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Command_elabExport___spec__13(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_elabEnd___closed__4;
lean_object* l_Lean_Elab_Command_addUnivLevel___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_forIn_loop___at_Lean_Elab_Command_elabOpen___spec__18___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabNamespace_declRange(lean_object*);
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabInitQuot(lean_object*);
@ -604,6 +609,7 @@ static lean_object* l___regBuiltin_Lean_Elab_Command_elabAddDeclDoc_declRange___
LEAN_EXPORT lean_object* l_Lean_MonadQuotation_addMacroScope___at_Lean_Elab_Command_elabVariable___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Command_elabExport___spec__19(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Command_elabExport___spec__10___closed__3;
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__3(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_elabSetOption___at_Lean_Elab_Command_elabSetOption___spec__1___closed__4;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabInitQuot___closed__5;
LEAN_EXPORT lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Command_elabAddDeclDoc___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
@ -611,7 +617,6 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Command_elabExport_declRange(l
static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__31;
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabOpen___spec__11___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_getDocStringText___at_Lean_Elab_Command_elabAddDeclDoc___spec__13___closed__2;
lean_object* l_Lean_Elab_Command_addUnivLevel(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Command_elabSection_declRange___closed__4;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabUniverse_declRange___closed__2;
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Command_elabOpen___spec__8___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -843,7 +848,6 @@ static lean_object* l___regBuiltin_Lean_Elab_Command_elabSynth_declRange___close
lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__2;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabReduce_declRange___closed__1;
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_BuiltinCommand_0__Lean_Elab_Command_checkEndHeader___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabSynth___lambda__2___boxed(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_elabEvalUnsafe___closed__5;
@ -910,7 +914,6 @@ lean_object* l_Lean_Elab_logException___at_Lean_Elab_Command_elabCommand___spec_
lean_object* l_Lean_indentExpr(lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_BuiltinCommand_0__Lean_Elab_Command_addScope___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_setEnv___at_Lean_Elab_Command_elabInitQuot___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___at_Lean_Elab_Command_elabUniverse___spec__2(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___closed__17;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabOpen_declRange___closed__7;
static lean_object* l___regBuiltin_Lean_Elab_Command_elabSynth_declRange___closed__1;
@ -5000,7 +5003,7 @@ x_4 = l_Lean_addBuiltinDeclarationRanges(x_2, x_3, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__3(lean_object* x_1, lean_object* x_2, size_t x_3, size_t x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
uint8_t x_9;
@ -5067,126 +5070,98 @@ return x_21;
}
}
}
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___at_Lean_Elab_Command_elabUniverse___spec__2(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
LEAN_EXPORT lean_object* l_Lean_Syntax_foldArgsM___at_Lean_Elab_Command_elabUniverse___spec__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) {
_start:
{
uint8_t x_8;
x_8 = lean_usize_dec_eq(x_2, x_3);
if (x_8 == 0)
{
lean_object* x_9; lean_object* x_10;
lean_dec(x_4);
x_9 = lean_array_uget(x_1, x_2);
lean_inc(x_5);
x_10 = l_Lean_Elab_Command_addUnivLevel(x_9, x_5, x_6, x_7);
if (lean_obj_tag(x_10) == 0)
{
lean_object* x_11; lean_object* x_12; size_t x_13; size_t x_14;
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);
x_13 = 1;
x_14 = lean_usize_add(x_2, x_13);
x_2 = x_14;
x_4 = x_11;
x_7 = x_12;
goto _start;
}
else
{
uint8_t x_16;
lean_dec(x_5);
x_16 = !lean_is_exclusive(x_10);
if (x_16 == 0)
{
return x_10;
}
else
{
lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_17 = lean_ctor_get(x_10, 0);
x_18 = lean_ctor_get(x_10, 1);
lean_inc(x_18);
lean_inc(x_17);
lean_dec(x_10);
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;
}
}
}
else
{
lean_object* x_20;
lean_dec(x_5);
x_20 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_20, 0, x_4);
lean_ctor_set(x_20, 1, x_7);
return x_20;
}
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabUniverse(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; lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10;
x_5 = lean_unsigned_to_nat(1u);
x_6 = l_Lean_Syntax_getArg(x_1, x_5);
lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10;
x_7 = l_Lean_Syntax_getArgs(x_1);
lean_dec(x_1);
x_7 = l_Lean_Syntax_getArgs(x_6);
lean_dec(x_6);
x_8 = lean_array_get_size(x_7);
x_9 = lean_unsigned_to_nat(0u);
x_10 = lean_nat_dec_lt(x_9, x_8);
if (x_10 == 0)
{
lean_object* x_11; lean_object* x_12;
lean_object* x_11;
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_3);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_2);
x_11 = lean_box(0);
x_12 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_12, 0, x_11);
lean_ctor_set(x_12, 1, x_4);
return x_12;
x_11 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_11, 0, x_3);
lean_ctor_set(x_11, 1, x_6);
return x_11;
}
else
{
uint8_t x_13;
x_13 = lean_nat_dec_le(x_8, x_8);
if (x_13 == 0)
uint8_t x_12;
x_12 = lean_nat_dec_le(x_8, x_8);
if (x_12 == 0)
{
lean_object* x_14; lean_object* x_15;
lean_object* x_13;
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_3);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_2);
x_14 = lean_box(0);
x_15 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_15, 0, x_14);
lean_ctor_set(x_15, 1, x_4);
return x_15;
x_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_3);
lean_ctor_set(x_13, 1, x_6);
return x_13;
}
else
{
size_t x_16; size_t x_17; lean_object* x_18; lean_object* x_19;
x_16 = 0;
x_17 = lean_usize_of_nat(x_8);
size_t x_14; size_t x_15; lean_object* x_16;
x_14 = 0;
x_15 = lean_usize_of_nat(x_8);
lean_dec(x_8);
x_18 = lean_box(0);
x_19 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___at_Lean_Elab_Command_elabUniverse___spec__2(x_7, x_16, x_17, x_18, x_2, x_3, x_4);
lean_dec(x_3);
x_16 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__3(x_2, x_7, x_14, x_15, x_3, x_4, x_5, x_6);
lean_dec(x_7);
return x_19;
return x_16;
}
}
}
}
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__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) {
LEAN_EXPORT lean_object* l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1___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) {
_start:
{
lean_object* x_7;
x_7 = lean_apply_4(x_1, x_2, x_4, x_5, x_6);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__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;
x_6 = lean_alloc_closure((void*)(l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1___lambda__1___boxed), 6, 1);
lean_closure_set(x_6, 0, x_2);
x_7 = lean_box(0);
x_8 = l_Lean_Syntax_foldArgsM___at_Lean_Elab_Command_elabUniverse___spec__2(x_1, x_6, x_7, x_3, x_4, x_5);
return x_8;
}
}
static lean_object* _init_l_Lean_Elab_Command_elabUniverse___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_addUnivLevel___boxed), 4, 0);
return x_1;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Command_elabUniverse(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; lean_object* x_7; lean_object* x_8;
x_5 = lean_unsigned_to_nat(1u);
x_6 = l_Lean_Syntax_getArg(x_1, x_5);
lean_dec(x_1);
x_7 = l_Lean_Elab_Command_elabUniverse___closed__1;
x_8 = l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1(x_6, x_7, x_2, x_3, x_4);
return x_8;
}
}
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__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) {
_start:
{
size_t x_9; size_t x_10; lean_object* x_11;
@ -5194,23 +5169,18 @@ x_9 = lean_unbox_usize(x_3);
lean_dec(x_3);
x_10 = lean_unbox_usize(x_4);
lean_dec(x_4);
x_11 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1(x_1, x_2, x_9, x_10, x_5, x_6, x_7, x_8);
x_11 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__3(x_1, x_2, x_9, x_10, x_5, x_6, x_7, x_8);
lean_dec(x_2);
return x_11;
}
}
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___at_Lean_Elab_Command_elabUniverse___spec__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_EXPORT lean_object* l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1___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) {
_start:
{
size_t x_8; size_t x_9; lean_object* x_10;
x_8 = lean_unbox_usize(x_2);
lean_dec(x_2);
x_9 = lean_unbox_usize(x_3);
lean_object* x_7;
x_7 = l_Lean_Syntax_forArgsM___at_Lean_Elab_Command_elabUniverse___spec__1___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_3);
x_10 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Command_elabUniverse___spec__1___at_Lean_Elab_Command_elabUniverse___spec__2(x_1, x_8, x_9, x_4, x_5, x_6, x_7);
lean_dec(x_6);
lean_dec(x_1);
return x_10;
return x_7;
}
}
static lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabUniverse___closed__1() {
@ -25791,6 +25761,8 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabChoice_declRange___clo
res = l___regBuiltin_Lean_Elab_Command_elabChoice_declRange(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Elab_Command_elabUniverse___closed__1 = _init_l_Lean_Elab_Command_elabUniverse___closed__1();
lean_mark_persistent(l_Lean_Elab_Command_elabUniverse___closed__1);
l___regBuiltin_Lean_Elab_Command_elabUniverse___closed__1 = _init_l___regBuiltin_Lean_Elab_Command_elabUniverse___closed__1();
lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabUniverse___closed__1);
l___regBuiltin_Lean_Elab_Command_elabUniverse___closed__2 = _init_l___regBuiltin_Lean_Elab_Command_elabUniverse___closed__2();

View file

@ -552,6 +552,7 @@ static lean_object* l___regBuiltin_Lean_Elab_Term_elabTrailingParserMacro_declRa
static lean_object* l_Lean_Elab_Term_elabSorry___closed__8;
static lean_object* l___regBuiltin_Lean_Elab_Term_elabPanic_declRange___closed__5;
static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Term_elabAnonymousCtor___spec__1___closed__3;
uint8_t l_Lean_Expr_hasMVar(lean_object*);
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Term_elabAnonymousCtor___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Term_elabSorry_declRange___closed__6;
static lean_object* l___private_Lean_Elab_BuiltinNotation_0__Lean_Elab_Term_elabTParserMacroAux___closed__5;
@ -17992,15 +17993,163 @@ return x_74;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_elabSubst___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* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) {
_start:
{
lean_object* x_15; lean_object* x_16;
x_15 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabSubst___lambda__4), 13, 5);
lean_closure_set(x_15, 0, x_1);
lean_closure_set(x_15, 1, x_2);
lean_closure_set(x_15, 2, x_7);
lean_closure_set(x_15, 3, x_3);
lean_closure_set(x_15, 4, x_4);
x_16 = l___private_Lean_Elab_BuiltinNotation_0__Lean_Elab_Term_withLocalIdentFor(x_5, x_6, x_15, x_8, x_9, x_10, x_11, x_12, x_13, x_14);
return x_16;
lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18;
x_15 = l_Lean_instantiateMVars___at_Lean_Elab_Term_MVarErrorInfo_logError___spec__1(x_1, x_8, x_9, x_10, x_11, x_12, x_13, 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_15);
x_18 = l_Lean_Expr_hasMVar(x_16);
if (x_18 == 0)
{
lean_object* x_19; lean_object* x_20;
x_19 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabSubst___lambda__4), 13, 5);
lean_closure_set(x_19, 0, x_2);
lean_closure_set(x_19, 1, x_3);
lean_closure_set(x_19, 2, x_7);
lean_closure_set(x_19, 3, x_4);
lean_closure_set(x_19, 4, x_5);
x_20 = l___private_Lean_Elab_BuiltinNotation_0__Lean_Elab_Term_withLocalIdentFor(x_6, x_16, x_19, x_8, x_9, x_10, x_11, x_12, x_13, x_17);
return x_20;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; 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; 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; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; 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; uint8_t x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81;
lean_dec(x_16);
lean_inc(x_12);
x_21 = l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_exprToSyntax___spec__1___rarg(x_12, x_13, x_17);
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_st_ref_get(x_13, x_23);
x_25 = lean_ctor_get(x_24, 1);
lean_inc(x_25);
lean_dec(x_24);
x_26 = l_Lean_Elab_Term_expandShow___closed__8;
x_27 = l_Lean_Name_str___override(x_2, x_26);
x_28 = l_Lean_Elab_Term_expandShow___closed__10;
lean_inc(x_22);
x_29 = lean_alloc_ctor(2, 2, 0);
lean_ctor_set(x_29, 0, x_22);
lean_ctor_set(x_29, 1, x_28);
x_30 = l_Lean_Elab_Term_expandSuffices___lambda__1___closed__1;
x_31 = l_Lean_Name_str___override(x_3, x_30);
x_32 = l_Lean_Elab_Term_expandSuffices___lambda__1___closed__2;
lean_inc(x_31);
x_33 = l_Lean_Name_str___override(x_31, x_32);
x_34 = l_Lean_Elab_Term_elabSubst___lambda__4___closed__1;
lean_inc(x_31);
x_35 = l_Lean_Name_str___override(x_31, x_34);
x_36 = l_Lean_Elab_Term_elabSubst___lambda__4___closed__4;
lean_inc(x_31);
x_37 = l_Lean_Name_str___override(x_31, x_36);
lean_inc(x_22);
x_38 = lean_alloc_ctor(2, 2, 0);
lean_ctor_set(x_38, 0, x_22);
lean_ctor_set(x_38, 1, x_36);
x_39 = l_Lean_Elab_Term_expandShow___closed__22;
x_40 = lean_array_push(x_39, x_7);
x_41 = l_Lean_Elab_Term_elabAnonymousCtor___lambda__3___closed__3;
lean_inc(x_22);
x_42 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_42, 0, x_22);
lean_ctor_set(x_42, 1, x_41);
lean_ctor_set(x_42, 2, x_40);
x_43 = l_Lean_Elab_Term_elabAnonymousCtor___lambda__3___closed__10;
x_44 = lean_array_push(x_43, x_38);
x_45 = lean_array_push(x_44, x_42);
lean_inc(x_22);
x_46 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_46, 0, x_22);
lean_ctor_set(x_46, 1, x_37);
lean_ctor_set(x_46, 2, x_45);
x_47 = l_Lean_Elab_Term_expandShow___closed__25;
lean_inc(x_22);
x_48 = lean_alloc_ctor(2, 2, 0);
lean_ctor_set(x_48, 0, x_22);
lean_ctor_set(x_48, 1, x_47);
x_49 = lean_array_push(x_39, x_48);
lean_inc(x_22);
x_50 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_50, 0, x_22);
lean_ctor_set(x_50, 1, x_41);
lean_ctor_set(x_50, 2, x_49);
x_51 = lean_array_push(x_43, x_46);
x_52 = lean_array_push(x_51, x_50);
x_53 = l_Lean_Elab_Term_elabSubst___lambda__4___closed__3;
lean_inc(x_22);
x_54 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_54, 0, x_22);
lean_ctor_set(x_54, 1, x_53);
lean_ctor_set(x_54, 2, x_52);
x_55 = l_Lean_Elab_Term_elabSubst___lambda__4___closed__5;
x_56 = l_Lean_Name_str___override(x_31, x_55);
lean_inc(x_22);
x_57 = lean_alloc_ctor(2, 2, 0);
lean_ctor_set(x_57, 0, x_22);
lean_ctor_set(x_57, 1, x_55);
x_58 = lean_array_push(x_43, x_57);
x_59 = lean_array_push(x_58, x_6);
lean_inc(x_22);
x_60 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_60, 0, x_22);
lean_ctor_set(x_60, 1, x_56);
lean_ctor_set(x_60, 2, x_59);
x_61 = l_Lean_Elab_Term_elabAnonymousCtor___lambda__3___closed__4;
lean_inc(x_22);
x_62 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_62, 0, x_22);
lean_ctor_set(x_62, 1, x_41);
lean_ctor_set(x_62, 2, x_61);
x_63 = lean_array_push(x_43, x_60);
x_64 = lean_array_push(x_63, x_62);
lean_inc(x_22);
x_65 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_65, 0, x_22);
lean_ctor_set(x_65, 1, x_53);
lean_ctor_set(x_65, 2, x_64);
x_66 = lean_array_push(x_43, x_54);
x_67 = lean_array_push(x_66, x_65);
lean_inc(x_22);
x_68 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_68, 0, x_22);
lean_ctor_set(x_68, 1, x_41);
lean_ctor_set(x_68, 2, x_67);
x_69 = lean_array_push(x_39, x_68);
lean_inc(x_22);
x_70 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_70, 0, x_22);
lean_ctor_set(x_70, 1, x_35);
lean_ctor_set(x_70, 2, x_69);
x_71 = lean_array_push(x_39, x_70);
lean_inc(x_22);
x_72 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_72, 0, x_22);
lean_ctor_set(x_72, 1, x_33);
lean_ctor_set(x_72, 2, x_71);
x_73 = lean_array_push(x_43, x_29);
x_74 = lean_array_push(x_73, x_72);
x_75 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_75, 0, x_22);
lean_ctor_set(x_75, 1, x_27);
lean_ctor_set(x_75, 2, x_74);
x_76 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_76, 0, x_4);
x_77 = 1;
x_78 = lean_box(x_77);
x_79 = lean_box(x_77);
lean_inc(x_75);
x_80 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabTerm___boxed), 11, 4);
lean_closure_set(x_80, 0, x_75);
lean_closure_set(x_80, 1, x_76);
lean_closure_set(x_80, 2, x_78);
lean_closure_set(x_80, 3, x_79);
x_81 = l_Lean_Elab_Term_withMacroExpansion___rarg(x_5, x_75, x_80, x_8, x_9, x_10, x_11, x_12, x_13, x_25);
return x_81;
}
}
}
static lean_object* _init_l_Lean_Elab_Term_elabSubst___lambda__6___closed__1() {
@ -18980,12 +19129,12 @@ else
{
lean_object* x_44; lean_object* x_45;
x_44 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabSubst___lambda__5), 14, 6);
lean_closure_set(x_44, 0, x_2);
lean_closure_set(x_44, 1, x_3);
lean_closure_set(x_44, 2, x_4);
lean_closure_set(x_44, 3, x_5);
lean_closure_set(x_44, 4, x_6);
lean_closure_set(x_44, 5, x_25);
lean_closure_set(x_44, 0, x_25);
lean_closure_set(x_44, 1, x_2);
lean_closure_set(x_44, 2, x_3);
lean_closure_set(x_44, 3, x_4);
lean_closure_set(x_44, 4, x_5);
lean_closure_set(x_44, 5, x_6);
x_45 = l___private_Lean_Elab_BuiltinNotation_0__Lean_Elab_Term_withLocalIdentFor(x_7, x_10, x_44, x_14, x_15, x_16, x_17, x_18, x_19, x_41);
return x_45;
}
@ -20215,7 +20364,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabSubst_declRange___cl
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(334u);
x_1 = lean_unsigned_to_nat(341u);
x_2 = lean_unsigned_to_nat(31u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20691,7 +20840,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabStateRefT_declRange_
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(336u);
x_1 = lean_unsigned_to_nat(343u);
x_2 = lean_unsigned_to_nat(29u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20703,7 +20852,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabStateRefT_declRange_
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(345u);
x_1 = lean_unsigned_to_nat(352u);
x_2 = lean_unsigned_to_nat(32u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20731,7 +20880,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabStateRefT_declRange_
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(336u);
x_1 = lean_unsigned_to_nat(343u);
x_2 = lean_unsigned_to_nat(33u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20743,7 +20892,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabStateRefT_declRange_
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(336u);
x_1 = lean_unsigned_to_nat(343u);
x_2 = lean_unsigned_to_nat(46u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20917,7 +21066,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabNoindex_declRange___
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(347u);
x_1 = lean_unsigned_to_nat(354u);
x_2 = lean_unsigned_to_nat(27u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20929,7 +21078,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabNoindex_declRange___
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(349u);
x_1 = lean_unsigned_to_nat(356u);
x_2 = lean_unsigned_to_nat(40u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20957,7 +21106,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabNoindex_declRange___
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(347u);
x_1 = lean_unsigned_to_nat(354u);
x_2 = lean_unsigned_to_nat(31u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -20969,7 +21118,7 @@ static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabNoindex_declRange___
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_unsigned_to_nat(347u);
x_1 = lean_unsigned_to_nat(354u);
x_2 = lean_unsigned_to_nat(42u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);

View file

@ -356,6 +356,7 @@ static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_Command___hyg_29
static lean_object* l_Lean_Elab_Command_liftCoreM___rarg___closed__1;
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_expandDeclId___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_instMonadTraceCommandElabM;
lean_object* l_Lean_removeLeadingSpaces(lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Command_getBracketedBinderIds___spec__1___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_getBracketedBinderIds___closed__9;
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapM___at_Lean_Elab_Command_liftTermElabM___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -503,7 +504,6 @@ LEAN_EXPORT lean_object* l_Std_AssocList_foldlM___at___private_Lean_Elab_Command
LEAN_EXPORT lean_object* l_Std_PersistentArray_forIn___at___private_Lean_Elab_Command_0__Lean_Elab_Command_addTraceAsMessagesCore___spec__11(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_addMacroStack___at_Lean_Elab_Command_instAddErrorMessageContextCommandElabM___spec__1___closed__5;
static lean_object* l_Lean_Elab_Command_mkCommandElabAttributeUnsafe___closed__4;
lean_object* l___private_Lean_DocString_0__Lean_removeLeadingSpaces(lean_object*);
static lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_Command_0__Lean_Elab_Command_addTraceAsMessagesCore___spec__20___closed__2;
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_Command___hyg_2658____closed__2;
@ -23740,7 +23740,7 @@ if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15;
x_10 = lean_ctor_get(x_7, 0);
x_11 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_11 = l_Lean_removeLeadingSpaces(x_2);
x_12 = l_Lean_addDocString___at_Lean_Elab_Command_expandDeclId___spec__10___closed__1;
x_13 = l_Lean_MapDeclarationExtension_insert___rarg(x_12, x_10, x_1, x_11);
lean_ctor_set(x_7, 0, x_13);
@ -23790,7 +23790,7 @@ lean_inc(x_23);
lean_inc(x_22);
lean_inc(x_21);
lean_dec(x_7);
x_30 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_30 = l_Lean_removeLeadingSpaces(x_2);
x_31 = l_Lean_addDocString___at_Lean_Elab_Command_expandDeclId___spec__10___closed__1;
x_32 = l_Lean_MapDeclarationExtension_insert___rarg(x_31, x_21, x_1, x_30);
x_33 = lean_alloc_ctor(0, 9, 0);

File diff suppressed because it is too large Load diff

View file

@ -72,9 +72,9 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkInstanceName___lambda__2(lean_obj
LEAN_EXPORT lean_object* l_Lean_Meta_forEachExpr___at_Lean_Elab_Command_mkInstanceName___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Array_anyMUnsafe_any___at_Lean_Elab_DefView_isInstance___spec__1___closed__1;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkDefViewOfOpaque(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__3;
static lean_object* l_Lean_Elab_Command_mkDefViewOfInstance___closed__4;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkDefViewOfDef(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__3;
LEAN_EXPORT uint8_t l_Lean_Elab_DefKind_isExample(uint8_t);
static lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Command_mkInstanceName___spec__18___rarg___closed__1;
lean_object* l_liftExcept___at_Lean_Elab_liftMacroM___spec__1(lean_object*, lean_object*, lean_object*);
@ -203,7 +203,7 @@ LEAN_EXPORT lean_object* l_Lean_Meta_visitLet_visit___at_Lean_Elab_Command_mkIns
lean_object* l_Lean_Syntax_getKind(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkInstanceName(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkFreshInstanceName___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109_(lean_object*);
lean_object* l_ReaderT_pure___at_Lean_Elab_liftMacroM___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_isDefLike___closed__6;
lean_object* l_Lean_Elab_Command_getMainModule___rarg(lean_object*, lean_object*);
@ -230,13 +230,13 @@ static lean_object* l_Lean_Elab_Command_mkInstanceName___lambda__2___closed__1;
static lean_object* l_Lean_Elab_Command_mkDefViewOfInstance___closed__9;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkDefViewOfAbbrev(lean_object*, lean_object*);
lean_object* l_Lean_Elab_expandOptNamedPrio___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__4;
static lean_object* l_Lean_throwMaxRecDepthAt___at_Lean_Elab_Command_mkInstanceName___spec__17___closed__2;
lean_object* l_Lean_Elab_Term_elabBinders___rarg(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_isDefLike___closed__3;
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Command_mkDefViewOfInstance___spec__8(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_instBEqDefKind;
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__2;
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__4;
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__2;
static lean_object* l_Lean_Meta_forEachExpr_x27___at_Lean_Elab_Command_mkInstanceName___spec__2___closed__1;
extern lean_object* l_Lean_Elab_unsupportedSyntaxExceptionId;
static lean_object* l_Lean_Elab_Command_mkDefViewOfOpaque___lambda__2___closed__2;
@ -258,10 +258,10 @@ lean_object* l_Lean_Elab_Command_getScope___rarg(lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_Basic_0__Lean_Meta_withLetDeclImp___rarg(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_mkDefViewOfInstance___closed__14;
LEAN_EXPORT lean_object* l_Lean_Meta_forEachExpr_x27___at_Lean_Elab_Command_mkInstanceName___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_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__1;
static lean_object* l_Lean_Elab_instInhabitedDefView___closed__2;
static lean_object* l_Lean_Elab_Command_mkDefViewOfInstance___closed__5;
LEAN_EXPORT lean_object* l_Lean_Elab_DefView_deriving_x3f___default;
static lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__1;
lean_object* l_Lean_Elab_Term_withAutoBoundImplicit___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Std_HashMap_insert___at_Lean_ForEachExpr_visit___spec__3(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Command_isDefLike___closed__10;
@ -6120,10 +6120,10 @@ return x_4;
LEAN_EXPORT lean_object* l_Lean_Elab_Command_mkDefViewOfExample(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; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; uint8_t x_21; lean_object* x_22;
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; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21;
x_3 = lean_unsigned_to_nat(1u);
x_4 = l_Lean_Syntax_getArg(x_2, x_3);
x_5 = l_Lean_Elab_expandDeclSig(x_4);
x_5 = l_Lean_Elab_expandOptDeclSig(x_4);
lean_dec(x_4);
x_6 = lean_ctor_get(x_5, 0);
lean_inc(x_6);
@ -6143,22 +6143,20 @@ x_16 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_16, 0, x_14);
lean_ctor_set(x_16, 1, x_15);
lean_ctor_set(x_16, 2, x_13);
x_17 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_17, 0, x_7);
x_18 = lean_unsigned_to_nat(2u);
x_19 = l_Lean_Syntax_getArg(x_2, x_18);
x_20 = lean_box(0);
x_21 = 2;
x_22 = lean_alloc_ctor(0, 7, 1);
lean_ctor_set(x_22, 0, x_2);
lean_ctor_set(x_22, 1, x_1);
lean_ctor_set(x_22, 2, x_16);
lean_ctor_set(x_22, 3, x_6);
lean_ctor_set(x_22, 4, x_17);
lean_ctor_set(x_22, 5, x_19);
lean_ctor_set(x_22, 6, x_20);
lean_ctor_set_uint8(x_22, sizeof(void*)*7, x_21);
return x_22;
x_17 = lean_unsigned_to_nat(2u);
x_18 = l_Lean_Syntax_getArg(x_2, x_17);
x_19 = lean_box(0);
x_20 = 2;
x_21 = lean_alloc_ctor(0, 7, 1);
lean_ctor_set(x_21, 0, x_2);
lean_ctor_set(x_21, 1, x_1);
lean_ctor_set(x_21, 2, x_16);
lean_ctor_set(x_21, 3, x_6);
lean_ctor_set(x_21, 4, x_7);
lean_ctor_set(x_21, 5, x_18);
lean_ctor_set(x_21, 6, x_19);
lean_ctor_set_uint8(x_21, sizeof(void*)*7, x_20);
return x_21;
}
}
static lean_object* _init_l_Lean_Elab_Command_isDefLike___closed__1() {
@ -6538,7 +6536,7 @@ lean_dec(x_3);
return x_5;
}
}
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__1() {
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__1() {
_start:
{
lean_object* x_1;
@ -6546,17 +6544,17 @@ x_1 = lean_mk_string_from_bytes("Elab", 4);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__2() {
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____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_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__1;
x_2 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__1;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__3() {
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__3() {
_start:
{
lean_object* x_1;
@ -6564,21 +6562,21 @@ x_1 = lean_mk_string_from_bytes("definition", 10);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__4() {
static lean_object* _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__2;
x_2 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__3;
x_1 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__2;
x_2 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__3;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109_(lean_object* x_1) {
_start:
{
lean_object* x_2; uint8_t x_3; lean_object* x_4;
x_2 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__4;
x_2 = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__4;
x_3 = 0;
x_4 = l_Lean_registerTraceClass(x_2, x_3, x_1);
return x_4;
@ -6768,15 +6766,15 @@ l_Lean_Elab_Command_mkDefView___closed__1 = _init_l_Lean_Elab_Command_mkDefView_
lean_mark_persistent(l_Lean_Elab_Command_mkDefView___closed__1);
l_Lean_Elab_Command_mkDefView___closed__2 = _init_l_Lean_Elab_Command_mkDefView___closed__2();
lean_mark_persistent(l_Lean_Elab_Command_mkDefView___closed__2);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__1 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__1();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__1);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__2 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__2();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__2);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__3 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__3();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__3);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__4 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__4();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110____closed__4);
res = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2110_(lean_io_mk_world());
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__1 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__1();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__1);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__2 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__2();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__2);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__3 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__3();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__3);
l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__4 = _init_l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__4();
lean_mark_persistent(l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109____closed__4);
res = l_Lean_Elab_Command_initFn____x40_Lean_Elab_DefView___hyg_2109_(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));

View file

@ -77,6 +77,7 @@ static lean_object* l_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____lambda_
LEAN_EXPORT lean_object* l_Lean_throwUnknownConstant___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__8(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_addDocString___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__18___closed__2;
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConst___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__3(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_removeLeadingSpaces(lean_object*);
static lean_object* l_Lean_addDocString___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__18___closed__1;
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__5(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_addConstInfo___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__11(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -107,7 +108,6 @@ LEAN_EXPORT lean_object* l_Lean_Elab_resolveGlobalConstNoOverloadWithInfo___at_L
static lean_object* l_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____closed__5;
lean_object* l_Lean_Syntax_getPos_x3f(lean_object*, uint8_t);
static lean_object* l_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____closed__15;
lean_object* l___private_Lean_DocString_0__Lean_removeLeadingSpaces(lean_object*);
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
lean_object* l_Lean_Expr_const___override(lean_object*, lean_object*);
static lean_object* l_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____closed__7;
@ -2466,7 +2466,7 @@ lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean
x_10 = lean_ctor_get(x_7, 0);
x_11 = lean_ctor_get(x_7, 4);
lean_dec(x_11);
x_12 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_12 = l_Lean_removeLeadingSpaces(x_2);
x_13 = l_Lean_addDocString___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__18___closed__1;
x_14 = l_Lean_MapDeclarationExtension_insert___rarg(x_13, x_10, x_1, x_12);
x_15 = l_Lean_addDocString___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__18___closed__5;
@ -2512,7 +2512,7 @@ lean_inc(x_25);
lean_inc(x_24);
lean_inc(x_23);
lean_dec(x_7);
x_29 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_29 = l_Lean_removeLeadingSpaces(x_2);
x_30 = l_Lean_addDocString___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__18___closed__1;
x_31 = l_Lean_MapDeclarationExtension_insert___rarg(x_30, x_23, x_1, x_29);
x_32 = l_Lean_addDocString___at_Lean_initFn____x40_Lean_Elab_InheritDoc___hyg_4____spec__18___closed__5;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2264,7 +2264,7 @@ static lean_object* _init_l_Lean_Elab_Tactic___aux__Lean__Elab__Tactic__Config__
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("withoutModifyingState", 21);
x_1 = lean_mk_string_from_bytes("withoutModifyingStateWithInfoAndMessages", 40);
return x_1;
}
}
@ -2305,7 +2305,7 @@ static lean_object* _init_l_Lean_Elab_Tactic___aux__Lean__Elab__Tactic__Config__
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Tactic_configElab___closed__2;
x_1 = l_Lean_Elab_Tactic_configElab___closed__4;
x_2 = l_Lean_Elab_Tactic___aux__Lean__Elab__Tactic__Config______macroRules__Lean__Elab__Tactic__configElab__1___closed__176;
x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;

View file

@ -14,31 +14,29 @@
extern "C" {
#endif
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__3;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__15;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__3;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__5;
lean_object* l_Lean_stringToMessageData(lean_object*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__14;
lean_object* l_Lean_Name_str___override(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange(lean_object*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__10;
lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Tactic_evalExact___spec__1___rarg(lean_object*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__16;
lean_object* lean_st_ref_get(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_Conv_changeLhs(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_Tactic_Conv_evalChange___closed__7;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_withMainContext___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___regBuiltin_Lean_Elab_Tactic_Conv_evalChange_declRange___closed__4;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__6;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__5;
lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_filterOldMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__12;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange_declRange___closed__3;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2(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_isExprDefEqGuarded(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_addBuiltinDeclarationRanges(lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange_declRange___closed__5;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__1;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__11;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange___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_object* l_Lean_Elab_Tactic_Conv_getLhs(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Tactic_tacticElabAttribute;
@ -56,17 +54,21 @@ static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__2;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__1;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__9;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__4;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__13;
lean_object* lean_infer_type(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__2;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__4;
uint8_t l_Lean_Syntax_isOfKind(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange_declRange(lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__7;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__1;
lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange_declRange___closed__6;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange___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*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__3;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange_declRange___closed__1;
lean_object* l_Lean_Elab_Tactic_logUnassignedAndAbort(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*);
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__5;
static lean_object* l_Lean_Elab_Tactic_Conv_evalChange___closed__6;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange___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, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
_start:
@ -76,6 +78,362 @@ x_12 = l_Lean_Elab_Tactic_Conv_changeLhs(x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9,
return x_12;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("invalid 'change' conv tactic, term", 34);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__1;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("\nis not definitionally equal to current left-hand-side", 54);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__3;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__5() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("", 0);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__6() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__5;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange___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) {
_start:
{
lean_object* x_11;
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_11 = l_Lean_Elab_Tactic_Conv_getLhs(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
if (lean_obj_tag(x_11) == 0)
{
lean_object* x_12; lean_object* x_13; 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;
x_12 = lean_ctor_get(x_11, 0);
lean_inc(x_12);
x_13 = lean_ctor_get(x_11, 1);
lean_inc(x_13);
lean_dec(x_11);
x_14 = lean_st_ref_get(x_9, x_13);
x_15 = lean_ctor_get(x_14, 1);
lean_inc(x_15);
lean_dec(x_14);
x_16 = lean_st_ref_get(x_7, x_15);
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
x_18 = lean_ctor_get(x_16, 1);
lean_inc(x_18);
lean_dec(x_16);
x_19 = lean_ctor_get(x_17, 0);
lean_inc(x_19);
lean_dec(x_17);
x_20 = lean_ctor_get(x_19, 1);
lean_inc(x_20);
lean_dec(x_19);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_12);
x_21 = lean_infer_type(x_12, x_6, x_7, x_8, x_9, x_18);
if (lean_obj_tag(x_21) == 0)
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; uint8_t 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);
lean_inc(x_23);
lean_dec(x_21);
x_24 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_24, 0, x_22);
x_25 = 0;
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_26 = l_Lean_Elab_Tactic_elabTermEnsuringType(x_1, x_24, x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_23);
if (lean_obj_tag(x_26) == 0)
{
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;
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);
lean_inc(x_27);
x_29 = l_Lean_Meta_getMVars(x_27, x_6, x_7, x_8, x_9, x_28);
x_30 = lean_ctor_get(x_29, 0);
lean_inc(x_30);
x_31 = lean_ctor_get(x_29, 1);
lean_inc(x_31);
lean_dec(x_29);
x_32 = l_Lean_Elab_Tactic_filterOldMVars(x_30, x_20, x_6, x_7, x_8, x_9, x_31);
lean_dec(x_20);
lean_dec(x_30);
x_33 = lean_ctor_get(x_32, 0);
lean_inc(x_33);
x_34 = lean_ctor_get(x_32, 1);
lean_inc(x_34);
lean_dec(x_32);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_35 = l_Lean_Elab_Tactic_logUnassignedAndAbort(x_33, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_34);
if (lean_obj_tag(x_35) == 0)
{
lean_object* x_36; lean_object* x_37; lean_object* x_38; uint8_t x_39;
x_36 = lean_ctor_get(x_35, 1);
lean_inc(x_36);
lean_dec(x_35);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_12);
lean_inc(x_27);
x_37 = l_Lean_Meta_isExprDefEqGuarded(x_27, x_12, x_6, x_7, x_8, x_9, x_36);
x_38 = lean_ctor_get(x_37, 0);
lean_inc(x_38);
x_39 = lean_unbox(x_38);
lean_dec(x_38);
if (x_39 == 0)
{
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; uint8_t x_51;
x_40 = lean_ctor_get(x_37, 1);
lean_inc(x_40);
lean_dec(x_37);
x_41 = l_Lean_indentExpr(x_27);
x_42 = l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__2;
x_43 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_43, 0, x_42);
lean_ctor_set(x_43, 1, x_41);
x_44 = l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__4;
x_45 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_45, 0, x_43);
lean_ctor_set(x_45, 1, x_44);
x_46 = l_Lean_indentExpr(x_12);
x_47 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_47, 0, x_45);
lean_ctor_set(x_47, 1, x_46);
x_48 = l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__6;
x_49 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_49, 0, x_47);
lean_ctor_set(x_49, 1, x_48);
x_50 = l_Lean_throwError___at_Lean_Elab_Tactic_evalTactic___spec__2(x_49, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_40);
lean_dec(x_9);
lean_dec(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);
x_51 = !lean_is_exclusive(x_50);
if (x_51 == 0)
{
return x_50;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54;
x_52 = lean_ctor_get(x_50, 0);
x_53 = lean_ctor_get(x_50, 1);
lean_inc(x_53);
lean_inc(x_52);
lean_dec(x_50);
x_54 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_54, 0, x_52);
lean_ctor_set(x_54, 1, x_53);
return x_54;
}
}
else
{
lean_object* x_55; lean_object* x_56;
lean_dec(x_12);
x_55 = lean_ctor_get(x_37, 1);
lean_inc(x_55);
lean_dec(x_37);
x_56 = l_Lean_Elab_Tactic_Conv_changeLhs(x_27, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_55);
return x_56;
}
}
else
{
uint8_t x_57;
lean_dec(x_27);
lean_dec(x_12);
lean_dec(x_9);
lean_dec(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);
x_57 = !lean_is_exclusive(x_35);
if (x_57 == 0)
{
return x_35;
}
else
{
lean_object* x_58; lean_object* x_59; lean_object* x_60;
x_58 = lean_ctor_get(x_35, 0);
x_59 = lean_ctor_get(x_35, 1);
lean_inc(x_59);
lean_inc(x_58);
lean_dec(x_35);
x_60 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_60, 0, x_58);
lean_ctor_set(x_60, 1, x_59);
return x_60;
}
}
}
else
{
uint8_t x_61;
lean_dec(x_20);
lean_dec(x_12);
lean_dec(x_9);
lean_dec(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);
x_61 = !lean_is_exclusive(x_26);
if (x_61 == 0)
{
return x_26;
}
else
{
lean_object* x_62; lean_object* x_63; lean_object* x_64;
x_62 = lean_ctor_get(x_26, 0);
x_63 = lean_ctor_get(x_26, 1);
lean_inc(x_63);
lean_inc(x_62);
lean_dec(x_26);
x_64 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_64, 0, x_62);
lean_ctor_set(x_64, 1, x_63);
return x_64;
}
}
}
else
{
uint8_t x_65;
lean_dec(x_20);
lean_dec(x_12);
lean_dec(x_9);
lean_dec(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);
x_65 = !lean_is_exclusive(x_21);
if (x_65 == 0)
{
return x_21;
}
else
{
lean_object* x_66; lean_object* x_67; lean_object* x_68;
x_66 = lean_ctor_get(x_21, 0);
x_67 = lean_ctor_get(x_21, 1);
lean_inc(x_67);
lean_inc(x_66);
lean_dec(x_21);
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;
}
}
}
else
{
uint8_t x_69;
lean_dec(x_9);
lean_dec(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);
x_69 = !lean_is_exclusive(x_11);
if (x_69 == 0)
{
return x_11;
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72;
x_70 = lean_ctor_get(x_11, 0);
x_71 = lean_ctor_get(x_11, 1);
lean_inc(x_71);
lean_inc(x_70);
lean_dec(x_11);
x_72 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_72, 0, x_70);
lean_ctor_set(x_72, 1, x_71);
return x_72;
}
}
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__1() {
_start:
{
@ -166,57 +524,6 @@ x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__11() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("invalid 'change' conv tactic, term", 34);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__12() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_Conv_evalChange___closed__11;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__13() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("\nis not definitionally equal to current left-hand-side", 54);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__14() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_Conv_evalChange___closed__13;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__15() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("", 0);
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__16() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_Conv_evalChange___closed__15;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Conv_evalChange(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:
{
@ -241,309 +548,14 @@ return x_13;
}
else
{
lean_object* x_14; lean_object* x_15; lean_object* x_16;
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_14 = lean_unsigned_to_nat(1u);
x_15 = l_Lean_Syntax_getArg(x_1, x_14);
lean_dec(x_1);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_16 = l_Lean_Elab_Tactic_Conv_getLhs(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
if (lean_obj_tag(x_16) == 0)
{
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; lean_object* x_25; lean_object* x_26;
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
x_18 = lean_ctor_get(x_16, 1);
lean_inc(x_18);
lean_dec(x_16);
x_19 = lean_st_ref_get(x_9, x_18);
x_20 = lean_ctor_get(x_19, 1);
lean_inc(x_20);
lean_dec(x_19);
x_21 = lean_st_ref_get(x_7, x_20);
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_ctor_get(x_22, 0);
lean_inc(x_24);
lean_dec(x_22);
x_25 = lean_ctor_get(x_24, 1);
lean_inc(x_25);
lean_dec(x_24);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_17);
x_26 = lean_infer_type(x_17, x_6, x_7, x_8, x_9, x_23);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_27; lean_object* x_28; lean_object* x_29; uint8_t x_30; lean_object* x_31;
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_alloc_ctor(1, 1, 0);
lean_ctor_set(x_29, 0, x_27);
x_30 = 0;
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_31 = l_Lean_Elab_Tactic_elabTermEnsuringType(x_15, x_29, x_30, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_28);
if (lean_obj_tag(x_31) == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40;
x_32 = lean_ctor_get(x_31, 0);
lean_inc(x_32);
x_33 = lean_ctor_get(x_31, 1);
lean_inc(x_33);
lean_dec(x_31);
lean_inc(x_32);
x_34 = l_Lean_Meta_getMVars(x_32, x_6, x_7, x_8, x_9, x_33);
x_35 = lean_ctor_get(x_34, 0);
lean_inc(x_35);
x_36 = lean_ctor_get(x_34, 1);
lean_inc(x_36);
lean_dec(x_34);
x_37 = l_Lean_Elab_Tactic_filterOldMVars(x_35, x_25, x_6, x_7, x_8, x_9, x_36);
lean_dec(x_25);
lean_dec(x_35);
x_38 = lean_ctor_get(x_37, 0);
lean_inc(x_38);
x_39 = lean_ctor_get(x_37, 1);
lean_inc(x_39);
lean_dec(x_37);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_40 = l_Lean_Elab_Tactic_logUnassignedAndAbort(x_38, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_39);
if (lean_obj_tag(x_40) == 0)
{
lean_object* x_41; lean_object* x_42; lean_object* x_43; uint8_t x_44;
x_41 = lean_ctor_get(x_40, 1);
lean_inc(x_41);
lean_dec(x_40);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_17);
lean_inc(x_32);
x_42 = l_Lean_Meta_isExprDefEqGuarded(x_32, x_17, x_6, x_7, x_8, x_9, x_41);
x_43 = lean_ctor_get(x_42, 0);
lean_inc(x_43);
x_44 = lean_unbox(x_43);
lean_dec(x_43);
if (x_44 == 0)
{
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; lean_object* x_53; lean_object* x_54; lean_object* x_55; uint8_t x_56;
x_45 = lean_ctor_get(x_42, 1);
lean_inc(x_45);
lean_dec(x_42);
x_46 = l_Lean_indentExpr(x_32);
x_47 = l_Lean_Elab_Tactic_Conv_evalChange___closed__12;
x_48 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_48, 0, x_47);
lean_ctor_set(x_48, 1, x_46);
x_49 = l_Lean_Elab_Tactic_Conv_evalChange___closed__14;
x_50 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_50, 0, x_48);
lean_ctor_set(x_50, 1, x_49);
x_51 = l_Lean_indentExpr(x_17);
x_52 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_52, 0, x_50);
lean_ctor_set(x_52, 1, x_51);
x_53 = l_Lean_Elab_Tactic_Conv_evalChange___closed__16;
x_54 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_54, 0, x_52);
lean_ctor_set(x_54, 1, x_53);
x_55 = l_Lean_throwError___at_Lean_Elab_Tactic_evalTactic___spec__2(x_54, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_45);
lean_dec(x_9);
lean_dec(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);
x_56 = !lean_is_exclusive(x_55);
if (x_56 == 0)
{
return x_55;
}
else
{
lean_object* x_57; lean_object* x_58; lean_object* x_59;
x_57 = lean_ctor_get(x_55, 0);
x_58 = lean_ctor_get(x_55, 1);
lean_inc(x_58);
lean_inc(x_57);
lean_dec(x_55);
x_59 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_59, 0, x_57);
lean_ctor_set(x_59, 1, x_58);
return x_59;
}
}
else
{
lean_object* x_60; lean_object* x_61;
lean_dec(x_17);
x_60 = lean_ctor_get(x_42, 1);
lean_inc(x_60);
lean_dec(x_42);
x_61 = l_Lean_Elab_Tactic_Conv_changeLhs(x_32, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_60);
return x_61;
}
}
else
{
uint8_t x_62;
lean_dec(x_32);
lean_dec(x_17);
lean_dec(x_9);
lean_dec(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);
x_62 = !lean_is_exclusive(x_40);
if (x_62 == 0)
{
return x_40;
}
else
{
lean_object* x_63; lean_object* x_64; lean_object* x_65;
x_63 = lean_ctor_get(x_40, 0);
x_64 = lean_ctor_get(x_40, 1);
lean_inc(x_64);
lean_inc(x_63);
lean_dec(x_40);
x_65 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_65, 0, x_63);
lean_ctor_set(x_65, 1, x_64);
return x_65;
}
}
}
else
{
uint8_t x_66;
lean_dec(x_25);
lean_dec(x_17);
lean_dec(x_9);
lean_dec(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);
x_66 = !lean_is_exclusive(x_31);
if (x_66 == 0)
{
return x_31;
}
else
{
lean_object* x_67; lean_object* x_68; lean_object* x_69;
x_67 = lean_ctor_get(x_31, 0);
x_68 = lean_ctor_get(x_31, 1);
lean_inc(x_68);
lean_inc(x_67);
lean_dec(x_31);
x_69 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_69, 0, x_67);
lean_ctor_set(x_69, 1, x_68);
return x_69;
}
}
}
else
{
uint8_t x_70;
lean_dec(x_25);
lean_dec(x_17);
lean_dec(x_15);
lean_dec(x_9);
lean_dec(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);
x_70 = !lean_is_exclusive(x_26);
if (x_70 == 0)
{
return x_26;
}
else
{
lean_object* x_71; lean_object* x_72; lean_object* x_73;
x_71 = lean_ctor_get(x_26, 0);
x_72 = lean_ctor_get(x_26, 1);
lean_inc(x_72);
lean_inc(x_71);
lean_dec(x_26);
x_73 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_73, 0, x_71);
lean_ctor_set(x_73, 1, x_72);
return x_73;
}
}
}
else
{
uint8_t x_74;
lean_dec(x_15);
lean_dec(x_9);
lean_dec(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);
x_74 = !lean_is_exclusive(x_16);
if (x_74 == 0)
{
return x_16;
}
else
{
lean_object* x_75; lean_object* x_76; lean_object* x_77;
x_75 = lean_ctor_get(x_16, 0);
x_76 = lean_ctor_get(x_16, 1);
lean_inc(x_76);
lean_inc(x_75);
lean_dec(x_16);
x_77 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_77, 0, x_75);
lean_ctor_set(x_77, 1, x_76);
return x_77;
}
}
x_16 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2), 10, 1);
lean_closure_set(x_16, 0, x_15);
x_17 = l_Lean_Elab_Tactic_withMainContext___rarg(x_16, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
return x_17;
}
}
}
@ -759,6 +771,18 @@ lean_dec_ref(res);
res = initialize_Lean_Elab_Tactic_Conv_Basic(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__1 = _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__1();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__1);
l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__2 = _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__2();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__2);
l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__3 = _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__3();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__3);
l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__4 = _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__4();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__4);
l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__5 = _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__5();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__5);
l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__6 = _init_l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__6();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___lambda__2___closed__6);
l_Lean_Elab_Tactic_Conv_evalChange___closed__1 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__1();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__1);
l_Lean_Elab_Tactic_Conv_evalChange___closed__2 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__2();
@ -779,18 +803,6 @@ l_Lean_Elab_Tactic_Conv_evalChange___closed__9 = _init_l_Lean_Elab_Tactic_Conv_e
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__9);
l_Lean_Elab_Tactic_Conv_evalChange___closed__10 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__10();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__10);
l_Lean_Elab_Tactic_Conv_evalChange___closed__11 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__11();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__11);
l_Lean_Elab_Tactic_Conv_evalChange___closed__12 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__12();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__12);
l_Lean_Elab_Tactic_Conv_evalChange___closed__13 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__13();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__13);
l_Lean_Elab_Tactic_Conv_evalChange___closed__14 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__14();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__14);
l_Lean_Elab_Tactic_Conv_evalChange___closed__15 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__15();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__15);
l_Lean_Elab_Tactic_Conv_evalChange___closed__16 = _init_l_Lean_Elab_Tactic_Conv_evalChange___closed__16();
lean_mark_persistent(l_Lean_Elab_Tactic_Conv_evalChange___closed__16);
l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__1 = _init_l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__1();
lean_mark_persistent(l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__1);
l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__2 = _init_l___regBuiltin_Lean_Elab_Tactic_Conv_evalChange___closed__2();

View file

@ -13,8 +13,8 @@
#ifdef __cplusplus
extern "C" {
#endif
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_ContextInfo_save___at_Lean_Elab_Term_withoutModifyingElabMetaStateWithInfo___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__11;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_withRWRulesSeq___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_Elab_Tactic_withRWRulesSeq___closed__1;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_withRWRulesSeq(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -37,6 +37,7 @@ lean_object* l_Lean_Elab_Tactic_SavedState_restore(lean_object*, uint8_t, lean_o
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___closed__1;
lean_object* lean_array_uget(lean_object*, size_t);
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___lambda__2___closed__2;
lean_object* l___private_Lean_Elab_Term_0__Lean_Elab_Term_withoutModifyingStateWithInfoAndMessagesImpl___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_List_mapTRAux___at_Lean_resolveGlobalConstCore___spec__2(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Tactic_withRWRulesSeq___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Std_Format_defWidth;
@ -49,7 +50,6 @@ lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConstCore___at_Lean_Elab_Tactic_withRWRulesSeq___spec__5___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_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__5;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___spec__10(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_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__2;
static lean_object* l_Lean_Elab_Tactic_withRWRulesSeq_go___closed__3;
LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___boxed(lean_object**);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__10;
@ -78,11 +78,11 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_rewriteTarget___boxed(lean_object*,
static lean_object* l_Lean_Elab_Tactic_withRWRulesSeq_go___closed__4;
static lean_object* l_Lean_resolveGlobalConstNoOverload___at_Lean_Elab_Tactic_withRWRulesSeq___spec__1___closed__2;
lean_object* lean_nat_add(lean_object*, lean_object*);
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__5;
LEAN_EXPORT lean_object* l_Lean_throwErrorAt___at_Lean_Elab_Tactic_withRWRulesSeq___spec__8(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_List_mapTRAux___at_Lean_resolveGlobalConstNoOverload___spec__1(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__5;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___lambda__1(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*);
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__10;
static lean_object* l_Lean_Elab_Tactic_withRWRulesSeq_go___closed__1;
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___lambda__2___closed__6;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_withRWRulesSeq_go___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*);
@ -103,7 +103,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_rewriteLocalDecl___boxed(lean_object
lean_object* l_Lean_Elab_Tactic_mkInitialTacticInfo(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_expandOptLocation(lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___spec__4___boxed(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_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4;
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__7;
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___closed__6;
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__2;
lean_object* l_Lean_replaceRef(lean_object*, lean_object*);
@ -112,7 +112,6 @@ static lean_object* l_Lean_resolveGlobalConst___at_Lean_Elab_Tactic_withRWRulesS
lean_object* l_Lean_Elab_Tactic_getMainTarget(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___lambda__2___closed__1;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___spec__4(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_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__8;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_rewriteTarget___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*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq_declRange___closed__6;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -127,7 +126,6 @@ lean_object* l_Lean_MVarId_replaceTargetEq(lean_object*, lean_object*, lean_obje
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___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___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__11;
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapM___at_Lean_Elab_Tactic_elabRewriteConfig___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_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__1;
lean_object* l_Lean_addBuiltinDeclarationRanges(lean_object*, lean_object*, lean_object*);
lean_object* lean_array_to_list(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__1;
@ -146,6 +144,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_rewriteLocalDecl___lambda__1(lean_ob
LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___lambda__1(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*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___spec__11(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapMAux___at_Lean_Elab_Tactic_elabRewriteConfig___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
size_t lean_usize_of_nat(lean_object*);
extern lean_object* l_Lean_Elab_Tactic_tacticElabAttribute;
static lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___lambda__2___closed__4;
@ -167,23 +166,21 @@ static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__2;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___spec__11___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_Expr_const___override(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__5;
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__6;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabRewriteConfig(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___spec__5(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getEqnsFor_x3f(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13(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_resolveGlobalConstNoOverload___at_Lean_Elab_Tactic_withRWRulesSeq___spec__1___closed__3;
lean_object* l_panic___at_Lean_expandExplicitBindersAux_loop___spec__1(lean_object*);
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__4;
static lean_object* l_Lean_resolveGlobalConst___at_Lean_Elab_Tactic_withRWRulesSeq___spec__2___closed__3;
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__3;
lean_object* l_Lean_Elab_Term_SavedState_restore(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Syntax_getArgs(lean_object*);
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapMAux___at_Lean_Elab_Tactic_elabRewriteConfig___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_rewriteLocalDecl___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*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___lambda__2(lean_object*, uint8_t, 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*);
lean_object* l_Lean_Elab_Term_addTermInfo(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*);
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__6;
lean_object* l___private_Lean_Elab_SyntheticMVars_0__Lean_Elab_Term_withSynthesizeImp___rarg(lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___lambda__2___closed__5;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__9;
@ -191,6 +188,7 @@ lean_object* l_Lean_Elab_withInfoTreeContext___at_Lean_Elab_Tactic_evalTactic_ev
lean_object* l_Lean_instantiateMVars___at_Lean_Elab_Term_MVarErrorInfo_logError___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___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_nat_mul(lean_object*, lean_object*);
lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*);
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Tactic_withRWRulesSeq___spec__10___closed__5;
@ -209,12 +207,15 @@ LEAN_EXPORT lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Tactic_withR
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConstCore___at_Lean_Elab_Tactic_withRWRulesSeq___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Syntax_isOfKind(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___lambda__3___closed__1;
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__8;
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__2;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___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*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___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*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___closed__9;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__8;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq___closed__6;
lean_object* l_Lean_Elab_Tactic_replaceMainGoal(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_Tactic_elabRewriteConfig___closed__4;
lean_object* l_Lean_Elab_Tactic_withoutRecover___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConstCore___at_Lean_Elab_Tactic_withRWRulesSeq___spec__5___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*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -231,11 +232,8 @@ LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewrit
lean_object* l_List_toString___at_Lean_resolveGlobalConstNoOverloadCore___spec__2(lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabRewriteConfig___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___regBuiltin_Lean_Elab_Tactic_evalRewriteSeq_declRange___closed__4;
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__3;
lean_object* l_Lean_Elab_Term_saveState___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalRewriteSeq___lambda__3(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* l_Lean_Syntax_formatStxAux(lean_object*, uint8_t, lean_object*, lean_object*);
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__7;
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapM___at_Lean_Elab_Tactic_elabRewriteConfig___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Tactic_withRWRulesSeq___spec__7___closed__1;
lean_object* l___private_Lean_Elab_SyntheticMVars_0__Lean_Elab_Term_withSynthesizeImp___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -4640,89 +4638,58 @@ return x_115;
}
}
}
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12(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_EXPORT lean_object* l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12(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; lean_object* x_11; lean_object* x_12;
x_9 = l_Lean_Elab_Term_saveState___rarg(x_3, x_4, x_5, x_6, x_7, x_8);
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
x_11 = lean_ctor_get(x_9, 1);
lean_object* x_9;
x_9 = l___private_Lean_Elab_Term_0__Lean_Elab_Term_withoutModifyingStateWithInfoAndMessagesImpl___rarg(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_9) == 0)
{
uint8_t x_10;
x_10 = !lean_is_exclusive(x_9);
if (x_10 == 0)
{
return x_9;
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_11 = lean_ctor_get(x_9, 0);
x_12 = lean_ctor_get(x_9, 1);
lean_inc(x_12);
lean_inc(x_11);
lean_dec(x_9);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_12 = lean_apply_7(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_11);
if (lean_obj_tag(x_12) == 0)
{
lean_object* x_13; lean_object* x_14; uint8_t x_15; lean_object* x_16; uint8_t x_17;
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 = 0;
x_16 = l_Lean_Elab_Term_SavedState_restore(x_10, x_15, x_2, x_3, x_4, x_5, x_6, x_7, x_14);
x_17 = !lean_is_exclusive(x_16);
if (x_17 == 0)
{
lean_object* x_18;
x_18 = lean_ctor_get(x_16, 0);
lean_dec(x_18);
lean_ctor_set(x_16, 0, x_13);
return x_16;
}
else
{
lean_object* x_19; lean_object* x_20;
x_19 = lean_ctor_get(x_16, 1);
lean_inc(x_19);
lean_dec(x_16);
x_20 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_20, 0, x_13);
lean_ctor_set(x_20, 1, x_19);
return x_20;
x_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_11);
lean_ctor_set(x_13, 1, x_12);
return x_13;
}
}
else
{
lean_object* x_21; lean_object* x_22; uint8_t x_23; lean_object* x_24; uint8_t x_25;
x_21 = lean_ctor_get(x_12, 0);
lean_inc(x_21);
x_22 = lean_ctor_get(x_12, 1);
lean_inc(x_22);
lean_dec(x_12);
x_23 = 0;
x_24 = l_Lean_Elab_Term_SavedState_restore(x_10, x_23, x_2, x_3, x_4, x_5, x_6, x_7, x_22);
x_25 = !lean_is_exclusive(x_24);
if (x_25 == 0)
uint8_t x_14;
x_14 = !lean_is_exclusive(x_9);
if (x_14 == 0)
{
lean_object* x_26;
x_26 = lean_ctor_get(x_24, 0);
lean_dec(x_26);
lean_ctor_set_tag(x_24, 1);
lean_ctor_set(x_24, 0, x_21);
return x_24;
return x_9;
}
else
{
lean_object* x_27; lean_object* x_28;
x_27 = lean_ctor_get(x_24, 1);
lean_inc(x_27);
lean_dec(x_24);
x_28 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_28, 0, x_21);
lean_ctor_set(x_28, 1, x_27);
return x_28;
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_9, 0);
x_16 = lean_ctor_get(x_9, 1);
lean_inc(x_16);
lean_inc(x_15);
lean_dec(x_9);
x_17 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_17, 0, x_15);
lean_ctor_set(x_17, 1, x_16);
return x_17;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___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, lean_object* x_9, lean_object* x_10) {
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabRewriteConfig___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, lean_object* x_9, lean_object* x_10) {
_start:
{
uint8_t x_11; lean_object* x_12;
@ -4825,7 +4792,7 @@ return x_26;
}
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__1() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__1() {
_start:
{
lean_object* x_1;
@ -4833,21 +4800,21 @@ x_1 = l_Std_PersistentHashMap_mkEmptyEntriesArray(lean_box(0), lean_box(0));
return x_1;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__2() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__1;
x_1 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__1;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__3() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__2;
x_1 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__2;
x_2 = lean_unsigned_to_nat(0u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -4855,7 +4822,7 @@ lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
@ -4864,23 +4831,23 @@ x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__5() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4;
x_1 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__4;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__6() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__6() {
_start:
{
size_t x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_1 = 5;
x_2 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__5;
x_3 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4;
x_2 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__5;
x_3 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__4;
x_4 = lean_unsigned_to_nat(0u);
x_5 = lean_alloc_ctor(0, 4, sizeof(size_t)*1);
lean_ctor_set(x_5, 0, x_2);
@ -4891,19 +4858,19 @@ lean_ctor_set_usize(x_5, 4, x_1);
return x_5;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__7() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__7() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__3;
x_2 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__6;
x_1 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__3;
x_2 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__6;
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__8() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__8() {
_start:
{
lean_object* x_1; lean_object* x_2;
@ -4912,103 +4879,7 @@ x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13(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; uint8_t x_12; uint8_t x_13; 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_11 = lean_alloc_closure((void*)(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___lambda__1), 10, 3);
lean_closure_set(x_11, 0, x_1);
lean_closure_set(x_11, 1, x_2);
lean_closure_set(x_11, 2, x_3);
x_12 = 0;
x_13 = 1;
x_14 = lean_box(x_12);
x_15 = lean_box(x_13);
x_16 = lean_alloc_closure((void*)(l___private_Lean_Elab_SyntheticMVars_0__Lean_Elab_Term_withSynthesizeImp___rarg___boxed), 10, 3);
lean_closure_set(x_16, 0, x_11);
lean_closure_set(x_16, 1, x_14);
lean_closure_set(x_16, 2, x_15);
x_17 = lean_alloc_closure((void*)(l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabRewriteConfig___spec__1), 8, 1);
lean_closure_set(x_17, 0, x_16);
x_18 = l_Lean_Elab_Term_saveState___rarg(x_5, x_6, x_7, x_8, x_9, x_10);
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_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__7;
x_22 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__8;
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_23 = l_Lean_Meta_withLCtx___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_FunBinders_elabFunBinderViews___spec__3___rarg(x_21, x_22, x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_20);
if (lean_obj_tag(x_23) == 0)
{
lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27;
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 = l_Lean_Elab_Term_SavedState_restore(x_19, x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_25);
x_27 = !lean_is_exclusive(x_26);
if (x_27 == 0)
{
lean_object* x_28;
x_28 = lean_ctor_get(x_26, 0);
lean_dec(x_28);
lean_ctor_set(x_26, 0, x_24);
return x_26;
}
else
{
lean_object* x_29; lean_object* x_30;
x_29 = lean_ctor_get(x_26, 1);
lean_inc(x_29);
lean_dec(x_26);
x_30 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_30, 0, x_24);
lean_ctor_set(x_30, 1, x_29);
return x_30;
}
}
else
{
lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
x_31 = lean_ctor_get(x_23, 0);
lean_inc(x_31);
x_32 = lean_ctor_get(x_23, 1);
lean_inc(x_32);
lean_dec(x_23);
x_33 = l_Lean_Elab_Term_SavedState_restore(x_19, x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_32);
x_34 = !lean_is_exclusive(x_33);
if (x_34 == 0)
{
lean_object* x_35;
x_35 = lean_ctor_get(x_33, 0);
lean_dec(x_35);
lean_ctor_set_tag(x_33, 1);
lean_ctor_set(x_33, 0, x_31);
return x_33;
}
else
{
lean_object* x_36; lean_object* x_37;
x_36 = lean_ctor_get(x_33, 1);
lean_inc(x_36);
lean_dec(x_33);
x_37 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_37, 0, x_31);
lean_ctor_set(x_37, 1, x_36);
return x_37;
}
}
}
}
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__1() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__9() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
@ -5018,17 +4889,17 @@ x_3 = l_Lean_Expr_const___override(x_2, x_1);
return x_3;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__2() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__10() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__1;
x_1 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__9;
x_2 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__3() {
static lean_object* _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__11() {
_start:
{
uint8_t x_1; uint8_t x_2; lean_object* x_3;
@ -5047,77 +4918,97 @@ uint8_t x_9;
x_9 = l_Lean_Syntax_isNone(x_1);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; uint8_t 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; lean_object* x_25; lean_object* x_26;
x_10 = lean_unsigned_to_nat(0u);
x_11 = l_Lean_Syntax_getArg(x_1, x_10);
x_12 = lean_unsigned_to_nat(3u);
x_13 = l_Lean_Syntax_getArg(x_11, x_12);
lean_dec(x_11);
x_14 = lean_box(0);
x_15 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__2;
x_15 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__10;
x_16 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_elabRewriteConfig___lambda__1), 10, 3);
lean_closure_set(x_16, 0, x_13);
lean_closure_set(x_16, 1, x_15);
lean_closure_set(x_16, 2, x_14);
x_17 = 0;
x_18 = 1;
x_19 = lean_box(x_17);
x_20 = lean_box(x_18);
x_21 = lean_alloc_closure((void*)(l___private_Lean_Elab_SyntheticMVars_0__Lean_Elab_Term_withSynthesizeImp___rarg___boxed), 10, 3);
lean_closure_set(x_21, 0, x_16);
lean_closure_set(x_21, 1, x_19);
lean_closure_set(x_21, 2, x_20);
x_22 = lean_alloc_closure((void*)(l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabRewriteConfig___spec__1), 8, 1);
lean_closure_set(x_22, 0, x_21);
x_23 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__7;
x_24 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__8;
x_25 = lean_alloc_closure((void*)(l_Lean_Meta_withLCtx___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_FunBinders_elabFunBinderViews___spec__3___rarg), 10, 3);
lean_closure_set(x_25, 0, x_23);
lean_closure_set(x_25, 1, x_24);
lean_closure_set(x_25, 2, x_22);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_16 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13(x_13, x_15, x_14, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_16) == 0)
x_26 = l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12(x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
x_18 = lean_ctor_get(x_16, 1);
lean_inc(x_18);
lean_dec(x_16);
x_19 = l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058_(x_17, x_2, x_3, x_4, x_5, x_6, x_7, x_18);
lean_object* x_27; lean_object* x_28; lean_object* x_29;
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 = l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058_(x_27, x_2, x_3, x_4, x_5, x_6, x_7, x_28);
lean_dec(x_3);
lean_dec(x_2);
return x_19;
return x_29;
}
else
{
uint8_t x_20;
uint8_t x_30;
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_20 = !lean_is_exclusive(x_16);
if (x_20 == 0)
x_30 = !lean_is_exclusive(x_26);
if (x_30 == 0)
{
return x_16;
return x_26;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = lean_ctor_get(x_16, 0);
x_22 = lean_ctor_get(x_16, 1);
lean_inc(x_22);
lean_inc(x_21);
lean_dec(x_16);
x_23 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_23, 0, x_21);
lean_ctor_set(x_23, 1, x_22);
return x_23;
lean_object* x_31; lean_object* x_32; lean_object* x_33;
x_31 = lean_ctor_get(x_26, 0);
x_32 = lean_ctor_get(x_26, 1);
lean_inc(x_32);
lean_inc(x_31);
lean_dec(x_26);
x_33 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set(x_33, 1, x_32);
return x_33;
}
}
}
else
{
lean_object* x_24; lean_object* x_25;
lean_object* x_34; lean_object* x_35;
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_24 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__3;
x_25 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_25, 0, x_24);
lean_ctor_set(x_25, 1, x_8);
return x_25;
x_34 = l_Lean_Elab_Tactic_elabRewriteConfig___closed__11;
x_35 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_35, 0, x_34);
lean_ctor_set(x_35, 1, x_8);
return x_35;
}
}
}
@ -5815,28 +5706,28 @@ l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____clos
lean_mark_persistent(l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__5);
l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__6 = _init_l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__6();
lean_mark_persistent(l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Rewrite___hyg_1058____closed__6);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__1 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__1();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__1);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__2 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__2();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__2);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__3 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__3();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__3);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__4);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__5 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__5();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__5);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__6 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__6();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__6);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__7 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__7();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__7);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__8 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__8();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabRewriteConfig___spec__12___at_Lean_Elab_Tactic_elabRewriteConfig___spec__13___closed__8);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__1 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__1();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__1);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__2 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__2();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__2);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__3 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__3();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__3);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__4 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__4();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__4);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__5 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__5();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__5);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__6 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__6();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__6);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__7 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__7();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__7);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__8 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__8();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__8);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__9 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__9();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__9);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__10 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__10();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__10);
l_Lean_Elab_Tactic_elabRewriteConfig___closed__11 = _init_l_Lean_Elab_Tactic_elabRewriteConfig___closed__11();
lean_mark_persistent(l_Lean_Elab_Tactic_elabRewriteConfig___closed__11);
l_Lean_Elab_Tactic_evalRewriteSeq___lambda__2___closed__1 = _init_l_Lean_Elab_Tactic_evalRewriteSeq___lambda__2___closed__1();
lean_mark_persistent(l_Lean_Elab_Tactic_evalRewriteSeq___lambda__2___closed__1);
l_Lean_Elab_Tactic_evalRewriteSeq___lambda__2___closed__2 = _init_l_Lean_Elab_Tactic_evalRewriteSeq___lambda__2___closed__2();

View file

@ -20,7 +20,6 @@ static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimp_declRange___closed_
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalSimp___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*, lean_object*);
lean_object* lean_array_set(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConstCore___at_Lean_Elab_Tactic_elabSimpArgs___spec__7___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_object*);
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Std_PersistentHashMap_empty___at_Lean_KeyedDeclsAttribute_ExtensionState_declNames___default___spec__1;
size_t lean_usize_add(size_t, size_t);
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Tactic_elabSimpArgs___spec__11(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -46,7 +45,6 @@ static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalDSimp_declRange___closed
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapM___at_Lean_Elab_Tactic_elabSimpConfigCore___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_resolveGlobalConst___at_Lean_Elab_Tactic_elabSimpArgs___spec__4___closed__3;
lean_object* l_List_filterTRAux___at_Lean_resolveGlobalConstCore___spec__1(lean_object*, lean_object*);
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__5;
lean_object* l_Lean_Elab_Tactic_SavedState_restore(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2;
static lean_object* l_Lean_Elab_Tactic_tacticToDischarge___closed__8;
@ -65,10 +63,12 @@ LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Tactic_elabSimpArgs___
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__2;
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_364____closed__2;
lean_object* l_Lean_SourceInfo_fromRef(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimpAll___closed__3;
lean_object* l_List_filterMap___at_Lean_resolveGlobalConst___spec__1(lean_object*);
static lean_object* l_Lean_Elab_Tactic_tacticToDischarge___closed__18;
lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_mkDischargeWrapper___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_pushInfoTree___at_Lean_Elab_Tactic_elabSimpArgs___spec__17___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_Elab_Tactic_tacticToDischarge___closed__5;
@ -77,6 +77,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_simpLocation_go___boxed(lean_object*
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConstNoOverload___at_Lean_Elab_Tactic_elabSimpArgs___spec__3(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_Tactic_tacticToDischarge___closed__14;
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapMAux___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__5;
lean_object* lean_environment_find(lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalDSimp_declRange___closed__3;
lean_object* l_Lean_getConstInfo___at_Lean_Meta_mkConstWithFreshMVarLevels___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -95,7 +96,6 @@ uint8_t lean_name_eq(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Tactic_elabSimpArgs___spec__16___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___regBuiltin_Lean_Elab_Tactic_evalDSimp_declRange___closed__6;
LEAN_EXPORT lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Tactic_elabSimpArgs___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimpAll_declRange___closed__1;
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__6;
LEAN_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_addDeclToUnfoldOrTheorem(lean_object*, lean_object*, uint8_t, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -125,6 +125,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_resolveGlobalConstNoOverloadWithInfo___at_L
lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_simpLocation___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*);
uint8_t lean_usize_dec_lt(size_t, size_t);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__10;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimpAll_declRange___closed__2;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabSimpConfigCore___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*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimp___closed__7;
@ -141,6 +142,7 @@ static lean_object* l_Lean_Elab_Tactic_tacticToDischarge___closed__20;
static lean_object* l_Lean_Elab_Tactic_mkSimpContext___closed__1;
static lean_object* l_Lean_resolveGlobalConst___at_Lean_Elab_Tactic_elabSimpArgs___spec__4___closed__2;
LEAN_EXPORT lean_object* l_Std_PersistentArray_mapMAux___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__9;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_mkSimpContext___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_EXPORT lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_364____closed__3;
@ -151,7 +153,6 @@ LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Tactic_evalDSimp(lean_object*)
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_evalSimpAll(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_addSimpTheorem___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_List_mapTRAux___at_Lean_resolveGlobalConstNoOverload___spec__1(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13(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_SimpTheorems_erase___at_Lean_Elab_Tactic_elabSimpArgs___spec__18___closed__1;
uint8_t l_Std_PersistentHashMap_contains___at_Lean_Meta_SimpTheorems_erase___spec__1(lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimpAll___closed__1;
@ -171,7 +172,6 @@ lean_object* lean_array_fget(lean_object*, lean_object*);
lean_object* l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__4;
static lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Tactic_elabSimpArgs___spec__9___closed__4;
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2;
static lean_object* l_Lean_resolveGlobalConstNoOverload___at_Lean_Elab_Tactic_elabSimpArgs___spec__3___closed__3;
static lean_object* l_Lean_Elab_Tactic_tacticToDischarge___closed__3;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabSimpArgs_resolveSimpIdTheorem_x3f(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -189,12 +189,10 @@ lean_object* l_Lean_Elab_Tactic_expandOptLocation(lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_addSimpTheorem___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Meta_SimpTheorems_isLemma(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__9___boxed(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_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__1;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_dsimpLocation___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_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_beqSimpKind____x40_Lean_Elab_Tactic_Simp___hyg_554____boxed(lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_simpExtension;
static lean_object* l_Lean_Elab_Tactic_mkSimpContext___lambda__3___closed__1;
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4;
lean_object* l_Lean_Elab_Term_elabTerm(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lean_Elab_Tactic_instInhabitedSimpKind;
LEAN_EXPORT lean_object* l_Lean_throwUnknownConstant___at_Lean_Elab_Tactic_elabSimpArgs___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -208,15 +206,14 @@ lean_object* l_Lean_throwError___at___private_Lean_Meta_RecursorInfo_0__Lean_Met
static lean_object* l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_185____closed__2;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimpAll___closed__4;
static lean_object* l_Lean_Elab_Tactic_elabDSimpConfigCore___closed__3;
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6;
LEAN_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_addDeclToUnfoldOrTheorem___lambda__1(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpArgs_resolveSimpIdTheorem_x3f___closed__3;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimp_declRange___closed__7;
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
static lean_object* l_Lean_Elab_Tactic_mkSimpContext___lambda__2___closed__5;
LEAN_EXPORT lean_object* l_Lean_resolveGlobalConst___at_Lean_Elab_Tactic_elabSimpArgs___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalDSimp_declRange___closed__7;
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabSimpConfig(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4;
static lean_object* l_Lean_Elab_Tactic_mkSimpContext___lambda__2___closed__4;
static lean_object* l_Lean_Elab_Tactic_tacticToDischarge___lambda__3___closed__2;
static lean_object* l_Lean_Elab_Tactic_instBEqSimpKind___closed__1;
@ -241,8 +238,10 @@ lean_object* l_Lean_Elab_Term_resolveId_x3f(lean_object*, lean_object*, uint8_t,
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabSimpArgs_resolveSimpIdTheorem_x3f___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_Elab_Tactic_tacticToDischarge___closed__19;
static lean_object* l_Lean_Elab_Tactic_elabSimpArgs_resolveSimpIdTheorem_x3f___closed__1;
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalDSimp_declRange___closed__4;
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCtxCore___closed__3;
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6;
static lean_object* l_Lean_Elab_Tactic_mkSimpContext___lambda__2___closed__2;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__4___boxed(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___regBuiltin_Lean_Elab_Tactic_evalDSimp___closed__4;
@ -300,6 +299,7 @@ LEAN_EXPORT lean_object* l_Lean_resolveGlobalName___at_Lean_Elab_Tactic_elabSimp
LEAN_EXPORT lean_object* l___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_addSimpTheorem___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__11;
lean_object* l_Lean_Expr_const___override(lean_object*, lean_object*);
lean_object* l_Lean_Syntax_getSepArgs(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_Simp_DischargeWrapper_with___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -310,11 +310,9 @@ lean_object* l_Lean_Expr_eta(lean_object*);
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimp_declRange___closed__6;
static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Tactic_elabSimpArgs___spec__20___closed__2;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalSimp___closed__1;
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Tactic_elabSimpArgs___spec__20___closed__4;
uint8_t l_Lean_Expr_hasMVar(lean_object*);
LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Tactic_tacticToDischarge___spec__1___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_SavedState_restore(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Syntax_getKind(lean_object*);
lean_object* l_Lean_Meta_dsimpGoal(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_simpAll(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -345,8 +343,8 @@ lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3;
static lean_object* l_Lean_Elab_Tactic_tacticToDischarge___lambda__3___closed__3;
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7;
lean_object* l_Lean_Meta_simpGoal(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__3;
lean_object* l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Tactic_elabSimpArgs___spec__15___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_resolveGlobalConstNoOverloadWithInfo___at_Lean_Elab_Tactic_elabSimpArgs___spec__2___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -423,7 +421,6 @@ LEAN_EXPORT lean_object* l_Lean_Elab_addConstInfo___at_Lean_Elab_Tactic_elabSimp
lean_object* l_Lean_Elab_Term_isLocalIdent_x3f(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_constName_x21(lean_object*);
static lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Tactic_elabSimpArgs___spec__1___rarg___closed__1;
lean_object* l_Lean_Elab_Term_saveState___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__11___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_Simp_defaultMaxSteps;
static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalDSimp_declRange___closed__2;
@ -1675,89 +1672,58 @@ return x_115;
}
}
}
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(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_EXPORT lean_object* l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(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; lean_object* x_11; lean_object* x_12;
x_9 = l_Lean_Elab_Term_saveState___rarg(x_3, x_4, x_5, x_6, x_7, x_8);
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
x_11 = lean_ctor_get(x_9, 1);
lean_object* x_9;
x_9 = l___private_Lean_Elab_Term_0__Lean_Elab_Term_withoutModifyingStateWithInfoAndMessagesImpl___rarg(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_9) == 0)
{
uint8_t x_10;
x_10 = !lean_is_exclusive(x_9);
if (x_10 == 0)
{
return x_9;
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_11 = lean_ctor_get(x_9, 0);
x_12 = lean_ctor_get(x_9, 1);
lean_inc(x_12);
lean_inc(x_11);
lean_dec(x_9);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_12 = lean_apply_7(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_11);
if (lean_obj_tag(x_12) == 0)
{
lean_object* x_13; lean_object* x_14; uint8_t x_15; lean_object* x_16; uint8_t x_17;
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 = 0;
x_16 = l_Lean_Elab_Term_SavedState_restore(x_10, x_15, x_2, x_3, x_4, x_5, x_6, x_7, x_14);
x_17 = !lean_is_exclusive(x_16);
if (x_17 == 0)
{
lean_object* x_18;
x_18 = lean_ctor_get(x_16, 0);
lean_dec(x_18);
lean_ctor_set(x_16, 0, x_13);
return x_16;
}
else
{
lean_object* x_19; lean_object* x_20;
x_19 = lean_ctor_get(x_16, 1);
lean_inc(x_19);
lean_dec(x_16);
x_20 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_20, 0, x_13);
lean_ctor_set(x_20, 1, x_19);
return x_20;
x_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_11);
lean_ctor_set(x_13, 1, x_12);
return x_13;
}
}
else
{
lean_object* x_21; lean_object* x_22; uint8_t x_23; lean_object* x_24; uint8_t x_25;
x_21 = lean_ctor_get(x_12, 0);
lean_inc(x_21);
x_22 = lean_ctor_get(x_12, 1);
lean_inc(x_22);
lean_dec(x_12);
x_23 = 0;
x_24 = l_Lean_Elab_Term_SavedState_restore(x_10, x_23, x_2, x_3, x_4, x_5, x_6, x_7, x_22);
x_25 = !lean_is_exclusive(x_24);
if (x_25 == 0)
uint8_t x_14;
x_14 = !lean_is_exclusive(x_9);
if (x_14 == 0)
{
lean_object* x_26;
x_26 = lean_ctor_get(x_24, 0);
lean_dec(x_26);
lean_ctor_set_tag(x_24, 1);
lean_ctor_set(x_24, 0, x_21);
return x_24;
return x_9;
}
else
{
lean_object* x_27; lean_object* x_28;
x_27 = lean_ctor_get(x_24, 1);
lean_inc(x_27);
lean_dec(x_24);
x_28 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_28, 0, x_21);
lean_ctor_set(x_28, 1, x_27);
return x_28;
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_9, 0);
x_16 = lean_ctor_get(x_9, 1);
lean_inc(x_16);
lean_inc(x_15);
lean_dec(x_9);
x_17 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_17, 0, x_15);
lean_ctor_set(x_17, 1, x_16);
return x_17;
}
}
}
}
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___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, lean_object* x_9, lean_object* x_10) {
LEAN_EXPORT lean_object* l_Lean_Elab_Tactic_elabSimpConfigCore___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, lean_object* x_9, lean_object* x_10) {
_start:
{
uint8_t x_11; lean_object* x_12;
@ -1860,7 +1826,7 @@ return x_26;
}
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__1() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1() {
_start:
{
lean_object* x_1;
@ -1868,21 +1834,21 @@ x_1 = l_Std_PersistentHashMap_mkEmptyEntriesArray(lean_box(0), lean_box(0));
return x_1;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__1;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__3() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2;
x_2 = lean_unsigned_to_nat(0u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -1890,7 +1856,7 @@ lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
@ -1899,23 +1865,23 @@ x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__5() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6() {
_start:
{
size_t x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_1 = 5;
x_2 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__5;
x_3 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4;
x_2 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__5;
x_3 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4;
x_4 = lean_unsigned_to_nat(0u);
x_5 = lean_alloc_ctor(0, 4, sizeof(size_t)*1);
lean_ctor_set(x_5, 0, x_2);
@ -1926,19 +1892,19 @@ lean_ctor_set_usize(x_5, 4, x_1);
return x_5;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__3;
x_2 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3;
x_2 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6;
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8() {
_start:
{
lean_object* x_1; lean_object* x_2;
@ -1947,103 +1913,7 @@ x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13(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; uint8_t x_12; uint8_t x_13; 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_11 = lean_alloc_closure((void*)(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___lambda__1), 10, 3);
lean_closure_set(x_11, 0, x_1);
lean_closure_set(x_11, 1, x_2);
lean_closure_set(x_11, 2, x_3);
x_12 = 0;
x_13 = 1;
x_14 = lean_box(x_12);
x_15 = lean_box(x_13);
x_16 = lean_alloc_closure((void*)(l___private_Lean_Elab_SyntheticMVars_0__Lean_Elab_Term_withSynthesizeImp___rarg___boxed), 10, 3);
lean_closure_set(x_16, 0, x_11);
lean_closure_set(x_16, 1, x_14);
lean_closure_set(x_16, 2, x_15);
x_17 = lean_alloc_closure((void*)(l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__1), 8, 1);
lean_closure_set(x_17, 0, x_16);
x_18 = l_Lean_Elab_Term_saveState___rarg(x_5, x_6, x_7, x_8, x_9, x_10);
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_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7;
x_22 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_23 = l_Lean_Meta_withLCtx___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_FunBinders_elabFunBinderViews___spec__3___rarg(x_21, x_22, x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_20);
if (lean_obj_tag(x_23) == 0)
{
lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27;
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 = l_Lean_Elab_Term_SavedState_restore(x_19, x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_25);
x_27 = !lean_is_exclusive(x_26);
if (x_27 == 0)
{
lean_object* x_28;
x_28 = lean_ctor_get(x_26, 0);
lean_dec(x_28);
lean_ctor_set(x_26, 0, x_24);
return x_26;
}
else
{
lean_object* x_29; lean_object* x_30;
x_29 = lean_ctor_get(x_26, 1);
lean_inc(x_29);
lean_dec(x_26);
x_30 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_30, 0, x_24);
lean_ctor_set(x_30, 1, x_29);
return x_30;
}
}
else
{
lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
x_31 = lean_ctor_get(x_23, 0);
lean_inc(x_31);
x_32 = lean_ctor_get(x_23, 1);
lean_inc(x_32);
lean_dec(x_23);
x_33 = l_Lean_Elab_Term_SavedState_restore(x_19, x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_32);
x_34 = !lean_is_exclusive(x_33);
if (x_34 == 0)
{
lean_object* x_35;
x_35 = lean_ctor_get(x_33, 0);
lean_dec(x_35);
lean_ctor_set_tag(x_33, 1);
lean_ctor_set(x_33, 0, x_31);
return x_33;
}
else
{
lean_object* x_36; lean_object* x_37;
x_36 = lean_ctor_get(x_33, 1);
lean_inc(x_36);
lean_dec(x_33);
x_37 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_37, 0, x_31);
lean_ctor_set(x_37, 1, x_36);
return x_37;
}
}
}
}
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__9() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
@ -2053,17 +1923,17 @@ x_3 = l_Lean_Expr_const___override(x_2, x_1);
return x_3;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__10() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__9;
x_2 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3() {
static lean_object* _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__11() {
_start:
{
lean_object* x_1; lean_object* x_2; uint8_t x_3; uint8_t x_4; uint8_t x_5; lean_object* x_6;
@ -2098,77 +1968,97 @@ uint8_t x_9;
x_9 = l_Lean_Syntax_isNone(x_1);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; uint8_t 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; lean_object* x_25; lean_object* x_26;
x_10 = lean_unsigned_to_nat(0u);
x_11 = l_Lean_Syntax_getArg(x_1, x_10);
x_12 = lean_unsigned_to_nat(3u);
x_13 = l_Lean_Syntax_getArg(x_11, x_12);
lean_dec(x_11);
x_14 = lean_box(0);
x_15 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2;
x_15 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__10;
x_16 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_elabSimpConfigCore___lambda__1), 10, 3);
lean_closure_set(x_16, 0, x_13);
lean_closure_set(x_16, 1, x_15);
lean_closure_set(x_16, 2, x_14);
x_17 = 0;
x_18 = 1;
x_19 = lean_box(x_17);
x_20 = lean_box(x_18);
x_21 = lean_alloc_closure((void*)(l___private_Lean_Elab_SyntheticMVars_0__Lean_Elab_Term_withSynthesizeImp___rarg___boxed), 10, 3);
lean_closure_set(x_21, 0, x_16);
lean_closure_set(x_21, 1, x_19);
lean_closure_set(x_21, 2, x_20);
x_22 = lean_alloc_closure((void*)(l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__1), 8, 1);
lean_closure_set(x_22, 0, x_21);
x_23 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7;
x_24 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
x_25 = lean_alloc_closure((void*)(l_Lean_Meta_withLCtx___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_FunBinders_elabFunBinderViews___spec__3___rarg), 10, 3);
lean_closure_set(x_25, 0, x_23);
lean_closure_set(x_25, 1, x_24);
lean_closure_set(x_25, 2, x_22);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_16 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13(x_13, x_15, x_14, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_16) == 0)
x_26 = l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
x_18 = lean_ctor_get(x_16, 1);
lean_inc(x_18);
lean_dec(x_16);
x_19 = l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6_(x_17, x_2, x_3, x_4, x_5, x_6, x_7, x_18);
lean_object* x_27; lean_object* x_28; lean_object* x_29;
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 = l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6_(x_27, x_2, x_3, x_4, x_5, x_6, x_7, x_28);
lean_dec(x_3);
lean_dec(x_2);
return x_19;
return x_29;
}
else
{
uint8_t x_20;
uint8_t x_30;
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_20 = !lean_is_exclusive(x_16);
if (x_20 == 0)
x_30 = !lean_is_exclusive(x_26);
if (x_30 == 0)
{
return x_16;
return x_26;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = lean_ctor_get(x_16, 0);
x_22 = lean_ctor_get(x_16, 1);
lean_inc(x_22);
lean_inc(x_21);
lean_dec(x_16);
x_23 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_23, 0, x_21);
lean_ctor_set(x_23, 1, x_22);
return x_23;
lean_object* x_31; lean_object* x_32; lean_object* x_33;
x_31 = lean_ctor_get(x_26, 0);
x_32 = lean_ctor_get(x_26, 1);
lean_inc(x_32);
lean_inc(x_31);
lean_dec(x_26);
x_33 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set(x_33, 1, x_32);
return x_33;
}
}
}
else
{
lean_object* x_24; lean_object* x_25;
lean_object* x_34; lean_object* x_35;
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_24 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3;
x_25 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_25, 0, x_24);
lean_ctor_set(x_25, 1, x_8);
return x_25;
x_34 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__11;
x_35 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_35, 0, x_34);
lean_ctor_set(x_35, 1, x_8);
return x_35;
}
}
}
@ -2446,7 +2336,7 @@ x_13 = l_Lean_Syntax_getArg(x_11, x_12);
lean_dec(x_11);
x_14 = lean_box(0);
x_15 = l_Lean_Elab_Tactic_elabSimpConfigCtxCore___closed__2;
x_16 = lean_alloc_closure((void*)(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___lambda__1), 10, 3);
x_16 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_elabSimpConfigCore___lambda__1), 10, 3);
lean_closure_set(x_16, 0, x_13);
lean_closure_set(x_16, 1, x_15);
lean_closure_set(x_16, 2, x_14);
@ -2460,8 +2350,8 @@ lean_closure_set(x_21, 1, x_19);
lean_closure_set(x_21, 2, x_20);
x_22 = lean_alloc_closure((void*)(l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__1), 8, 1);
lean_closure_set(x_22, 0, x_21);
x_23 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7;
x_24 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
x_23 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7;
x_24 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
x_25 = lean_alloc_closure((void*)(l_Lean_Meta_withLCtx___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_FunBinders_elabFunBinderViews___spec__3___rarg), 10, 3);
lean_closure_set(x_25, 0, x_23);
lean_closure_set(x_25, 1, x_24);
@ -2472,7 +2362,7 @@ lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_26 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
x_26 = l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_27; lean_object* x_28; lean_object* x_29;
@ -2643,7 +2533,7 @@ x_13 = l_Lean_Syntax_getArg(x_11, x_12);
lean_dec(x_11);
x_14 = lean_box(0);
x_15 = l_Lean_Elab_Tactic_elabDSimpConfigCore___closed__2;
x_16 = lean_alloc_closure((void*)(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___lambda__1), 10, 3);
x_16 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_elabSimpConfigCore___lambda__1), 10, 3);
lean_closure_set(x_16, 0, x_13);
lean_closure_set(x_16, 1, x_15);
lean_closure_set(x_16, 2, x_14);
@ -2657,8 +2547,8 @@ lean_closure_set(x_21, 1, x_19);
lean_closure_set(x_21, 2, x_20);
x_22 = lean_alloc_closure((void*)(l_Lean_Elab_withSaveInfoContext___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__1), 8, 1);
lean_closure_set(x_22, 0, x_21);
x_23 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7;
x_24 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
x_23 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7;
x_24 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
x_25 = lean_alloc_closure((void*)(l_Lean_Meta_withLCtx___at___private_Lean_Elab_Binders_0__Lean_Elab_Term_FunBinders_elabFunBinderViews___spec__3___rarg), 10, 3);
lean_closure_set(x_25, 0, x_23);
lean_closure_set(x_25, 1, x_24);
@ -2669,7 +2559,7 @@ lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_26 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
x_26 = l_Lean_Elab_withoutModifyingStateWithInfoAndMessages___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12(x_25, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_27; lean_object* x_28; lean_object* x_29;
@ -3484,7 +3374,7 @@ lean_ctor_set(x_27, 0, x_12);
lean_ctor_set(x_27, 1, x_26);
lean_ctor_set(x_27, 2, x_25);
x_28 = l_Lean_Elab_Tactic_tacticToDischarge___closed__13;
x_29 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
x_29 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
lean_inc(x_12);
x_30 = lean_alloc_ctor(1, 3, 0);
lean_ctor_set(x_30, 0, x_12);
@ -4182,7 +4072,7 @@ if (x_11 == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
x_12 = lean_box(0);
x_13 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
x_13 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
x_14 = lean_unsigned_to_nat(1000u);
x_15 = l_Lean_Meta_SimpTheorems_add(x_1, x_13, x_2, x_4, x_3, x_14, x_12, x_6, x_7, x_8, x_9, x_10);
return x_15;
@ -4426,7 +4316,7 @@ lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
x_23 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
x_23 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
x_24 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_24, 0, x_23);
lean_ctor_set(x_24, 1, x_21);
@ -4498,7 +4388,7 @@ lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
x_41 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8;
x_41 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8;
x_42 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_42, 0, x_41);
lean_ctor_set(x_42, 1, x_39);
@ -6281,7 +6171,7 @@ lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24;
x_21 = lean_ctor_get(x_11, 1);
lean_inc(x_21);
lean_dec(x_11);
x_22 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6;
x_22 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6;
x_23 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_23, 0, x_1);
lean_ctor_set(x_23, 1, x_22);
@ -10007,7 +9897,7 @@ static lean_object* _init_l_Lean_Elab_Tactic_mkSimpContext___lambda__2___closed_
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2;
x_1 = l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2;
x_2 = lean_unsigned_to_nat(0u);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -11980,28 +11870,28 @@ l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__7
lean_mark_persistent(l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__7);
l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__8 = _init_l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__8();
lean_mark_persistent(l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_6____closed__8);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__1 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__1();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__1);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__2);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__3 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__3();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__3);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__4);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__5 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__5();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__5);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__6);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__7);
l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8 = _init_l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8();
lean_mark_persistent(l_Lean_withoutModifyingState___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__12___at_Lean_Elab_Tactic_elabSimpConfigCore___spec__13___closed__8);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__1);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__2);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__3);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__4);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__5 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__5();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__5);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__6);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__7);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__8);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__9 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__9();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__9);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__10 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__10();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__10);
l_Lean_Elab_Tactic_elabSimpConfigCore___closed__11 = _init_l_Lean_Elab_Tactic_elabSimpConfigCore___closed__11();
lean_mark_persistent(l_Lean_Elab_Tactic_elabSimpConfigCore___closed__11);
l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_185____closed__1 = _init_l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_185____closed__1();
lean_mark_persistent(l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_185____closed__1);
l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_185____closed__2 = _init_l_Lean_Elab_Tactic_evalUnsafe____x40_Lean_Elab_Tactic_Simp___hyg_185____closed__2();

View file

@ -661,6 +661,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Term_exceptionToSorry(lean_object*, lean_ob
static lean_object* l___private_Lean_Elab_Term_0__Lean_Elab_Term_tryLiftAndCoe___closed__5;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_resolveLocalName___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Name_quickCmp(lean_object*, lean_object*);
lean_object* l_Lean_removeLeadingSpaces(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_elabTermAux___spec__1___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Elab_Term_withAuxDecl___spec__3___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_levelMVarToParam___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -944,7 +945,6 @@ static lean_object* l_Lean_Elab_Term_isLetRecAuxMVar___closed__2;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_instMetaEvalTermElabM___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_mkTermElabAttributeUnsafe___closed__17;
LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_Lean_Elab_Term_addAutoBoundImplicits_go___spec__25___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_DocString_0__Lean_removeLeadingSpaces(lean_object*);
static lean_object* l_Lean_Elab_Term_mkExplicitBinder___closed__10;
static lean_object* l_List_foldl___at_Lean_Elab_Term_instAddErrorMessageContextTermElabM___spec__2___closed__2;
static lean_object* l_Lean_Elab_Term_getFVarLocalDecl_x21___closed__4;
@ -62486,7 +62486,7 @@ lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean
x_14 = lean_ctor_get(x_11, 0);
x_15 = lean_ctor_get(x_11, 4);
lean_dec(x_15);
x_16 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_16 = l_Lean_removeLeadingSpaces(x_2);
x_17 = l_Lean_addDocString___at_Lean_Elab_Term_expandDeclId___spec__9___closed__1;
x_18 = l_Lean_MapDeclarationExtension_insert___rarg(x_17, x_14, x_1, x_16);
x_19 = l_Lean_Elab_Tactic_instInhabitedSnapshot___closed__8;
@ -62592,7 +62592,7 @@ lean_inc(x_49);
lean_inc(x_48);
lean_inc(x_47);
lean_dec(x_11);
x_53 = l___private_Lean_DocString_0__Lean_removeLeadingSpaces(x_2);
x_53 = l_Lean_removeLeadingSpaces(x_2);
x_54 = l_Lean_addDocString___at_Lean_Elab_Term_expandDeclId___spec__9___closed__1;
x_55 = l_Lean_MapDeclarationExtension_insert___rarg(x_54, x_47, x_1, x_53);
x_56 = l_Lean_Elab_Tactic_instInhabitedSnapshot___closed__8;

View file

@ -670,6 +670,7 @@ LEAN_EXPORT lean_object* l_Lean_BinderInfo_isInstImplicit___boxed(lean_object*);
extern lean_object* l_Lean_KVMap_empty;
LEAN_EXPORT lean_object* l_Lean_instReprData__1___lambda__5(lean_object*, uint64_t, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_mapTRAux___at_Lean_Expr_instantiateLevelParamsArray___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Expr_isFVarOf___boxed(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lean_BinderInfo_isExplicit(uint8_t);
LEAN_EXPORT uint8_t l_List_foldr___at_Lean_Expr_const___override___spec__3(uint8_t, lean_object*);
static lean_object* l___private_Lean_Expr_0__Lean_reprMVarId____x40_Lean_Expr___hyg_1919____closed__12;
@ -883,6 +884,7 @@ LEAN_EXPORT lean_object* l_Lean_Expr_hasLooseBVars___boxed(lean_object*);
LEAN_EXPORT lean_object* lean_lit_type(lean_object*);
LEAN_EXPORT lean_object* l_Lean_instBEqLiteral;
LEAN_EXPORT lean_object* l_Lean_Expr_getArgD___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lean_Expr_isFVarOf(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_mkFreshLMVarId___rarg(lean_object*, lean_object*);
static lean_object* l_Lean_mkLetFunAnnotation___closed__2;
static lean_object* l_Lean_instBEqBinderInfo___closed__1;
@ -8685,6 +8687,35 @@ x_4 = lean_box(x_3);
return x_4;
}
}
LEAN_EXPORT uint8_t l_Lean_Expr_isFVarOf(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 1)
{
lean_object* x_3; uint8_t x_4;
x_3 = lean_ctor_get(x_1, 0);
x_4 = lean_name_eq(x_3, x_2);
return x_4;
}
else
{
uint8_t x_5;
x_5 = 0;
return x_5;
}
}
}
LEAN_EXPORT lean_object* l_Lean_Expr_isFVarOf___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_Lean_Expr_isFVarOf(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
LEAN_EXPORT uint8_t l_Lean_Expr_isForall(lean_object* x_1) {
_start:
{
@ -9339,7 +9370,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_getRevArg_x21___closed__1;
x_3 = lean_unsigned_to_nat(911u);
x_3 = lean_unsigned_to_nat(922u);
x_4 = lean_unsigned_to_nat(20u);
x_5 = l_Lean_Expr_getRevArg_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -9636,7 +9667,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_appFn_x21___closed__1;
x_3 = lean_unsigned_to_nat(945u);
x_3 = lean_unsigned_to_nat(956u);
x_4 = lean_unsigned_to_nat(15u);
x_5 = l_Lean_Expr_appFn_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -9685,7 +9716,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_appArg_x21___closed__1;
x_3 = lean_unsigned_to_nat(949u);
x_3 = lean_unsigned_to_nat(960u);
x_4 = lean_unsigned_to_nat(15u);
x_5 = l_Lean_Expr_appFn_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -9734,7 +9765,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_appFn_x21_x27___closed__1;
x_3 = lean_unsigned_to_nat(954u);
x_3 = lean_unsigned_to_nat(965u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Expr_appFn_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -9792,7 +9823,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_appArg_x21_x27___closed__1;
x_3 = lean_unsigned_to_nat(959u);
x_3 = lean_unsigned_to_nat(970u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Expr_appFn_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -9858,7 +9889,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_sortLevel_x21___closed__1;
x_3 = lean_unsigned_to_nat(963u);
x_3 = lean_unsigned_to_nat(974u);
x_4 = lean_unsigned_to_nat(14u);
x_5 = l_Lean_Expr_sortLevel_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -9924,7 +9955,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_litValue_x21___closed__1;
x_3 = lean_unsigned_to_nat(967u);
x_3 = lean_unsigned_to_nat(978u);
x_4 = lean_unsigned_to_nat(13u);
x_5 = l_Lean_Expr_litValue_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10151,7 +10182,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_constName_x21___closed__1;
x_3 = lean_unsigned_to_nat(986u);
x_3 = lean_unsigned_to_nat(997u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Expr_constName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10238,7 +10269,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_constLevels_x21___closed__1;
x_3 = lean_unsigned_to_nat(994u);
x_3 = lean_unsigned_to_nat(1005u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Expr_constName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10288,7 +10319,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_bvarIdx_x21___closed__1;
x_3 = lean_unsigned_to_nat(998u);
x_3 = lean_unsigned_to_nat(1009u);
x_4 = lean_unsigned_to_nat(16u);
x_5 = l_Lean_Expr_bvarIdx_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10354,7 +10385,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_fvarId_x21___closed__1;
x_3 = lean_unsigned_to_nat(1002u);
x_3 = lean_unsigned_to_nat(1013u);
x_4 = lean_unsigned_to_nat(14u);
x_5 = l_Lean_Expr_fvarId_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10413,7 +10444,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_mvarId_x21___closed__1;
x_3 = lean_unsigned_to_nat(1006u);
x_3 = lean_unsigned_to_nat(1017u);
x_4 = lean_unsigned_to_nat(14u);
x_5 = l_Lean_Expr_mvarId_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10463,7 +10494,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_bindingName_x21___closed__1;
x_3 = lean_unsigned_to_nat(1011u);
x_3 = lean_unsigned_to_nat(1022u);
x_4 = lean_unsigned_to_nat(23u);
x_5 = l_Lean_Expr_bindingName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10521,7 +10552,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_bindingDomain_x21___closed__1;
x_3 = lean_unsigned_to_nat(1016u);
x_3 = lean_unsigned_to_nat(1027u);
x_4 = lean_unsigned_to_nat(23u);
x_5 = l_Lean_Expr_bindingName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10579,7 +10610,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_bindingBody_x21___closed__1;
x_3 = lean_unsigned_to_nat(1021u);
x_3 = lean_unsigned_to_nat(1032u);
x_4 = lean_unsigned_to_nat(23u);
x_5 = l_Lean_Expr_bindingName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10647,7 +10678,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_bindingInfo_x21___closed__1;
x_3 = lean_unsigned_to_nat(1026u);
x_3 = lean_unsigned_to_nat(1037u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l_Lean_Expr_bindingName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10707,7 +10738,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_letName_x21___closed__1;
x_3 = lean_unsigned_to_nat(1030u);
x_3 = lean_unsigned_to_nat(1041u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Expr_letName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10756,7 +10787,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_letType_x21___closed__1;
x_3 = lean_unsigned_to_nat(1034u);
x_3 = lean_unsigned_to_nat(1045u);
x_4 = lean_unsigned_to_nat(19u);
x_5 = l_Lean_Expr_letName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10805,7 +10836,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_letValue_x21___closed__1;
x_3 = lean_unsigned_to_nat(1038u);
x_3 = lean_unsigned_to_nat(1049u);
x_4 = lean_unsigned_to_nat(21u);
x_5 = l_Lean_Expr_letName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10854,7 +10885,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_letBody_x21___closed__1;
x_3 = lean_unsigned_to_nat(1042u);
x_3 = lean_unsigned_to_nat(1053u);
x_4 = lean_unsigned_to_nat(23u);
x_5 = l_Lean_Expr_letName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10937,7 +10968,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_mdataExpr_x21___closed__1;
x_3 = lean_unsigned_to_nat(1050u);
x_3 = lean_unsigned_to_nat(1061u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Expr_mdataExpr_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -10994,7 +11025,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_projExpr_x21___closed__1;
x_3 = lean_unsigned_to_nat(1054u);
x_3 = lean_unsigned_to_nat(1065u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Expr_projExpr_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -11043,7 +11074,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_projIdx_x21___closed__1;
x_3 = lean_unsigned_to_nat(1058u);
x_3 = lean_unsigned_to_nat(1069u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Expr_projExpr_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -12902,7 +12933,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateApp_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1408u);
x_3 = lean_unsigned_to_nat(1419u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Expr_appFn_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -12981,7 +13012,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateConst_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1419u);
x_3 = lean_unsigned_to_nat(1430u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Expr_constName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13047,7 +13078,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateSort_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1430u);
x_3 = lean_unsigned_to_nat(1441u);
x_4 = lean_unsigned_to_nat(14u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateSort_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13118,7 +13149,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateMData_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1441u);
x_3 = lean_unsigned_to_nat(1452u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateMData_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13186,7 +13217,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateProj_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1452u);
x_3 = lean_unsigned_to_nat(1463u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateProj_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13257,7 +13288,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateForall_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1467u);
x_3 = lean_unsigned_to_nat(1478u);
x_4 = lean_unsigned_to_nat(23u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateForall_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13360,7 +13391,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_updateForallE_x21___closed__1;
x_3 = lean_unsigned_to_nat(1478u);
x_3 = lean_unsigned_to_nat(1489u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateForall_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13466,7 +13497,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateLambda_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1487u);
x_3 = lean_unsigned_to_nat(1498u);
x_4 = lean_unsigned_to_nat(19u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateLambda_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13569,7 +13600,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l_Lean_Expr_updateLambdaE_x21___closed__1;
x_3 = lean_unsigned_to_nat(1498u);
x_3 = lean_unsigned_to_nat(1509u);
x_4 = lean_unsigned_to_nat(20u);
x_5 = l___private_Lean_Expr_0__Lean_Expr_updateLambda_x21Impl___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -13667,7 +13698,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Expr_mkData___closed__5;
x_2 = l___private_Lean_Expr_0__Lean_Expr_updateLet_x21Impl___closed__1;
x_3 = lean_unsigned_to_nat(1507u);
x_3 = lean_unsigned_to_nat(1518u);
x_4 = lean_unsigned_to_nat(22u);
x_5 = l_Lean_Expr_letName_x21___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

View file

@ -4285,49 +4285,69 @@ return x_10;
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14;
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16;
lean_dec(x_5);
x_11 = lean_array_uget(x_2, x_4);
x_12 = lean_unsigned_to_nat(1u);
x_12 = lean_unsigned_to_nat(2u);
x_13 = l_Lean_Syntax_getArg(x_11, x_12);
x_14 = l_Lean_Linter_MissingDocs_declModifiersPubNoDoc(x_13);
lean_dec(x_13);
if (x_14 == 0)
x_14 = lean_unsigned_to_nat(0u);
x_15 = l_Lean_Syntax_getArg(x_11, x_14);
x_16 = l_Lean_Syntax_isNone(x_15);
lean_dec(x_15);
if (x_16 == 0)
{
size_t x_15; size_t x_16; lean_object* x_17;
size_t x_17; size_t x_18; lean_object* x_19;
lean_dec(x_13);
lean_dec(x_11);
x_15 = 1;
x_16 = lean_usize_add(x_4, x_15);
x_17 = lean_box(0);
x_4 = x_16;
x_5 = x_17;
x_17 = 1;
x_18 = lean_usize_add(x_4, x_17);
x_19 = lean_box(0);
x_4 = x_18;
x_5 = x_19;
goto _start;
}
else
{
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; size_t x_27; size_t x_28; lean_object* x_29;
x_19 = l_Lean_Syntax_getArg(x_1, x_12);
x_20 = lean_unsigned_to_nat(0u);
x_21 = l_Lean_Syntax_getArg(x_19, x_20);
lean_dec(x_19);
x_22 = lean_unsigned_to_nat(2u);
x_23 = l_Lean_Syntax_getArg(x_11, x_22);
uint8_t x_21;
x_21 = l_Lean_Linter_MissingDocs_declModifiersPubNoDoc(x_13);
lean_dec(x_13);
if (x_21 == 0)
{
size_t x_22; size_t x_23; lean_object* x_24;
lean_dec(x_11);
x_24 = l_Array_forInUnsafe_loop___at_Lean_Linter_MissingDocs_checkDecl___spec__1___closed__1;
x_25 = l_Lean_Linter_MissingDocs_lintField(x_21, x_23, x_24, x_6, x_7, x_8);
lean_dec(x_23);
lean_dec(x_21);
x_26 = lean_ctor_get(x_25, 1);
lean_inc(x_26);
lean_dec(x_25);
x_27 = 1;
x_28 = lean_usize_add(x_4, x_27);
x_29 = lean_box(0);
x_4 = x_28;
x_5 = x_29;
x_8 = x_26;
x_22 = 1;
x_23 = lean_usize_add(x_4, x_22);
x_24 = lean_box(0);
x_4 = x_23;
x_5 = x_24;
goto _start;
}
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; size_t x_34; size_t x_35; lean_object* x_36;
x_26 = lean_unsigned_to_nat(1u);
x_27 = l_Lean_Syntax_getArg(x_1, x_26);
x_28 = l_Lean_Syntax_getArg(x_27, x_14);
lean_dec(x_27);
x_29 = lean_unsigned_to_nat(3u);
x_30 = l_Lean_Syntax_getArg(x_11, x_29);
lean_dec(x_11);
x_31 = l_Array_forInUnsafe_loop___at_Lean_Linter_MissingDocs_checkDecl___spec__1___closed__1;
x_32 = l_Lean_Linter_MissingDocs_lintField(x_28, x_30, x_31, x_6, x_7, x_8);
lean_dec(x_30);
lean_dec(x_28);
x_33 = lean_ctor_get(x_32, 1);
lean_inc(x_33);
lean_dec(x_32);
x_34 = 1;
x_35 = lean_usize_add(x_4, x_34);
x_36 = lean_box(0);
x_4 = x_35;
x_5 = x_36;
x_8 = x_33;
goto _start;
}
}
}
}
}

View file

@ -233,7 +233,7 @@ LEAN_EXPORT lean_object* l_Lean_addTrace___at_Lean_Meta_processPostponed_loop___
LEAN_EXPORT lean_object* l_Lean_Meta_instMonadEnvMetaM___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Meta_Basic_0__Lean_Meta_forallTelescopeReducingAuxAux_process___rarg___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_EXPORT lean_object* l___private_Lean_Meta_Basic_0__Lean_Meta_isClassExpensive_x3f(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(uint8_t, uint8_t);
uint8_t l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(uint8_t, uint8_t);
static lean_object* l_Lean_Meta_instAlternativeMetaM___closed__2;
LEAN_EXPORT lean_object* l_Lean_Meta_setInlineAttribute___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_withConfig___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -1425,7 +1425,7 @@ x_5 = lean_ctor_get(x_1, 1);
x_6 = lean_ctor_get_uint8(x_2, sizeof(void*)*2);
x_7 = lean_ctor_get(x_2, 0);
x_8 = lean_ctor_get(x_2, 1);
x_9 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_3, x_6);
x_9 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_3, x_6);
if (x_9 == 0)
{
uint8_t x_10;
@ -7262,7 +7262,7 @@ x_8 = lean_ctor_get(x_6, 0);
x_9 = 0;
x_10 = lean_unbox(x_8);
lean_dec(x_8);
x_11 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_10, x_9);
x_11 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_10, x_9);
x_12 = lean_box(x_11);
lean_ctor_set(x_6, 0, x_12);
return x_6;
@ -7278,7 +7278,7 @@ lean_dec(x_6);
x_15 = 0;
x_16 = lean_unbox(x_13);
lean_dec(x_13);
x_17 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_16, x_15);
x_17 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_16, x_15);
x_18 = lean_box(x_17);
x_19 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_19, 0, x_18);
@ -7312,7 +7312,7 @@ x_8 = lean_ctor_get(x_6, 0);
x_9 = 2;
x_10 = lean_unbox(x_8);
lean_dec(x_8);
x_11 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_10, x_9);
x_11 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_10, x_9);
x_12 = lean_box(x_11);
lean_ctor_set(x_6, 0, x_12);
return x_6;
@ -7328,7 +7328,7 @@ lean_dec(x_6);
x_15 = 2;
x_16 = lean_unbox(x_13);
lean_dec(x_13);
x_17 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_16, x_15);
x_17 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_16, x_15);
x_18 = lean_box(x_17);
x_19 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_19, 0, x_18);

View file

@ -4026,7 +4026,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_Closure_collectExprAux___closed__1;
x_2 = l_Lean_Meta_Closure_collectExprAux___closed__2;
x_3 = lean_unsigned_to_nat(1441u);
x_3 = lean_unsigned_to_nat(1452u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Meta_Closure_collectExprAux___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -4055,7 +4055,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_Closure_collectExprAux___closed__1;
x_2 = l_Lean_Meta_Closure_collectExprAux___closed__5;
x_3 = lean_unsigned_to_nat(1452u);
x_3 = lean_unsigned_to_nat(1463u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Meta_Closure_collectExprAux___closed__6;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -4084,7 +4084,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_Closure_collectExprAux___closed__1;
x_2 = l_Lean_Meta_Closure_collectExprAux___closed__8;
x_3 = lean_unsigned_to_nat(1408u);
x_3 = lean_unsigned_to_nat(1419u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Meta_Closure_collectExprAux___closed__9;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -4113,7 +4113,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_Closure_collectExprAux___closed__1;
x_2 = l_Lean_Meta_Closure_collectExprAux___closed__11;
x_3 = lean_unsigned_to_nat(1498u);
x_3 = lean_unsigned_to_nat(1509u);
x_4 = lean_unsigned_to_nat(20u);
x_5 = l_Lean_Meta_Closure_collectExprAux___closed__12;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -4142,7 +4142,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_Closure_collectExprAux___closed__1;
x_2 = l_Lean_Meta_Closure_collectExprAux___closed__14;
x_3 = lean_unsigned_to_nat(1478u);
x_3 = lean_unsigned_to_nat(1489u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l_Lean_Meta_Closure_collectExprAux___closed__15;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -4171,7 +4171,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_Closure_collectExprAux___closed__1;
x_2 = l_Lean_Meta_Closure_collectExprAux___closed__17;
x_3 = lean_unsigned_to_nat(1507u);
x_3 = lean_unsigned_to_nat(1518u);
x_4 = lean_unsigned_to_nat(22u);
x_5 = l_Lean_Meta_Closure_collectExprAux___closed__18;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

View file

@ -23,17 +23,18 @@ lean_object* l_Lean_throwError___at_Lean_Meta_setInlineAttribute___spec__1(lean_
LEAN_EXPORT lean_object* l_List_foldlM___at_Lean_Meta_evalExprCore___spec__12___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_List_foldlM___at_Lean_Meta_evalExprCore___spec__10___closed__3;
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Meta_evalExprCore___spec__15___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3;
LEAN_EXPORT lean_object* l_Lean_Declaration_foldExprM___at_Lean_Meta_evalExprCore___spec__9___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_isCasesOnRecursor(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr_x27(lean_object*);
lean_object* lean_st_ref_get(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Declaration_foldExprM___at_Lean_Meta_evalExprCore___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_throwError___at___private_Lean_Meta_InferType_0__Lean_Meta_inferProjType___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_evalConst___at_Lean_Meta_evalExprCore___spec__13___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_compileDecl___at_Lean_Meta_evalExprCore___spec__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l___private_Lean_Message_0__Lean_beqMessageSeverity____x40_Lean_Message___hyg_101_(uint8_t, uint8_t);
LEAN_EXPORT lean_object* l_Lean_addAndCompile___at_Lean_Meta_evalExprCore___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_FindImpl_findUnsafe_x3f(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_evalExprCore___rarg___closed__5;
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr_x27___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_log___at_Lean_Meta_evalExprCore___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_logAt___at_Lean_Meta_evalExprCore___spec__6___closed__1;
@ -59,7 +60,9 @@ LEAN_EXPORT lean_object* l_Lean_ofExcept___at_Lean_Meta_evalExprCore___spec__14(
static lean_object* l_Lean_addDecl___at_Lean_Meta_evalExprCore___spec__2___closed__1;
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr(lean_object*);
static lean_object* l_Lean_Meta_evalExprCore___rarg___closed__2;
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___rarg___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* l_Lean_FileMap_toPosition(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___rarg___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_List_foldlM___at_Lean_Meta_evalExprCore___spec__10___closed__4;
uint8_t l_Lean_Expr_isConstOf(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore(lean_object*);
@ -77,13 +80,16 @@ LEAN_EXPORT lean_object* l_Lean_throwKernelException___at_Lean_Meta_evalExprCore
static lean_object* l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__2;
static lean_object* l_Lean_addDecl___at_Lean_Meta_evalExprCore___spec__2___closed__2;
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr_x27___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Meta_evalExprCore___rarg___closed__4;
lean_object* l_Lean_Syntax_getPos_x3f(lean_object*, uint8_t);
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
static lean_object* l_List_foldlM___at_Lean_Meta_evalExprCore___spec__10___closed__2;
LEAN_EXPORT lean_object* l_Lean_addDecl___at_Lean_Meta_evalExprCore___spec__2___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___rarg(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_ofExcept___at_Lean_Meta_evalExprCore___spec__14___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Expr_hasMVar(lean_object*);
LEAN_EXPORT uint8_t l_List_foldlM___at_Lean_Meta_evalExprCore___spec__10___lambda__1(lean_object*, lean_object*);
static lean_object* l_Lean_Meta_evalExprCore___rarg___closed__3;
uint8_t lean_is_aux_recursor(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_foldlM___at_Lean_Meta_evalExprCore___spec__11(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_foldlM___at_Lean_Meta_evalExprCore___spec__10(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -91,6 +97,7 @@ LEAN_EXPORT lean_object* l_Lean_addDecl___at_Lean_Meta_evalExprCore___spec__2(le
lean_object* lean_st_ref_set(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*);
lean_object* lean_infer_type(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_instantiateMVars___at___private_Lean_Meta_Basic_0__Lean_Meta_mkLeveErrorMessageCore___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -2498,6 +2505,163 @@ x_2 = lean_alloc_closure((void*)(l_Lean_evalConst___at_Lean_Meta_evalExprCore___
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t 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_dec(x_5);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_1);
x_11 = lean_infer_type(x_1, x_6, x_7, x_8, x_9, x_10);
if (lean_obj_tag(x_11) == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_12 = lean_ctor_get(x_11, 0);
lean_inc(x_12);
x_13 = lean_ctor_get(x_11, 1);
lean_inc(x_13);
lean_dec(x_11);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_12);
x_14 = lean_apply_6(x_2, x_12, x_6, x_7, x_8, x_9, x_13);
if (lean_obj_tag(x_14) == 0)
{
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;
x_15 = lean_ctor_get(x_14, 1);
lean_inc(x_15);
lean_dec(x_14);
x_16 = lean_box(0);
lean_inc(x_3);
x_17 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_17, 0, x_3);
lean_ctor_set(x_17, 1, x_16);
lean_ctor_set(x_17, 2, x_12);
lean_inc(x_3);
x_18 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_18, 0, x_3);
lean_ctor_set(x_18, 1, x_16);
x_19 = lean_box(0);
x_20 = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(x_20, 0, x_17);
lean_ctor_set(x_20, 1, x_1);
lean_ctor_set(x_20, 2, x_19);
lean_ctor_set(x_20, 3, x_18);
lean_ctor_set_uint8(x_20, sizeof(void*)*4, x_4);
x_21 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_21, 0, x_20);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
x_22 = l_Lean_addAndCompile___at_Lean_Meta_evalExprCore___spec__1(x_21, x_6, x_7, x_8, x_9, x_15);
if (lean_obj_tag(x_22) == 0)
{
lean_object* x_23; lean_object* x_24;
x_23 = lean_ctor_get(x_22, 1);
lean_inc(x_23);
lean_dec(x_22);
x_24 = l_Lean_evalConst___at_Lean_Meta_evalExprCore___spec__13___rarg(x_3, x_6, x_7, x_8, x_9, x_23);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
return x_24;
}
else
{
uint8_t x_25;
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_3);
x_25 = !lean_is_exclusive(x_22);
if (x_25 == 0)
{
return x_22;
}
else
{
lean_object* x_26; lean_object* x_27; lean_object* x_28;
x_26 = lean_ctor_get(x_22, 0);
x_27 = lean_ctor_get(x_22, 1);
lean_inc(x_27);
lean_inc(x_26);
lean_dec(x_22);
x_28 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_28, 0, x_26);
lean_ctor_set(x_28, 1, x_27);
return x_28;
}
}
}
else
{
uint8_t x_29;
lean_dec(x_12);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_3);
lean_dec(x_1);
x_29 = !lean_is_exclusive(x_14);
if (x_29 == 0)
{
return x_14;
}
else
{
lean_object* x_30; lean_object* x_31; lean_object* x_32;
x_30 = lean_ctor_get(x_14, 0);
x_31 = lean_ctor_get(x_14, 1);
lean_inc(x_31);
lean_inc(x_30);
lean_dec(x_14);
x_32 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_32, 0, x_30);
lean_ctor_set(x_32, 1, x_31);
return x_32;
}
}
}
else
{
uint8_t x_33;
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_33 = !lean_is_exclusive(x_11);
if (x_33 == 0)
{
return x_11;
}
else
{
lean_object* x_34; lean_object* x_35; lean_object* x_36;
x_34 = lean_ctor_get(x_11, 0);
x_35 = lean_ctor_get(x_11, 1);
lean_inc(x_35);
lean_inc(x_34);
lean_dec(x_11);
x_36 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_36, 0, x_34);
lean_ctor_set(x_36, 1, x_35);
return x_36;
}
}
}
}
static lean_object* _init_l_Lean_Meta_evalExprCore___rarg___closed__1() {
_start:
{
@ -2516,10 +2680,36 @@ x_3 = l_Lean_Name_str___override(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Meta_evalExprCore___rarg___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string_from_bytes("failed to evaluate expression, it contains metavariables", 56);
return x_1;
}
}
static lean_object* _init_l_Lean_Meta_evalExprCore___rarg___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Meta_evalExprCore___rarg___closed__3;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Meta_evalExprCore___rarg___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_logAt___at_Lean_Meta_evalExprCore___spec__6___closed__1;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___rarg(lean_object* x_1, lean_object* x_2, uint8_t 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; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17;
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; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20;
x_9 = lean_st_ref_get(x_7, x_8);
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
@ -2536,245 +2726,137 @@ lean_inc(x_15);
x_16 = lean_ctor_get(x_14, 1);
lean_inc(x_16);
lean_dec(x_14);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_1);
x_17 = lean_infer_type(x_1, x_4, x_5, x_6, x_7, x_16);
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_17 = l_Lean_instantiateMVars___at___private_Lean_Meta_Basic_0__Lean_Meta_mkLeveErrorMessageCore___spec__2(x_1, x_4, x_5, x_6, x_7, x_16);
x_18 = lean_ctor_get(x_17, 0);
lean_inc(x_18);
x_19 = lean_ctor_get(x_17, 1);
lean_inc(x_19);
lean_dec(x_17);
x_20 = l_Lean_Expr_hasMVar(x_18);
if (x_20 == 0)
{
lean_object* x_21; lean_object* x_22;
x_21 = lean_box(0);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_18);
x_20 = lean_apply_6(x_2, x_18, x_4, x_5, x_6, x_7, x_19);
if (lean_obj_tag(x_20) == 0)
x_22 = l_Lean_Meta_evalExprCore___rarg___lambda__1(x_18, x_2, x_15, x_3, x_21, x_4, x_5, x_6, x_7, x_19);
if (lean_obj_tag(x_22) == 0)
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28;
x_21 = lean_ctor_get(x_20, 1);
lean_inc(x_21);
lean_dec(x_20);
x_22 = lean_box(0);
lean_inc(x_15);
x_23 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_23, 0, x_15);
lean_ctor_set(x_23, 1, x_22);
lean_ctor_set(x_23, 2, x_18);
lean_inc(x_15);
x_24 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_24, 0, x_15);
lean_ctor_set(x_24, 1, x_22);
x_25 = lean_box(0);
x_26 = lean_alloc_ctor(0, 4, 1);
lean_ctor_set(x_26, 0, x_23);
lean_ctor_set(x_26, 1, x_1);
lean_ctor_set(x_26, 2, x_25);
lean_ctor_set(x_26, 3, x_24);
lean_ctor_set_uint8(x_26, sizeof(void*)*4, x_3);
x_27 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_27, 0, x_26);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_28 = l_Lean_addAndCompile___at_Lean_Meta_evalExprCore___spec__1(x_27, x_4, x_5, x_6, x_7, x_21);
if (lean_obj_tag(x_28) == 0)
lean_object* x_23; lean_object* x_24; lean_object* x_25; uint8_t x_26;
x_23 = lean_ctor_get(x_22, 0);
lean_inc(x_23);
x_24 = lean_ctor_get(x_22, 1);
lean_inc(x_24);
lean_dec(x_22);
x_25 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_24);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_26 = !lean_is_exclusive(x_25);
if (x_26 == 0)
{
lean_object* x_29; lean_object* x_30;
x_29 = lean_ctor_get(x_28, 1);
lean_inc(x_29);
lean_dec(x_28);
x_30 = l_Lean_evalConst___at_Lean_Meta_evalExprCore___spec__13___rarg(x_15, x_4, x_5, x_6, x_7, x_29);
if (lean_obj_tag(x_30) == 0)
lean_object* x_27;
x_27 = lean_ctor_get(x_25, 0);
lean_dec(x_27);
lean_ctor_set(x_25, 0, x_23);
return x_25;
}
else
{
lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
x_31 = lean_ctor_get(x_30, 0);
lean_object* x_28; lean_object* x_29;
x_28 = lean_ctor_get(x_25, 1);
lean_inc(x_28);
lean_dec(x_25);
x_29 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_29, 0, x_23);
lean_ctor_set(x_29, 1, x_28);
return x_29;
}
}
else
{
lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33;
x_30 = lean_ctor_get(x_22, 0);
lean_inc(x_30);
x_31 = lean_ctor_get(x_22, 1);
lean_inc(x_31);
x_32 = lean_ctor_get(x_30, 1);
lean_inc(x_32);
lean_dec(x_30);
x_33 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_32);
lean_dec(x_22);
x_32 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_31);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_34 = !lean_is_exclusive(x_33);
if (x_34 == 0)
x_33 = !lean_is_exclusive(x_32);
if (x_33 == 0)
{
lean_object* x_35;
x_35 = lean_ctor_get(x_33, 0);
lean_dec(x_35);
lean_ctor_set(x_33, 0, x_31);
return x_33;
lean_object* x_34;
x_34 = lean_ctor_get(x_32, 0);
lean_dec(x_34);
lean_ctor_set_tag(x_32, 1);
lean_ctor_set(x_32, 0, x_30);
return x_32;
}
else
{
lean_object* x_36; lean_object* x_37;
x_36 = lean_ctor_get(x_33, 1);
lean_inc(x_36);
lean_dec(x_33);
x_37 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_37, 0, x_31);
lean_ctor_set(x_37, 1, x_36);
return x_37;
}
}
else
{
lean_object* x_38; lean_object* x_39; lean_object* x_40; uint8_t x_41;
x_38 = lean_ctor_get(x_30, 0);
lean_inc(x_38);
x_39 = lean_ctor_get(x_30, 1);
lean_inc(x_39);
lean_dec(x_30);
x_40 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_39);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_41 = !lean_is_exclusive(x_40);
if (x_41 == 0)
{
lean_object* x_42;
x_42 = lean_ctor_get(x_40, 0);
lean_dec(x_42);
lean_ctor_set_tag(x_40, 1);
lean_ctor_set(x_40, 0, x_38);
return x_40;
}
else
{
lean_object* x_43; lean_object* x_44;
x_43 = lean_ctor_get(x_40, 1);
lean_inc(x_43);
lean_dec(x_40);
x_44 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_44, 0, x_38);
lean_ctor_set(x_44, 1, x_43);
return x_44;
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(1, 2, 0);
lean_ctor_set(x_36, 0, x_30);
lean_ctor_set(x_36, 1, x_35);
return x_36;
}
}
}
else
{
lean_object* x_45; lean_object* x_46; lean_object* x_47; uint8_t x_48;
lean_dec(x_15);
x_45 = lean_ctor_get(x_28, 0);
lean_inc(x_45);
x_46 = lean_ctor_get(x_28, 1);
lean_inc(x_46);
lean_dec(x_28);
x_47 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_46);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_48 = !lean_is_exclusive(x_47);
if (x_48 == 0)
{
lean_object* x_49;
x_49 = lean_ctor_get(x_47, 0);
lean_dec(x_49);
lean_ctor_set_tag(x_47, 1);
lean_ctor_set(x_47, 0, x_45);
return x_47;
}
else
{
lean_object* x_50; lean_object* x_51;
x_50 = lean_ctor_get(x_47, 1);
lean_inc(x_50);
lean_dec(x_47);
x_51 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_51, 0, x_45);
lean_ctor_set(x_51, 1, x_50);
return x_51;
}
}
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54; uint8_t x_55;
lean_dec(x_18);
lean_dec(x_15);
lean_dec(x_1);
x_52 = lean_ctor_get(x_20, 0);
lean_inc(x_52);
x_53 = lean_ctor_get(x_20, 1);
lean_inc(x_53);
lean_dec(x_20);
x_54 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_53);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_55 = !lean_is_exclusive(x_54);
if (x_55 == 0)
{
lean_object* x_56;
x_56 = lean_ctor_get(x_54, 0);
lean_dec(x_56);
lean_ctor_set_tag(x_54, 1);
lean_ctor_set(x_54, 0, x_52);
return x_54;
}
else
{
lean_object* x_57; lean_object* x_58;
x_57 = lean_ctor_get(x_54, 1);
lean_inc(x_57);
lean_dec(x_54);
x_58 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_58, 0, x_52);
lean_ctor_set(x_58, 1, x_57);
return x_58;
}
}
}
else
{
lean_object* x_59; lean_object* x_60; lean_object* x_61; uint8_t x_62;
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; uint8_t x_46;
lean_dec(x_15);
lean_dec(x_2);
lean_dec(x_1);
x_59 = lean_ctor_get(x_17, 0);
lean_inc(x_59);
x_60 = lean_ctor_get(x_17, 1);
lean_inc(x_60);
lean_dec(x_17);
x_61 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_60);
x_37 = l_Lean_indentExpr(x_18);
x_38 = l_Lean_Meta_evalExprCore___rarg___closed__4;
x_39 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_39, 0, x_38);
lean_ctor_set(x_39, 1, x_37);
x_40 = l_Lean_Meta_evalExprCore___rarg___closed__5;
x_41 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_41, 0, x_39);
lean_ctor_set(x_41, 1, x_40);
x_42 = l_Lean_throwError___at___private_Lean_Meta_InferType_0__Lean_Meta_inferProjType___spec__1(x_41, x_4, x_5, x_6, x_7, x_19);
x_43 = lean_ctor_get(x_42, 0);
lean_inc(x_43);
x_44 = lean_ctor_get(x_42, 1);
lean_inc(x_44);
lean_dec(x_42);
x_45 = l_Lean_setEnv___at_Lean_Meta_setInlineAttribute___spec__2(x_12, x_4, x_5, x_6, x_7, x_44);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_62 = !lean_is_exclusive(x_61);
if (x_62 == 0)
x_46 = !lean_is_exclusive(x_45);
if (x_46 == 0)
{
lean_object* x_63;
x_63 = lean_ctor_get(x_61, 0);
lean_dec(x_63);
lean_ctor_set_tag(x_61, 1);
lean_ctor_set(x_61, 0, x_59);
return x_61;
lean_object* x_47;
x_47 = lean_ctor_get(x_45, 0);
lean_dec(x_47);
lean_ctor_set_tag(x_45, 1);
lean_ctor_set(x_45, 0, x_43);
return x_45;
}
else
{
lean_object* x_64; lean_object* x_65;
x_64 = lean_ctor_get(x_61, 1);
lean_inc(x_64);
lean_dec(x_61);
x_65 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_65, 0, x_59);
lean_ctor_set(x_65, 1, x_64);
return x_65;
lean_object* x_48; lean_object* x_49;
x_48 = lean_ctor_get(x_45, 1);
lean_inc(x_48);
lean_dec(x_45);
x_49 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_49, 0, x_43);
lean_ctor_set(x_49, 1, x_48);
return x_49;
}
}
}
@ -2916,6 +2998,16 @@ lean_dec(x_2);
return x_7;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___rarg___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, lean_object* x_9, lean_object* x_10) {
_start:
{
uint8_t x_11; lean_object* x_12;
x_11 = lean_unbox(x_4);
lean_dec(x_4);
x_12 = l_Lean_Meta_evalExprCore___rarg___lambda__1(x_1, x_2, x_3, x_11, x_5, x_6, x_7, x_8, x_9, x_10);
return x_12;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_evalExprCore___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, lean_object* x_8) {
_start:
{
@ -2943,15 +3035,6 @@ x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_logAt___at_Lean_Meta_evalExprCore___spec__6___closed__1;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Meta_evalExpr_x27___rarg___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:
{
@ -2980,7 +3063,7 @@ x_14 = l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__2;
x_15 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_15, 0, x_14);
lean_ctor_set(x_15, 1, x_13);
x_16 = l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3;
x_16 = l_Lean_Meta_evalExprCore___rarg___closed__5;
x_17 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_17, 0, x_15);
lean_ctor_set(x_17, 1, x_16);
@ -3021,7 +3104,7 @@ x_24 = l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__2;
x_25 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_25, 0, x_24);
lean_ctor_set(x_25, 1, x_23);
x_26 = l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3;
x_26 = l_Lean_Meta_evalExprCore___rarg___closed__5;
x_27 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_27, 0, x_25);
lean_ctor_set(x_27, 1, x_26);
@ -3168,7 +3251,7 @@ x_15 = l_Lean_Meta_evalExpr___rarg___lambda__1___closed__2;
x_16 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_16, 0, x_15);
lean_ctor_set(x_16, 1, x_13);
x_17 = l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3;
x_17 = l_Lean_Meta_evalExprCore___rarg___closed__5;
x_18 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_18, 0, x_16);
lean_ctor_set(x_18, 1, x_17);
@ -3305,12 +3388,16 @@ l_Lean_Meta_evalExprCore___rarg___closed__1 = _init_l_Lean_Meta_evalExprCore___r
lean_mark_persistent(l_Lean_Meta_evalExprCore___rarg___closed__1);
l_Lean_Meta_evalExprCore___rarg___closed__2 = _init_l_Lean_Meta_evalExprCore___rarg___closed__2();
lean_mark_persistent(l_Lean_Meta_evalExprCore___rarg___closed__2);
l_Lean_Meta_evalExprCore___rarg___closed__3 = _init_l_Lean_Meta_evalExprCore___rarg___closed__3();
lean_mark_persistent(l_Lean_Meta_evalExprCore___rarg___closed__3);
l_Lean_Meta_evalExprCore___rarg___closed__4 = _init_l_Lean_Meta_evalExprCore___rarg___closed__4();
lean_mark_persistent(l_Lean_Meta_evalExprCore___rarg___closed__4);
l_Lean_Meta_evalExprCore___rarg___closed__5 = _init_l_Lean_Meta_evalExprCore___rarg___closed__5();
lean_mark_persistent(l_Lean_Meta_evalExprCore___rarg___closed__5);
l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__1 = _init_l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__1();
lean_mark_persistent(l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__1);
l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__2 = _init_l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__2();
lean_mark_persistent(l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__2);
l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3 = _init_l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3();
lean_mark_persistent(l_Lean_Meta_evalExpr_x27___rarg___lambda__1___closed__3);
l_Lean_Meta_evalExpr___rarg___lambda__1___closed__1 = _init_l_Lean_Meta_evalExpr___rarg___lambda__1___closed__1();
lean_mark_persistent(l_Lean_Meta_evalExpr___rarg___lambda__1___closed__1);
l_Lean_Meta_evalExpr___rarg___lambda__1___closed__2 = _init_l_Lean_Meta_evalExpr___rarg___lambda__1___closed__2();

View file

@ -220,7 +220,7 @@ static lean_object* l_Std_Range_forIn_loop___at___private_Lean_Meta_ExprDefEq_0_
LEAN_EXPORT lean_object* l___private_Lean_Meta_ExprDefEq_0__Lean_Meta_processConstApprox_defaultCase___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_addTrace___at_Lean_Meta_processPostponed_loop___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Meta_ExprDefEq_0__Lean_Meta_processAssignment_process___closed__2;
uint8_t l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(uint8_t, uint8_t);
uint8_t l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(uint8_t, uint8_t);
static lean_object* l_Std_Range_forIn_loop___at___private_Lean_Meta_ExprDefEq_0__Lean_Meta_isDefEqEtaStruct_go___spec__1___closed__1;
LEAN_EXPORT lean_object* l___private_Lean_Meta_ExprDefEq_0__Lean_Meta_isDefEqArgsFirstPass(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_LocalContext_contains(lean_object*, lean_object*);
@ -16185,7 +16185,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_CheckAssignment_check___closed__1;
x_2 = l_Lean_Meta_CheckAssignment_check___closed__2;
x_3 = lean_unsigned_to_nat(1441u);
x_3 = lean_unsigned_to_nat(1452u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Meta_CheckAssignment_check___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -16214,7 +16214,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_CheckAssignment_check___closed__1;
x_2 = l_Lean_Meta_CheckAssignment_check___closed__5;
x_3 = lean_unsigned_to_nat(1452u);
x_3 = lean_unsigned_to_nat(1463u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Meta_CheckAssignment_check___closed__6;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -16243,7 +16243,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_CheckAssignment_check___closed__1;
x_2 = l_Lean_Meta_CheckAssignment_check___closed__8;
x_3 = lean_unsigned_to_nat(1498u);
x_3 = lean_unsigned_to_nat(1509u);
x_4 = lean_unsigned_to_nat(20u);
x_5 = l_Lean_Meta_CheckAssignment_check___closed__9;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -16272,7 +16272,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_CheckAssignment_check___closed__1;
x_2 = l_Lean_Meta_CheckAssignment_check___closed__11;
x_3 = lean_unsigned_to_nat(1478u);
x_3 = lean_unsigned_to_nat(1489u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l_Lean_Meta_CheckAssignment_check___closed__12;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -16301,7 +16301,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Meta_CheckAssignment_check___closed__1;
x_2 = l_Lean_Meta_CheckAssignment_check___closed__14;
x_3 = lean_unsigned_to_nat(1507u);
x_3 = lean_unsigned_to_nat(1518u);
x_4 = lean_unsigned_to_nat(22u);
x_5 = l_Lean_Meta_CheckAssignment_check___closed__15;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -66212,7 +66212,7 @@ x_11 = lean_ctor_get(x_8, 1);
x_12 = 3;
x_13 = lean_unbox(x_10);
lean_dec(x_10);
x_14 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_13, x_12);
x_14 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_13, x_12);
if (x_14 == 0)
{
uint8_t x_15; lean_object* x_16;
@ -66247,7 +66247,7 @@ lean_dec(x_8);
x_21 = 3;
x_22 = lean_unbox(x_19);
lean_dec(x_19);
x_23 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_22, x_21);
x_23 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_22, x_21);
if (x_23 == 0)
{
uint8_t x_24; lean_object* x_25; lean_object* x_26;

View file

@ -403,7 +403,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__3___closed__1;
x_2 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__3___closed__2;
x_3 = lean_unsigned_to_nat(1408u);
x_3 = lean_unsigned_to_nat(1419u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__3___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -581,7 +581,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__3___closed__1;
x_2 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__8___closed__1;
x_3 = lean_unsigned_to_nat(1507u);
x_3 = lean_unsigned_to_nat(1518u);
x_4 = lean_unsigned_to_nat(22u);
x_5 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__8___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -782,7 +782,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__3___closed__1;
x_2 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__10___closed__1;
x_3 = lean_unsigned_to_nat(1498u);
x_3 = lean_unsigned_to_nat(1509u);
x_4 = lean_unsigned_to_nat(20u);
x_5 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__10___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -906,7 +906,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__3___closed__1;
x_2 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__11___closed__1;
x_3 = lean_unsigned_to_nat(1478u);
x_3 = lean_unsigned_to_nat(1489u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l___private_Lean_Meta_ExprLens_0__Lean_Meta_lensCoord___rarg___lambda__11___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

View file

@ -21,7 +21,7 @@ lean_object* lean_st_ref_get(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_getConstNoEx_x3f(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_isReducible___at___private_Lean_Meta_GetConst_0__Lean_Meta_canUnfoldDefault___spec__3(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_getConst_x3f(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(uint8_t, uint8_t);
uint8_t l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(uint8_t, uint8_t);
uint8_t lean_get_reducibility_status(lean_object*, lean_object*);
lean_object* l_Lean_ConstantInfo_name(lean_object*);
LEAN_EXPORT lean_object* l_Lean_getReducibilityStatus___at___private_Lean_Meta_GetConst_0__Lean_Meta_canUnfoldDefault___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
@ -315,7 +315,7 @@ x_39 = lean_ctor_get(x_38, 0);
lean_inc(x_39);
lean_dec(x_38);
x_40 = 3;
x_41 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_6, x_40);
x_41 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_6, x_40);
if (x_41 == 0)
{
uint8_t x_42; lean_object* x_43;
@ -360,7 +360,7 @@ x_51 = lean_ctor_get(x_49, 0);
lean_inc(x_51);
lean_dec(x_49);
x_52 = 3;
x_53 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10461_(x_6, x_52);
x_53 = l___private_Init_Meta_0__Lean_Meta_beqTransparencyMode____x40_Init_Meta___hyg_10498_(x_6, x_52);
if (x_53 == 0)
{
uint8_t x_54; lean_object* x_55; lean_object* x_56;

File diff suppressed because it is too large Load diff

View file

@ -149,7 +149,7 @@ LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Meta_Match_M
uint8_t lean_name_eq(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_checkNumPatterns(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_List_filterTRAux___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processConstructor___spec__8(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_constructorApp_x3f(lean_object*, lean_object*);
lean_object* l_Lean_Expr_constructorApp_x3f(lean_object*, lean_object*, uint8_t);
static lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_solveCnstrs_go___lambda__3___closed__3;
LEAN_EXPORT lean_object* l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_filterTrivialCnstrs(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Meta_Match_mkMatcher___lambda__14(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, size_t, 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*);
@ -10295,13 +10295,14 @@ uint8_t x_17;
x_17 = !lean_is_exclusive(x_16);
if (x_17 == 0)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20;
lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21;
x_18 = lean_ctor_get(x_16, 0);
x_19 = lean_ctor_get(x_16, 1);
x_20 = l_Lean_Expr_constructorApp_x3f(x_2, x_18);
if (lean_obj_tag(x_20) == 0)
x_20 = 0;
x_21 = l_Lean_Expr_constructorApp_x3f(x_2, x_18, x_20);
if (lean_obj_tag(x_21) == 0)
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27;
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28;
lean_free_object(x_16);
lean_dec(x_10);
lean_dec(x_9);
@ -10309,141 +10310,141 @@ lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
x_21 = l_Lean_Meta_Match_Pattern_toMessageData(x_3);
x_22 = l_Lean_indentD(x_21);
x_23 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__2;
x_24 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_24, 0, x_23);
lean_ctor_set(x_24, 1, x_22);
x_25 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__4;
x_26 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_26, 0, x_24);
lean_ctor_set(x_26, 1, x_25);
x_27 = l_Lean_throwErrorAt___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__2(x_4, x_26, x_11, x_12, x_13, x_14, x_19);
return x_27;
x_22 = l_Lean_Meta_Match_Pattern_toMessageData(x_3);
x_23 = l_Lean_indentD(x_22);
x_24 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__2;
x_25 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_25, 0, x_24);
lean_ctor_set(x_25, 1, x_23);
x_26 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__4;
x_27 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_27, 0, x_25);
lean_ctor_set(x_27, 1, x_26);
x_28 = l_Lean_throwErrorAt___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__2(x_4, x_27, x_11, x_12, x_13, x_14, x_19);
return x_28;
}
else
{
uint8_t x_28;
uint8_t x_29;
lean_dec(x_14);
lean_dec(x_13);
lean_dec(x_12);
lean_dec(x_11);
lean_dec(x_3);
x_28 = !lean_is_exclusive(x_20);
if (x_28 == 0)
x_29 = !lean_is_exclusive(x_21);
if (x_29 == 0)
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
x_29 = lean_ctor_get(x_20, 0);
x_30 = lean_ctor_get(x_29, 0);
lean_inc(x_30);
x_31 = lean_ctor_get(x_29, 1);
lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35;
x_30 = lean_ctor_get(x_21, 0);
x_31 = lean_ctor_get(x_30, 0);
lean_inc(x_31);
lean_dec(x_29);
x_32 = lean_ctor_get(x_30, 0);
x_32 = lean_ctor_get(x_30, 1);
lean_inc(x_32);
x_33 = lean_ctor_get(x_32, 0);
lean_dec(x_30);
x_33 = lean_ctor_get(x_31, 0);
lean_inc(x_33);
lean_dec(x_32);
x_34 = lean_name_eq(x_33, x_5);
lean_dec(x_5);
x_34 = lean_ctor_get(x_33, 0);
lean_inc(x_34);
lean_dec(x_33);
if (x_34 == 0)
x_35 = lean_name_eq(x_34, x_5);
lean_dec(x_5);
lean_dec(x_34);
if (x_35 == 0)
{
lean_object* x_35;
lean_object* x_36;
lean_dec(x_32);
lean_dec(x_31);
lean_dec(x_30);
lean_free_object(x_20);
lean_free_object(x_21);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_4);
x_35 = lean_box(0);
lean_ctor_set(x_16, 0, x_35);
x_36 = lean_box(0);
lean_ctor_set(x_16, 0, x_36);
return x_16;
}
else
{
lean_object* x_36; 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;
x_36 = lean_ctor_get(x_30, 3);
lean_inc(x_36);
lean_dec(x_30);
x_37 = lean_array_get_size(x_31);
x_38 = l_Array_extract___rarg(x_31, x_36, x_37);
x_39 = lean_array_to_list(lean_box(0), x_38);
x_40 = lean_box(0);
x_41 = l_List_mapTRAux___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__4(x_39, x_40);
x_42 = l_List_appendTR___rarg(x_41, x_6);
x_43 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_43, 0, x_4);
lean_ctor_set(x_43, 1, x_7);
lean_ctor_set(x_43, 2, x_8);
lean_ctor_set(x_43, 3, x_9);
lean_ctor_set(x_43, 4, x_42);
lean_ctor_set(x_43, 5, x_10);
lean_ctor_set(x_20, 0, x_43);
lean_ctor_set(x_16, 0, x_20);
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;
x_37 = lean_ctor_get(x_31, 3);
lean_inc(x_37);
lean_dec(x_31);
x_38 = lean_array_get_size(x_32);
x_39 = l_Array_extract___rarg(x_32, x_37, x_38);
x_40 = lean_array_to_list(lean_box(0), x_39);
x_41 = lean_box(0);
x_42 = l_List_mapTRAux___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__4(x_40, x_41);
x_43 = l_List_appendTR___rarg(x_42, x_6);
x_44 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_44, 0, x_4);
lean_ctor_set(x_44, 1, x_7);
lean_ctor_set(x_44, 2, x_8);
lean_ctor_set(x_44, 3, x_9);
lean_ctor_set(x_44, 4, x_43);
lean_ctor_set(x_44, 5, x_10);
lean_ctor_set(x_21, 0, x_44);
lean_ctor_set(x_16, 0, x_21);
return x_16;
}
}
else
{
lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; uint8_t x_49;
x_44 = lean_ctor_get(x_20, 0);
lean_inc(x_44);
lean_dec(x_20);
x_45 = lean_ctor_get(x_44, 0);
lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; uint8_t x_50;
x_45 = lean_ctor_get(x_21, 0);
lean_inc(x_45);
x_46 = lean_ctor_get(x_44, 1);
lean_dec(x_21);
x_46 = lean_ctor_get(x_45, 0);
lean_inc(x_46);
lean_dec(x_44);
x_47 = lean_ctor_get(x_45, 0);
x_47 = lean_ctor_get(x_45, 1);
lean_inc(x_47);
x_48 = lean_ctor_get(x_47, 0);
lean_inc(x_48);
lean_dec(x_47);
x_49 = lean_name_eq(x_48, x_5);
lean_dec(x_5);
lean_dec(x_48);
if (x_49 == 0)
{
lean_object* x_50;
lean_dec(x_46);
lean_dec(x_45);
x_48 = lean_ctor_get(x_46, 0);
lean_inc(x_48);
x_49 = lean_ctor_get(x_48, 0);
lean_inc(x_49);
lean_dec(x_48);
x_50 = lean_name_eq(x_49, x_5);
lean_dec(x_5);
lean_dec(x_49);
if (x_50 == 0)
{
lean_object* x_51;
lean_dec(x_47);
lean_dec(x_46);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_4);
x_50 = lean_box(0);
lean_ctor_set(x_16, 0, x_50);
x_51 = lean_box(0);
lean_ctor_set(x_16, 0, x_51);
return x_16;
}
else
{
lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59;
x_51 = lean_ctor_get(x_45, 3);
lean_inc(x_51);
lean_dec(x_45);
x_52 = lean_array_get_size(x_46);
x_53 = l_Array_extract___rarg(x_46, x_51, x_52);
x_54 = lean_array_to_list(lean_box(0), x_53);
x_55 = lean_box(0);
x_56 = l_List_mapTRAux___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__4(x_54, x_55);
x_57 = l_List_appendTR___rarg(x_56, x_6);
x_58 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_58, 0, x_4);
lean_ctor_set(x_58, 1, x_7);
lean_ctor_set(x_58, 2, x_8);
lean_ctor_set(x_58, 3, x_9);
lean_ctor_set(x_58, 4, x_57);
lean_ctor_set(x_58, 5, x_10);
x_59 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_59, 0, x_58);
lean_ctor_set(x_16, 0, x_59);
lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60;
x_52 = lean_ctor_get(x_46, 3);
lean_inc(x_52);
lean_dec(x_46);
x_53 = lean_array_get_size(x_47);
x_54 = l_Array_extract___rarg(x_47, x_52, x_53);
x_55 = lean_array_to_list(lean_box(0), x_54);
x_56 = lean_box(0);
x_57 = l_List_mapTRAux___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__4(x_55, x_56);
x_58 = l_List_appendTR___rarg(x_57, x_6);
x_59 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_59, 0, x_4);
lean_ctor_set(x_59, 1, x_7);
lean_ctor_set(x_59, 2, x_8);
lean_ctor_set(x_59, 3, x_9);
lean_ctor_set(x_59, 4, x_58);
lean_ctor_set(x_59, 5, x_10);
x_60 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_60, 0, x_59);
lean_ctor_set(x_16, 0, x_60);
return x_16;
}
}
@ -10451,119 +10452,120 @@ return x_16;
}
else
{
lean_object* x_60; lean_object* x_61; lean_object* x_62;
x_60 = lean_ctor_get(x_16, 0);
x_61 = lean_ctor_get(x_16, 1);
lean_object* x_61; lean_object* x_62; uint8_t x_63; lean_object* x_64;
x_61 = lean_ctor_get(x_16, 0);
x_62 = lean_ctor_get(x_16, 1);
lean_inc(x_62);
lean_inc(x_61);
lean_inc(x_60);
lean_dec(x_16);
x_62 = l_Lean_Expr_constructorApp_x3f(x_2, x_60);
if (lean_obj_tag(x_62) == 0)
x_63 = 0;
x_64 = l_Lean_Expr_constructorApp_x3f(x_2, x_61, x_63);
if (lean_obj_tag(x_64) == 0)
{
lean_object* x_63; 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_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_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
x_63 = l_Lean_Meta_Match_Pattern_toMessageData(x_3);
x_64 = l_Lean_indentD(x_63);
x_65 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__2;
x_66 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_66, 0, x_65);
lean_ctor_set(x_66, 1, x_64);
x_67 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__4;
x_65 = l_Lean_Meta_Match_Pattern_toMessageData(x_3);
x_66 = l_Lean_indentD(x_65);
x_67 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__2;
x_68 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_68, 0, x_66);
lean_ctor_set(x_68, 1, x_67);
x_69 = l_Lean_throwErrorAt___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__2(x_4, x_68, x_11, x_12, x_13, x_14, x_61);
return x_69;
lean_ctor_set(x_68, 0, x_67);
lean_ctor_set(x_68, 1, x_66);
x_69 = l_Lean_Meta_Match_processInaccessibleAsCtor___lambda__1___closed__4;
x_70 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_70, 0, x_68);
lean_ctor_set(x_70, 1, x_69);
x_71 = l_Lean_throwErrorAt___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__2(x_4, x_70, x_11, x_12, x_13, x_14, x_62);
return x_71;
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; uint8_t x_76;
lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; uint8_t x_78;
lean_dec(x_14);
lean_dec(x_13);
lean_dec(x_12);
lean_dec(x_11);
lean_dec(x_3);
x_70 = lean_ctor_get(x_62, 0);
lean_inc(x_70);
if (lean_is_exclusive(x_62)) {
lean_ctor_release(x_62, 0);
x_71 = x_62;
} else {
lean_dec_ref(x_62);
x_71 = lean_box(0);
}
x_72 = lean_ctor_get(x_70, 0);
x_72 = lean_ctor_get(x_64, 0);
lean_inc(x_72);
x_73 = lean_ctor_get(x_70, 1);
lean_inc(x_73);
lean_dec(x_70);
if (lean_is_exclusive(x_64)) {
lean_ctor_release(x_64, 0);
x_73 = x_64;
} else {
lean_dec_ref(x_64);
x_73 = lean_box(0);
}
x_74 = lean_ctor_get(x_72, 0);
lean_inc(x_74);
x_75 = lean_ctor_get(x_74, 0);
x_75 = lean_ctor_get(x_72, 1);
lean_inc(x_75);
lean_dec(x_74);
x_76 = lean_name_eq(x_75, x_5);
lean_dec(x_5);
lean_dec(x_75);
if (x_76 == 0)
{
lean_object* x_77; lean_object* x_78;
lean_dec(x_73);
lean_dec(x_72);
lean_dec(x_71);
x_76 = lean_ctor_get(x_74, 0);
lean_inc(x_76);
x_77 = lean_ctor_get(x_76, 0);
lean_inc(x_77);
lean_dec(x_76);
x_78 = lean_name_eq(x_77, x_5);
lean_dec(x_5);
lean_dec(x_77);
if (x_78 == 0)
{
lean_object* x_79; lean_object* x_80;
lean_dec(x_75);
lean_dec(x_74);
lean_dec(x_73);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_4);
x_77 = lean_box(0);
x_78 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_78, 0, x_77);
lean_ctor_set(x_78, 1, x_61);
return x_78;
x_79 = lean_box(0);
x_80 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_80, 0, x_79);
lean_ctor_set(x_80, 1, x_62);
return x_80;
}
else
{
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;
x_79 = lean_ctor_get(x_72, 3);
lean_inc(x_79);
lean_dec(x_72);
x_80 = lean_array_get_size(x_73);
x_81 = l_Array_extract___rarg(x_73, x_79, x_80);
x_82 = lean_array_to_list(lean_box(0), x_81);
x_83 = lean_box(0);
x_84 = l_List_mapTRAux___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__4(x_82, x_83);
x_85 = l_List_appendTR___rarg(x_84, x_6);
x_86 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_86, 0, x_4);
lean_ctor_set(x_86, 1, x_7);
lean_ctor_set(x_86, 2, x_8);
lean_ctor_set(x_86, 3, x_9);
lean_ctor_set(x_86, 4, x_85);
lean_ctor_set(x_86, 5, x_10);
if (lean_is_scalar(x_71)) {
x_87 = lean_alloc_ctor(1, 1, 0);
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_81 = lean_ctor_get(x_74, 3);
lean_inc(x_81);
lean_dec(x_74);
x_82 = lean_array_get_size(x_75);
x_83 = l_Array_extract___rarg(x_75, x_81, x_82);
x_84 = lean_array_to_list(lean_box(0), x_83);
x_85 = lean_box(0);
x_86 = l_List_mapTRAux___at_Lean_Meta_Match_processInaccessibleAsCtor___spec__4(x_84, x_85);
x_87 = l_List_appendTR___rarg(x_86, x_6);
x_88 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_88, 0, x_4);
lean_ctor_set(x_88, 1, x_7);
lean_ctor_set(x_88, 2, x_8);
lean_ctor_set(x_88, 3, x_9);
lean_ctor_set(x_88, 4, x_87);
lean_ctor_set(x_88, 5, x_10);
if (lean_is_scalar(x_73)) {
x_89 = lean_alloc_ctor(1, 1, 0);
} else {
x_87 = x_71;
x_89 = x_73;
}
lean_ctor_set(x_87, 0, x_86);
x_88 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_88, 0, x_87);
lean_ctor_set(x_88, 1, x_61);
return x_88;
lean_ctor_set(x_89, 0, x_88);
x_90 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_90, 0, x_89);
lean_ctor_set(x_90, 1, x_62);
return x_90;
}
}
}
}
else
{
uint8_t x_89;
uint8_t x_91;
lean_dec(x_14);
lean_dec(x_13);
lean_dec(x_12);
@ -10577,23 +10579,23 @@ lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_89 = !lean_is_exclusive(x_16);
if (x_89 == 0)
x_91 = !lean_is_exclusive(x_16);
if (x_91 == 0)
{
return x_16;
}
else
{
lean_object* x_90; lean_object* x_91; lean_object* x_92;
x_90 = lean_ctor_get(x_16, 0);
x_91 = lean_ctor_get(x_16, 1);
lean_inc(x_91);
lean_inc(x_90);
lean_object* x_92; lean_object* x_93; lean_object* x_94;
x_92 = lean_ctor_get(x_16, 0);
x_93 = lean_ctor_get(x_16, 1);
lean_inc(x_93);
lean_inc(x_92);
lean_dec(x_16);
x_92 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_92, 0, x_90);
lean_ctor_set(x_92, 1, x_91);
return x_92;
x_94 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_94, 0, x_92);
lean_ctor_set(x_94, 1, x_93);
return x_94;
}
}
}
@ -14683,7 +14685,7 @@ lean_inc(x_1);
x_12 = l_Lean_Meta_whnfD(x_1, x_7, x_8, x_9, x_10, x_11);
if (lean_obj_tag(x_12) == 0)
{
lean_object* x_13; 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_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19; lean_object* x_20;
x_13 = lean_ctor_get(x_12, 0);
lean_inc(x_13);
x_14 = lean_ctor_get(x_12, 1);
@ -14698,144 +14700,145 @@ lean_dec(x_15);
x_18 = lean_ctor_get(x_16, 0);
lean_inc(x_18);
lean_dec(x_16);
x_19 = l_Lean_Expr_constructorApp_x3f(x_18, x_13);
if (lean_obj_tag(x_19) == 0)
x_19 = 0;
x_20 = l_Lean_Expr_constructorApp_x3f(x_18, x_13, x_19);
if (lean_obj_tag(x_20) == 0)
{
lean_object* x_20; lean_object* x_21;
lean_object* x_21; lean_object* x_22;
lean_dec(x_6);
x_20 = lean_box(0);
x_21 = l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___lambda__1(x_1, x_2, x_3, x_4, x_5, x_20, x_7, x_8, x_9, x_10, x_17);
return x_21;
x_21 = lean_box(0);
x_22 = l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___lambda__1(x_1, x_2, x_3, x_4, x_5, x_21, x_7, x_8, x_9, x_10, x_17);
return x_22;
}
else
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25;
x_22 = lean_ctor_get(x_19, 0);
lean_inc(x_22);
lean_dec(x_19);
x_23 = lean_ctor_get(x_22, 0);
lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_23 = lean_ctor_get(x_20, 0);
lean_inc(x_23);
x_24 = lean_ctor_get(x_22, 1);
lean_dec(x_20);
x_24 = lean_ctor_get(x_23, 0);
lean_inc(x_24);
lean_dec(x_22);
x_25 = lean_ctor_get(x_23, 1);
lean_inc(x_25);
lean_dec(x_23);
lean_inc(x_10);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
x_25 = l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_altsAreCtorLike(x_6, x_7, x_8, x_9, x_10, x_17);
if (lean_obj_tag(x_25) == 0)
x_26 = l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_altsAreCtorLike(x_6, x_7, x_8, x_9, x_10, x_17);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_26; uint8_t x_27;
x_26 = lean_ctor_get(x_25, 0);
lean_inc(x_26);
x_27 = lean_unbox(x_26);
lean_object* x_27; uint8_t x_28;
x_27 = lean_ctor_get(x_26, 0);
lean_inc(x_27);
x_28 = lean_unbox(x_27);
lean_dec(x_27);
if (x_28 == 0)
{
lean_object* x_29; lean_object* x_30; lean_object* x_31;
lean_dec(x_25);
lean_dec(x_24);
x_29 = lean_ctor_get(x_26, 1);
lean_inc(x_29);
lean_dec(x_26);
if (x_27 == 0)
{
lean_object* x_28; lean_object* x_29; lean_object* x_30;
lean_dec(x_24);
lean_dec(x_23);
x_28 = lean_ctor_get(x_25, 1);
lean_inc(x_28);
lean_dec(x_25);
x_29 = lean_box(0);
x_30 = l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___lambda__1(x_1, x_2, x_3, x_4, x_5, x_29, x_7, x_8, x_9, x_10, x_28);
return x_30;
x_30 = lean_box(0);
x_31 = l___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___lambda__1(x_1, x_2, x_3, x_4, x_5, x_30, x_7, x_8, x_9, x_10, x_29);
return x_31;
}
else
{
lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34;
lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35;
lean_dec(x_1);
x_31 = lean_ctor_get(x_25, 1);
lean_inc(x_31);
lean_dec(x_25);
x_32 = l_List_reverse___rarg(x_2);
x_33 = lean_box(0);
lean_inc(x_23);
x_34 = l_List_filterMapM_loop___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___spec__2(x_23, x_32, x_33, x_7, x_8, x_9, x_10, x_31);
if (lean_obj_tag(x_34) == 0)
x_32 = lean_ctor_get(x_26, 1);
lean_inc(x_32);
lean_dec(x_26);
x_33 = l_List_reverse___rarg(x_2);
x_34 = lean_box(0);
lean_inc(x_24);
x_35 = l_List_filterMapM_loop___at___private_Lean_Meta_Match_Match_0__Lean_Meta_Match_processNonVariable___spec__2(x_24, x_33, x_34, x_7, x_8, x_9, x_10, x_32);
if (lean_obj_tag(x_35) == 0)
{
uint8_t x_35;
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
uint8_t x_36;
x_36 = !lean_is_exclusive(x_35);
if (x_36 == 0)
{
lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42;
x_36 = lean_ctor_get(x_34, 0);
x_37 = lean_ctor_get(x_23, 3);
lean_inc(x_37);
lean_dec(x_23);
x_38 = lean_array_get_size(x_24);
x_39 = l_Array_extract___rarg(x_24, x_37, x_38);
x_40 = lean_array_to_list(lean_box(0), x_39);
x_41 = l_List_appendTR___rarg(x_40, x_4);
x_42 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_42, 0, x_3);
lean_ctor_set(x_42, 1, x_41);
lean_ctor_set(x_42, 2, x_36);
lean_ctor_set(x_42, 3, x_5);
lean_ctor_set(x_34, 0, x_42);
return x_34;
}
else
{
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;
x_43 = lean_ctor_get(x_34, 0);
x_44 = lean_ctor_get(x_34, 1);
lean_inc(x_44);
lean_inc(x_43);
lean_dec(x_34);
x_45 = lean_ctor_get(x_23, 3);
lean_inc(x_45);
lean_dec(x_23);
x_46 = lean_array_get_size(x_24);
x_47 = l_Array_extract___rarg(x_24, x_45, x_46);
x_48 = lean_array_to_list(lean_box(0), x_47);
x_49 = l_List_appendTR___rarg(x_48, x_4);
x_50 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_50, 0, x_3);
lean_ctor_set(x_50, 1, x_49);
lean_ctor_set(x_50, 2, x_43);
lean_ctor_set(x_50, 3, x_5);
x_51 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_51, 0, x_50);
lean_ctor_set(x_51, 1, x_44);
return x_51;
}
}
else
{
uint8_t x_52;
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;
x_37 = lean_ctor_get(x_35, 0);
x_38 = lean_ctor_get(x_24, 3);
lean_inc(x_38);
lean_dec(x_24);
x_39 = lean_array_get_size(x_25);
x_40 = l_Array_extract___rarg(x_25, x_38, x_39);
x_41 = lean_array_to_list(lean_box(0), x_40);
x_42 = l_List_appendTR___rarg(x_41, x_4);
x_43 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_43, 0, x_3);
lean_ctor_set(x_43, 1, x_42);
lean_ctor_set(x_43, 2, x_37);
lean_ctor_set(x_43, 3, x_5);
lean_ctor_set(x_35, 0, x_43);
return x_35;
}
else
{
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;
x_44 = lean_ctor_get(x_35, 0);
x_45 = lean_ctor_get(x_35, 1);
lean_inc(x_45);
lean_inc(x_44);
lean_dec(x_35);
x_46 = lean_ctor_get(x_24, 3);
lean_inc(x_46);
lean_dec(x_24);
x_47 = lean_array_get_size(x_25);
x_48 = l_Array_extract___rarg(x_25, x_46, x_47);
x_49 = lean_array_to_list(lean_box(0), x_48);
x_50 = l_List_appendTR___rarg(x_49, x_4);
x_51 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_51, 0, x_3);
lean_ctor_set(x_51, 1, x_50);
lean_ctor_set(x_51, 2, x_44);
lean_ctor_set(x_51, 3, x_5);
x_52 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_52, 0, x_51);
lean_ctor_set(x_52, 1, x_45);
return x_52;
}
}
else
{
uint8_t x_53;
lean_dec(x_25);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
x_52 = !lean_is_exclusive(x_34);
if (x_52 == 0)
x_53 = !lean_is_exclusive(x_35);
if (x_53 == 0)
{
return x_34;
return x_35;
}
else
{
lean_object* x_53; lean_object* x_54; lean_object* x_55;
x_53 = lean_ctor_get(x_34, 0);
x_54 = lean_ctor_get(x_34, 1);
lean_object* x_54; lean_object* x_55; lean_object* x_56;
x_54 = lean_ctor_get(x_35, 0);
x_55 = lean_ctor_get(x_35, 1);
lean_inc(x_55);
lean_inc(x_54);
lean_inc(x_53);
lean_dec(x_34);
x_55 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_55, 0, x_53);
lean_ctor_set(x_55, 1, x_54);
return x_55;
lean_dec(x_35);
x_56 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_56, 0, x_54);
lean_ctor_set(x_56, 1, x_55);
return x_56;
}
}
}
}
else
{
uint8_t x_56;
uint8_t x_57;
lean_dec(x_25);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
@ -14845,30 +14848,30 @@ lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_56 = !lean_is_exclusive(x_25);
if (x_56 == 0)
x_57 = !lean_is_exclusive(x_26);
if (x_57 == 0)
{
return x_25;
return x_26;
}
else
{
lean_object* x_57; lean_object* x_58; lean_object* x_59;
x_57 = lean_ctor_get(x_25, 0);
x_58 = lean_ctor_get(x_25, 1);
lean_object* x_58; lean_object* x_59; lean_object* x_60;
x_58 = lean_ctor_get(x_26, 0);
x_59 = lean_ctor_get(x_26, 1);
lean_inc(x_59);
lean_inc(x_58);
lean_inc(x_57);
lean_dec(x_25);
x_59 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_59, 0, x_57);
lean_ctor_set(x_59, 1, x_58);
return x_59;
lean_dec(x_26);
x_60 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_60, 0, x_58);
lean_ctor_set(x_60, 1, x_59);
return x_60;
}
}
}
}
else
{
uint8_t x_60;
uint8_t x_61;
lean_dec(x_10);
lean_dec(x_9);
lean_dec(x_8);
@ -14879,23 +14882,23 @@ lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_60 = !lean_is_exclusive(x_12);
if (x_60 == 0)
x_61 = !lean_is_exclusive(x_12);
if (x_61 == 0)
{
return x_12;
}
else
{
lean_object* x_61; lean_object* x_62; lean_object* x_63;
x_61 = lean_ctor_get(x_12, 0);
x_62 = lean_ctor_get(x_12, 1);
lean_object* x_62; lean_object* x_63; lean_object* x_64;
x_62 = lean_ctor_get(x_12, 0);
x_63 = lean_ctor_get(x_12, 1);
lean_inc(x_63);
lean_inc(x_62);
lean_inc(x_61);
lean_dec(x_12);
x_63 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_63, 0, x_61);
lean_ctor_set(x_63, 1, x_62);
return x_63;
x_64 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_64, 0, x_62);
lean_ctor_set(x_64, 1, x_63);
return x_64;
}
}
}

View file

@ -2017,7 +2017,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Meta_Tactic_Simp_Main_0__Lean_Meta_Simp_mkImpCongr___closed__1;
x_2 = l___private_Lean_Meta_Tactic_Simp_Main_0__Lean_Meta_Simp_mkImpCongr___closed__2;
x_3 = lean_unsigned_to_nat(1478u);
x_3 = lean_unsigned_to_nat(1489u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l___private_Lean_Meta_Tactic_Simp_Main_0__Lean_Meta_Simp_mkImpCongr___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -37977,7 +37977,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Meta_Tactic_Simp_Main_0__Lean_Meta_Simp_mkImpCongr___closed__1;
x_2 = l_Lean_Meta_Simp_simp_simpProj___lambda__1___closed__1;
x_3 = lean_unsigned_to_nat(1452u);
x_3 = lean_unsigned_to_nat(1463u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Meta_Simp_simp_simpProj___lambda__1___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -782,7 +782,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__1;
x_2 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__2;
x_3 = lean_unsigned_to_nat(1498u);
x_3 = lean_unsigned_to_nat(1509u);
x_4 = lean_unsigned_to_nat(20u);
x_5 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -920,7 +920,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__1;
x_2 = l_Lean_Core_transform_visit___rarg___lambda__4___closed__1;
x_3 = lean_unsigned_to_nat(1478u);
x_3 = lean_unsigned_to_nat(1489u);
x_4 = lean_unsigned_to_nat(24u);
x_5 = l_Lean_Core_transform_visit___rarg___lambda__4___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -1058,7 +1058,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__1;
x_2 = l_Lean_Core_transform_visit___rarg___lambda__6___closed__1;
x_3 = lean_unsigned_to_nat(1507u);
x_3 = lean_unsigned_to_nat(1518u);
x_4 = lean_unsigned_to_nat(22u);
x_5 = l_Lean_Core_transform_visit___rarg___lambda__6___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -1230,7 +1230,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__1;
x_2 = l_Lean_Core_transform_visit___rarg___lambda__9___closed__1;
x_3 = lean_unsigned_to_nat(1441u);
x_3 = lean_unsigned_to_nat(1452u);
x_4 = lean_unsigned_to_nat(17u);
x_5 = l_Lean_Core_transform_visit___rarg___lambda__9___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -1302,7 +1302,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l_Lean_Core_transform_visit___rarg___lambda__2___closed__1;
x_2 = l_Lean_Core_transform_visit___rarg___lambda__10___closed__1;
x_3 = lean_unsigned_to_nat(1452u);
x_3 = lean_unsigned_to_nat(1463u);
x_4 = lean_unsigned_to_nat(18u);
x_5 = l_Lean_Core_transform_visit___rarg___lambda__10___closed__2;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);

Some files were not shown because too many files have changed in this diff Show more