chore: update stage0

This commit is contained in:
Leonardo de Moura 2020-08-10 10:13:52 -07:00
parent 3ce794c58a
commit 9bd4acd9c9
100 changed files with 70654 additions and 26293 deletions

View file

@ -719,3 +719,55 @@ export Array (mkArray)
@[inline] def List.toArray {α : Type u} (as : List α) : Array α :=
as.toArrayAux (Array.mkEmpty as.redLength)
namespace Array
def toListLitAux {α : Type u} (a : Array α) (n : Nat) (hsz : a.size = n) : ∀ (i : Nat), i ≤ a.size → List α → List α
| 0, hi, acc => acc
| (i+1), hi, acc => toListLitAux i (Nat.leOfSuccLe hi) (a.getLit i hsz (Nat.ltOfLtOfEq (Nat.ltOfLtOfLe (Nat.ltSuccSelf i) hi) hsz) :: acc)
def toArrayLit {α : Type u} (a : Array α) (n : Nat) (hsz : a.size = n) : Array α :=
List.toArray $ toListLitAux a n hsz n (hsz ▸ Nat.leRefl _) []
theorem toArrayLitEq {α : Type u} (a : Array α) (n : Nat) (hsz : a.size = n) : a = toArrayLit a n hsz :=
-- TODO: this is painful to prove without proper automation
sorry
/-
First, we need to prove
∀ i j acc, i ≤ a.size → (toListLitAux a n hsz (i+1) hi acc).index j = if j < i then a.getLit j hsz _ else acc.index (j - i)
by induction
Base case is trivial
(j : Nat) (acc : List α) (hi : 0 ≤ a.size)
|- (toListLitAux a n hsz 0 hi acc).index j = if j < 0 then a.getLit j hsz _ else acc.index (j - 0)
... |- acc.index j = acc.index j
Induction
(j : Nat) (acc : List α) (hi : i+1 ≤ a.size)
|- (toListLitAux a n hsz (i+1) hi acc).index j = if j < i + 1 then a.getLit j hsz _ else acc.index (j - (i + 1))
... |- (toListLitAux a n hsz i hi' (a.getLit i hsz _ :: acc)).index j = if j < i + 1 then a.getLit j hsz _ else acc.index (j - (i + 1)) * by def
... |- if j < i then a.getLit j hsz _ else (a.getLit i hsz _ :: acc).index (j-i) * by induction hypothesis
=
if j < i + 1 then a.getLit j hsz _ else acc.index (j - (i + 1))
If j < i, then both are a.getLit j hsz _
If j = i, then lhs reduces else-branch to (a.getLit i hsz _) and rhs is then-brachn (a.getLit i hsz _)
If j >= i + 1, we use
- j - i >= 1 > 0
- (a::as).index k = as.index (k-1) If k > 0
- j - (i + 1) = (j - i) - 1
Then lhs = (a.getLit i hsz _ :: acc).index (j-i) = acc.index (j-i-1) = acc.index (j-(i+1)) = rhs
With this proof, we have
∀ j, j < n → (toListLitAux a n hsz n _ []).index j = a.getLit j hsz _
We also need
- (toListLitAux a n hsz n _ []).length = n
- j < n -> (List.toArray as).getLit j _ _ = as.index j
Then using Array.extLit, we have that a = List.toArray $ toListLitAux a n hsz n _ []
-/
end Array

View file

@ -490,6 +490,11 @@ if s.isNat then
else
none
def beq (ss1 ss2 : Substring) : Bool :=
ss1.toString == ss2.toString
instance hasBeq : HasBeq Substring := ⟨beq⟩
end Substring
namespace String

View file

@ -13,6 +13,9 @@ universes u v
def dbgTrace {α : Type u} (s : String) (f : Unit → α) : α :=
f ()
def dbgTraceVal {α : Type u} [HasToString α] (a : α) : α :=
dbgTrace (toString a) (fun _ => a)
/- Display the given message if `a` is shared, that is, RC(a) > 1 -/
@[neverExtract, extern "lean_dbg_trace_if_shared"]
def dbgTraceIfShared {α : Type u} (s : String) (a : α) : α :=

View file

@ -12,7 +12,6 @@ import Lean.Attributes
import Lean.Parser
import Lean.ReducibilityAttrs
import Lean.Elab
import Lean.EqnCompiler
import Lean.Class
import Lean.LocalContext
import Lean.MetavarContext

View file

@ -62,5 +62,8 @@ hasInlineAttrAux env InlineAttributeKind.noinline n
def hasMacroInlineAttribute (env : Environment) (n : Name) : Bool :=
hasInlineAttrAux env InlineAttributeKind.macroInline n
def setInlineAttribute (env : Environment) (declName : Name) (kind : InlineAttributeKind) : Except String Environment :=
inlineAttrs.setValue env declName kind
end Compiler
end Lean

View file

@ -9,12 +9,12 @@ universes u v
namespace Lean
inductive Format
| nil : Format
| line : Format
| text : String → Format
| nest : Nat → Format → Format
| compose : Bool → Format → Format → Format
| choice : Format → Format → Format
| nil : Format
| line : Format
| text : String → Format
| nest (indent : Nat) : Format → Format
| compose (flattened : Bool) : Format → Format → Format
| choice : Format → Format → Format
namespace Format
@[export lean_format_append]

View file

@ -222,7 +222,7 @@ partial def delabFor : Name → Delab
def delab : Delab := do
k ← getExprKind;
delabFor k <|> (liftM $ show MetaM Syntax from throw $ Meta.Exception.other $ "don't know how to delaborate '" ++ toString k ++ "'")
delabFor k <|> (liftM $ show MetaM Syntax from throw $ Meta.Exception.other Syntax.missing $ "don't know how to delaborate '" ++ toString k ++ "'")
@[builtinDelab fvar]
def delabFVar : Delab := do
@ -463,9 +463,10 @@ def delabCoeFun : Delab := delabCoe
end Delaborator
/-- "Delaborate" the given term into surface-level syntax using the given general and subterm-specific options. -/
def delab (e : Expr) (defaultOptions : Options) (optionsPerPos : OptionsPerPos := {}) : MetaM Syntax := do
some stx ← Delaborator.delab { expr := e, defaultOptions := defaultOptions, optionsPerPos := optionsPerPos }
/-- "Delaborate" the given term into surface-level syntax using the default and given subterm-specific options. -/
def delab (e : Expr) (optionsPerPos : OptionsPerPos := {}) : MetaM Syntax := do
opts ← Meta.getOptions;
some stx ← Delaborator.delab { expr := e, defaultOptions := opts, optionsPerPos := optionsPerPos }
| unreachable!;
pure stx

View file

@ -225,8 +225,8 @@ match (x $ mkTermContext ctx s declName?).run (mkTermState s) with
| EStateM.Result.error (Term.Exception.ex ex) newS => do modify $ fun s => { s with env := newS.env, messages := newS.messages, ngen := newS.ngen }; throw ex
| EStateM.Result.error Term.Exception.postpone newS => unreachable!
@[inline] def runTermElabM {α} (declName? : Option Name) (elab : Array Expr → TermElabM α) : CommandElabM α := do
s ← get; liftTermElabM declName? (Term.elabBinders (getVarDecls s) elab)
@[inline] def runTermElabM {α} (declName? : Option Name) (elabFn : Array Expr → TermElabM α) : CommandElabM α := do
s ← get; liftTermElabM declName? (Term.elabBinders (getVarDecls s) elabFn)
@[inline] def withLogging (x : CommandElabM Unit) : CommandElabM Unit :=
catch x (fun ex => match ex with
@ -307,9 +307,9 @@ fun stx => do
| none => unless (checkAnonymousScope scopes) $ throwError stx "invalid 'end', name is missing"
| some header => unless (checkEndHeader header scopes) $ throwError stx "invalid 'end', name mismatch"
@[inline] def withNamespace {α} (ref : Syntax) (ns : Name) (elab : CommandElabM α) : CommandElabM α := do
@[inline] def withNamespace {α} (ref : Syntax) (ns : Name) (elabFn : CommandElabM α) : CommandElabM α := do
addNamespace ref ns;
a ← elab;
a ← elabFn;
modify $ fun s => { s with scopes := s.scopes.drop ns.getNumParts };
pure a

View file

@ -49,14 +49,15 @@ else
def antiquotKind? : Syntax → Option SyntaxNodeKind
| Syntax.node (Name.str k "antiquot" _) args =>
-- we treat all antiquotations where the kind was left implicit (`$e`) the same (see `elimAntiquotChoices`)
if (args.get! 3).isNone then some Name.anonymous
else some k
if (args.get! 3).isOfKind `antiquotName then some k
else
-- we treat all antiquotations where the kind was left implicit (`$e`) the same (see `elimAntiquotChoices`)
some Name.anonymous
| _ => none
-- `$e*` is an antiquotation "splice" matching an arbitrary number of syntax nodes
def isAntiquotSplice (stx : Syntax) : Bool :=
isAntiquot stx && (stx.getArg 5).getOptional?.isSome
isAntiquot stx && (stx.getArg 4).getOptional?.isSome
-- If any item of a `many` node is an antiquotation splice, its result should
-- be substituted into the `many` node's children

View file

@ -43,7 +43,7 @@ liftMetaTactic ref $ fun mvarId => do
let eq := mkApp3 (Lean.mkConst `Eq [u]) eType e (mkBVar 0);
let target := Lean.mkForall x BinderInfo.default eType $ Lean.mkForall h BinderInfo.default eq (b.liftLooseBVars 0 1);
evalGeneralizeFinalize mvarId e target
| _ => throw $ Meta.Exception.other "unexpected type after generalize"
| _ => throw $ Meta.Exception.other Syntax.missing "unexpected type after generalize"
-- If generalizing fails, fall back to not replacing anything
private def evalGeneralizeFallback (ref : Syntax) (h : Name) (e : Expr) (x : Name) : TacticM Unit :=

View file

@ -236,6 +236,10 @@ mkMessageCore ctx.fileName ctx.fileMap msgData severity (ref.getPos.getD ctx.cmd
/-- Auxiliary function for `liftMetaM` -/
private def fromMetaException (ctx : Context) (ref : Syntax) (ex : Meta.Exception) : Exception :=
-- We use `ref` stored in `ex` if it contains position information
let ref := match ex.getRef.getPos with
| some _ => ex.getRef
| none => ref;
Exception.ex $ Elab.Exception.error $ mkMessageAux ctx ref ex.toMessageData MessageSeverity.error
/-- Auxiliary function for `liftMetaM` -/

View file

@ -1,6 +0,0 @@
/-
Copyright (c) 2019 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.EqnCompiler.MatchPattern

View file

@ -106,6 +106,9 @@ def ofList: List MessageData → MessageData
def ofArray (msgs : Array MessageData) : MessageData :=
ofList msgs.toList
instance coeOfList : HasCoe (List MessageData) MessageData := ⟨ofList⟩
instance coeOfListExpr : HasCoe (List Expr) MessageData := ⟨fun es => ofList $ es.map ofExpr⟩
end MessageData
structure Message :=

View file

@ -20,3 +20,5 @@ import Lean.Meta.Message
import Lean.Meta.KAbstract
import Lean.Meta.RecursorInfo
import Lean.Meta.GeneralizeTelescope
import Lean.Meta.EqnCompiler
import Lean.Meta.ReduceEval

View file

@ -340,5 +340,25 @@ u ← getDecLevel `mkArrayLit type;
listLit ← mkListLit type xs;
pure (mkApp (mkApp (mkConst `List.toArray [u]) type) listLit)
def mkSorry (type : Expr) (synthetic : Bool) : MetaM Expr := do
u ← getLevel type;
pure $ mkApp2 (mkConst `sorryAx [u]) type (toExpr synthetic)
/-- Return a proof for `p : Prop` using `decide p` -/
def mkDecideProof (p : Expr) : MetaM Expr := do
decP ← mkAppM `Decidable.decide #[p];
decEqTrue ← mkEq decP (mkConst `Bool.true);
h ← mkEqRefl (mkConst `Bool.true);
h ← mkExpectedTypeHint h decEqTrue;
mkAppM `ofDecideEqTrue #[h]
/-- Return `a < b` -/
def mkLt (a b : Expr) : MetaM Expr :=
mkAppM `HasLess.Less #[a, b]
/-- Return `a <= b` -/
def mkLe (a b : Expr) : MetaM Expr :=
mkAppM `HasLessEq.LessEq #[a, b]
end Meta
end Lean

View file

@ -10,6 +10,7 @@ import Lean.ReducibilityAttrs
import Lean.Util.Trace
import Lean.Util.RecDepth
import Lean.Util.Closure
import Lean.Compiler.InlineAttrs
import Lean.Meta.Exception
import Lean.Meta.DiscrTreeTypes
import Lean.Eval
@ -138,7 +139,7 @@ instance MetaM.inhabited {α} : Inhabited (MetaM α) :=
@[inline] def withIncRecDepth {α} (x : MetaM α) : MetaM α := do
ctx ← read;
when (ctx.currRecDepth == ctx.maxRecDepth) $ throw $ Exception.other maxRecDepthErrorMessage;
when (ctx.currRecDepth == ctx.maxRecDepth) $ throw $ Exception.other Syntax.missing maxRecDepthErrorMessage;
adaptReader (fun (ctx : Context) => { ctx with currRecDepth := ctx.currRecDepth + 1 }) x
@[inline] def getLCtx : MetaM LocalContext := do
@ -163,17 +164,17 @@ def setEnv (env : Environment) : MetaM Unit := do
modify $ fun s => { s with env := env }
def mkWHNFRef : IO (IO.Ref (Expr → MetaM Expr)) :=
IO.mkRef $ fun _ => throw $ Exception.other "whnf implementation was not set"
IO.mkRef $ fun _ => throw $ Exception.other Syntax.missing "whnf implementation was not set"
@[init mkWHNFRef] def whnfRef : IO.Ref (Expr → MetaM Expr) := arbitrary _
def mkInferTypeRef : IO (IO.Ref (Expr → MetaM Expr)) :=
IO.mkRef $ fun _ => throw $ Exception.other "inferType implementation was not set"
IO.mkRef $ fun _ => throw $ Exception.other Syntax.missing "inferType implementation was not set"
@[init mkInferTypeRef] def inferTypeRef : IO.Ref (Expr → MetaM Expr) := arbitrary _
def mkIsExprDefEqAuxRef : IO (IO.Ref (Expr → Expr → MetaM Bool)) :=
IO.mkRef $ fun _ _ => throw $ Exception.other "isDefEq implementation was not set"
IO.mkRef $ fun _ _ => throw $ Exception.other Syntax.missing "isDefEq implementation was not set"
@[init mkIsExprDefEqAuxRef] def isExprDefEqAuxRef : IO.Ref (Expr → Expr → MetaM Bool) := arbitrary _
@ -254,10 +255,15 @@ ctx ← read;
s ← get;
throw (f { env := s.env, mctx := s.mctx, lctx := ctx.lctx, opts := ctx.config.opts })
def throwOther {α} (msg : MessageData) : MetaM α := do
def throwOther {α} (msg : MessageData) (ref := Syntax.missing) : MetaM α := do
ctx ← read;
s ← get;
throw (Exception.other (MessageData.withContext { env := s.env, mctx := s.mctx, lctx := ctx.lctx, opts := ctx.config.opts } msg))
throw (Exception.other ref (MessageData.withContext { env := s.env, mctx := s.mctx, lctx := ctx.lctx, opts := ctx.config.opts } msg))
@[inline] def ofExcept {α ε} [HasToString ε] (x : Except ε α) : MetaM α :=
match x with
| Except.ok a => pure a
| Except.error e => throwOther (toString e)
def throwBug {α} (b : Bug) : MetaM α :=
throwEx $ Exception.bug b
@ -860,6 +866,12 @@ type ← inferType value;
let type := type.headBeta;
mkAuxDefinition name type value
def setInlineAttribute (declName : Name) (kind := Compiler.InlineAttributeKind.inline): MetaM Unit := do
env ← getEnv;
match Compiler.setInlineAttribute env declName kind with
| Except.ok env => setEnv env
| Except.error msg => throwOther msg
private partial def instantiateForallAux (ps : Array Expr) : Nat → Expr → MetaM Expr
| i, e =>
if h : i < ps.size then do
@ -867,7 +879,7 @@ private partial def instantiateForallAux (ps : Array Expr) : Nat → Expr → Me
e ← whnf e;
match e with
| Expr.forallE _ _ b _ => instantiateForallAux (i+1) (b.instantiate1 p)
| _ => throw (Exception.other "invalid instantiateForall, too many parameters")
| _ => throwOther "invalid instantiateForall, too many parameters"
else
pure e

View file

@ -0,0 +1,16 @@
/-
Copyright (c) 2019 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Meta.EqnCompiler.MatchPattern
import Lean.Meta.EqnCompiler.DepElim
import Lean.Meta.EqnCompiler.CaseValues
import Lean.Meta.EqnCompiler.CaseArraySizes
namespace Lean
@[init] private def regTraceClasses : IO Unit :=
registerTraceClass `Meta.EqnCompiler
end Lean

View file

@ -0,0 +1,96 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Meta.Tactic.Assert
import Lean.Meta.EqnCompiler.CaseValues
namespace Lean
namespace Meta
structure CaseArraySizesSubgoal :=
(mvarId : MVarId)
(elems : Array FVarId := #[])
(diseqs : Array FVarId := #[])
(subst : FVarSubst := {})
instance CaseArraySizesSubgoal.inhabited : Inhabited CaseArraySizesSubgoal :=
⟨{ mvarId := arbitrary _ }⟩
def getArrayArgType (a : Expr) : MetaM Expr := do
aType ← inferType a;
aType ← whnfD aType;
unless (aType.isAppOfArity `Array 1) $
throwOther ("array expected" ++ indentExpr a);
pure aType.appArg!
private def mkArrayGetLit (a : Expr) (i : Nat) (n : Nat) (h : Expr) : MetaM Expr := do
lt ← mkLt (mkNatLit i) (mkNatLit n);
ltPrf ← mkDecideProof lt;
mkAppM `Array.getLit #[a, mkNatLit i, h, ltPrf]
private partial def introArrayLitAux (mvarId : MVarId) (α : Expr) (a : Expr) (n : Nat) (xNamePrefix : Name) (aSizeEqN : Expr)
: Nat → Array Expr → Array Expr → MetaM (Expr × Array Expr)
| i, xs, args =>
if i < n then do
withLocalDecl (xNamePrefix.appendIndexAfter (i+1)) α BinderInfo.default fun xi => do
let xs := xs.push xi;
ai ← mkArrayGetLit a i n aSizeEqN;
let args := args.push ai;
introArrayLitAux (i+1) xs args
else do
xsLit ← mkArrayLit α xs.toList;
aEqXsLit ← mkEq a xsLit;
aEqLitPrf ← mkAppM `Array.toArrayLitEq #[a, mkNatLit n, aSizeEqN];
withLocalDecl `hEqALit aEqXsLit BinderInfo.default fun heq => do
target ← getMVarType mvarId;
newTarget ← mkForall (xs.push heq) target;
pure (newTarget, args.push aEqLitPrf)
private partial def introArrayLit (mvarId : MVarId) (a : Expr) (n : Nat) (xNamePrefix : Name) (aSizeEqN : Expr) : MetaM MVarId := do
α ← getArrayArgType a;
(newTarget, args) ← introArrayLitAux mvarId α a n xNamePrefix aSizeEqN 0 #[] #[];
tag ← getMVarTag mvarId;
newMVar ← mkFreshExprSyntheticOpaqueMVar newTarget tag;
assignExprMVar mvarId (mkAppN newMVar args);
pure newMVar.mvarId!
/--
Split goal `... |- C a` into sizes.size + 1 subgoals
1) `..., x_1 ... x_{sizes[0]} |- C #[x_1, ... x_{sizes[0]}]`
...
n) `..., x_1 ... x_{sizes[n-1]} |- C #[x_1, ..., x_{sizes[n-1]}]`
n+1) `..., (h_1 : a.size != sizes[0]), ..., (h_n : a.size != sizes[n-1]) |- C a`
where `n = sizes.size` -/
def caseArraySizes (mvarId : MVarId) (fvarId : FVarId) (sizes : Array Nat) (xNamePrefix := `x) (hNamePrefix := `h) : MetaM (Array CaseArraySizesSubgoal) := do
let a := mkFVar fvarId;
α ← getArrayArgType a;
aSize ← mkAppM `Array.size #[a];
mvarId ← assertExt mvarId `aSize (mkConst `Nat) aSize;
(aSizeFVarId, mvarId) ← intro1 mvarId;
(hEq, mvarId) ← intro1 mvarId;
subgoals ← caseValues mvarId aSizeFVarId (sizes.map mkNatLit) hNamePrefix;
subgoals.mapIdxM fun i subgoal => do
let subst := subgoal.subst;
let mvarId := subgoal.mvarId;
let hEqSz := (subst.get hEq).fvarId!;
if h : i < sizes.size then do
let n := sizes.get ⟨i, h⟩;
mvarId ← clear mvarId (subgoal.newHs.get! 0);
mvarId ← clear mvarId (subst.get aSizeFVarId).fvarId!;
withMVarContext mvarId do
hEqSzSymm ← mkEqSymm (mkFVar hEqSz);
mvarId ← introArrayLit mvarId a n xNamePrefix hEqSzSymm;
(xs, mvarId) ← introN mvarId n;
(hEqLit, mvarId) ← intro1 mvarId;
mvarId ← clear mvarId hEqSz;
(subst, mvarId) ← substCore mvarId hEqLit false subst;
pure { mvarId := mvarId, elems := xs, subst := subst }
else do
(subst, mvarId) ← substCore mvarId hEq false subst;
let diseqs := subgoal.newHs.map fun fvarId => (subst.get fvarId).fvarId!;
pure { mvarId := mvarId, diseqs := diseqs, subst := subst }
end Meta
end Lean

View file

@ -0,0 +1,105 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Meta.Tactic.Subst
import Lean.Meta.Tactic.Clear
namespace Lean
namespace Meta
structure CaseValueSubgoal :=
(mvarId : MVarId)
(newH : FVarId)
(subst : FVarSubst := {})
instance CaseValueSubgoal.inhabited : Inhabited CaseValueSubgoal :=
⟨{ mvarId := arbitrary _, newH := arbitrary _ }⟩
/--
Split goal `... |- C x` into two subgoals
`..., (h : x = value) |- C value`
`..., (h : x != value) |- C x`
where `fvarId` is `x`s id.
The type of `x` must have decidable equality.
Remark: `subst` field of the second subgoal is equal to the input `subst`. -/
def caseValueAux (mvarId : MVarId) (fvarId : FVarId) (value : Expr) (hName : Name := `h) (subst : FVarSubst := {})
: MetaM (CaseValueSubgoal × CaseValueSubgoal) :=
withMVarContext mvarId $ do
tag ← getMVarTag mvarId;
checkNotAssigned mvarId `caseValue;
target ← getMVarType mvarId;
xEqValue ← mkEq (mkFVar fvarId) value;
let xNeqValue := mkApp (mkConst `Not) xEqValue;
let thenTarget := Lean.mkForall hName BinderInfo.default xEqValue target;
let elseTarget := Lean.mkForall hName BinderInfo.default xNeqValue target;
thenMVar ← mkFreshExprSyntheticOpaqueMVar thenTarget tag;
elseMVar ← mkFreshExprSyntheticOpaqueMVar elseTarget tag;
val ← mkAppOptM `dite #[none, xEqValue, none, thenMVar, elseMVar];
assignExprMVar mvarId val;
(elseH, elseMVarId) ← intro1 elseMVar.mvarId! false;
let elseSubgoal := { mvarId := elseMVarId, newH := elseH, subst := subst : CaseValueSubgoal };
(thenH, thenMVarId) ← intro1 thenMVar.mvarId! false;
let symm := false;
let clearH := false;
(thenSubst, thenMVarId) ← substCore thenMVarId thenH symm subst clearH;
withMVarContext thenMVarId do {
trace! `Meta ("subst domain: " ++ toString thenSubst.domain);
let thenH := (thenSubst.get thenH).fvarId!;
trace! `Meta "searching for decl";
decl ← getLocalDecl thenH;
trace! `Meta "found decl"
};
let thenSubgoal := { mvarId := thenMVarId, newH := (thenSubst.get thenH).fvarId!, subst := thenSubst : CaseValueSubgoal };
pure (thenSubgoal, elseSubgoal)
def caseValue (mvarId : MVarId) (fvarId : FVarId) (value : Expr) : MetaM (CaseValueSubgoal × CaseValueSubgoal) := do
s ← caseValueAux mvarId fvarId value;
appendTagSuffix s.1.mvarId `thenBranch;
appendTagSuffix s.2.mvarId `elseBranch;
pure s
structure CaseValuesSubgoal :=
(mvarId : MVarId)
(newHs : Array FVarId := #[])
(subst : FVarSubst := {})
instance CaseValueSubgoals.inhabited : Inhabited CaseValuesSubgoal :=
⟨{ mvarId := arbitrary _ }⟩
private def caseValuesAux (hNamePrefix : Name) (fvarId : FVarId) : Nat → MVarId → List Expr → Array FVarId → Array CaseValuesSubgoal → MetaM (Array CaseValuesSubgoal)
| i, mvarId, [], hs, subgoals => throwTacticEx `caseValues mvarId "list of values must not be empty"
| i, mvarId, v::vs, hs, subgoals => do
(thenSubgoal, elseSubgoal) ← caseValueAux mvarId fvarId v (hNamePrefix.appendIndexAfter i) {};
appendTagSuffix thenSubgoal.mvarId ((`case).appendIndexAfter i);
thenMVarId ← hs.foldlM
(fun thenMVarId h => match thenSubgoal.subst.get h with
| Expr.fvar fvarId _ => tryClear thenMVarId fvarId
| _ => pure thenMVarId)
thenSubgoal.mvarId;
let subgoals := subgoals.push { mvarId := thenMVarId, newHs := #[thenSubgoal.newH], subst := thenSubgoal.subst };
match vs with
| [] => do
appendTagSuffix elseSubgoal.mvarId ((`case).appendIndexAfter (i+1));
pure $ subgoals.push { mvarId := elseSubgoal.mvarId, newHs := hs.push elseSubgoal.newH, subst := {} }
| _ => caseValuesAux (i+1) elseSubgoal.mvarId vs (hs.push elseSubgoal.newH) subgoals
/--
Split goal `... |- C x` into values.size + 1 subgoals
1) `..., (h_1 : x = value[0]) |- C value[0]`
...
n) `..., (h_n : x = value[n - 1]) |- C value[n - 1]`
n+1) `..., (h_1 : x != value[0]) ... (h_n : x != value[n-1]) |- C x`
where `n = values.size`
where `fvarId` is `x`s id.
The type of `x` must have decidable equality.
Remark: the last subgoal is for the "else" catchall case, and its `subst` is `{}`.
Remark: the fiels `newHs` has size 1 forall but the last subgoal. -/
def caseValues (mvarId : MVarId) (fvarId : FVarId) (values : Array Expr) (hNamePrefix := `h) : MetaM (Array CaseValuesSubgoal) :=
caseValuesAux hNamePrefix fvarId 1 mvarId values.toList #[] #[]
end Meta
end Lean

View file

@ -0,0 +1,754 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Util.CollectLevelParams
import Lean.Meta.Check
import Lean.Meta.Tactic.Cases
import Lean.Meta.GeneralizeTelescope
import Lean.Meta.EqnCompiler.MVarRenaming
import Lean.Meta.EqnCompiler.CaseValues
import Lean.Meta.EqnCompiler.CaseArraySizes
namespace Lean
namespace Meta
namespace DepElim
abbrev VarId := Name
inductive Pattern (internal : Bool := false) : Type
| inaccessible (ref : Syntax) (e : Expr) : Pattern
| var (ref : Syntax) (varId : VarId) : Pattern
| ctor (ref : Syntax) (ctorName : Name) (us : List Level) (params : List Expr) (fields : List Pattern) : Pattern
| val (ref : Syntax) (e : Expr) : Pattern
| arrayLit (ref : Syntax) (type : Expr) (xs : List Pattern) : Pattern
| as (ref : Syntax) (varId : VarId) (p : Pattern) : Pattern
abbrev IPattern := Pattern true
namespace Pattern
instance {b} : Inhabited (Pattern b) := ⟨Pattern.inaccessible Syntax.missing (arbitrary _)⟩
def ref {b : Bool} : Pattern b → Syntax
| inaccessible r _ => r
| var r _ => r
| ctor r _ _ _ _ => r
| val r _ => r
| arrayLit r _ _ => r
| as r _ _ => r
partial def toMessageData {b : Bool} : Pattern b → MessageData
| inaccessible _ e => ".(" ++ e ++ ")"
| var _ varId => if b then mkMVar varId else mkFVar varId
| ctor _ ctorName _ _ [] => ctorName
| ctor _ ctorName _ _ pats => "(" ++ ctorName ++ pats.foldl (fun (msg : MessageData) pat => msg ++ " " ++ toMessageData pat) Format.nil ++ ")"
| val _ e => "val!(" ++ e ++ ")"
| arrayLit _ _ pats => "#[" ++ MessageData.joinSep (pats.map toMessageData) ", " ++ "]"
| as _ varId p => (if b then mkMVar varId else mkFVar varId) ++ "@" ++toMessageData p
partial def toExpr {b} : Pattern b → MetaM Expr
| inaccessible _ e => pure e
| var _ varId => if b then pure (mkMVar varId) else pure (mkFVar varId)
| val _ e => pure e
| as _ _ p => toExpr p
| arrayLit _ type xs => do
xs ← xs.mapM toExpr;
mkArrayLit type xs
| ctor _ ctorName us params fields => do
fields ← fields.mapM toExpr;
pure $ mkAppN (mkConst ctorName us) (params ++ fields).toArray
/- Apply the free variable substitution `s` to the given (internal) pattern -/
partial def applyFVarSubst (s : FVarSubst) : Pattern true → IPattern
| inaccessible r e => inaccessible r $ s.apply e
| ctor r n us ps fs => ctor r n us (ps.map s.apply) $ fs.map applyFVarSubst
| val r e => val r $ s.apply e
| arrayLit r t xs => arrayLit r (s.apply t) $ xs.map applyFVarSubst
| var r id => var r id
| as r v p => as r v $ applyFVarSubst p
partial def instantiateMVars : IPattern → MetaM IPattern
| inaccessible r e => inaccessible r <$> Meta.instantiateMVars e
| ctor r n us ps fs => ctor r n us <$> ps.mapM Meta.instantiateMVars <*> fs.mapM instantiateMVars
| val r e => val r <$> Meta.instantiateMVars e
| arrayLit r t xs => arrayLit r <$> Meta.instantiateMVars t <*> xs.mapM instantiateMVars
| var ref mvarId => do
mctx ← getMCtx;
match mctx.getExprAssignment? mvarId with
| some v => inaccessible ref <$> Meta.instantiateMVars v
| none => pure (var ref mvarId)
| as ref mvarId p => do
mctx ← getMCtx;
match mctx.getExprAssignment? mvarId with
| some v => instantiateMVars p
| none => as ref mvarId <$> instantiateMVars p
partial def applyMVarRenaming (m : MVarRenaming) : Pattern true → IPattern
| inaccessible r e => inaccessible r $ m.apply e
| ctor r n us ps fs => ctor r n us (ps.map m.apply) $ fs.map applyMVarRenaming
| val r e => val r $ m.apply e
| arrayLit r t xs => arrayLit r (m.apply t) $ xs.map applyMVarRenaming
| var ref mvarId =>
match m.find? mvarId with
| some newMVarId => var ref newMVarId
| none => var ref mvarId
| as ref mvarId p =>
match m.find? mvarId with
| some newMVarId => as ref newMVarId $ applyMVarRenaming p
| none => as ref mvarId $ applyMVarRenaming p
partial def toIPattern (s : FVarSubst) : Pattern → IPattern
| inaccessible r e => inaccessible r $ s.apply e
| ctor r n us ps fs => ctor r n us (ps.map s.apply) $ fs.map toIPattern
| val r e => val r $ s.apply e
| arrayLit r t xs => arrayLit r (s.apply t) $ xs.map toIPattern
| var ref fvarId =>
match s.get fvarId with
| Expr.mvar mvarId _ => Pattern.var ref mvarId
| _ => unreachable!
| as ref fvarId p =>
match s.get fvarId with
| Expr.mvar mvarId _ => Pattern.as ref mvarId $ toIPattern p
| _ => unreachable!
end Pattern
structure AltLHS :=
(fvarDecls : List LocalDecl) -- Free variables used in the patterns.
(patterns : List Pattern) -- We use `List Pattern` since we have nary match-expressions.
structure Alt :=
(idx : Nat) -- for generating error messages
(rhs : Expr)
(mvars : List MVarId)
(patterns : List IPattern)
namespace Alt
instance : Inhabited Alt := ⟨⟨0, arbitrary _, [], []⟩⟩
partial def toMessageData (alt : Alt) : MetaM MessageData := do
let msg : MessageData := alt.mvars.map mkMVar ++ " |- " ++ (alt.patterns.map Pattern.toMessageData) ++ " => " ++ alt.rhs;
addContext msg
private def convertMVar (s : FVarSubst) (m : MVarRenaming) (mvarId : MVarId) : MetaM (MVarRenaming × MVarId) :=
if s.isEmpty && m.isEmpty then pure (m, mvarId)
else do
mvarDecl ← getMVarDecl mvarId;
let mvarType0 := mvarDecl.type;
mvarType0 ← instantiateMVars mvarType0;
let mvarType := s.apply mvarType0;
let mvarType := m.apply mvarType;
let lctx := mvarDecl.lctx;
if (s.any fun fvarId _ => lctx.contains fvarId) || mvarType != mvarType0 then do
newMVar ← mkFreshExprMVar mvarType;
let m := m.insert mvarId newMVar.mvarId!;
pure (m, newMVar.mvarId!)
else
pure (m, mvarId)
private def convertMVars (s : FVarSubst) (mvars : List MVarId) : MetaM (MVarRenaming × List MVarId) := do
(m, mvars) ← mvars.foldlM
(fun (acc : MVarRenaming × List MVarId) mvarId => do
let (m, mvarIds) := acc;
(m, mvarId') ← convertMVar s m mvarId;
let m := if mvarId == mvarId' then m else m.insert mvarId mvarId';
pure (m, mvarId'::mvarIds))
({}, []);
pure (m, mvars.reverse)
def applyFVarSubst (s : FVarSubst) (alt : Alt) : MetaM Alt := do
(m, mvars) ← convertMVars s alt.mvars;
let patterns := alt.patterns.map fun p => (p.applyFVarSubst s).applyMVarRenaming m;
let rhs := m.apply $ s.apply alt.rhs;
pure { alt with patterns := patterns, mvars := mvars, rhs := rhs }
private def copyMVar (m : MVarRenaming) (mvarId : MVarId) : MetaM (MVarRenaming × MVarId) := do
mvarDecl ← getMVarDecl mvarId;
let mvarType := mvarDecl.type;
mvarType ← instantiateMVars mvarType;
let mvarType := m.apply mvarType;
newMVar ← mkFreshExprMVar mvarType;
let m := m.insert mvarId newMVar.mvarId!;
pure (m, newMVar.mvarId!)
private def copyMVars (mvars : List MVarId) : MetaM (MVarRenaming × List MVarId) := do
(m, mvars) ← mvars.foldlM
(fun (acc : MVarRenaming × List MVarId) mvarId => do
let (m, mvarIds) := acc;
(m, mvarId) ← copyMVar m mvarId;
pure (m, mvarId::mvarIds))
({}, []);
pure (m, mvars.reverse)
def copyCore (alt : Alt) : MetaM (MVarRenaming × Alt) := do
(m, mvars) ← copyMVars alt.mvars;
let patterns := alt.patterns.map fun p => p.applyMVarRenaming m;
let rhs := m.apply alt.rhs;
pure (m, { alt with patterns := patterns, mvars := mvars, rhs := rhs })
/- Create a copy of the given alternative with fresh metavariables. -/
def copy (alt : Alt) : MetaM Alt := do
(m, alt) ← copyCore alt;
pure alt
end Alt
inductive Example
| var : FVarId → Example
| underscore : Example
| ctor : Name → List Example → Example
| val : Expr → Example
| arrayLit : List Example → Example
namespace Example
partial def replaceFVarId (fvarId : FVarId) (ex : Example) : Example → Example
| var x => if x == fvarId then ex else var x
| ctor n exs => ctor n $ exs.map replaceFVarId
| arrayLit exs => arrayLit $ exs.map replaceFVarId
| ex => ex
partial def applyFVarSubst (s : FVarSubst) : Example → Example
| var fvarId =>
match s.get fvarId with
| Expr.fvar fvarId' _ => var fvarId'
| _ => underscore
| ctor n exs => ctor n $ exs.map applyFVarSubst
| arrayLit exs => arrayLit $ exs.map applyFVarSubst
| ex => ex
partial def varsToUnderscore : Example → Example
| var x => underscore
| ctor n exs => ctor n $ exs.map varsToUnderscore
| arrayLit exs => arrayLit $ exs.map varsToUnderscore
| ex => ex
partial def toMessageData : Example → MessageData
| var fvarId => mkFVar fvarId
| ctor ctorName [] => mkConst ctorName
| ctor ctorName exs => "(" ++ mkConst ctorName ++ exs.foldl (fun (msg : MessageData) pat => msg ++ " " ++ toMessageData pat) Format.nil ++ ")"
| arrayLit exs => "#" ++ MessageData.ofList (exs.map toMessageData)
| val e => e
| underscore => "_"
end Example
def examplesToMessageData (cex : List Example) : MessageData :=
MessageData.joinSep (cex.map (Example.toMessageData ∘ Example.varsToUnderscore)) ", "
structure Problem :=
(mvarId : MVarId)
(vars : List Expr)
(alts : List Alt)
(examples : List Example)
def withGoalOf {α} (p : Problem) (x : MetaM α) : MetaM α :=
withMVarContext p.mvarId x
namespace Problem
instance : Inhabited Problem := ⟨{ mvarId := arbitrary _, vars := [], alts := [], examples := []}⟩
def toMessageData (p : Problem) : MetaM MessageData :=
withGoalOf p do
alts ← p.alts.mapM Alt.toMessageData;
pure $ "vars " ++ p.vars.toArray
-- ++ Format.line ++ "var ids " ++ toString (p.vars.map (fun x => match x with | Expr.fvar id _ => toString id | _ => "[nonvar]"))
++ Format.line ++ MessageData.joinSep alts Format.line
++ Format.line ++ "examples: " ++ examplesToMessageData p.examples
++ Format.line
end Problem
abbrev CounterExample := List Example
def counterExampleToMessageData (cex : CounterExample) : MessageData :=
examplesToMessageData cex
def counterExamplesToMessageData (cexs : List CounterExample) : MessageData :=
MessageData.joinSep (cexs.map counterExampleToMessageData) Format.line
structure ElimResult :=
(elim : Expr) -- The eliminator. It is not just `Expr.const elimName` because the type of the major premises may contain free variables.
(counterExamples : List CounterExample)
(unusedAltIdxs : List Nat)
/- The number of patterns in each AltLHS must be equal to majors.length -/
private def checkNumPatterns (majors : List Expr) (lhss : List AltLHS) : MetaM Unit :=
let num := majors.length;
when (lhss.any (fun lhs => lhs.patterns.length != num)) $
throwOther "incorrect number of patterns"
/-
Given major premises `(x_1 : A_1) (x_2 : A_2[x_1]) ... (x_n : A_n[x_1, x_2, ...])`, return
`forall (x_1 : A_1) (x_2 : A_2[x_1]) ... (x_n : A_n[x_1, x_2, ...]), sortv` -/
private def withMotive {α} (majors : Array Expr) (sortv : Expr) (k : Expr → MetaM α) : MetaM α := do
type ← mkForall majors sortv;
trace! `Meta.EqnCompiler.matchDebug ("motive: " ++ type);
withLocalDecl `motive type BinderInfo.default k
private def localDeclsToMVarsAux : List LocalDecl → List MVarId → FVarSubst → MetaM (List MVarId × FVarSubst)
| [], mvars, s => pure (mvars.reverse, s)
| d::ds, mvars, s => do
let type := s.apply d.type;
mvar ← mkFreshExprMVar type;
let s := s.insert d.fvarId mvar;
localDeclsToMVarsAux ds (mvar.mvarId! :: mvars) s
private def localDeclsToMVars (fvarDecls : List LocalDecl) : MetaM (List MVarId × FVarSubst) :=
localDeclsToMVarsAux fvarDecls [] {}
private def mkThunk (type : Expr) : Expr :=
Lean.mkForall `u BinderInfo.default (Lean.mkConst `Unit) type
private partial def withAltsAux {α} (motive : Expr) : List AltLHS → List Alt → Array Expr → (List Alt → Array Expr → MetaM α) → MetaM α
| [], alts, minors, k => k alts.reverse minors
| lhs::lhss, alts, minors, k => do
let xs := lhs.fvarDecls.toArray.map LocalDecl.toExpr;
minorType ← withExistingLocalDecls lhs.fvarDecls do {
args ← lhs.patterns.toArray.mapM Pattern.toExpr;
let minorType := mkAppN motive args;
mkForall xs minorType
};
let minorType := if minorType.isForall then minorType else mkThunk minorType;
let idx := alts.length;
let minorName := (`h).appendIndexAfter (idx+1);
trace! `Meta.EqnCompiler.matchDebug ("minor premise " ++ minorName ++ " : " ++ minorType);
withLocalDecl minorName minorType BinderInfo.default fun minor => do
let rhs := if xs.isEmpty then mkApp minor (mkConst `Unit.unit) else mkAppN minor xs;
let minors := minors.push minor;
(mvars, s) ← localDeclsToMVars lhs.fvarDecls;
let patterns := lhs.patterns.map (fun p => p.toIPattern s);
let rhs := s.apply rhs;
let alts := { idx := idx, rhs := rhs, mvars := mvars, patterns := patterns : Alt } :: alts;
withAltsAux lhss alts minors k
/- Given a list of `AltLHS`, create a minor premise for each one, convert them into `Alt`, and then execute `k` -/
private partial def withAlts {α} (motive : Expr) (lhss : List AltLHS) (k : List Alt → Array Expr → MetaM α) : MetaM α :=
withAltsAux motive lhss [] #[] k
def assignGoalOf (p : Problem) (e : Expr) : MetaM Unit :=
withGoalOf p (assignExprMVar p.mvarId e)
structure State :=
(used : Std.HashSet Nat := {}) -- used alternatives
(counterExamples : List (List Example) := [])
/-- Return true if the given (sub-)problem has been solved. -/
private def isDone (p : Problem) : Bool :=
p.vars.isEmpty
/-- Return true if the next element on the `p.vars` list is a variable. -/
private def isNextVar (p : Problem) : Bool :=
match p.vars with
| Expr.fvar _ _ :: _ => true
| _ => false
private def hasAsPattern (p : Problem) : Bool :=
p.alts.any fun alt => match alt.patterns with
| Pattern.as _ _ _ :: _ => true
| _ => false
/- Return true if the next pattern of each remaining alternative is an inaccessible term or a variable -/
private def isVariableTransition (p : Problem) : Bool :=
p.alts.all fun alt => match alt.patterns with
| Pattern.inaccessible _ _ :: _ => true
| Pattern.var _ _ :: _ => true
| _ => false
/- Return true if the next pattern of each remaining alternative is a constructor application -/
private def isConstructorTransition (p : Problem) : Bool :=
p.alts.all fun alt => match alt.patterns with
| Pattern.ctor _ _ _ _ _ :: _ => true
| _ => false
/- Return true if the next pattern of the remaining alternatives contain variables AND constructors. -/
private def isCompleteTransition (p : Problem) : Bool :=
let (ok, hasVar, hasCtor) := p.alts.foldl
(fun (acc : Bool × Bool × Bool) (alt : Alt) =>
let (ok, hasVar, hasCtor) := acc;
match alt.patterns with
| Pattern.ctor _ _ _ _ _ :: _ => (ok, hasVar, true)
| Pattern.var _ _ :: _ => (ok, true, hasCtor)
| _ => (false, hasVar, hasCtor))
(true, false, false);
ok && hasVar && hasCtor
/- Return true if the next pattern of the remaining alternatives contain variables AND values. -/
private def isValueTransition (p : Problem) : Bool :=
let (ok, hasVar, hasVal) := p.alts.foldl
(fun (acc : Bool × Bool × Bool) (alt : Alt) =>
let (ok, hasVar, hasVal) := acc;
match alt.patterns with
| Pattern.val _ _ :: _ => (ok, hasVar, true)
| Pattern.var _ _ :: _ => (ok, true, hasVal)
| _ => (false, hasVar, hasVal))
(true, false, false);
ok && hasVar && hasVal
/- Return true if the next pattern of the remaining alternatives contain variables AND array literals. -/
private def isArrayLitTransition (p : Problem) : Bool :=
let (ok, hasVar, hasArray) := p.alts.foldl
(fun (acc : Bool × Bool × Bool) (alt : Alt) =>
let (ok, hasVar, hasArray) := acc;
match alt.patterns with
| Pattern.arrayLit _ _ _ :: _ => (ok, hasVar, true)
| Pattern.var _ _ :: _ => (ok, true, hasArray)
| _ => (false, hasVar, hasArray))
(true, false, false);
ok && hasVar && hasArray
private def processNonVariable (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("non variable step");
match p.vars with
| x :: xs =>
let alts := p.alts.map fun alt => match alt.patterns with
| _ :: ps => { alt with patterns := ps }
| _ => unreachable!;
process { p with alts := alts, vars := xs } s
| _ => unreachable!
private def processLeaf (p : Problem) (s : State) : MetaM State :=
match p.alts with
| [] => do
admit p.mvarId;
pure { s with counterExamples := p.examples :: s.counterExamples }
| alt :: _ => do
-- TODO: check whether we have unassigned metavars in rhs
assignGoalOf p alt.rhs;
pure { s with used := s.used.insert alt.idx }
private def processAsPattern (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("as-pattern step");
match p.vars with
| [] => unreachable!
| x :: xs => do
alts ← p.alts.mapM fun alt => match alt.patterns with
| Pattern.as _ mvarId p :: ps => do
assignExprMVar mvarId x;
rhs ← instantiateMVars alt.rhs;
let mvars := alt.mvars.erase mvarId;
let ps := p :: ps;
ps ← ps.mapM fun p => p.instantiateMVars;
pure { alt with patterns := ps, rhs := rhs, mvars := mvars }
| _ => pure alt;
process { p with alts := alts } s
private def processVariable (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("variable step");
match p.vars with
| [] => unreachable!
| x :: xs => do
alts ← p.alts.mapM fun alt => match alt.patterns with
| Pattern.inaccessible _ _ :: ps => pure { alt with patterns := ps }
| Pattern.var _ mvarId :: ps => do
-- trace! `Meta.EqnCompiler.matchDebug (">> assign " ++ mkMVar mvarId ++ " := " ++ x);
assignExprMVar mvarId x;
rhs ← instantiateMVars alt.rhs;
let mvars := alt.mvars.erase mvarId;
-- trace! `Meta.EqnCompiler.matchDebug (">> patterns before assignment: " ++ MessageData.ofList (ps.map Pattern.toMessageData));
patterns ← ps.mapM fun p => p.instantiateMVars;
-- trace! `Meta.EqnCompiler.matchDebug (">> patterns after assignment: " ++ MessageData.ofList (patterns.map Pattern.toMessageData));
pure { alt with patterns := patterns, rhs := rhs, mvars := mvars }
| _ => unreachable!;
process { p with alts := alts, vars := xs } s
private def isFirstPatternCtor (ctorName : Name) (alt : Alt) : Bool :=
match alt.patterns with
| Pattern.ctor _ n _ _ _ :: _ => n == ctorName
| _ => false
private def processConstructor (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("constructor step");
match p.vars with
| [] => unreachable!
| x :: xs => do
subgoals ← cases p.mvarId x.fvarId!;
subgoals.foldlM
(fun (s : State) subgoal => do
let subst := subgoal.subst;
let fields := subgoal.fields.toList;
let newVars := fields ++ xs;
let newVars := newVars.map fun x => x.applyFVarSubst subst;
let subex := Example.ctor subgoal.ctorName $ fields.map fun field => match field with
| Expr.fvar fvarId _ => Example.var fvarId
| _ => Example.underscore; -- This case can happen due to dependent elimination
let examples := p.examples.map $ Example.replaceFVarId x.fvarId! subex;
let examples := examples.map $ Example.applyFVarSubst subst;
let newAlts := p.alts.filter $ isFirstPatternCtor subgoal.ctorName;
let newAlts := newAlts.map fun alt => match alt.patterns with
| Pattern.ctor _ _ _ _ fields :: ps => { alt with patterns := fields ++ ps }
| _ => unreachable!;
newAlts ← newAlts.mapM fun alt => alt.applyFVarSubst subst;
newAlts ← newAlts.mapM fun alt => alt.copy;
process { mvarId := subgoal.mvarId, vars := newVars, alts := newAlts, examples := examples } s)
s
private def throwInductiveTypeExpected {α} (type : Expr) : MetaM α := do
throwOther ("failed to compile pattern matching, inductive type expected" ++ indentExpr type)
private partial def tryConstructorAux (alt : Alt) (ref : Syntax) (mvarId : MVarId) (ctorName : Name) (us : List Level) (params : Array Expr) (mvars : Array Expr)
: Nat → Array MVarId → Array IPattern → MetaM Alt
| i, newMVars, fields => do
if h : i < mvars.size then do
let mvar := mvars.get ⟨i, h⟩;
e ← instantiateMVars mvar;
match e with
| Expr.mvar mvarId _ => tryConstructorAux (i+1) (newMVars.push mvarId) (fields.push (Pattern.var ref mvarId))
| _ => tryConstructorAux (i+1) newMVars (fields.push (Pattern.inaccessible ref e))
else do
let p := Pattern.ctor ref ctorName us params.toList fields.toList;
e ← p.toExpr;
assignExprMVar mvarId e;
ps ← alt.patterns.mapM Pattern.instantiateMVars;
let ps := p :: ps;
rhs ← instantiateMVars alt.rhs;
unless (alt.mvars.contains mvarId) $
throwOther "ill-format alternative"; -- TODO: improve error message
let mvars := (alt.mvars.map fun mvarId' => if mvarId' == mvarId then newMVars.toList else [mvarId']).join;
mvars ← mvars.filterM fun mvarId => not <$> isExprMVarAssigned mvarId;
pure { alt with rhs := rhs, mvars := mvars, patterns := ps }
private def tryConstructor? (alt : Alt) (ref : Syntax) (mvarId : MVarId) (ctorName : Name) (us : List Level) (params : Array Expr) (expectedType : Expr)
: MetaM (Option Alt) := do
let ctor := mkAppN (mkConst ctorName us) params;
ctorType ← inferType ctor;
(mvars, _, resultType) ← forallMetaTelescopeReducing ctorType;
trace! `Meta.EqnCompiler.matchDebug ("ctorName: " ++ ctorName ++ ", resultType: " ++ resultType ++ ", expectedType: " ++ expectedType);
condM (isDefEq resultType expectedType)
(Option.some <$> tryConstructorAux alt ref mvarId ctorName us params mvars 0 #[] #[])
(pure none)
private def expandAlt (alt : Alt) (ref : Syntax) (mvarId : MVarId) : MetaM (List Alt) := do
env ← getEnv;
mvarDecl ← getMVarDecl mvarId;
let expectedType := mvarDecl.type;
expectedType ← whnfD expectedType;
matchConst env expectedType.getAppFn (fun _ => throwInductiveTypeExpected expectedType) fun info us =>
match info with
| ConstantInfo.inductInfo val =>
val.ctors.foldlM
(fun (result : List Alt) ctor => do
(mvarSubst, alt) ← alt.copyCore;
let mvarId := mvarSubst.find! mvarId;
mvarDecl ← getMVarDecl mvarId;
let expectedType := mvarDecl.type;
expectedType ← whnfD expectedType;
let I := expectedType.getAppFn;
let Iargs := expectedType.getAppArgs;
let params := Iargs.extract 0 val.nparams;
alt? ← tryConstructor? alt ref mvarId ctor us params expectedType;
match alt? with
| none => pure result
| some alt => pure (alt :: result))
[]
| _ => throwInductiveTypeExpected expectedType
private def processComplete (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("complete step");
withGoalOf p do
env ← getEnv;
newAlts ← p.alts.foldlM
(fun (newAlts : List Alt) alt =>
match alt.patterns with
| Pattern.ctor _ _ _ _ _ :: ps => pure (alt :: newAlts)
| p@(Pattern.var ref mvarId) :: ps => do
let alt := { alt with patterns := ps };
alts ← expandAlt alt ref mvarId;
pure (alts ++ newAlts)
| _ => unreachable!)
[];
process { p with alts := newAlts.reverse } s
private def collectValues (p : Problem) : Array Expr :=
p.alts.foldl
(fun (values : Array Expr) alt =>
match alt.patterns with
| Pattern.val _ v :: _ => if values.contains v then values else values.push v
| _ => values)
#[]
private def isFirstPatternVar (alt : Alt) : Bool :=
match alt.patterns with
| Pattern.var _ _ :: _ => true
| _ => false
private def processValue (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("value step");
match p.vars with
| [] => unreachable!
| x :: xs => do
let values := collectValues p;
subgoals ← caseValues p.mvarId x.fvarId! values;
subgoals.size.foldM
(fun i (s : State) =>
let subgoal := subgoals.get! i;
if h : i < values.size then do
let value := values.get ⟨i, h⟩;
-- (x = value) branch
let subst := subgoal.subst;
let examples := p.examples.map $ Example.replaceFVarId x.fvarId! (Example.val value);
let examples := examples.map $ Example.applyFVarSubst subst;
let newAlts := p.alts.filter fun alt => match alt.patterns with
| Pattern.val _ v :: _ => v == value
| Pattern.var _ _ :: _ => true
| _ => false;
newAlts ← newAlts.mapM fun alt => alt.applyFVarSubst subst;
newAlts ← newAlts.mapM fun alt => alt.copy;
newAlts ← newAlts.mapM fun alt => match alt.patterns with
| Pattern.val _ _ :: ps => pure { alt with patterns := ps }
| Pattern.var _ mvarId :: ps => do
assignExprMVar mvarId value;
ps ← ps.mapM Pattern.instantiateMVars;
rhs ← instantiateMVars alt.rhs;
let mvars := alt.mvars.erase mvarId;
pure { alt with rhs := rhs, mvars := mvars, patterns := ps }
| _ => unreachable!;
let newVars := xs.map fun x => x.applyFVarSubst subst;
process { mvarId := subgoal.mvarId, vars := newVars, alts := newAlts, examples := examples } s
else do
-- else branch
let newAlts := p.alts.filter isFirstPatternVar;
newAlts ← newAlts.mapM fun alt => alt.copy;
process { p with mvarId := subgoal.mvarId, alts := newAlts, vars := x::xs } s)
s
private def collectArraySizes (p : Problem) : Array Nat :=
p.alts.foldl
(fun (sizes : Array Nat) alt =>
match alt.patterns with
| Pattern.arrayLit _ _ ps :: _ => let sz := ps.length; if sizes.contains sz then sizes else sizes.push sz
| _ => sizes)
#[]
private def processArrayLit (process : Problem → State → MetaM State) (p : Problem) (s : State) : MetaM State := do
trace! `Meta.EqnCompiler.match ("array literal step");
match p.vars with
| [] => unreachable!
| x :: xs => do
let sizes := collectArraySizes p;
subgoals ← caseArraySizes p.mvarId x.fvarId! sizes;
subgoals.size.foldM
(fun i (s : State) =>
let subgoal := subgoals.get! i;
if h : i < sizes.size then do
let size := sizes.get! i;
let subst := subgoal.subst;
let elems := subgoal.elems.toList;
let newVars := elems.map mkFVar ++ xs;
let newVars := newVars.map fun x => x.applyFVarSubst subst;
let subex := Example.arrayLit $ elems.map Example.var;
let examples := p.examples.map $ Example.replaceFVarId x.fvarId! subex;
let examples := examples.map $ Example.applyFVarSubst subst;
let newAlts := p.alts.filter fun alt => match alt.patterns with
| Pattern.arrayLit _ _ ps :: _ => ps.length == size
| Pattern.var _ _ :: _ => true
| _ => false;
newAlts ← newAlts.mapM fun alt => alt.applyFVarSubst subst;
newAlts ← newAlts.mapM fun alt => alt.copy;
newAlts ← newAlts.mapM fun alt => match alt.patterns with
| Pattern.arrayLit _ _ pats :: ps => pure { alt with patterns := pats ++ ps }
| Pattern.var ref mvarId :: ps => do
α ← getArrayArgType x;
newMVars ← size.foldM
(fun _ (newMVars : List Expr) => do
newMVar ← mkFreshExprMVar α;
pure (newMVar :: newMVars))
[];
arrayLit ← mkArrayLit α newMVars;
assignExprMVar mvarId arrayLit;
ps ← ps.mapM Pattern.instantiateMVars;
rhs ← instantiateMVars alt.rhs;
let mvars := alt.mvars.erase mvarId;
let mvars := newMVars.map Expr.mvarId! ++ mvars;
let ps := newMVars.map (fun mvar => Pattern.var ref mvar.mvarId!) ++ ps;
pure { alt with rhs := rhs, mvars := mvars, patterns := ps }
| _ => unreachable!;
process { mvarId := subgoal.mvarId, vars := newVars, alts := newAlts, examples := examples } s
else do
-- else branch
let newAlts := p.alts.filter isFirstPatternVar;
newAlts ← newAlts.mapM fun alt => alt.copy;
process { p with mvarId := subgoal.mvarId, alts := newAlts, vars := x::xs } s)
s
private partial def process : Problem → State → MetaM State
| p, s => withIncRecDepth do
withGoalOf p (traceM `Meta.EqnCompiler.match p.toMessageData);
if isDone p then
processLeaf p s
else if hasAsPattern p then
processAsPattern process p s
else if !isNextVar p then
processNonVariable process p s
else if isVariableTransition p then
processVariable process p s
else if isConstructorTransition p then
processConstructor process p s
else if isCompleteTransition p then
processComplete process p s
else if isValueTransition p then
processValue process p s
else if isArrayLitTransition p then
processArrayLit process p s
else do
msg ← p.toMessageData;
-- TODO: remaining cases
throwOther ("not implement yet " ++ msg)
def getUnusedLevelParam (majors : List Expr) (lhss : List AltLHS) : MetaM Level := do
let s : CollectLevelParams.State := {};
s ← majors.foldlM
(fun s major => do
major ← instantiateMVars major;
majorType ← inferType major;
majorType ← instantiateMVars majorType;
let s := collectLevelParams s major;
pure $ collectLevelParams s majorType)
s;
pure s.getUnusedLevelParam
/- Return `Prop` if `inProf == true` and `Sort u` otherwise, where `u` is a fresh universe level parameter. -/
private def mkElimSort (majors : List Expr) (lhss : List AltLHS) (inProp : Bool) : MetaM Expr :=
if inProp then
pure $ mkSort $ levelZero
else do
v ← getUnusedLevelParam majors lhss;
pure $ mkSort $ v
def mkElimCore (elimName : Name) (motive : Expr) (majors : List Expr) (lhss : List AltLHS) (inProp : Bool := false) : MetaM ElimResult := do
checkNumPatterns majors lhss;
generalizeTelescope majors.toArray `_d fun majors => do
let mvarType := mkAppN motive majors;
trace! `Meta.EqnCompiler.matchDebug ("target: " ++ mvarType);
withAlts motive lhss fun alts minors => do
mvar ← mkFreshExprMVar mvarType;
let examples := majors.toList.map fun major => Example.var major.fvarId!;
s ← process { mvarId := mvar.mvarId!, vars := majors.toList, alts := alts, examples := examples } {};
let args := #[motive] ++ majors ++ minors;
type ← mkForall args mvarType;
val ← mkLambda args mvar;
trace! `Meta.EqnCompiler.matchDebug ("eliminator value: " ++ val ++ "\ntype: " ++ type);
elim ← mkAuxDefinition elimName type val;
setInlineAttribute elimName;
trace! `Meta.EqnCompiler.matchDebug ("eliminator: " ++ elim);
let unusedAltIdxs : List Nat := lhss.length.fold
(fun i r => if s.used.contains i then r else i::r)
[];
pure { elim := elim, counterExamples := s.counterExamples, unusedAltIdxs := unusedAltIdxs.reverse }
def mkElim (elimName : Name) (majors : List Expr) (lhss : List AltLHS) (inProp : Bool := false) : MetaM ElimResult := do
sortv ← mkElimSort majors lhss inProp;
generalizeTelescope majors.toArray `_d fun majors => do
withMotive majors sortv fun motive =>
mkElimCore elimName motive majors.toList lhss inProp
@[init] private def regTraceClasses : IO Unit := do
registerTraceClass `Meta.EqnCompiler.match;
registerTraceClass `Meta.EqnCompiler.matchDebug
end DepElim
end Meta
end Lean

View file

@ -0,0 +1,37 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Util.ReplaceExpr
namespace Lean
namespace Meta
/- A mapping from MVarId to MVarId -/
structure MVarRenaming :=
(map : NameMap MVarId := {})
def MVarRenaming.isEmpty (s : MVarRenaming) : Bool :=
s.map.isEmpty
def MVarRenaming.find? (s : MVarRenaming) (mvarId : MVarId) : Option MVarId :=
s.map.find? mvarId
def MVarRenaming.find! (s : MVarRenaming) (mvarId : MVarId) : MVarId :=
(s.find? mvarId).get!
def MVarRenaming.insert (s : MVarRenaming) (mvarId mvarId' : MVarId) : MVarRenaming :=
{ s with map := s.map.insert mvarId mvarId' }
def MVarRenaming.apply (s : MVarRenaming) (e : Expr) : Expr :=
if !e.hasMVar then e
else if s.map.isEmpty then e
else e.replace $ fun e => match e with
| Expr.mvar mvarId _ => match s.map.find? mvarId with
| none => e
| some newMVarId => mkMVar newMVarId
| _ => none
end Meta
end Lean

View file

@ -35,14 +35,19 @@ inductive Exception
| notInstance (e : Expr) (ctx : ExceptionContext)
| appBuilder (op : Name) (msg : MessageData) (ctx : ExceptionContext)
| synthInstance (inst : Expr) (ctx : ExceptionContext)
| tactic (tacticName : Name) (mvarId : MVarId) (msg : MessageData) (ctx : ExceptionContext)
| tactic (ref : Syntax) (tacticName : Name) (mvarId : MVarId) (msg : MessageData) (ctx : ExceptionContext)
| generalizeTelescope (es : Array Expr) (ctx : ExceptionContext)
| kernel (ex : KernelException) (opts : Options)
| bug (b : Bug) (ctx : ExceptionContext)
| other (msg : MessageData)
| other (ref : Syntax) (msg : MessageData)
namespace Exception
instance : Inhabited Exception := ⟨other ""⟩
instance : Inhabited Exception := ⟨other Syntax.missing ""⟩
def getRef : Exception → Syntax
| tactic ref _ _ _ _ => ref
| other ref _ => ref
| _ => Syntax.missing
-- TODO: improve, use (to be implemented) pretty printer
def toStr : Exception → String
@ -64,11 +69,11 @@ def toStr : Exception → String
| notInstance _ _ => "type class instance expected"
| appBuilder _ _ _ => "application builder failure"
| synthInstance _ _ => "type class instance synthesis failed"
| tactic tacName _ _ _ => "tactic '" ++ toString tacName ++ "' failed"
| tactic _ tacName _ _ _ => "tactic '" ++ toString tacName ++ "' failed"
| generalizeTelescope _ _ => "generalize telescope"
| kernel _ _ => "kernel exception"
| bug _ _ => "bug"
| other s => toString $ fmt s
| other _ s => toString $ fmt s
instance : HasToString Exception := ⟨toStr⟩
@ -95,11 +100,11 @@ def toTraceMessageData : Exception → MessageData
| notInstance i ctx => mkCtx ctx $ `notInstance ++ " " ++ i
| appBuilder op msg ctx => mkCtx ctx $ `appBuilder ++ " " ++ op ++ " " ++ msg
| synthInstance inst ctx => mkCtx ctx $ `synthInstance ++ " " ++ inst
| tactic tacName mvarId msg ctx => mkCtx ctx $ `tacticFailure ++ " " ++ tacName ++ " " ++ msg
| tactic _ tacName mvarId msg ctx => mkCtx ctx $ `tacticFailure ++ " " ++ tacName ++ " " ++ msg
| generalizeTelescope es ctx => mkCtx ctx $ `generalizeTelescope ++ " " ++ es
| kernel ex opts => ex.toMessageData opts
| bug _ _ => "internal bug" -- TODO improve
| other s => s
| other _ s => s
end Exception

View file

@ -23,7 +23,7 @@ run? ctx $ do
fType ← whnf fType;
match fType with
| Expr.forallE _ d _ _ => pure d
| _ => throw $ Exception.other "unexpected"
| _ => throwOther "unexpected"
private def whnf? (ctx : ExceptionContext) (e : Expr) : Option Expr :=
run? ctx (whnf e)
@ -73,11 +73,11 @@ def toMessageData : Exception → MessageData
| notInstance i ctx => mkCtx ctx $ "not a type class instance " ++ i
| appBuilder op msg ctx => mkCtx ctx $ "application builder failure " ++ op ++ " " ++ msg
| synthInstance inst ctx => mkCtx ctx $ "failed to synthesize" ++ indentExpr inst
| tactic tacName mvarId msg ctx => mkCtx ctx $ "tactic '" ++ tacName ++ "' failed, " ++ msg ++ Format.line ++ MessageData.ofGoal mvarId
| tactic _ tacName mvarId msg ctx => mkCtx ctx $ "tactic '" ++ tacName ++ "' failed, " ++ msg ++ Format.line ++ MessageData.ofGoal mvarId
| generalizeTelescope es ctx => mkCtx ctx $ "failed to create telescope generalizing " ++ es
| kernel ex opts => ex.toMessageData opts
| bug _ _ => "internal bug" -- TODO improve
| other s => s
| other _ s => s
end Exception

View file

@ -101,7 +101,7 @@ match indInfo with
indicesPos := indicesPos,
numArgs := numArgs
}
| _ => throw $ Exception.other "ill-formed builtin recursor"
| _ => throwOther "ill-formed builtin recursor"
private def getMajorPosIfAuxRecursor? (declName : Name) (majorPos? : Option Nat) : MetaM (Option Nat) :=
if majorPos?.isSome then pure majorPos?
@ -116,11 +116,11 @@ else do
recInfo ← getConstInfo (mkRecFor p);
match recInfo with
| ConstantInfo.recInfo val => pure (some (val.nparams + val.nindices + (if s == casesOnSuffix then 1 else val.nmotives)))
| _ => throw $ Exception.other "unexpected recursor information"
| _ => throwOther "unexpected recursor information"
| _ => pure none
private def checkMotive (declName : Name) (motive : Expr) (motiveArgs : Array Expr) : MetaM Unit :=
unless (motive.isFVar && motiveArgs.all Expr.isFVar) $ throw $ Exception.other
unless (motive.isFVar && motiveArgs.all Expr.isFVar) $ throwOther
("invalid user defined recursor '" ++ toString declName ++ "', result type must be of the form (C t), " ++
"where C is a bound variable, and t is a (possibly empty) sequence of bound variables")
@ -143,17 +143,17 @@ match majorPos? with
let major := xs.get ⟨majorPos, h⟩;
let depElim := motiveArgs.contains major;
pure (major, majorPos, depElim)
else throw $ Exception.other
else throwOther
("invalid major premise position for user defined recursor, recursor has only " ++ toString xs.size ++ " arguments")
| none => do
when motiveArgs.isEmpty $ throw $ Exception.other
when motiveArgs.isEmpty $ throwOther
("invalid user defined recursor, '" ++ toString declName ++ "' does not support dependent elimination, " ++
"and position of the major premise was not specified " ++
"(solution: set attribute '[recursor <pos>]', where <pos> is the position of the major premise)");
let major := motiveArgs.back;
match xs.getIdx? major with
| some majorPos => pure (major, majorPos, true)
| none => throw $ Exception.other ("ill-formed recursor '" ++ toString declName ++ "'")
| none => throwOther ("ill-formed recursor '" ++ toString declName ++ "'")
private def getParamsPos (declName : Name) (xs : Array Expr) (numParams : Nat) (Iargs : Array Expr) : MetaM (List (Option Nat)) := do
paramsPos ← numParams.foldM
@ -167,7 +167,7 @@ paramsPos ← numParams.foldM
if localDecl.binderInfo.isInstImplicit then
pure $ paramsPos.push none
else
throw $ Exception.other
throwOther
("invalid user defined recursor '" ++ toString declName ++ "' , type of the major premise does not contain the recursor parameter"))
#[];
pure paramsPos.toList
@ -181,7 +181,7 @@ indicesPos ← numIndices.foldM
j? ← Iargs.findIdxM? $ fun Iarg => isDefEq Iarg x;
match j? with
| some j => pure $ indicesPos.push j
| none => throw $ Exception.other
| none => throwOther
("invalid user defined recursor '" ++ toString declName ++ "' , type of the major premise does not contain the recursor index"))
#[];
pure indicesPos.toList
@ -190,7 +190,7 @@ private def getMotiveLevel (declName : Name) (motiveResultType : Expr) : MetaM L
match motiveResultType with
| Expr.sort u@(Level.zero _) _ => pure u
| Expr.sort u@(Level.param _ _) _ => pure u
| _ => throw $ Exception.other
| _ => throwOther
("invalid user defined recursor '" ++ toString declName ++ "' , motive result sort must be Prop or (Sort u) where u is a universe level parameter")
private def getUnivLevelPos (declName : Name) (lparams : List Name) (motiveLvl : Level) (Ilevels : List Level) : MetaM (List RecursorUnivLevelPos) := do
@ -202,7 +202,7 @@ univLevelPos ← lparams.foldlM
else
match Ilevels.findIdx? $ fun u => u == mkLevelParam p with
| some i => pure $ univLevelPos.push $ RecursorUnivLevelPos.majorType i
| none => throw $ Exception.other
| none => throwOther
("invalid user defined recursor '" ++ toString declName ++ "' , major premise type does not contain universe level parameter '" ++ toString p ++ "'"))
#[];
pure univLevelPos.toList
@ -228,7 +228,7 @@ private def getProduceMotiveAndRecursive (xs : Array Expr) (numParams numIndices
pure (produceMotive.toList, rec)
private def checkMotiveResultType (declName : Name) (motiveArgs : Array Expr) (motiveResultType : Expr) (motiveTypeParams : Array Expr) : MetaM Unit :=
when (!motiveResultType.isSort || motiveArgs.size != motiveTypeParams.size) $ throw $ Exception.other
when (!motiveResultType.isSort || motiveArgs.size != motiveTypeParams.size) $ throwOther
("invalid user defined recursor '" ++ toString declName ++ "', motive must have a type of the form "
++ "(C : Pi (i : B A), I A i -> Type), where A is (possibly empty) sequence of variables (aka parameters), "
++ "(i : B A) is a (possibly empty) telescope (aka indices), and I is a constant")
@ -241,7 +241,7 @@ forallTelescopeReducing cinfo.type $ fun xs type => type.withApp $ fun motive mo
let numParams := getNumParams xs motive 0;
(major, majorPos, depElim) ← getMajorPosDepElim declName majorPos? xs motive motiveArgs;
let numIndices := if depElim then motiveArgs.size - 1 else motiveArgs.size;
when (majorPos < numIndices) $ throw $ Exception.other
when (majorPos < numIndices) $ throwOther
("invalid user defined recursor '" ++ toString declName ++ "', indices must occur before major premise");
majorType ← inferType major;
majorType.withApp $ fun I Iargs =>
@ -267,7 +267,7 @@ forallTelescopeReducing cinfo.type $ fun xs type => type.withApp $ fun motive mo
indicesPos := indicesPos,
numArgs := xs.size
}
| _ => throw $ Exception.other
| _ => throwOther
("invalid user defined recursor '" ++ toString declName
++ "', type of the major premise must be of the form (I ...), where I is a constant")

View file

@ -0,0 +1,61 @@
/-
Copyright (c) 2020 Sebastian Ullrich. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
-/
/-! Evaluation by reduction -/
import Lean.Meta.Offset
namespace Lean
namespace Meta
class HasReduceEval (α : Type) :=
(reduceEval : Expr → MetaM α)
def reduceEval {α : Type} [HasReduceEval α] (e : Expr) : MetaM α :=
withAtLeastTransparency TransparencyMode.default $
HasReduceEval.reduceEval e
instance Nat.hasReduceEval : HasReduceEval Nat := ⟨fun e => do
e ← whnf e;
some n ← pure $ evalNat e
| throwOther $ "reduceEval: failed to evaluate argument: " ++ toString e;
pure n⟩
instance Option.hasReduceEval {α : Type} [HasReduceEval α] : HasReduceEval (Option α) := ⟨fun e => do
e ← whnf e;
Expr.const c _ _ ← pure e.getAppFn
| throwOther $ "reduceEval: failed to evaluate argument: " ++ toString e;
let nargs := e.getAppNumArgs;
if c == `Option.none && nargs == 0 then pure none
else if c == `Option.some && nargs == 1 then some <$> reduceEval e.appArg!
else throwOther $ "reduceEval: failed to evaluate argument: " ++ toString e⟩
instance String.hasReduceEval : HasReduceEval String := ⟨fun e => do
Expr.lit (Literal.strVal s) _ ← whnf e
| throwOther $ "reduceEval: failed to evaluate argument: " ++ toString e;
pure s⟩
private partial def evalName : Expr → MetaM Name | e => do
e ← whnf e;
Expr.const c _ _ ← pure e.getAppFn
| throwOther $ "reduceEval: failed to evaluate argument: " ++ toString e;
let nargs := e.getAppNumArgs;
if c == `Lean.Name.anonymous && nargs == 0 then pure Name.anonymous
else if c == `Lean.Name.str && nargs == 3 then do
n ← evalName $ e.getArg! 0;
s ← reduceEval $ e.getArg! 1;
pure $ mkNameStr n s
else if c == `Lean.Name.num && nargs == 3 then do
n ← evalName $ e.getArg! 0;
u ← reduceEval $ e.getArg! 1;
pure $ mkNameNum n u
else
throwOther $ "reduceEval: failed to evaluate argument: " ++ toString e
instance Name.hasReduceEval : HasReduceEval Name := ⟨evalName⟩
end Meta
end Lean

View file

@ -154,7 +154,7 @@ structure State extends Meta.State :=
abbrev SynthM := ReaderT Context (EStateM Exception State)
instance SynthM.inhabited {α} : Inhabited (SynthM α) := ⟨throw $ Exception.other ""⟩
instance SynthM.inhabited {α} : Inhabited (SynthM α) := ⟨throw $ Exception.other Syntax.missing ""⟩
def getTraceState : SynthM TraceState := do s ← get; pure s.traceState
def getOptions : SynthM Options := do ctx ← read; pure ctx.config.opts
@ -514,7 +514,7 @@ private partial def preprocessArgs : Expr → Nat → Array Expr → MetaM (Arra
let args := args.set ⟨i, h⟩ arg;
preprocessArgs (b.instantiate1 arg) (i+1) args
| _ =>
throw $ Exception.other "type class resolution failed, insufficient number of arguments" -- TODO improve error message
throw $ Exception.other Syntax.missing "type class resolution failed, insufficient number of arguments" -- TODO improve error message
else
pure args

View file

@ -34,5 +34,21 @@ withMVarContext mvarId $ do
assignExprMVar mvarId newMVar;
pure newMVar.mvarId!
/--
Convert the given goal `Ctx |- target` into `Ctx |- forall (name : type) -> name = val -> target`.
It assumes `val` has type `type` -/
def assertExt (mvarId : MVarId) (name : Name) (type : Expr) (val : Expr) (hName : Name := `h) : MetaM MVarId := do
withMVarContext mvarId $ do
checkNotAssigned mvarId `assert;
tag ← getMVarTag mvarId;
target ← getMVarType mvarId;
u ← getLevel type;
let hType := mkApp3 (mkConst `Eq [u]) type (mkBVar 0) val;
let newType := Lean.mkForall name BinderInfo.default type $ Lean.mkForall hName BinderInfo.default hType target;
newMVar ← mkFreshExprSyntheticOpaqueMVar newType tag;
rflPrf ← mkEqRefl val;
assignExprMVar mvarId (mkApp2 newMVar val rflPrf);
pure newMVar.mvarId!
end Meta
end Lean

View file

@ -64,7 +64,8 @@ def mkAuxName (useUnusedNames : Bool) (lctx : LocalContext) (defaultName : Name)
| n :: rest => (if n != "_" then n else if useUnusedNames then lctx.getUnusedName defaultName else defaultName, rest)
def introN (mvarId : MVarId) (n : Nat) (givenNames : List Name := []) (useUnusedNames := true) : MetaM (Array FVarId × MVarId) :=
introNCore mvarId n (mkAuxName useUnusedNames) givenNames
if n == 0 then pure (#[], mvarId)
else introNCore mvarId n (mkAuxName useUnusedNames) givenNames
def intro (mvarId : MVarId) (name : Name) : MetaM (FVarId × MVarId) := do
(fvarIds, mvarId) ← introN mvarId 1 [name];

View file

@ -14,11 +14,12 @@ import Lean.Meta.Tactic.FVarSubst
namespace Lean
namespace Meta
def substCore (mvarId : MVarId) (hFVarId : FVarId) (symm := false) (fvarSubst : FVarSubst := {}) : MetaM (FVarSubst × MVarId) :=
def substCore (mvarId : MVarId) (hFVarId : FVarId) (symm := false) (fvarSubst : FVarSubst := {}) (clearH := true) : MetaM (FVarSubst × MVarId) :=
withMVarContext mvarId $ do
tag ← getMVarTag mvarId;
checkNotAssigned mvarId `subst;
hLocalDecl ← getLocalDecl hFVarId;
let hFVarIdOriginal := hFVarId;
match hLocalDecl.type.eq? with
| none => throwTacticEx `subst mvarId "argument must be an equality proof"
| some (α, lhs, rhs) => do
@ -57,8 +58,12 @@ withMVarContext mvarId $ do
newVal ← if depElim then mkEqRec motive minor major else mkEqNDRec motive minor major;
assignExprMVar mvarId newVal;
let mvarId := newMVar.mvarId!;
mvarId ← clear mvarId hFVarId;
mvarId ← clear mvarId aFVarId;
mvarId ←
if clearH then do
mvarId ← clear mvarId hFVarId;
clear mvarId aFVarId
else
pure mvarId;
(newFVars, mvarId) ← introN mvarId (vars.size - 2) [] false;
fvarSubst ← newFVars.size.foldM
(fun i (fvarSubst : FVarSubst) =>
@ -66,7 +71,8 @@ withMVarContext mvarId $ do
let newFVar := newFVars.get! i;
pure $ fvarSubst.insert var (mkFVar newFVar))
fvarSubst;
let fvarSubst := fvarSubst.insert aFVarIdOriginal b;
let fvarSubst := fvarSubst.insert aFVarIdOriginal (if clearH then b else mkFVar aFVarId);
let fvarSubst := fvarSubst.insert hFVarIdOriginal (mkFVar hFVarId);
pure (fvarSubst, mvarId)
};
if depElim then do
@ -99,6 +105,7 @@ withMVarContext mvarId $ do
"invalid equality proof, it is not of the form "
++ (if symm then "(t = x)" else "(x = t)")
++ indentExpr hLocalDecl.type
++ Format.line ++ "after WHNF, variable expected, but obtained" ++ indentExpr a
def subst (mvarId : MVarId) (hFVarId : FVarId) : MetaM MVarId :=
withMVarContext mvarId $ do

View file

@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Lean.Meta.Basic
import Lean.Meta.AppBuilder
import Lean.Meta.LevelDefEq
namespace Lean
@ -17,11 +18,15 @@ pure mvarDecl.userName
def setMVarTag (mvarId : MVarId) (tag : Name) : MetaM Unit := do
modify $ fun s => { s with mctx := s.mctx.setMVarUserName mvarId tag }
def appendTagSuffix (mvarId : MVarId) (suffix : Name) : MetaM Unit := do
tag ← getMVarTag mvarId;
setMVarTag mvarId (tag ++ suffix)
def mkFreshExprSyntheticOpaqueMVar (type : Expr) (userName : Name := Name.anonymous) : MetaM Expr :=
mkFreshExprMVar type userName MetavarKind.syntheticOpaque
def throwTacticEx {α} (tacticName : Name) (mvarId : MVarId) (msg : MessageData) : MetaM α := do
throwEx $ fun ctx => Exception.tactic tacticName mvarId (MessageData.withContext ctx msg) ctx
def throwTacticEx {α} (tacticName : Name) (mvarId : MVarId) (msg : MessageData) (ref := Syntax.missing) : MetaM α := do
throwEx $ fun ctx => Exception.tactic ref tacticName mvarId (MessageData.withContext ctx msg) ctx
def checkNotAssigned (mvarId : MVarId) (tacticName : Name) : MetaM Unit :=
whenM (isExprMVarAssigned mvarId) $ throwTacticEx tacticName mvarId "metavariable has already been assigned"
@ -44,5 +49,14 @@ instance Meta.hasOrelse {α} : HasOrelse (MetaM α) := ⟨Meta.orelse⟩
@[init] private def regTraceClasses : IO Unit :=
registerTraceClass `Meta.Tactic
/-- Assign `mvarId` to `sorryAx` -/
def admit (mvarId : MVarId) (synthetic := true) : MetaM Unit :=
withMVarContext mvarId $ do
checkNotAssigned mvarId `admit;
mvarType ← getMVarType mvarId;
val ← mkSorry mvarType synthetic;
assignExprMVar mvarId val;
pure ()
end Meta
end Lean

View file

@ -96,7 +96,7 @@ structure TokenCacheEntry :=
(token : Syntax := Syntax.missing)
structure ParserCache :=
(tokenCache : TokenCacheEntry := {})
(tokenCache : TokenCacheEntry)
def initCacheForInput (input : String) : ParserCache :=
{ tokenCache := { startPos := input.bsize + 1 /- make sure it is not a valid position -/} }
@ -161,7 +161,7 @@ end Error
structure ParserState :=
(stxStack : Array Syntax := #[])
(pos : String.Pos := 0)
(cache : ParserCache := {})
(cache : ParserCache)
(errorMsg : Option Error := none)
namespace ParserState
@ -1428,7 +1428,7 @@ categoryParser `term prec
def dollarSymbol : Parser := symbol "$"
/-- Fail if previous token is immediately followed by ':'. -/
private def noImmediateColon : Parser :=
def checkNoImmediateColon : Parser :=
{ fn := fun c s =>
let prev := s.stxStack.back;
if checkTailNoWs prev then
@ -1445,8 +1445,8 @@ private def noImmediateColon : Parser :=
def setExpectedFn (expected : List String) (p : ParserFn) : ParserFn :=
fun c s => match p c s with
| s'@{ errorMsg := some msg } => { s' with errorMsg := some { msg with expected := [] } }
| s' => s'
| s'@{ errorMsg := some msg, .. } => { s' with errorMsg := some { msg with expected := [] } }
| s' => s'
def setExpected (expected : List String) (p : Parser) : Parser :=
{ fn := setExpectedFn expected p.fn, info := p.info }
@ -1466,10 +1466,10 @@ def antiquotExpr : Parser := identNoAntiquot <|> antiquotNestedExpr
produces the syntax tree for `$e`. -/
def mkAntiquot (name : String) (kind : Option SyntaxNodeKind) (anonymous := true) : Parser :=
let kind := (kind.getD Name.anonymous) ++ `antiquot;
let nameP := checkNoWsBefore ("no space before ':" ++ name ++ "'") >> symbol ":" >> nonReservedSymbol name;
let nameP := node `antiquotName $ checkNoWsBefore ("no space before ':" ++ name ++ "'") >> symbol ":" >> nonReservedSymbol name;
-- if parsing the kind fails and `anonymous` is true, check that we're not ignoring a different
-- antiquotation kind via `noImmediateColon`
let nameP := if anonymous then nameP <|> noImmediateColon >> pushNone >> pushNone else nameP;
let nameP := if anonymous then nameP <|> checkNoImmediateColon >> pushNone else nameP;
-- antiquotations are not part of the "standard" syntax, so hide "expected '$'" on error
node kind $ try $
setExpected [] dollarSymbol >>
@ -1661,14 +1661,6 @@ kinds ← builtinSyntaxNodeKindSetRef.get;
categories ← builtinParserCategoriesRef.get;
pure { tokens := tokens, kinds := kinds, categories := categories }
private def mergePrecendences (msgPreamble : String) (sym : String) : Option Nat → Option Nat → Except String (Option Nat)
| none, b => pure b
| a, none => pure a
| some a, some b =>
if a == b then pure $ some a
else
throw $ msgPreamble ++ "precedence mismatch for '" ++ toString sym ++ "', previous: " ++ toString a ++ ", new: " ++ toString b
private def addTokenConfig (tokens : TokenTable) (tk : Token) : Except String TokenTable := do
if tk == "" then throw "invalid empty symbol"
else match tokens.find? tk with
@ -1874,15 +1866,15 @@ private def catNameToString : Name → String
| Name.str Name.anonymous s _ => s
| n => n.toString
@[inline] def mkCategoryAntiquotParser (kind : Name) : ParserFn :=
(mkAntiquot (catNameToString kind) none).fn
@[inline] def mkCategoryAntiquotParser (kind : Name) : Parser :=
mkAntiquot (catNameToString kind) none
def categoryParserFnImpl (catName : Name) : ParserFn :=
fun ctx s =>
let categories := (parserExtension.getState ctx.env).categories;
match categories.find? catName with
| some cat =>
prattParser catName cat.tables cat.leadingIdentAsSymbol (mkCategoryAntiquotParser catName) ctx s
prattParser catName cat.tables cat.leadingIdentAsSymbol (mkCategoryAntiquotParser catName).fn ctx s
| none => s.mkUnexpectedError ("unknown parser category '" ++ toString catName ++ "'")
@[init] def setCategoryParserFnRef : IO Unit :=

View file

@ -22,7 +22,7 @@ categoryParser `tactic rbp
def Tactic.seq : Parser := node `Lean.Parser.Tactic.seq $ sepBy tacticParser "; " true
def Tactic.nonEmptySeq : Parser := node `Lean.Parser.Tactic.seq $ sepBy1 tacticParser "; " true
def darrow : Parser := "=>"
def darrow : Parser := " => "
namespace Term
@ -51,8 +51,8 @@ def namedPattern := checkNoWsBefore "no space before '@'" >> parser! "@" >> term
@[builtinTermParser] def num : Parser := parser! numLit
@[builtinTermParser] def str : Parser := parser! strLit
@[builtinTermParser] def char : Parser := parser! charLit
@[builtinTermParser] def type := parser! "Type" >> optional (checkPrec (maxPrec-1) >> levelParser maxPrec)
@[builtinTermParser] def sort := parser! "Sort" >> optional (checkPrec (maxPrec-1) >> levelParser maxPrec)
@[builtinTermParser] def type := parser! "Type" >> optional (checkWsBefore "" >> checkPrec (maxPrec-1) >> levelParser maxPrec)
@[builtinTermParser] def sort := parser! "Sort" >> optional (checkWsBefore "" >> checkPrec (maxPrec-1) >> levelParser maxPrec)
@[builtinTermParser] def prop := parser! "Prop"
@[builtinTermParser] def hole := parser! "_"
@[builtinTermParser] def namedHole := parser! "?" >> ident
@ -74,10 +74,10 @@ def haveAssign := parser! " := " >> termParser
def structInstArrayRef := parser! "[" >> termParser >>"]"
def structInstLVal := (ident <|> fieldIdx <|> structInstArrayRef) >> many (group ("." >> (ident <|> fieldIdx)) <|> structInstArrayRef)
def structInstField := parser! structInstLVal >> " := " >> termParser
@[builtinTermParser] def structInst := parser! "{" >> optional (try (termParser >> "with")) >> sepBy structInstField ", " true >> optional ".." >> optional (" : " >> termParser) >> "}"
@[builtinTermParser] def structInst := parser! "{ " >> optional (try (termParser >> " with ")) >> sepBy structInstField ", " true >> optional ".." >> optional (" : " >> termParser) >> " }"
def typeSpec := parser! " : " >> termParser
def optType : Parser := optional typeSpec
@[builtinTermParser] def subtype := parser! "{" >> ident >> optType >> " // " >> termParser >> "}"
@[builtinTermParser] def subtype := parser! "{ " >> ident >> optType >> " // " >> termParser >> " }"
@[builtinTermParser] def listLit := parser! "[" >> sepBy termParser "," true >> "]"
@[builtinTermParser] def arrayLit := parser! "#[" >> sepBy termParser "," true >> "]"
@[builtinTermParser] def explicit := parser! "@" >> termParser maxPrec
@ -92,10 +92,10 @@ def instBinder := parser! "[" >> optIdent >> termParser >> "]"
def bracketedBinder (requireType := false) := explicitBinder requireType <|> implicitBinder requireType <|> instBinder
@[builtinTermParser] def depArrow := parser! bracketedBinder true >> checkPrec 25 >> unicodeSymbol " → " " -> " >> termParser
def simpleBinder := parser! many1 binderIdent
@[builtinTermParser] def «forall» := parser!:leadPrec unicodeSymbol "∀" "forall" >> many1 (simpleBinder <|> bracketedBinder) >> ", " >> termParser
@[builtinTermParser] def «forall» := parser!:leadPrec unicodeSymbol "∀ " "forall " >> many1 (simpleBinder <|> bracketedBinder) >> ", " >> termParser
def funBinder : Parser := implicitBinder <|> instBinder <|> termParser maxPrec
@[builtinTermParser] def «fun» := parser!:maxPrec unicodeSymbol "λ" "fun" >> many1 funBinder >> darrow >> termParser
@[builtinTermParser] def «fun» := parser!:maxPrec unicodeSymbol "λ " "fun " >> many1 funBinder >> darrow >> termParser
def matchAlt : Parser :=
nodeWithAntiquot "matchAlt" `Lean.Parser.Term.matchAlt $
@ -103,10 +103,12 @@ nodeWithAntiquot "matchAlt" `Lean.Parser.Term.matchAlt $
def matchAlts (optionalFirstBar := true) : Parser :=
withPosition $ fun pos =>
(if optionalFirstBar then optional "|" else "|") >>
(if optionalFirstBar then optional "| " else "| ") >>
sepBy1 matchAlt (checkColGe pos.column "alternatives must be indented" >> "|")
@[builtinTermParser] def «match» := parser!:leadPrec "match " >> sepBy1 termParser ", " >> optType >> " with " >> matchAlts
def matchDiscr := optIdent >> termParser
@[builtinTermParser] def «match» := parser!:leadPrec "match " >> sepBy1 matchDiscr ", " >> optType >> " with " >> matchAlts
@[builtinTermParser] def «nomatch» := parser!:leadPrec "nomatch " >> termParser
def optExprPrecedence := optional (try ":" >> termParser maxPrec)
@[builtinTermParser] def «parser!» := parser!:leadPrec "parser! " >> optExprPrecedence >> termParser
@ -146,14 +148,14 @@ def bracketedDoSeq := parser! "{" >> doSeq >> "}"
@[builtinTermParser] def uminus := parser!:65 "-" >> termParser 100
def namedArgument := parser! try ("(" >> ident >> " := ") >> termParser >> ")"
@[builtinTermParser] def app := tparser!:(maxPrec-1) checkWsBefore "expected space" >> many1 (namedArgument <|> termParser maxPrec)
@[builtinTermParser] def app := tparser!:(maxPrec-1) many1 (checkWsBefore "expected space" >> (namedArgument <|> termParser maxPrec))
@[builtinTermParser] def proj := tparser! symbolNoWs "." >> (fieldIdx <|> ident)
@[builtinTermParser] def arrow := tparser! unicodeInfixR " → " " -> " 25
@[builtinTermParser] def arrayRef := tparser! symbolNoWs "[" >> termParser >>"]"
@[builtinTermParser] def dollar := tparser!:0 try (dollarSymbol >> checkWsBefore "expected space") >> termParser 0
@[builtinTermParser] def dollarProj := tparser!:0 "$." >> (fieldIdx <|> ident)
@[builtinTermParser] def dollarProj := tparser!:0 " $. " >> (fieldIdx <|> ident)
@[builtinTermParser] def «where» := tparser!:0 " where " >> sepBy1 letDecl (group ("; " >> symbol " where "))

View file

@ -1,2 +1,39 @@
/-
Copyright (c) 2020 Sebastian Ullrich. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
-/
import Lean.Delaborator
import Lean.PrettyPrinter.Parenthesizer
import Lean.PrettyPrinter.Formatter
namespace Lean
namespace PrettyPrinter
def ppTerm (table : Parser.TokenTable) : Syntax → MetaM Format :=
parenthesizeTerm >=> formatTerm table
def ppExpr (table : Parser.TokenTable) : Expr → MetaM Format :=
delab >=> ppTerm table
def ppCommand (table : Parser.TokenTable) : Syntax → MetaM Format :=
parenthesizeCommand >=> formatCommand table
def ppModule (table : Parser.TokenTable) (stx : Syntax) : MetaM Format := do
let header := stx.getArg 0;
f ← format table (mkConst `Lean.Parser.Module.header) header;
let cmds := stx.getArgs.extract 1 stx.getArgs.size;
cmds.foldlM (fun f cmd => do
cmdF ← ppCommand table cmd;
pure $ f ++ "\n\n" ++ cmdF) f
-- TODO: activate when ready
/-@[init]-/ def registerPPTerm : IO Unit := do
table ← Parser.builtinTokenTable.get;
ppExprFnRef.set $ fun env mctx lctx opts e => match
ppExpr table e { currRecDepth := 0, maxRecDepth := 1000, lctx := lctx, config := { opts := opts } } { env := env, mctx := mctx } with
| EStateM.Result.ok f st => f
| EStateM.Result.error e st => "<pretty printer error: " ++ toString e ++ ">"
end PrettyPrinter
end Lean

View file

@ -4,7 +4,17 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich
-/
/-!
The formatter turns a `Syntax` tree into a `Format` object, inserting both mandatory whitespace (to separate adjacent
tokens) as well as "pretty" optional whitespace.
The basic approach works much like the parenthesizer: A right-to-left traversal over the syntax tree and the parser that
produced it, driven by parser-specific handlers registered via an attribute. The traversal is right-to-left so that when
emitting a token, we already know the text following it and can decide whether or not whitespace between the two is
necessary.
-/
import Lean.Parser
import Lean.Meta
import Lean.Elab.Quotation
namespace Lean
@ -15,14 +25,19 @@ structure Context :=
(table : Parser.TokenTable)
structure State :=
(stxTrav : Syntax.Traverser)
(stxTrav : Syntax.Traverser)
-- Textual content of `stack` up to the first whitespace (not enclosed in an escaped ident). We assume that the textual
-- content of `stack` is modified only by `pushText` and `pushLine`, so `leadWord` is adjusted there accordingly.
(leadWord : String := "")
-- Stack of generated Format objects, analogous to the Syntax stack in the parser.
-- Note, however, that the stack is reversed because of the right-to-left traversal.
(stack : Array Format := #[])
end Formatter
abbrev FormatterM := ReaderT Formatter.Context $ StateT Formatter.State MetaM
abbrev Formatter := Expr → FormatterM Format
abbrev Formatter := Expr → FormatterM Unit
unsafe def mkFormatterAttribute : IO (KeyedDeclsAttribute Formatter) :=
KeyedDeclsAttribute.init {
@ -40,5 +55,293 @@ KeyedDeclsAttribute.init {
} `Lean.PrettyPrinter.formatterAttribute
@[init mkFormatterAttribute] constant formatterAttribute : KeyedDeclsAttribute Formatter := arbitrary _
namespace Formatter
open Lean.Meta
open Lean.Format
instance FormatterM.monadTraverser : Syntax.MonadTraverser FormatterM := ⟨{
get := State.stxTrav <$> get,
set := fun t => modify (fun st => { st with stxTrav := t }),
modifyGet := fun _ f => modifyGet (fun st => let (a, t) := f st.stxTrav; (a, { st with stxTrav := t })) }⟩
open Syntax.MonadTraverser
def getStack : FormatterM (Array Format) := do
st ← get;
pure st.stack
def getStackSize : FormatterM Nat := do
stack ← getStack;
pure stack.size
def setStack (stack : Array Format) : FormatterM Unit :=
modify fun st => { st with stack := stack }
def push (f : Format) : FormatterM Unit :=
modify fun st => { st with stack := st.stack.push f }
/-- Execute `x` at the right-most child of the current node, if any, then advance to the left. -/
def visitArgs (x : FormatterM Unit) : FormatterM Unit := do
stx ← getCur;
when (stx.getArgs.size > 0) $
goDown (stx.getArgs.size - 1) *> x <* goUp;
goLeft
/-- Execute `x`, pass array of generated Format objects to `fn`, and push result. -/
def fold (fn : Array Format → Format) (x : FormatterM Unit) : FormatterM Unit := do
sp ← getStackSize;
x;
stack ← getStack;
let f := fn $ stack.extract sp stack.size;
setStack $ (stack.shrink sp).push f
/-- Execute `x` and concatenate generated Format objects. -/
def concat (x : FormatterM Unit) : FormatterM Unit := do
fold (Array.foldl (fun acc f => f ++ acc) Format.nil) x
def concatArgs (x : FormatterM Unit) : FormatterM Unit :=
concat (visitArgs x)
/--
Call an appropriate `[formatter]` depending on the `Parser` `Expr` `p`. After the call, the traverser position
should be to the left of all nodes produced by `p`, or at the left-most child if there are no other nodes left. -/
partial def visit : Formatter | p => do
stx ← getCur;
-- do reductions _except_ for definition unfolding
p ← liftM $ whnfCore p;
trace! `PrettyPrinter.format ("formatting" ++ MessageData.nest 2 (line ++ stx) ++ line ++ "using" ++ MessageData.nest 2 (line ++ p));
sp ← getStackSize;
let c := Expr.constName? p.getAppFn;
env ← liftM getEnv;
match c >>= (formatterAttribute.ext.getState env).table.find? with
| some (f::_) => do
-- call first matching formatter
f p
| _ =>
-- `choice` is not an actual parser, so special-case it here
if c == some `choice then do
visitArgs do {
stx ← getCur;
sp ← getStackSize;
stx.getArgs.forM fun _ => visit (mkConst stx.getKind);
stack ← getStack;
when (stack.size > sp && stack.anyRange sp stack.size fun f => pretty f != pretty (stack.get! sp))
panic! "Formatter.visit: inequal choice children";
-- discard all but one child format
setStack $ stack.extract 0 (sp+1)
}
else do {
-- (try to) unfold definition and recurse
some p' ← liftM $ unfoldDefinition? p
| throw $ Exception.other Syntax.missing $ "no known formatter for '" ++ toString p ++ "'";
visit p'
};
stack ← getStack;
trace! `PrettyPrinter.format (" => " ++ (stack.extract sp stack.size).foldl (fun acc f => repr (toString f) ++ " " ++ acc) "")
open Lean.Parser
@[builtinFormatter categoryParser]
def categoryParser.formatter : Formatter | p => do
stx ← getCur;
-- visit `(mkCategoryAntiquotParser $(p.getArg! 0) <|> $(mkConst stx.getKind))
visit (mkAppN (mkConst `Lean.Parser.orelse) #[
mkApp (mkConst `Lean.Parser.mkCategoryAntiquotParser) (p.getArg! 0),
mkConst stx.getKind])
@[builtinFormatter termParser]
def termParser.formatter : Formatter | p => do
stx ← getCur;
-- this can happen at `termParser <|> many1 commandParser` in `Term.stxQuot`
if stx.getKind == nullKind then
throw $ Exception.other Syntax.missing "BACKTRACK"
else
categoryParser.formatter p
@[builtinFormatter withAntiquot]
def withAntiquot.formatter : Formatter | p =>
-- deoptimize
visit (mkAppN (mkConst `Lean.Parser.orelse) #[p.getArg! 0, p.getArg! 1])
@[builtinFormatter try]
def try.formatter : Formatter | p =>
visit p.appArg!
@[builtinFormatter andthen]
def andthen.formatter : Formatter | p =>
visit (p.getArg! 1) *> visit (p.getArg! 0)
def checkKind (k : SyntaxNodeKind) : FormatterM Unit := do
stx ← getCur;
when (k != stx.getKind) $ do {
trace! `PrettyPrinter.format.backtrack ("unexpected node kind '" ++ toString stx.getKind ++ "', expected '" ++ toString k ++ "'");
-- HACK; see `orelse.formatter`
throw $ Exception.other Syntax.missing "BACKTRACK"
}
@[builtinFormatter node]
def node.formatter : Formatter | p => do
k ← liftM $ reduceEval $ p.getArg! 0;
checkKind k;
concatArgs $ visit p.appArg!
@[builtinFormatter trailingNode]
def trailingNode.formatter : Formatter | p => do
k ← liftM $ reduceEval $ p.getArg! 0;
checkKind k;
concatArgs do
visit p.appArg!;
-- leading term, not actually produced by `p`
categoryParser.formatter p
def parseToken (s : String) : FormatterM ParserState := do
ctx ← read;
env ← liftM getEnv;
pure $ Parser.tokenFn { input := s, fileName := "", fileMap := FileMap.ofString "", prec := 0, env := env, tokens := ctx.table } (Parser.mkParserState s)
def pushToken (tk : String) : FormatterM Unit := do
st ← get;
-- If there is no space between `tk` and the next word, compare parsing `tk` with and without the next word
if st.leadWord != "" && tk.trimRight == tk then do
t1 ← parseToken tk.trimLeft;
t2 ← parseToken $ tk.trimLeft ++ st.leadWord;
if t1.pos == t2.pos then do
-- same result => use `tk` as is, extend `leadWord` if not prefixed by whitespace
modify fun st => { st with leadWord := if tk.trimLeft == tk then tk ++ st.leadWord else "" };
push tk
else do
-- different result => add space
modify fun st => { st with leadWord := if tk.trimLeft == tk then tk else "" };
push $ tk ++ " "
else do {
-- already separated => use `tk` as is
modify fun st => { st with leadWord := if tk.trimLeft == tk then tk else "" };
push tk
}
@[builtinFormatter symbol]
def symbol.formatter : Formatter | p => do
let sym := p.getArg! 0;
sym ← liftM $ reduceEval sym;
pushToken sym;
goLeft
@[builtinFormatter symbolNoWs] def symbolNoWs.formatter := symbol.formatter
@[builtinFormatter unicodeSymbol] def unicodeSymbol.formatter := symbol.formatter
@[builtinFormatter nonReservedSymbol] def nonReservedSymbol.formatter := symbol.formatter
@[builtinFormatter identNoAntiquot]
def identNoAntiquot.formatter : Formatter | _ => do
checkKind identKind;
stx ← getCur;
let s := stx.getId.toString;
-- try to parse `s` as-is; if it fails, escape
pst ← parseToken s;
let s := if pst.stxStack == #[stx] then s else match stx.getId with
| Name.str Name.anonymous s _ => "«" ++ s ++ "»"
| _ => panic! "unimplemented: escaping non-atomic identifiers (is anyone even using those?)";
pushToken s;
goLeft
@[builtinFormatter rawIdent] def rawIdent.formatter : Formatter | _ => do
checkKind identKind;
stx ← getCur;
pushToken stx.getId.toString;
goLeft
def visitAtom (k : SyntaxNodeKind) : Formatter | p => do
stx ← getCur;
when (k != Name.anonymous) $
checkKind k;
Syntax.atom _ val ← pure $ stx.ifNode (fun n => n.getArg 0) (fun _ => stx)
| throw $ Exception.other Syntax.missing $ "not an atom: " ++ toString stx;
pushToken val;
goLeft
@[builtinFormatter charLitNoAntiquot] def charLitNoAntiquot.formatter := visitAtom charLitKind
@[builtinFormatter strLitNoAntiquot] def strLitNoAntiquot.formatter := visitAtom strLitKind
@[builtinFormatter nameLitNoAntiquot] def nameLitNoAntiquot.formatter := visitAtom nameLitKind
@[builtinFormatter numLitNoAntiquot] def numLitNoAntiquot.formatter := visitAtom numLitKind
@[builtinFormatter fieldIdx] def fieldIdx.formatter := visitAtom fieldIdxKind
@[builtinFormatter many]
def many.formatter : Formatter | p => do
stx ← getCur;
concatArgs $ stx.getArgs.size.forM $ fun _ => visit (p.getArg! 0)
@[builtinFormatter many1] def many1.formatter : Formatter | p => do
stx ← getCur;
if stx.getKind == nullKind then do
many.formatter p
else
-- can happen with `unboxSingleton = true`
visit (p.getArg! 0)
@[builtinFormatter Parser.optional]
def optional.formatter : Formatter | p => do
concatArgs $ visit (p.getArg! 0)
@[builtinFormatter sepBy]
def sepBy.formatter : Formatter | p => do
stx ← getCur;
concatArgs $ (List.range stx.getArgs.size).reverse.forM $ fun i => visit (p.getArg! (i % 2))
@[builtinFormatter sepBy1] def sepBy1.formatter := sepBy.formatter
@[builtinFormatter orelse] def orelse.formatter : Formatter | p => do
st ← get;
-- HACK: We have no (immediate) information on which side of the orelse could have produced the current node, so try
-- them in turn. Uses the syntax traverser non-linearly!
catch (visit (p.getArg! 0)) $ fun e => match e with
| Exception.other _ "BACKTRACK" => set st *> visit (p.getArg! 1)
| _ => throw e
@[builtinFormatter withPosition] def withPosition.formatter : Formatter | p => do
-- call closure with dummy position
visit $ mkApp (p.getArg! 0) (mkConst `sorryAx [levelZero])
@[builtinFormatter setExpected] def setExpected.formatter : Formatter | p => visit (p.getArg! 1)
@[builtinFormatter checkWsBefore] def checkWsBefore.formatter : Formatter | p => do
modify fun st => { st with leadWord := "" };
push " "
@[builtinFormatter checkPrec] def checkPrec.formatter : Formatter | p => pure ()
@[builtinFormatter checkStackTop] def checkStackTop.formatter : Formatter | p => pure ()
@[builtinFormatter checkNoWsBefore] def checkNoWsBefore.formatter : Formatter | p => pure ()
@[builtinFormatter checkTailWs] def checkTailWs.formatter : Formatter | p => pure ()
@[builtinFormatter checkColGe] def checkColGe.formatter : Formatter | p => pure ()
@[builtinFormatter checkNoImmediateColon] def checkNoImmediateColon.formatter : Formatter | p => pure ()
@[builtinFormatter pushNone] def pushNone.formatter : Formatter | p => goLeft
open Lean.Parser.Command
@[builtinFormatter commentBody] def commentBody.formatter := visitAtom Name.anonymous
-- TODO: delete with old frontend
@[builtinFormatter quotedSymbol] def quotedSymbol.formatter : Formatter | p => do
checkKind quotedSymbolKind;
concatArgs do
push "`"; goLeft;
visitAtom Name.anonymous p;
push "`"; goLeft
@[builtinFormatter unquotedSymbol] def unquotedSymbol.formatter := visitAtom Name.anonymous
end Formatter
def format (table : Parser.TokenTable) (parser : Expr) (stx : Syntax) : MetaM Format := Meta.withAtLeastTransparency Meta.TransparencyMode.default do
(_, st) ← Formatter.visit parser { table := table } { stxTrav := Syntax.Traverser.fromSyntax stx };
pure $ st.stack.get! 0
def formatTerm (table) := format table (mkApp (mkConst `Lean.Parser.termParser) (mkNatLit 0))
def formatCommand (table) := format table (mkApp (mkConst `Lean.Parser.commandParser) (mkNatLit 0))
@[init] private def regTraceClasses : IO Unit := do
registerTraceClass `PrettyPrinter.format;
pure ()
end PrettyPrinter
end Lean

View file

@ -63,7 +63,7 @@ practice since if there is another parser to the left that produced zero nodes i
there is no danger of the left-most child being processed multiple times.
Ultimately, most parenthesizers are implemented via three primitives that do all the actual syntax traversal:
`visitParenthesizable mkParen prec` recurses on the current node and afterwards transforms it with `mkParen` if the above
`maybeParenthesize mkParen prec x` runs `x` and afterwards transforms it with `mkParen` if the above
condition for `p prec` is fulfilled. `visitToken` advances to the preceding sibling and is used on atoms. `visitArgs x`
executes `x` on the last child of the current node and then advances to the preceding sibling (of the original current
node).
@ -71,6 +71,7 @@ node).
-/
import Lean.Parser
import Lean.Meta
import Lean.Elab.Quotation
namespace Lean
@ -144,7 +145,8 @@ partial def visit : Parenthesizer | p => do
stx ← getCur;
-- do reductions _except_ for definition unfolding
p ← liftM $ whnfCore p;
trace! `PrettyPrinter.parenthesize ("parenthesizing" ++ MessageData.nest 2 (line ++ stx) ++ line ++ "using" ++ MessageData.nest 2 (line ++ p));
st ← get;
trace! `PrettyPrinter.parenthesize ("parenthesizing (contPrec := " ++ toString st.contPrec ++ ")" ++ MessageData.nest 2 (line ++ stx) ++ line ++ "using" ++ MessageData.nest 2 (line ++ p));
let c := Expr.constName? p.getAppFn;
env ← liftM getEnv;
match c >>= (parenthesizerAttribute.ext.getState env).table.find? with
@ -160,9 +162,15 @@ match c >>= (parenthesizerAttribute.ext.getState env).table.find? with
else do
-- (try to) unfold definition and recurse
some p' ← liftM $ unfoldDefinition? p
| throw $ Exception.other $ "no known parenthesizer for '" ++ toString p ++ "'";
| throw $ Exception.other Syntax.missing $ "no known parenthesizer for '" ++ toString p ++ "'";
visit p'
/-- Continue evaluation of `p` by further reducing it. -/
def resume : Parenthesizer | p => do
some p' ← liftM $ unfoldDefinition? p
| throw $ Exception.other Syntax.missing $ "no known parenthesizer for '" ++ toString p ++ "'";
visit p'
open Lean.Parser
-- Macro scopes in the parenthesizer output are ultimately ignored by the pretty printer,
@ -173,26 +181,14 @@ instance monadQuotation : MonadQuotation ParenthesizerM := {
withFreshMacroScope := fun α x => x,
}
def visitAntiquot : ParenthesizerM Unit := do
stx ← getCur;
if Elab.Term.Quotation.isAntiquot stx then visitArgs $ do
-- antiquot syntax is, simplified, `syntax:maxPrec "$" "$"* antiquotExpr ":" (nonReservedSymbol name) "*"?`
goLeft; goLeft; goLeft; -- now on `antiquotExpr`
visit (mkConst `Lean.Parser.antiquotExpr);
addPrecCheck maxPrec
else
throw $ Exception.other $ "not an antiquotation"
/-- Recurse using `visit`, and parenthesize the result using `mkParen` if necessary. -/
def visitParenthesizable (mkParen : Syntax → Syntax) (prec : Nat) : ParenthesizerM Unit := do
/-- Run `x` and parenthesize the result using `mkParen` if necessary. -/
def maybeParenthesize (mkParen : Syntax → Syntax) (prec : Nat) (x : ParenthesizerM Unit) : ParenthesizerM Unit := do
stx ← getCur;
idx ← getIdx;
st ← get;
-- reset prec/prec and store `mkParen` for the recursive call
set { stxTrav := st.stxTrav };
adaptReader (fun (ctx : Context) => { ctx with mkParen := some mkParen }) $
-- we assume that each node kind is produced by a 0-ary parser of the same name
visit (mkConst stx.getKind);
adaptReader (fun (ctx : Context) => { ctx with mkParen := some mkParen }) x;
{ minPrec := some minPrec, trailPrec := trailPrec, .. } ← get
| panic! "visitParenthesizable: visited a term without tokens?!";
trace! `PrettyPrinter.parenthesize ("...precedences are " ++ fmt prec ++ " >? " ++ fmt minPrec ++ ", " ++ fmt trailPrec ++ " <=? " ++ fmt st.contPrec);
@ -229,67 +225,38 @@ def visitToken : Parenthesizer | p => do
modify (fun st => { st with contPrec := none, visitedToken := true });
goLeft
def evalNat (e : Expr) : ParenthesizerM Nat := do
e ← liftM $ whnf e;
some n ← pure $ Meta.evalNat e
| throw $ Exception.other $ "failed to evaluate Nat argument: " ++ toString e;
pure n
def evalOptPrec (e : Expr) : ParenthesizerM Nat := do
e ← liftM $ whnf e;
match e.getAppFn.constName? with
| some `Option.none => pure 0
| some `Option.some => evalNat e.appArg!
| _ => throw $ Exception.other $ "failed to evaluate precedence: " ++ toString e
def evalString (e : Expr) : ParenthesizerM String := do
Expr.lit (Literal.strVal s) _ ← liftM $ whnf e
| throw $ Exception.other $ "failed to evaluate String argument: " ++ toString e;
pure s
partial def evalName : Expr → ParenthesizerM Name | e => do
e ← liftM $ whnf e;
if e.isAppOfArity `Lean.Name.anonymous 0 then
pure Name.anonymous
else if e.isAppOfArity `Lean.Name.str 3 then do
n ← evalName $ e.getArg! 0;
s ← evalString $ e.getArg! 1;
pure $ mkNameStr n s
else if e.isAppOfArity `Lean.Name.num 3 then do
n ← evalName $ e.getArg! 0;
u ← evalNat $ e.getArg! 1;
pure $ mkNameNum n u
else
throw $ Exception.other $ "failed to evaluate Name argument: " ++ toString e
@[builtinParenthesizer categoryParser]
def categoryParser.parenthesizer : Parenthesizer | p => do
stx ← getCur;
-- visit `(mkCategoryAntiquotParser $(p.getArg! 0) <|> $(mkConst stx.getKind))
visit (mkAppN (mkConst `Lean.Parser.orelse) #[
mkApp (mkConst `Lean.Parser.mkCategoryAntiquotParser) (p.getArg! 0),
mkConst stx.getKind])
@[builtinParenthesizer termParser]
def termParser.parenthesizer : Parenthesizer | p => visitAntiquot <|> do
def termParser.parenthesizer : Parenthesizer | p => do
stx ← getCur;
-- this can happen at `termParser <|> many1 commandParser` in `Term.stxQuot`
if stx.getKind == nullKind then
throw $ Exception.other "BACKTRACK"
throw $ Exception.other Syntax.missing "BACKTRACK"
else do
prec ← evalNat p.appArg!;
visitParenthesizable (fun stx => Unhygienic.run `(($stx))) prec
prec ← liftM $ reduceEval p.appArg!;
maybeParenthesize (fun stx => Unhygienic.run `(($stx))) prec (resume p)
@[builtinParenthesizer tacticParser]
def tacticParser.parenthesizer : Parenthesizer | p => visitAntiquot <|> do
prec ← evalNat p.appArg!;
visitParenthesizable (fun stx => Unhygienic.run `(tactic|($stx))) prec
def tacticParser.parenthesizer : Parenthesizer | p => do
prec ← liftM $ reduceEval p.appArg!;
maybeParenthesize (fun stx => Unhygienic.run `(tactic|($stx))) prec (resume p)
@[builtinParenthesizer levelParser]
def levelParser.parenthesizer : Parenthesizer | p => visitAntiquot <|> do
prec ← evalNat p.appArg!;
visitParenthesizable (fun stx => Unhygienic.run `(level|($stx))) prec
@[builtinParenthesizer categoryParser]
def categoryParser.parenthesizer : Parenthesizer | p => visitAntiquot <|> do
stx ← getCur;
visit (mkConst stx.getKind)
def levelParser.parenthesizer : Parenthesizer | p => do
prec ← liftM $ reduceEval p.appArg!;
maybeParenthesize (fun stx => Unhygienic.run `(level|($stx))) prec (resume p)
@[builtinParenthesizer withAntiquot]
def withAntiquot.parenthesizer : Parenthesizer | p =>
visitAntiquot <|> visit (p.getArg! 1)
-- deoptimize
visit (mkAppN (mkConst `Lean.Parser.orelse) #[p.getArg! 0, p.getArg! 1])
@[builtinParenthesizer try]
def try.parenthesizer : Parenthesizer | p =>
@ -302,17 +269,17 @@ visit (p.getArg! 1) *> visit (p.getArg! 0)
@[builtinParenthesizer node]
def node.parenthesizer : Parenthesizer | p => do
stx ← getCur;
k ← evalName $ p.getArg! 0;
k ← liftM $ reduceEval $ p.getArg! 0;
when (k != stx.getKind) $ do {
trace! `PrettyPrinter.parenthesize.backtrack ("unexpected node kind '" ++ toString stx.getKind ++ "', expected '" ++ toString k ++ "'");
-- HACK; see `orelse.parenthesizer`
throw $ Exception.other "BACKTRACK"
throw $ Exception.other Syntax.missing "BACKTRACK"
};
visitArgs $ visit p.appArg!
@[builtinParenthesizer checkPrec]
def checkPrec.parenthesizer : Parenthesizer | p => do
prec ← evalNat $ p.getArg! 0;
prec ← liftM $ reduceEval $ p.getArg! 0;
addPrecCheck prec
@[builtinParenthesizer leadingNode]
@ -320,20 +287,18 @@ def leadingNode.parenthesizer : Parenthesizer | p => do
-- Unfold `leadingNode` as usual, but limit `contPrec` to `maxPrec-1` afterwards.
-- This is because `maxPrec-1` is the precedence of function application, which is the only way to turn a leading parser
-- into a trailing one.
some p ← liftM $ unfoldDefinition? p
| unreachable!;
visit p;
resume p;
modify $ fun st => { st with contPrec := (fun p => Nat.min (maxPrec-1) p) <$> st.contPrec }
@[builtinParenthesizer trailingNode]
def trailingNode.parenthesizer : Parenthesizer | p => do
stx ← getCur;
k ← evalName $ p.getArg! 0;
prec ← evalNat $ p.getArg! 1;
k ← liftM $ reduceEval $ p.getArg! 0;
prec ← liftM $ reduceEval $ p.getArg! 1;
when (k != stx.getKind) $ do {
trace! `PrettyPrinter.parenthesize.backtrack ("unexpected node kind '" ++ toString stx.getKind ++ "', expected '" ++ toString k ++ "'");
-- HACK; see `orelse.parenthesizer`
throw $ Exception.other "BACKTRACK"
throw $ Exception.other Syntax.missing "BACKTRACK"
};
visitArgs $ do {
visit p.appArg!;
@ -344,7 +309,8 @@ visitArgs $ do {
-- parser is calling us; we only need to know its `mkParen`, which we retrieve from the context.
{ mkParen := some mkParen, .. } ← read
| panic! "trailingNode.parenthesizer called outside of visitParenthesizable call";
visitAntiquot <|> visitParenthesizable mkParen 0
maybeParenthesize mkParen 0 $
visit (mkAppN (mkConst `Lean.Parser.categoryParser) #[toExpr `someCategory, mkNatLit 0])
}
@[builtinParenthesizer symbol] def symbol.parenthesizer := visitToken
@ -369,7 +335,7 @@ visitArgs $ stx.getArgs.size.forM $ fun _ => visit (p.getArg! 0)
@[builtinParenthesizer many1] def many1.parenthesizer : Parenthesizer | p => do
stx ← getCur;
if stx.getKind == nullKind then
visitArgs $ stx.getArgs.size.forM $ fun _ => visit (p.getArg! 0)
many.parenthesizer p
else
-- can happen with `unboxSingleton = true`
visit (p.getArg! 0)
@ -390,18 +356,23 @@ st ← get;
-- HACK: We have no (immediate) information on which side of the orelse could have produced the current node, so try
-- them in turn. Uses the syntax traverser non-linearly!
catch (visit (p.getArg! 0)) $ fun e => match e with
| Exception.other "BACKTRACK" => set st *> visit (p.getArg! 1)
| _ => throw e
| Exception.other _ "BACKTRACK" => set st *> visit (p.getArg! 1)
| _ => throw e
@[builtinParenthesizer withPosition] def withPosition.parenthesizer : Parenthesizer | p => do
-- call closure with dummy position
visit $ mkApp (p.getArg! 0) (mkConst `sorryAx [levelZero])
@[builtinParenthesizer setExpected] def setExpected.parenthesizer : Parenthesizer | p => visit (p.getArg! 1)
@[builtinParenthesizer checkStackTop] def checkStackTop.parenthesizer : Parenthesizer | p => pure ()
@[builtinParenthesizer checkWsBefore] def checkWsBefore.parenthesizer : Parenthesizer | p => pure ()
@[builtinParenthesizer checkNoWsBefore] def checkNoWsBefore.parenthesizer : Parenthesizer | p => pure ()
@[builtinParenthesizer checkTailWs] def checkTailWs.parenthesizer : Parenthesizer | p => pure ()
@[builtinParenthesizer checkColGe] def checkColGe.parenthesizer : Parenthesizer | p => pure ()
@[builtinParenthesizer checkNoImmediateColon] def checkNoImmediateColon.parenthesizer : Parenthesizer | p => pure ()
@[builtinParenthesizer pushNone] def pushNone.parenthesizer : Parenthesizer | p => goLeft
open Lean.Parser.Command
@[builtinParenthesizer commentBody] def commentBody.parenthesizer := visitToken
@ -411,7 +382,7 @@ open Lean.Parser.Command
end Parenthesizer
/-- Add necessary parentheses in `stx` parsed by `parser`. -/
def parenthesize (parser : Expr) (stx : Syntax) : MetaM Syntax := do
def parenthesize (parser : Expr) (stx : Syntax) : MetaM Syntax := Meta.withAtLeastTransparency Meta.TransparencyMode.default do
(_, st) ← Parenthesizer.visit parser {} { stxTrav := Syntax.Traverser.fromSyntax stx };
pure st.stxTrav.cur

View file

@ -289,9 +289,9 @@ partial def formatStxAux (maxDepth : Option Nat) (showInfo : Bool) : Nat → Syn
| _, missing => "<missing>"
| depth, node kind args =>
let depth := depth + 1;
if kind == `Lean.Parser.noKind then
if kind == nullKind then
sbracket $
if depth > maxDepth.getD depth then
if args.size > 0 && depth > maxDepth.getD depth then
".."
else
joinSep (args.toList.map (formatStxAux depth)) line
@ -299,7 +299,7 @@ partial def formatStxAux (maxDepth : Option Nat) (showInfo : Bool) : Nat → Syn
let shorterName := kind.replacePrefix `Lean.Parser Name.anonymous;
let header := format shorterName;
let body : List Format :=
if depth > maxDepth.getD depth then [".."] else args.toList.map (formatStxAux depth);
if args.size > 0 && depth > maxDepth.getD depth then [".."] else args.toList.map (formatStxAux depth);
paren $ joinSep (header :: body) line
def formatStx (stx : Syntax) (maxDepth : Option Nat := none) (showInfo := false) : Format :=
@ -308,6 +308,15 @@ formatStxAux maxDepth showInfo 0 stx
instance : HasFormat (Syntax) := ⟨formatStx⟩
instance : HasToString (Syntax) := ⟨toString ∘ format⟩
partial def structEq : Syntax → Syntax → Bool
| Syntax.missing, Syntax.missing => true
| Syntax.node k args, Syntax.node k' args' => k == k' && args.isEqv args' structEq
| Syntax.atom _ val, Syntax.atom _ val' => val == val'
| Syntax.ident _ rawVal val preresolved, Syntax.ident _ rawVal' val' preresolved' => rawVal == rawVal' && val == val' && preresolved == preresolved'
| _, _ => false
instance structHasBeq : HasBeq Lean.Syntax := ⟨structEq⟩
/--
Represents a cursor into a syntax tree that can be read, written, and advanced down/up/left/right.
Indices are allowed to be out-of-bound, in which case `cur` is `Syntax.missing`.

View file

@ -15,10 +15,10 @@ abbrev PPExprFn := Environment → MetavarContext → LocalContext → Options
constant ppOld : Environment → MetavarContext → LocalContext → Options → Expr → Format := arbitrary _
def mkPPExprFnRef : IO (IO.Ref PPExprFn) := IO.mkRef ppOld
@[init mkPPExprFnRef] def PPExprFnRef : IO.Ref PPExprFn := arbitrary _
@[init mkPPExprFnRef] def ppExprFnRef : IO.Ref PPExprFn := arbitrary _
def mkPPExprFnExtension : IO (EnvExtension PPExprFn) :=
registerEnvExtension $ PPExprFnRef.get
registerEnvExtension $ ppExprFnRef.get
@[init mkPPExprFnExtension]
constant ppExprExt : EnvExtension PPExprFn := arbitrary _

View file

@ -60,14 +60,17 @@ some root ← sp.findM? (fun path => IO.isDir $ path ++ pathSep ++ pkg)
| throw $ IO.userError $ "unknown package '" ++ pkg ++ "'";
pure $ root ++ modPathToFilePath mod ++ ".olean"
/-- Infer module name of source file name, assuming that `lean` is called from the package source root. -/
/-- Infer module name of source file name. -/
@[export lean_module_name_of_file]
def moduleNameOfFileName (fname : String) : IO Name := do
def moduleNameOfFileName (fname : String) (rootDir : Option String) : IO Name := do
fname ← realPathNormalized fname;
root ← IO.currentDir >>= realPathNormalized;
when (!root.isPrefixOf fname) $
throw $ IO.userError $ "input file '" ++ fname ++ "' must be contained in current directory (" ++ root ++ ")";
let fnameSuffix := fname.drop root.length;
rootDir ← match rootDir with
| some rootDir => pure rootDir
| none => IO.currentDir;
rootDir ← realPathNormalized rootDir;
when (!rootDir.isPrefixOf fname) $
throw $ IO.userError $ "input file '" ++ fname ++ "' must be contained in root directory (" ++ rootDir ++ ")";
let fnameSuffix := fname.drop rootDir.length;
let fnameSuffix := if fnameSuffix.get 0 == pathSeparator then fnameSuffix.drop 1 else fnameSuffix;
some extPos ← pure (fnameSuffix.revPosOf '.')
| throw (IO.userError ("failed to convert file name '" ++ fname ++ "' to module name, extension is missing"));

View file

@ -950,7 +950,7 @@ class csimp_fn {
let x := Array.size w in
C
```
`f z` and `Array.size w` do not share any free variable, but it `w` is an reference to a field of `w`.
`f z` and `Array.size w` do not share any free variable, but `w` is an reference to a field of `z`.
In the example above, `w` is an array, and `f z` will not be able to update the array nested there if
we have `let x := Array.size w` after it.

View file

@ -196,6 +196,8 @@ static void display_help(std::ostream & out) {
std::cout << " --o=oname -o create olean file\n";
std::cout << " --c=fname -c name of the C output file\n";
std::cout << " --stdin take input from stdin\n";
std::cout << " --root=dir set package root directory from which the module name of the input file is calculated\n"
<< " (default: current working directory)\n";
std::cout << " --trust=num -t trust level (default: max) 0 means do not trust any macro,\n"
<< " and type check all imported modules\n";
std::cout << " --quiet -q do not print verbose messages\n";
@ -230,6 +232,7 @@ static struct option g_long_options[] = {
{"run", no_argument, 0, 'r'},
{"o", optional_argument, 0, 'o'},
{"stdin", no_argument, 0, 'i'},
{"root", required_argument, 0, 'R'},
{"memory", required_argument, 0, 'M'},
{"trust", required_argument, 0, 't'},
{"profile", no_argument, 0, 'P'},
@ -256,7 +259,7 @@ static struct option g_long_options[] = {
};
static char const * g_opt_str =
"PdD:o:c:C:qgvht:012j:012rM:012T:012ap:e"
"PdD:o:c:C:qgvht:012j:012rR:M:012T:012ap:e"
#if defined(LEAN_MULTI_THREAD)
"s:012"
#endif
@ -351,9 +354,13 @@ void init_search_path() {
get_io_scalar_result<unsigned>(lean_init_search_path(mk_option_none(), io_mk_world()));
}
extern "C" object* lean_module_name_of_file(object* fname, object* w);
optional<name> module_name_of_file(std::string const & fname, bool optional) {
object * o = lean_module_name_of_file(mk_string(fname), io_mk_world());
extern "C" object* lean_module_name_of_file(object* fname, object * root_dir, object* w);
optional<name> module_name_of_file(std::string const & fname, optional<std::string> const & root_dir, bool optional) {
object * oroot_dir = mk_option_none();
if (root_dir) {
oroot_dir = mk_option_some(mk_string(*root_dir));
}
object * o = lean_module_name_of_file(mk_string(fname), oroot_dir, io_mk_world());
if (io_result_is_error(o) && optional) {
return lean::optional<name>();
} else {
@ -444,6 +451,7 @@ int main(int argc, char ** argv) {
optional<std::string> server_in;
std::string native_output;
optional<std::string> c_output;
optional<std::string> root_dir;
while (true) {
int c = getopt_long(argc, argv, g_opt_str, g_long_options, NULL);
if (c == -1)
@ -481,6 +489,9 @@ int main(int argc, char ** argv) {
case 'o':
olean_fn = optarg;
break;
case 'R':
root_dir = optarg;
break;
case 'M':
check_optarg("M");
opts = opts.update(get_max_memory_opt_name(), static_cast<unsigned>(atoi(optarg)));
@ -589,7 +600,7 @@ int main(int argc, char ** argv) {
}
mod_fn = argv[optind++];
contents = read_file(mod_fn);
main_module_name = module_name_of_file(mod_fn, /* optional */ !olean_fn && !c_output);
main_module_name = module_name_of_file(mod_fn, root_dir, /* optional */ !olean_fn && !c_output);
}
bool ok = true;

File diff suppressed because one or more lines are too long

View file

@ -21,6 +21,7 @@ lean_object* l_Array_findM_x3f(lean_object*, lean_object*);
lean_object* l_List_repr___rarg(lean_object*, lean_object*);
lean_object* l_Array_anyRangeM___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_array_set(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toListLitAux___main___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_foldl_u2082___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateM_u2082Aux___main(lean_object*, lean_object*);
lean_object* l_Array_iterate_u2082(lean_object*, lean_object*, lean_object*);
@ -50,6 +51,7 @@ lean_object* l_Array_mapIdxM(lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Array_mapM___spec__1___rarg___lambda__1(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_anyRangeMAux___main___at_Array_anyRange___spec__2(lean_object*);
lean_object* l_Array_anyRangeMAux___main___at_Array_allM___spec__1___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t);
lean_object* l_Array_toListLitAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_eraseIdx___rarg(lean_object*, lean_object*);
lean_object* lean_array_uget(lean_object*, size_t);
lean_object* l_Array_umapIdxM___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
@ -197,6 +199,7 @@ lean_object* l_Array_findSome_x21___rarg___closed__2;
lean_object* l_Array_mapIdx(lean_object*, lean_object*);
lean_object* l_Array_indexOfAux___main(lean_object*);
lean_object* l_Array_getLit___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toListLitAux___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_getLit(lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Array_foldlFrom___spec__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_HasRepr___rarg___closed__1;
@ -213,12 +216,14 @@ lean_object* l_Array_foldlStepMAux___main___rarg___lambda__1(lean_object*, lean_
lean_object* l_Array_forRevMAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_HasRepr___rarg___boxed(lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Array_toListLitAux___main(lean_object*);
lean_object* l_Array_HasToString___rarg___boxed(lean_object*, lean_object*);
lean_object* l_Array_anyRangeMAux___main___at_Array_allM___spec__1___rarg___lambda__1___boxed(lean_object*, lean_object*);
lean_object* l_Array_umapMAux___main___at_Array_mapIdx___spec__1(lean_object*, lean_object*);
lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at_Array_iterateRev___spec__1(lean_object*, lean_object*);
lean_object* l_Array_iterateM_u2082Aux(lean_object*, lean_object*);
lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at_Array_toList___spec__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toArrayLit___rarg___boxed(lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_Array_extract___rarg___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_findIdxAux___main___at_Array_getIdx_x3f___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
@ -272,6 +277,7 @@ uint8_t l_Array_anyRangeMAux___main___at_Array_anyRange___spec__1___rarg(lean_ob
lean_object* l___private_Init_Data_Array_Basic_4__foldrRangeMAux___main___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Nat_repr(lean_object*);
lean_object* l_Array_umapMAux___main___at_Array_mapIdx___spec__1___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toArrayLit(lean_object*);
lean_object* l_Array_shrink___rarg___boxed(lean_object*, lean_object*);
lean_object* l_Array_anyRangeMAux___main___at_Array_allM___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_anyRangeMAux___main___at_Array_allRangeM___spec__1___rarg___lambda__1(lean_object*, uint8_t);
@ -315,6 +321,7 @@ lean_object* l_Array_findSomeRevMAux___rarg(lean_object*, lean_object*, lean_obj
lean_object* l_Array_forMAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_findRevM_x3f(lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Array_foldl___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toListLitAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toList___rarg___boxed(lean_object*);
lean_object* l_Array_reverse___rarg(lean_object*);
lean_object* l_Array_findRev_x3f___rarg___boxed(lean_object*, lean_object*);
@ -538,6 +545,7 @@ lean_object* l_Array_iterateMAux___main___at_Array_mapIdxM___spec__1(lean_object
lean_object* l_Array_findSomeMAux___main___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_sz___boxed(lean_object*, lean_object*);
lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_toListLitAux(lean_object*);
lean_object* l_Array_findMAux___main___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t);
lean_object* l_Array_foldlStep___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_anyRangeMAux___main___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -572,6 +580,7 @@ lean_object* l_Array_findSomeM_x3f(lean_object*, lean_object*);
lean_object* l_Array_umapMAux___main___at_Array_umapM___spec__1(lean_object*, lean_object*);
lean_object* l_Array_iterate___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_anyFrom(lean_object*);
lean_object* l_Array_toArrayLit___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_set_x21___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Data_Array_Basic_1__swapAtPanic_x21___rarg___closed__1;
lean_object* l_Array_foldrRange(lean_object*, lean_object*);
@ -8201,6 +8210,111 @@ x_2 = lean_alloc_closure((void*)(l_List_toArray___rarg), 1, 0);
return x_2;
}
}
lean_object* l_Array_toListLitAux___main___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; uint8_t x_8;
x_7 = lean_unsigned_to_nat(0u);
x_8 = lean_nat_dec_eq(x_4, x_7);
if (x_8 == 0)
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_9 = lean_unsigned_to_nat(1u);
x_10 = lean_nat_sub(x_4, x_9);
lean_dec(x_4);
x_11 = lean_array_fget(x_1, x_10);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_11);
lean_ctor_set(x_12, 1, x_6);
x_3 = lean_box(0);
x_4 = x_10;
x_5 = lean_box(0);
x_6 = x_12;
goto _start;
}
else
{
lean_dec(x_4);
return x_6;
}
}
}
lean_object* l_Array_toListLitAux___main(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_Array_toListLitAux___main___rarg___boxed), 6, 0);
return x_2;
}
}
lean_object* l_Array_toListLitAux___main___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) {
_start:
{
lean_object* x_7;
x_7 = l_Array_toListLitAux___main___rarg(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_2);
lean_dec(x_1);
return x_7;
}
}
lean_object* l_Array_toListLitAux___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7;
x_7 = l_Array_toListLitAux___main___rarg(x_1, x_2, lean_box(0), x_4, lean_box(0), x_6);
return x_7;
}
}
lean_object* l_Array_toListLitAux(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_Array_toListLitAux___rarg___boxed), 6, 0);
return x_2;
}
}
lean_object* l_Array_toListLitAux___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) {
_start:
{
lean_object* x_7;
x_7 = l_Array_toListLitAux___rarg(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_2);
lean_dec(x_1);
return x_7;
}
}
lean_object* l_Array_toArrayLit___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_box(0);
lean_inc(x_2);
x_5 = l_Array_toListLitAux___main___rarg(x_1, x_2, lean_box(0), x_2, lean_box(0), x_4);
lean_dec(x_2);
x_6 = l_List_redLength___main___rarg(x_5);
x_7 = lean_mk_empty_array_with_capacity(x_6);
lean_dec(x_6);
x_8 = l_List_toArrayAux___main___rarg(x_5, x_7);
return x_8;
}
}
lean_object* l_Array_toArrayLit(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_Array_toArrayLit___rarg___boxed), 3, 0);
return x_2;
}
}
lean_object* l_Array_toArrayLit___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l_Array_toArrayLit___rarg(x_1, x_2, x_3);
lean_dec(x_1);
return x_4;
}
}
lean_object* initialize_Init_Data_Nat_Basic(lean_object*);
lean_object* initialize_Init_Data_Fin_Basic(lean_object*);
lean_object* initialize_Init_Data_UInt(lean_object*);

View file

@ -99,6 +99,7 @@ lean_object* l_String_anyAux___main___boxed(lean_object*, lean_object*, lean_obj
lean_object* l_Substring_takeRightWhileAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Nat_repeatAux___main___at_String_pushn___spec__1___boxed(lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Substring_hasBeq___closed__1;
lean_object* l_String_trim___boxed(lean_object*);
lean_object* l_String_foldrAux___main(lean_object*);
lean_object* l___private_Init_Data_String_Basic_5__utf8PrevAux___main(lean_object*, lean_object*, lean_object*);
@ -153,6 +154,7 @@ lean_object* l_String_bsize___boxed(lean_object*);
lean_object* l_String_Iterator_forward___main(lean_object*, lean_object*);
lean_object* l_String_singleton(uint32_t);
lean_object* l_String_Iterator_pos(lean_object*);
lean_object* l_Substring_beq___boxed(lean_object*, lean_object*);
lean_object* l_String_Iterator_prev(lean_object*);
uint32_t l_String_back(lean_object*);
uint8_t l_String_all(lean_object*, lean_object*);
@ -163,6 +165,7 @@ lean_object* l_Substring_take___boxed(lean_object*, lean_object*);
lean_object* l_String_takeRight(lean_object*, lean_object*);
lean_object* l_Substring_toIterator(lean_object*);
lean_object* l_Substring_splitOnAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Substring_hasBeq;
lean_object* l_String_Iterator_toString___boxed(lean_object*);
uint8_t l_String_isNat(lean_object*);
lean_object* l_Substring_takeWhileAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
@ -179,6 +182,7 @@ lean_object* l_String_Iterator_prevn(lean_object*, lean_object*);
lean_object* l_String_foldl(lean_object*);
lean_object* l___private_Init_Data_String_Basic_7__utf8ExtractAux_u2081(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_String_foldr___rarg(lean_object*, lean_object*, lean_object*);
uint8_t l_Substring_beq(lean_object*, lean_object*);
lean_object* l_String_anyAux___main___at_Substring_all___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_String_Iterator_next(lean_object*);
lean_object* l_String_nextUntil___boxed(lean_object*, lean_object*, lean_object*);
@ -4629,6 +4633,51 @@ return x_9;
}
}
}
uint8_t l_Substring_beq(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; 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_string_utf8_extract(x_3, x_4, x_5);
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_string_utf8_extract(x_7, x_8, x_9);
x_11 = lean_string_dec_eq(x_6, x_10);
lean_dec(x_10);
lean_dec(x_6);
return x_11;
}
}
lean_object* l_Substring_beq___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_Substring_beq(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
lean_object* _init_l_Substring_hasBeq___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Substring_beq___boxed), 2, 0);
return x_1;
}
}
lean_object* _init_l_Substring_hasBeq() {
_start:
{
lean_object* x_1;
x_1 = l_Substring_hasBeq___closed__1;
return x_1;
}
}
lean_object* _init_l_String_drop___closed__1() {
_start:
{
@ -5032,6 +5081,10 @@ l_Substring_drop___closed__2 = _init_l_Substring_drop___closed__2();
lean_mark_persistent(l_Substring_drop___closed__2);
l_Substring_extract___closed__1 = _init_l_Substring_extract___closed__1();
lean_mark_persistent(l_Substring_extract___closed__1);
l_Substring_hasBeq___closed__1 = _init_l_Substring_hasBeq___closed__1();
lean_mark_persistent(l_Substring_hasBeq___closed__1);
l_Substring_hasBeq = _init_l_Substring_hasBeq();
lean_mark_persistent(l_Substring_hasBeq);
l_String_drop___closed__1 = _init_l_String_drop___closed__1();
lean_mark_persistent(l_String_drop___closed__1);
return lean_mk_io_result(lean_box(0));

View file

@ -34,9 +34,11 @@ lean_object* l_withPtrEqResult___rarg___boxed(lean_object*, lean_object*, lean_o
lean_object* l_withPtrEqResultUnsafe(lean_object*, lean_object*, lean_object*);
lean_object* l_withPtrEqDecEq(lean_object*);
lean_object* l_withPtrEqResultUnsafe___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_dbgTraceVal___rarg(lean_object*, lean_object*);
lean_object* l_panicWithPos___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_withPtrEqResultUnsafe___rarg___boxed(lean_object*, lean_object*, lean_object*);
lean_object* lean_dbg_sleep(uint32_t, lean_object*);
lean_object* l_dbgTraceVal___rarg___lambda__1(lean_object*, lean_object*);
lean_object* l_Nat_repr(lean_object*);
lean_object* l_withPtrAddr___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_withPtrEq(lean_object*, lean_object*, lean_object*);
@ -48,6 +50,7 @@ size_t lean_ptr_addr(lean_object*);
lean_object* l_withPtrEqUnsafe___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_unreachable_x21(lean_object*);
lean_object* l_unreachable_x21___rarg___closed__3;
lean_object* l_dbgTraceVal___rarg___lambda__1___boxed(lean_object*, lean_object*);
lean_object* l___private_Init_Util_1__mkPanicMessage___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_panicWithPos(lean_object*);
lean_object* l___private_Init_Util_1__mkPanicMessage___closed__1;
@ -62,6 +65,7 @@ lean_object* l___private_Init_Util_1__mkPanicMessage___closed__3;
lean_object* l_dbgSleep___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_withPtrAddrUnsafe___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_ptrAddrUnsafe___boxed(lean_object*, lean_object*);
lean_object* l_dbgTraceVal(lean_object*);
lean_object* l_unsafeCast___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_dbgTrace___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
@ -71,6 +75,43 @@ x_4 = lean_dbg_trace(x_2, x_3);
return x_4;
}
}
lean_object* l_dbgTraceVal___rarg___lambda__1(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_inc(x_1);
return x_1;
}
}
lean_object* l_dbgTraceVal___rarg(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5;
lean_inc(x_2);
x_3 = lean_apply_1(x_1, x_2);
x_4 = lean_alloc_closure((void*)(l_dbgTraceVal___rarg___lambda__1___boxed), 2, 1);
lean_closure_set(x_4, 0, x_2);
x_5 = lean_dbg_trace(x_3, x_4);
return x_5;
}
}
lean_object* l_dbgTraceVal(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_dbgTraceVal___rarg), 2, 0);
return x_2;
}
}
lean_object* l_dbgTraceVal___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_dbgTraceVal___rarg___lambda__1(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* l_dbgTraceIfShared___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
@ -208,7 +249,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_1 = l_unreachable_x21___rarg___closed__1;
x_2 = lean_unsigned_to_nat(40u);
x_2 = lean_unsigned_to_nat(43u);
x_3 = lean_unsigned_to_nat(0u);
x_4 = l_unreachable_x21___rarg___closed__2;
x_5 = l___private_Init_Util_1__mkPanicMessage(x_1, x_2, x_3, x_4);

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Lean
// Imports: Init Lean.Compiler Lean.Environment Lean.Modifiers Lean.ProjFns Lean.Runtime Lean.Attributes Lean.Parser Lean.ReducibilityAttrs Lean.Elab Lean.EqnCompiler Lean.Class Lean.LocalContext Lean.MetavarContext Lean.AuxRecursor Lean.Linter Lean.Meta Lean.Util Lean.Eval Lean.Structure Lean.Delaborator Lean.PrettyPrinter
// Imports: Init Lean.Compiler Lean.Environment Lean.Modifiers Lean.ProjFns Lean.Runtime Lean.Attributes Lean.Parser Lean.ReducibilityAttrs Lean.Elab Lean.Class Lean.LocalContext Lean.MetavarContext Lean.AuxRecursor Lean.Linter Lean.Meta Lean.Util Lean.Eval Lean.Structure Lean.Delaborator Lean.PrettyPrinter
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -23,7 +23,6 @@ lean_object* initialize_Lean_Attributes(lean_object*);
lean_object* initialize_Lean_Parser(lean_object*);
lean_object* initialize_Lean_ReducibilityAttrs(lean_object*);
lean_object* initialize_Lean_Elab(lean_object*);
lean_object* initialize_Lean_EqnCompiler(lean_object*);
lean_object* initialize_Lean_Class(lean_object*);
lean_object* initialize_Lean_LocalContext(lean_object*);
lean_object* initialize_Lean_MetavarContext(lean_object*);
@ -70,9 +69,6 @@ lean_dec_ref(res);
res = initialize_Lean_Elab(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_EqnCompiler(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Class(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);

View file

@ -105,6 +105,7 @@ extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed_
extern lean_object* l_Lean_EnumAttributes_Inhabited___closed__1;
lean_object* l_Lean_Compiler_mkInlineAttrs___closed__1;
lean_object* l_Lean_EnumAttributes_getValue___at___private_Lean_Compiler_InlineAttrs_1__hasInlineAttrAux___main___spec__1___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Compiler_setInlineAttribute___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Std_RBNode_fold___main___at_Lean_Compiler_mkInlineAttrs___spec__2___boxed(lean_object*, lean_object*);
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
uint8_t l_Lean_Name_isInternal___main(lean_object*);
@ -125,12 +126,14 @@ lean_object* l_Lean_Compiler_mkInlineAttrs___closed__12;
lean_object* lean_io_initializing(lean_object*);
extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__2;
lean_object* l_Array_qsortAux___main___at_Lean_Compiler_mkInlineAttrs___spec__3(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_EnumAttributes_setValue___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_List_map___main___at_Lean_Compiler_mkInlineAttrs___spec__8___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Compiler_mkInlineAttrs(lean_object*);
lean_object* l_Lean_Compiler_mkInlineAttrs___closed__26;
lean_object* l_Lean_registerEnumAttributes___at_Lean_Compiler_mkInlineAttrs___spec__1___lambda__2(lean_object*);
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Name_toStringWithSep___main(lean_object*, lean_object*);
lean_object* l_Lean_Compiler_setInlineAttribute(lean_object*, lean_object*, uint8_t);
lean_object* l_Lean_Compiler_mkInlineAttrs___closed__11;
extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__4;
lean_object* l_Lean_registerEnumAttributes___at_Lean_Compiler_mkInlineAttrs___spec__1___lambda__1(lean_object*, lean_object*);
@ -2364,6 +2367,26 @@ x_4 = lean_box(x_3);
return x_4;
}
}
lean_object* l_Lean_Compiler_setInlineAttribute(lean_object* x_1, lean_object* x_2, uint8_t x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = l_Lean_Compiler_inlineAttrs;
x_5 = lean_box(x_3);
x_6 = l_Lean_EnumAttributes_setValue___rarg(x_4, x_1, x_2, x_5);
return x_6;
}
}
lean_object* l_Lean_Compiler_setInlineAttribute___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint8_t x_4; lean_object* x_5;
x_4 = lean_unbox(x_3);
lean_dec(x_3);
x_5 = l_Lean_Compiler_setInlineAttribute(x_1, x_2, x_4);
return x_5;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Attributes(lean_object*);
lean_object* initialize_Lean_Compiler_Util(lean_object*);

View file

@ -141,6 +141,7 @@ lean_object* l_Lean_Delaborator_delabCoe___lambda__1(lean_object*, lean_object*,
extern lean_object* l_Lean_mkAppStx___closed__8;
lean_object* l___regBuiltin_Lean_Delaborator_delabCoe___closed__1;
uint8_t l_Lean_getPPUniverses(lean_object*);
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
extern lean_object* l_Lean_mkAppStx___closed__7;
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* lean_get_projection_info(lean_object*, lean_object*);
@ -233,7 +234,6 @@ size_t l_Lean_Name_hash(lean_object*);
lean_object* l_Nat_repr(lean_object*);
uint8_t l_Lean_LocalDecl_binderInfo(lean_object*);
extern lean_object* l_Lean_Level_LevelToFormat_Result_format___main___closed__5;
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__3;
extern lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__2;
lean_object* l_Lean_Delaborator_getExprKind___closed__26;
lean_object* l_Lean_Delaborator_delabFor___main(lean_object*, lean_object*, lean_object*, lean_object*);
@ -327,7 +327,7 @@ lean_object* l_Lean_SMap_empty___at_Lean_Delaborator_delabAttribute___spec__1___
lean_object* l_Lean_Meta_withLocalDecl___rarg(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l___regBuiltin_Lean_Delaborator_delabProjectionApp(lean_object*);
lean_object* l___regBuiltin_Lean_Delaborator_delabAppExplicit___closed__1;
lean_object* l_Lean_delab(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_delab(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Array_anyRangeMAux___main___at_Lean_Delaborator_delabLam___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Delaborator_mkDelabAttribute___closed__13;
lean_object* l_Lean_Delaborator_delabFor(lean_object*, lean_object*, lean_object*, lean_object*);
@ -7708,7 +7708,7 @@ return x_2;
lean_object* l_Lean_Delaborator_delab(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17;
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;
x_4 = l_Lean_Delaborator_getExprKind(x_1, x_2, x_3);
x_5 = lean_ctor_get(x_4, 0);
lean_inc(x_5);
@ -7733,115 +7733,117 @@ x_14 = l_Lean_Elab_Term_mkConst___closed__4;
x_15 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_15, 0, x_13);
lean_ctor_set(x_15, 1, x_14);
x_16 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_16, 0, x_15);
x_17 = l_Lean_Delaborator_delabFor___main(x_7, x_1, x_2, x_6);
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_18;
x_18 = lean_ctor_get(x_17, 0);
lean_inc(x_18);
x_16 = lean_box(0);
x_17 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_17, 0, x_16);
lean_ctor_set(x_17, 1, x_15);
x_18 = l_Lean_Delaborator_delabFor___main(x_7, x_1, x_2, x_6);
if (lean_obj_tag(x_18) == 0)
{
uint8_t x_19;
x_19 = !lean_is_exclusive(x_17);
if (x_19 == 0)
lean_object* x_19;
x_19 = lean_ctor_get(x_18, 0);
lean_inc(x_19);
if (lean_obj_tag(x_19) == 0)
{
lean_object* x_20;
x_20 = lean_ctor_get(x_17, 0);
lean_dec(x_20);
lean_ctor_set_tag(x_17, 1);
lean_ctor_set(x_17, 0, x_16);
return x_17;
uint8_t x_20;
x_20 = !lean_is_exclusive(x_18);
if (x_20 == 0)
{
lean_object* x_21;
x_21 = lean_ctor_get(x_18, 0);
lean_dec(x_21);
lean_ctor_set_tag(x_18, 1);
lean_ctor_set(x_18, 0, x_17);
return x_18;
}
else
{
lean_object* x_21; lean_object* x_22;
x_21 = lean_ctor_get(x_17, 1);
lean_inc(x_21);
lean_dec(x_17);
x_22 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_22, 0, x_16);
lean_ctor_set(x_22, 1, x_21);
return x_22;
}
}
else
{
uint8_t x_23;
lean_dec(x_16);
x_23 = !lean_is_exclusive(x_17);
if (x_23 == 0)
{
lean_object* x_24; uint8_t x_25;
x_24 = lean_ctor_get(x_17, 0);
lean_dec(x_24);
x_25 = !lean_is_exclusive(x_18);
if (x_25 == 0)
{
return x_17;
}
else
{
lean_object* x_26; lean_object* x_27;
x_26 = lean_ctor_get(x_18, 0);
lean_inc(x_26);
lean_object* x_22; lean_object* x_23;
x_22 = lean_ctor_get(x_18, 1);
lean_inc(x_22);
lean_dec(x_18);
x_27 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_27, 0, x_26);
lean_ctor_set(x_17, 0, x_27);
return x_17;
x_23 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_23, 0, x_17);
lean_ctor_set(x_23, 1, x_22);
return x_23;
}
}
else
{
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32;
x_28 = lean_ctor_get(x_17, 1);
lean_inc(x_28);
uint8_t x_24;
lean_dec(x_17);
x_29 = lean_ctor_get(x_18, 0);
x_24 = !lean_is_exclusive(x_18);
if (x_24 == 0)
{
lean_object* x_25; uint8_t x_26;
x_25 = lean_ctor_get(x_18, 0);
lean_dec(x_25);
x_26 = !lean_is_exclusive(x_19);
if (x_26 == 0)
{
return x_18;
}
else
{
lean_object* x_27; lean_object* x_28;
x_27 = lean_ctor_get(x_19, 0);
lean_inc(x_27);
lean_dec(x_19);
x_28 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_28, 0, x_27);
lean_ctor_set(x_18, 0, x_28);
return x_18;
}
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33;
x_29 = lean_ctor_get(x_18, 1);
lean_inc(x_29);
if (lean_is_exclusive(x_18)) {
lean_ctor_release(x_18, 0);
x_30 = x_18;
lean_dec(x_18);
x_30 = lean_ctor_get(x_19, 0);
lean_inc(x_30);
if (lean_is_exclusive(x_19)) {
lean_ctor_release(x_19, 0);
x_31 = x_19;
} else {
lean_dec_ref(x_18);
x_30 = lean_box(0);
lean_dec_ref(x_19);
x_31 = lean_box(0);
}
if (lean_is_scalar(x_30)) {
x_31 = lean_alloc_ctor(1, 1, 0);
if (lean_is_scalar(x_31)) {
x_32 = lean_alloc_ctor(1, 1, 0);
} else {
x_31 = x_30;
x_32 = x_31;
}
lean_ctor_set(x_31, 0, x_29);
x_32 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_32, 0, x_31);
lean_ctor_set(x_32, 1, x_28);
return x_32;
lean_ctor_set(x_32, 0, x_30);
x_33 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_33, 0, x_32);
lean_ctor_set(x_33, 1, x_29);
return x_33;
}
}
}
else
{
uint8_t x_33;
lean_dec(x_16);
x_33 = !lean_is_exclusive(x_17);
if (x_33 == 0)
{
return x_17;
}
else
{
lean_object* x_34; lean_object* x_35; lean_object* x_36;
x_34 = lean_ctor_get(x_17, 0);
x_35 = lean_ctor_get(x_17, 1);
lean_inc(x_35);
lean_inc(x_34);
uint8_t x_34;
lean_dec(x_17);
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;
x_34 = !lean_is_exclusive(x_18);
if (x_34 == 0)
{
return x_18;
}
else
{
lean_object* x_35; lean_object* x_36; lean_object* x_37;
x_35 = lean_ctor_get(x_18, 0);
x_36 = lean_ctor_get(x_18, 1);
lean_inc(x_36);
lean_inc(x_35);
lean_dec(x_18);
x_37 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_37, 0, x_35);
lean_ctor_set(x_37, 1, x_36);
return x_37;
}
}
}
@ -13843,7 +13845,7 @@ lean_ctor_set(x_42, 0, x_41);
lean_ctor_set(x_42, 1, x_40);
x_43 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_44 = lean_array_push(x_43, x_42);
x_45 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_45 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_46 = lean_array_push(x_44, x_45);
x_47 = lean_array_push(x_46, x_2);
x_48 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -13886,7 +13888,7 @@ lean_ctor_set(x_62, 0, x_61);
lean_ctor_set(x_62, 1, x_60);
x_63 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_64 = lean_array_push(x_63, x_62);
x_65 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_65 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_66 = lean_array_push(x_64, x_65);
x_67 = lean_array_push(x_66, x_55);
x_68 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -13985,7 +13987,7 @@ lean_ctor_set(x_108, 0, x_96);
lean_ctor_set(x_108, 1, x_107);
x_109 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_110 = lean_array_push(x_109, x_108);
x_111 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_111 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_112 = lean_array_push(x_110, x_111);
x_113 = lean_array_push(x_112, x_2);
x_114 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14024,7 +14026,7 @@ lean_ctor_set(x_124, 0, x_96);
lean_ctor_set(x_124, 1, x_123);
x_125 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_126 = lean_array_push(x_125, x_124);
x_127 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_127 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_128 = lean_array_push(x_126, x_127);
x_129 = lean_array_push(x_128, x_120);
x_130 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14123,7 +14125,7 @@ lean_ctor_set(x_170, 0, x_148);
lean_ctor_set(x_170, 1, x_169);
x_171 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_172 = lean_array_push(x_171, x_170);
x_173 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_173 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_174 = lean_array_push(x_172, x_173);
x_175 = lean_array_push(x_174, x_2);
x_176 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14162,7 +14164,7 @@ lean_ctor_set(x_186, 0, x_148);
lean_ctor_set(x_186, 1, x_185);
x_187 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_188 = lean_array_push(x_187, x_186);
x_189 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_189 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_190 = lean_array_push(x_188, x_189);
x_191 = lean_array_push(x_190, x_182);
x_192 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14250,7 +14252,7 @@ lean_ctor_set(x_220, 0, x_208);
lean_ctor_set(x_220, 1, x_219);
x_221 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_222 = lean_array_push(x_221, x_220);
x_223 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_223 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_224 = lean_array_push(x_222, x_223);
x_225 = lean_array_push(x_224, x_2);
x_226 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14290,7 +14292,7 @@ lean_ctor_set(x_237, 0, x_208);
lean_ctor_set(x_237, 1, x_236);
x_238 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_239 = lean_array_push(x_238, x_237);
x_240 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_240 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_241 = lean_array_push(x_239, x_240);
x_242 = lean_array_push(x_241, x_233);
x_243 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14372,7 +14374,7 @@ lean_ctor_set(x_272, 0, x_258);
lean_ctor_set(x_272, 1, x_271);
x_273 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_274 = lean_array_push(x_273, x_272);
x_275 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_275 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_276 = lean_array_push(x_274, x_275);
x_277 = lean_array_push(x_276, x_2);
x_278 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14412,7 +14414,7 @@ lean_ctor_set(x_289, 0, x_258);
lean_ctor_set(x_289, 1, x_288);
x_290 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_291 = lean_array_push(x_290, x_289);
x_292 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_292 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_293 = lean_array_push(x_291, x_292);
x_294 = lean_array_push(x_293, x_285);
x_295 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14537,7 +14539,7 @@ lean_ctor_set(x_325, 0, x_324);
lean_ctor_set(x_325, 1, x_323);
x_326 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_327 = lean_array_push(x_326, x_325);
x_328 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_328 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_329 = lean_array_push(x_327, x_328);
x_330 = lean_array_push(x_329, x_2);
x_331 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14580,7 +14582,7 @@ lean_ctor_set(x_345, 0, x_344);
lean_ctor_set(x_345, 1, x_343);
x_346 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_347 = lean_array_push(x_346, x_345);
x_348 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_348 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_349 = lean_array_push(x_347, x_348);
x_350 = lean_array_push(x_349, x_338);
x_351 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14687,7 +14689,7 @@ lean_ctor_set(x_383, 0, x_372);
lean_ctor_set(x_383, 1, x_382);
x_384 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_385 = lean_array_push(x_384, x_383);
x_386 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_386 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_387 = lean_array_push(x_385, x_386);
x_388 = lean_array_push(x_387, x_2);
x_389 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14728,7 +14730,7 @@ lean_ctor_set(x_401, 0, x_372);
lean_ctor_set(x_401, 1, x_400);
x_402 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_403 = lean_array_push(x_402, x_401);
x_404 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_404 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_405 = lean_array_push(x_403, x_404);
x_406 = lean_array_push(x_405, x_396);
x_407 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14852,7 +14854,7 @@ lean_ctor_set(x_437, 0, x_436);
lean_ctor_set(x_437, 1, x_435);
x_438 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_439 = lean_array_push(x_438, x_437);
x_440 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_440 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_441 = lean_array_push(x_439, x_440);
x_442 = lean_array_push(x_441, x_2);
x_443 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -14895,7 +14897,7 @@ lean_ctor_set(x_457, 0, x_456);
lean_ctor_set(x_457, 1, x_455);
x_458 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_459 = lean_array_push(x_458, x_457);
x_460 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_460 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_461 = lean_array_push(x_459, x_460);
x_462 = lean_array_push(x_461, x_450);
x_463 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15121,7 +15123,7 @@ lean_ctor_set(x_526, 0, x_525);
lean_ctor_set(x_526, 1, x_524);
x_527 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_528 = lean_array_push(x_527, x_526);
x_529 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_529 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_530 = lean_array_push(x_528, x_529);
x_531 = lean_array_push(x_530, x_2);
x_532 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15164,7 +15166,7 @@ lean_ctor_set(x_546, 0, x_545);
lean_ctor_set(x_546, 1, x_544);
x_547 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_548 = lean_array_push(x_547, x_546);
x_549 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_549 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_550 = lean_array_push(x_548, x_549);
x_551 = lean_array_push(x_550, x_539);
x_552 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15263,7 +15265,7 @@ lean_ctor_set(x_592, 0, x_580);
lean_ctor_set(x_592, 1, x_591);
x_593 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_594 = lean_array_push(x_593, x_592);
x_595 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_595 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_596 = lean_array_push(x_594, x_595);
x_597 = lean_array_push(x_596, x_2);
x_598 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15302,7 +15304,7 @@ lean_ctor_set(x_608, 0, x_580);
lean_ctor_set(x_608, 1, x_607);
x_609 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_610 = lean_array_push(x_609, x_608);
x_611 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_611 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_612 = lean_array_push(x_610, x_611);
x_613 = lean_array_push(x_612, x_604);
x_614 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15401,7 +15403,7 @@ lean_ctor_set(x_654, 0, x_632);
lean_ctor_set(x_654, 1, x_653);
x_655 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_656 = lean_array_push(x_655, x_654);
x_657 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_657 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_658 = lean_array_push(x_656, x_657);
x_659 = lean_array_push(x_658, x_2);
x_660 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15440,7 +15442,7 @@ lean_ctor_set(x_670, 0, x_632);
lean_ctor_set(x_670, 1, x_669);
x_671 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_672 = lean_array_push(x_671, x_670);
x_673 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_673 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_674 = lean_array_push(x_672, x_673);
x_675 = lean_array_push(x_674, x_666);
x_676 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15528,7 +15530,7 @@ lean_ctor_set(x_704, 0, x_692);
lean_ctor_set(x_704, 1, x_703);
x_705 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_706 = lean_array_push(x_705, x_704);
x_707 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_707 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_708 = lean_array_push(x_706, x_707);
x_709 = lean_array_push(x_708, x_2);
x_710 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15568,7 +15570,7 @@ lean_ctor_set(x_721, 0, x_692);
lean_ctor_set(x_721, 1, x_720);
x_722 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_723 = lean_array_push(x_722, x_721);
x_724 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_724 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_725 = lean_array_push(x_723, x_724);
x_726 = lean_array_push(x_725, x_717);
x_727 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15650,7 +15652,7 @@ lean_ctor_set(x_756, 0, x_742);
lean_ctor_set(x_756, 1, x_755);
x_757 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_758 = lean_array_push(x_757, x_756);
x_759 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_759 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_760 = lean_array_push(x_758, x_759);
x_761 = lean_array_push(x_760, x_2);
x_762 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15690,7 +15692,7 @@ lean_ctor_set(x_773, 0, x_742);
lean_ctor_set(x_773, 1, x_772);
x_774 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_775 = lean_array_push(x_774, x_773);
x_776 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_776 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_777 = lean_array_push(x_775, x_776);
x_778 = lean_array_push(x_777, x_769);
x_779 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15812,7 +15814,7 @@ lean_ctor_set(x_807, 0, x_806);
lean_ctor_set(x_807, 1, x_805);
x_808 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_809 = lean_array_push(x_808, x_807);
x_810 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_810 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_811 = lean_array_push(x_809, x_810);
x_812 = lean_array_push(x_811, x_2);
x_813 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15855,7 +15857,7 @@ lean_ctor_set(x_827, 0, x_826);
lean_ctor_set(x_827, 1, x_825);
x_828 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_829 = lean_array_push(x_828, x_827);
x_830 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_830 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_831 = lean_array_push(x_829, x_830);
x_832 = lean_array_push(x_831, x_820);
x_833 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -15964,7 +15966,7 @@ lean_ctor_set(x_865, 0, x_854);
lean_ctor_set(x_865, 1, x_864);
x_866 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_867 = lean_array_push(x_866, x_865);
x_868 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_868 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_869 = lean_array_push(x_867, x_868);
x_870 = lean_array_push(x_869, x_2);
x_871 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -16005,7 +16007,7 @@ lean_ctor_set(x_883, 0, x_854);
lean_ctor_set(x_883, 1, x_882);
x_884 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_885 = lean_array_push(x_884, x_883);
x_886 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_886 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_887 = lean_array_push(x_885, x_886);
x_888 = lean_array_push(x_887, x_878);
x_889 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -16126,7 +16128,7 @@ lean_ctor_set(x_917, 0, x_916);
lean_ctor_set(x_917, 1, x_915);
x_918 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_919 = lean_array_push(x_918, x_917);
x_920 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_920 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_921 = lean_array_push(x_919, x_920);
x_922 = lean_array_push(x_921, x_2);
x_923 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -16169,7 +16171,7 @@ lean_ctor_set(x_937, 0, x_936);
lean_ctor_set(x_937, 1, x_935);
x_938 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_939 = lean_array_push(x_938, x_937);
x_940 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_940 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_941 = lean_array_push(x_939, x_940);
x_942 = lean_array_push(x_941, x_930);
x_943 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -18538,87 +18540,92 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1);
return x_5;
}
}
lean_object* l_Lean_delab(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
lean_object* l_Lean_delab(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_6 = lean_unsigned_to_nat(1u);
x_7 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_7, 0, x_1);
lean_ctor_set(x_7, 1, x_6);
lean_ctor_set(x_7, 2, x_2);
lean_ctor_set(x_7, 3, x_3);
lean_inc(x_4);
x_8 = l_Lean_Delaborator_delab(x_7, x_4, x_5);
if (lean_obj_tag(x_8) == 0)
{
lean_object* x_9;
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
x_6 = lean_ctor_get(x_5, 0);
lean_inc(x_6);
lean_dec(x_5);
x_7 = lean_unsigned_to_nat(1u);
x_8 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_8, 0, x_1);
lean_ctor_set(x_8, 1, x_7);
lean_ctor_set(x_8, 2, x_6);
lean_ctor_set(x_8, 3, x_2);
lean_inc(x_3);
x_9 = l_Lean_Delaborator_delab(x_8, x_3, x_4);
if (lean_obj_tag(x_9) == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_10 = lean_ctor_get(x_8, 1);
lean_object* x_10;
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
lean_dec(x_8);
x_11 = l_Lean_Meta_isClassQuick___main___closed__1;
x_12 = l_unreachable_x21___rarg(x_11);
x_13 = lean_apply_2(x_12, x_4, x_10);
return x_13;
}
else
if (lean_obj_tag(x_10) == 0)
{
uint8_t x_14;
lean_dec(x_4);
x_14 = !lean_is_exclusive(x_8);
if (x_14 == 0)
{
lean_object* x_15; lean_object* x_16;
x_15 = lean_ctor_get(x_8, 0);
lean_dec(x_15);
x_16 = lean_ctor_get(x_9, 0);
lean_inc(x_16);
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_11 = lean_ctor_get(x_9, 1);
lean_inc(x_11);
lean_dec(x_9);
lean_ctor_set(x_8, 0, x_16);
return x_8;
x_12 = l_Lean_Meta_isClassQuick___main___closed__1;
x_13 = l_unreachable_x21___rarg(x_12);
x_14 = lean_apply_2(x_13, x_3, x_11);
return x_14;
}
else
{
lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_17 = lean_ctor_get(x_8, 1);
uint8_t x_15;
lean_dec(x_3);
x_15 = !lean_is_exclusive(x_9);
if (x_15 == 0)
{
lean_object* x_16; lean_object* x_17;
x_16 = lean_ctor_get(x_9, 0);
lean_dec(x_16);
x_17 = lean_ctor_get(x_10, 0);
lean_inc(x_17);
lean_dec(x_8);
x_18 = lean_ctor_get(x_9, 0);
lean_dec(x_10);
lean_ctor_set(x_9, 0, x_17);
return x_9;
}
else
{
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_18 = lean_ctor_get(x_9, 1);
lean_inc(x_18);
lean_dec(x_9);
x_19 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_19, 0, x_18);
lean_ctor_set(x_19, 1, x_17);
return x_19;
x_19 = lean_ctor_get(x_10, 0);
lean_inc(x_19);
lean_dec(x_10);
x_20 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_20, 0, x_19);
lean_ctor_set(x_20, 1, x_18);
return x_20;
}
}
}
else
{
uint8_t x_20;
lean_dec(x_4);
x_20 = !lean_is_exclusive(x_8);
if (x_20 == 0)
uint8_t x_21;
lean_dec(x_3);
x_21 = !lean_is_exclusive(x_9);
if (x_21 == 0)
{
return x_8;
return x_9;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = lean_ctor_get(x_8, 0);
x_22 = lean_ctor_get(x_8, 1);
lean_object* x_22; lean_object* x_23; lean_object* x_24;
x_22 = lean_ctor_get(x_9, 0);
x_23 = lean_ctor_get(x_9, 1);
lean_inc(x_23);
lean_inc(x_22);
lean_inc(x_21);
lean_dec(x_8);
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_dec(x_9);
x_24 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_24, 0, x_22);
lean_ctor_set(x_24, 1, x_23);
return x_24;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -39,6 +39,7 @@ extern lean_object* l_Lean_Meta_reduceNative_x3f___closed__2;
lean_object* l_Lean_Elab_Term_expandIf___closed__3;
extern lean_object* l_Lean_Parser_Term_andthen___elambda__1___closed__1;
lean_object* l_Lean_Elab_Term_elabBAnd___closed__1;
extern lean_object* l_Lean_Meta_mkLt___closed__4;
extern lean_object* l_Lean_Expr_eq_x3f___closed__2;
lean_object* l___regBuiltin_Lean_Elab_Term_elabBAnd___closed__1;
lean_object* l_Lean_Elab_Term_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*);
@ -53,6 +54,7 @@ lean_object* l___private_Lean_Syntax_7__quoteName___main(lean_object*);
lean_object* l_Lean_Elab_Term_elabModN___closed__3;
lean_object* l___regBuiltin_Lean_Elab_Term_elabNativeRefl___closed__1;
lean_object* l_Lean_Elab_Term_elabAnonymousCtor___closed__2;
extern lean_object* l_Lean_Meta_mkLe___closed__4;
lean_object* l_Lean_Elab_Term_elabBOr___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__19;
lean_object* l_Lean_Elab_Term_elabInfix(lean_object*, lean_object*, lean_object*, lean_object*);
@ -86,6 +88,7 @@ lean_object* l_Lean_Elab_Term_elabPow___closed__3;
lean_object* lean_environment_find(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_decide___elambda__1___closed__2;
lean_object* l___regBuiltin_Lean_Elab_Term_elabseqRight___closed__1;
extern lean_object* l_Lean_Meta_mkSorry___closed__4;
lean_object* l_Lean_Elab_Term_elabMod___closed__1;
lean_object* l_Lean_Elab_Term_elabTermAndSynthesize(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_expandDollar(lean_object*, lean_object*, lean_object*);
@ -120,7 +123,6 @@ lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* l_Lean_Elab_Term_elabModN(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabAndThen___closed__1;
lean_object* l_Lean_Elab_Term_elabDecide___closed__3;
extern lean_object* l_Lean_Parser_Term_gt___elambda__1___closed__2;
lean_object* l_Lean_Elab_Term_elabEquiv(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppFn___main(lean_object*);
@ -128,12 +130,10 @@ extern lean_object* l_Lean_Expr_listLitAux___main___closed__5;
lean_object* l___regBuiltin_Lean_Elab_Term_elabAppend___closed__1;
lean_object* l___private_Lean_Elab_BuiltinNotation_5__getPropToDecide(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_getAppArgs___closed__1;
extern lean_object* l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1;
lean_object* l_Lean_Elab_Term_mkAuxName(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabAnd(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__33;
lean_object* l_Lean_Elab_Term_expandSubtype___closed__11;
lean_object* l_Lean_Elab_Term_elabLT___closed__3;
extern lean_object* l_Lean_Parser_Term_typeAscription___elambda__1___closed__2;
lean_object* l___regBuiltin_Lean_Elab_Term_elabAppend(lean_object*);
lean_object* l_Lean_Elab_Term_elabDiv___closed__3;
@ -150,7 +150,6 @@ extern lean_object* l_Lean_Parser_Term_andM___elambda__1___closed__2;
lean_object* l_Lean_Elab_Term_elabNativeRefl___closed__2;
lean_object* l___regBuiltin_Lean_Elab_Term_ElabFComp(lean_object*);
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__14;
lean_object* l_Lean_Elab_Term_elabLT___closed__1;
lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabEquiv___closed__2;
lean_object* l_Lean_Elab_Term_getMainModule___rarg(lean_object*);
@ -169,6 +168,7 @@ extern lean_object* l_Lean_mkAppStx___closed__8;
lean_object* l_Lean_Elab_Term_expandSubtype___closed__1;
lean_object* l_Lean_Elab_Term_mkExpectedTypeHint(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Term_elabMap(lean_object*);
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
lean_object* l___regBuiltin_Lean_Elab_Term_expandShow___closed__1;
lean_object* l___private_Lean_Elab_Term_3__fromMetaState(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Term_elabBNe___closed__1;
@ -199,7 +199,6 @@ lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___close
lean_object* l___private_Lean_Elab_BuiltinNotation_2__elabTParserMacroAux___closed__6;
extern lean_object* l_Lean_Parser_Term_dollarProj___elambda__1___closed__2;
lean_object* l___regBuiltin_Lean_Elab_Term_expandHave(lean_object*);
lean_object* l_Lean_Elab_Term_elabDecide___closed__2;
lean_object* l_Lean_Elab_Term_elabOr___closed__2;
lean_object* l_Lean_Elab_Term_elabMul___closed__3;
lean_object* l_Lean_Elab_Term_tryPostponeIfNoneOrMVar(lean_object*, lean_object*, lean_object*);
@ -261,7 +260,6 @@ extern lean_object* l_Lean_Parser_Term_sub___elambda__1___closed__1;
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__15;
lean_object* l_Lean_Elab_Term_elabNativeRefl___closed__4;
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__30;
lean_object* l_Lean_Elab_Term_elabLE___closed__1;
lean_object* l_Lean_Elab_Term_ElabFComp___closed__4;
lean_object* l_Lean_Elab_Term_expandShow___closed__3;
extern lean_object* l_Lean_Expr_iff_x3f___closed__2;
@ -287,6 +285,7 @@ lean_object* l___private_Lean_Elab_BuiltinNotation_2__elabTParserMacroAux___clos
lean_object* l___regBuiltin_Lean_Elab_Term_elabLE___closed__1;
extern lean_object* l___private_Lean_Elab_Quotation_4__getHeadInfo___elambda__3___closed__1;
lean_object* l_Lean_Elab_Term_elabAnonymousCtor___closed__8;
extern lean_object* l_Lean_Meta_mkDecideProof___closed__4;
lean_object* l_Lean_Elab_Term_expandIf___closed__9;
lean_object* l_Lean_Elab_Term_elabProd___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Term_elabAnonymousCtor(lean_object*);
@ -298,13 +297,11 @@ lean_object* l___regBuiltin_Lean_Elab_Term_elabEq___closed__1;
extern lean_object* l_Lean_boolToExpr___closed__1;
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__23;
lean_object* l___private_Lean_Elab_BuiltinNotation_2__elabTParserMacroAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__3;
lean_object* l___regBuiltin_Lean_Elab_Term_elabNativeDecide(lean_object*);
lean_object* l_Lean_Elab_Term_elabSub(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_fcomp___elambda__1___closed__2;
lean_object* l_Lean_Elab_Term_elabMapRev___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabMod___closed__3;
lean_object* l_Lean_Elab_Term_elabLE___closed__2;
lean_object* l___regBuiltin_Lean_Elab_Term_elabAnd___closed__1;
lean_object* l_Lean_Elab_Term_elabseqRight___closed__1;
extern lean_object* l_Lean_mkDecIsTrue___closed__2;
@ -321,7 +318,6 @@ lean_object* l___regBuiltin_Lean_Elab_Term_elabLT(lean_object*);
lean_object* l_Lean_Elab_Term_expandDollar___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabseqRight___closed__2;
lean_object* l_Lean_Elab_Term_elabIff___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabLT___closed__2;
lean_object* l_Lean_Elab_Term_elabBAnd(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_getCurrMacroScope(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_orM___elambda__1___closed__2;
@ -363,7 +359,6 @@ lean_object* l_Lean_Elab_Term_elabPow___boxed(lean_object*, lean_object*, lean_o
lean_object* l___regBuiltin_Lean_Elab_Term_elabMod(lean_object*);
lean_object* l_Lean_Elab_Term_elabGE(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabLT___closed__4;
lean_object* l_Lean_Elab_Term_elabOr(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabMap___closed__1;
lean_object* l_Lean_Elab_Term_elabAnd___closed__2;
@ -426,7 +421,6 @@ lean_object* l___regBuiltin_Lean_Elab_Term_elabPow___closed__1;
lean_object* l_Lean_Elab_Term_expandSubtype___closed__2;
extern lean_object* l___private_Lean_Meta_DiscrTree_6__shouldAddAsStar___closed__8;
extern lean_object* l_Lean_Parser_Term_if___elambda__1___closed__2;
lean_object* l_Lean_Elab_Term_elabLE___closed__3;
lean_object* l_Lean_Elab_Term_elabLT(lean_object*, lean_object*, lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Term_elabDiv(lean_object*);
lean_object* l_Lean_mkApp(lean_object*, lean_object*);
@ -438,7 +432,6 @@ extern lean_object* l_Lean_Parser_Term_let___elambda__1___closed__1;
lean_object* l___regBuiltin_Lean_Elab_Term_elabAndM(lean_object*);
lean_object* l_Lean_Syntax_getArgs(lean_object*);
lean_object* l_Lean_Elab_Term_expandIf___closed__1;
lean_object* l_Lean_Elab_Term_elabLE___closed__4;
lean_object* l_Lean_Elab_Term_elabOrM___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_BuiltinNotation_3__mkNativeReflAuxDecl___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_BuiltinNotation_1__elabParserMacroAux___closed__3;
@ -1168,7 +1161,7 @@ lean_ctor_set(x_79, 0, x_43);
lean_ctor_set(x_79, 1, x_78);
x_80 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_81 = lean_array_push(x_80, x_79);
x_82 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_82 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_83 = lean_array_push(x_81, x_82);
lean_inc(x_83);
x_84 = lean_array_push(x_83, x_56);
@ -1510,7 +1503,7 @@ lean_ctor_set(x_46, 0, x_37);
lean_ctor_set(x_46, 1, x_45);
x_47 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_48 = lean_array_push(x_47, x_46);
x_49 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_49 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_50 = lean_array_push(x_48, x_49);
x_51 = lean_array_push(x_50, x_15);
x_52 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -1676,7 +1669,7 @@ lean_ctor_set(x_117, 0, x_67);
lean_ctor_set(x_117, 1, x_116);
x_118 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_119 = lean_array_push(x_118, x_117);
x_120 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_120 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_121 = lean_array_push(x_119, x_120);
x_122 = lean_array_push(x_121, x_82);
x_123 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -6744,7 +6737,7 @@ x_24 = lean_ctor_get(x_3, 0);
lean_inc(x_24);
x_25 = l_Lean_TraceState_Inhabited___closed__1;
lean_ctor_set(x_20, 4, x_25);
x_26 = l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1;
x_26 = l_Lean_Meta_mkSorry___closed__4;
x_27 = l_Lean_Meta_mkEqRefl(x_26, x_24, x_20);
if (lean_obj_tag(x_27) == 0)
{
@ -6824,7 +6817,7 @@ lean_ctor_set(x_53, 2, x_47);
lean_ctor_set(x_53, 3, x_48);
lean_ctor_set(x_53, 4, x_52);
lean_ctor_set(x_53, 5, x_50);
x_54 = l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1;
x_54 = l_Lean_Meta_mkSorry___closed__4;
x_55 = l_Lean_Meta_mkEqRefl(x_54, x_51, x_53);
if (lean_obj_tag(x_55) == 0)
{
@ -6979,27 +6972,9 @@ return x_5;
lean_object* _init_l_Lean_Elab_Term_elabDecide___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("ofDecideEqTrue");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Term_elabDecide___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_Term_elabDecide___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Elab_Term_elabDecide___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Elab_Term_elabDecide___closed__2;
x_2 = l_Lean_Meta_mkDecideProof___closed__4;
x_3 = l_Lean_mkConst(x_2, x_1);
return x_3;
}
@ -7067,7 +7042,7 @@ lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean
x_28 = lean_ctor_get(x_26, 0);
x_29 = lean_ctor_get(x_26, 1);
x_30 = l___private_Lean_Elab_Term_3__fromMetaState(x_1, x_3, x_18, x_29, x_22);
x_31 = l_Lean_Elab_Term_elabDecide___closed__3;
x_31 = l_Lean_Elab_Term_elabDecide___closed__1;
x_32 = l_Lean_mkApp3(x_31, x_8, x_19, x_28);
lean_ctor_set(x_26, 1, x_30);
lean_ctor_set(x_26, 0, x_32);
@ -7082,7 +7057,7 @@ lean_inc(x_34);
lean_inc(x_33);
lean_dec(x_26);
x_35 = l___private_Lean_Elab_Term_3__fromMetaState(x_1, x_3, x_18, x_34, x_22);
x_36 = l_Lean_Elab_Term_elabDecide___closed__3;
x_36 = l_Lean_Elab_Term_elabDecide___closed__1;
x_37 = l_Lean_mkApp3(x_36, x_8, x_19, x_33);
x_38 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_38, 0, x_37);
@ -7170,7 +7145,7 @@ if (lean_is_exclusive(x_59)) {
x_62 = lean_box(0);
}
x_63 = l___private_Lean_Elab_Term_3__fromMetaState(x_1, x_3, x_18, x_61, x_53);
x_64 = l_Lean_Elab_Term_elabDecide___closed__3;
x_64 = l_Lean_Elab_Term_elabDecide___closed__1;
x_65 = l_Lean_mkApp3(x_64, x_8, x_19, x_60);
if (lean_is_scalar(x_62)) {
x_66 = lean_alloc_ctor(0, 2, 0);
@ -7904,47 +7879,11 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1);
return x_5;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLE___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("HasLessEq");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLE___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_Term_elabLE___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLE___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("LessEq");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLE___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Term_elabLE___closed__2;
x_2 = l_Lean_Elab_Term_elabLE___closed__3;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Elab_Term_elabLE(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5;
x_4 = l_Lean_Elab_Term_elabLE___closed__4;
x_4 = l_Lean_Meta_mkLe___closed__4;
x_5 = l_Lean_Elab_Term_elabInfixOp(x_4, x_1, x_2, x_3);
return x_5;
}
@ -8034,47 +7973,11 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1);
return x_5;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLT___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("HasLess");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLT___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_Term_elabLT___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLT___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("Less");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Term_elabLT___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Term_elabLT___closed__2;
x_2 = l_Lean_Elab_Term_elabLT___closed__3;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Elab_Term_elabLT(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5;
x_4 = l_Lean_Elab_Term_elabLT___closed__4;
x_4 = l_Lean_Meta_mkLt___closed__4;
x_5 = l_Lean_Elab_Term_elabInfixOp(x_4, x_1, x_2, x_3);
return x_5;
}
@ -9705,10 +9608,6 @@ if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Elab_Term_elabDecide___closed__1 = _init_l_Lean_Elab_Term_elabDecide___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_elabDecide___closed__1);
l_Lean_Elab_Term_elabDecide___closed__2 = _init_l_Lean_Elab_Term_elabDecide___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_elabDecide___closed__2);
l_Lean_Elab_Term_elabDecide___closed__3 = _init_l_Lean_Elab_Term_elabDecide___closed__3();
lean_mark_persistent(l_Lean_Elab_Term_elabDecide___closed__3);
l___regBuiltin_Lean_Elab_Term_elabDecide___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_elabDecide___closed__1();
lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabDecide___closed__1);
res = l___regBuiltin_Lean_Elab_Term_elabDecide(lean_io_mk_world());
@ -9807,14 +9706,6 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabPow___closed__1);
res = l___regBuiltin_Lean_Elab_Term_elabPow(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Elab_Term_elabLE___closed__1 = _init_l_Lean_Elab_Term_elabLE___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_elabLE___closed__1);
l_Lean_Elab_Term_elabLE___closed__2 = _init_l_Lean_Elab_Term_elabLE___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_elabLE___closed__2);
l_Lean_Elab_Term_elabLE___closed__3 = _init_l_Lean_Elab_Term_elabLE___closed__3();
lean_mark_persistent(l_Lean_Elab_Term_elabLE___closed__3);
l_Lean_Elab_Term_elabLE___closed__4 = _init_l_Lean_Elab_Term_elabLE___closed__4();
lean_mark_persistent(l_Lean_Elab_Term_elabLE___closed__4);
l___regBuiltin_Lean_Elab_Term_elabLE___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_elabLE___closed__1();
lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabLE___closed__1);
res = l___regBuiltin_Lean_Elab_Term_elabLE(lean_io_mk_world());
@ -9829,14 +9720,6 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabGE___closed__1);
res = l___regBuiltin_Lean_Elab_Term_elabGE(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Elab_Term_elabLT___closed__1 = _init_l_Lean_Elab_Term_elabLT___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_elabLT___closed__1);
l_Lean_Elab_Term_elabLT___closed__2 = _init_l_Lean_Elab_Term_elabLT___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_elabLT___closed__2);
l_Lean_Elab_Term_elabLT___closed__3 = _init_l_Lean_Elab_Term_elabLT___closed__3();
lean_mark_persistent(l_Lean_Elab_Term_elabLT___closed__3);
l_Lean_Elab_Term_elabLT___closed__4 = _init_l_Lean_Elab_Term_elabLT___closed__4();
lean_mark_persistent(l_Lean_Elab_Term_elabLT___closed__4);
l___regBuiltin_Lean_Elab_Term_elabLT___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_elabLT___closed__1();
lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabLT___closed__1);
res = l___regBuiltin_Lean_Elab_Term_elabLT(lean_io_mk_world());

View file

@ -121,11 +121,11 @@ uint8_t l___private_Lean_Elab_Declaration_3__isMutualInductive(lean_object*);
extern lean_object* l_Lean_Parser_Command_instance___elambda__1___closed__2;
extern lean_object* l_Lean_mkReducibilityAttrs___closed__4;
lean_object* l_Lean_mkAtomFrom(lean_object*, lean_object*);
extern lean_object* l_Lean_Compiler_mkInlineAttrs___closed__4;
extern lean_object* l_Lean_Parser_Command_universe___elambda__1___closed__2;
extern lean_object* l___private_Lean_Elab_Quotation_8__letBindRhss___main___closed__11;
uint8_t l___private_Lean_Elab_Declaration_5__isMutualPreambleCommand(lean_object*);
lean_object* l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabAbbrev___closed__3;
lean_object* lean_environment_main_module(lean_object*);
extern lean_object* l_Lean_Parser_Command_end___elambda__1___closed__1;
lean_object* l_Lean_Elab_Command_elabMutual(lean_object*, lean_object*, lean_object*);
@ -190,7 +190,6 @@ lean_object* l_Lean_Elab_Command_elabConstant___closed__3;
lean_object* l___private_Lean_Elab_Declaration_7__expandMutualPreamble_x3f___closed__11;
lean_object* l_Lean_Elab_Command_elabAbbrev___closed__1;
lean_object* l_Lean_Elab_Command_checkValidInductiveModifier(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabAbbrev___closed__4;
lean_object* l_Lean_CollectLevelParams_main___main(lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Command_liftTermElabM___rarg___closed__1;
lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1;
@ -206,26 +205,8 @@ lean_object* l_Lean_Elab_Command_elabMutual___closed__1;
lean_object* _init_l_Lean_Elab_Command_elabAbbrev___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("inline");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Command_elabAbbrev___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_elabAbbrev___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Elab_Command_elabAbbrev___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Command_elabAbbrev___closed__2;
x_1 = l_Lean_Compiler_mkInlineAttrs___closed__4;
x_2 = lean_box(0);
x_3 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_3, 0, x_1);
@ -233,7 +214,7 @@ lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Elab_Command_elabAbbrev___closed__4() {
lean_object* _init_l_Lean_Elab_Command_elabAbbrev___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
@ -258,9 +239,9 @@ lean_inc(x_8);
x_9 = lean_ctor_get(x_7, 1);
lean_inc(x_9);
lean_dec(x_7);
x_10 = l_Lean_Elab_Command_elabAbbrev___closed__3;
x_10 = l_Lean_Elab_Command_elabAbbrev___closed__1;
x_11 = l_Lean_Elab_Command_Modifiers_addAttribute(x_1, x_10);
x_12 = l_Lean_Elab_Command_elabAbbrev___closed__4;
x_12 = l_Lean_Elab_Command_elabAbbrev___closed__2;
x_13 = l_Lean_Elab_Command_Modifiers_addAttribute(x_11, x_12);
x_14 = lean_unsigned_to_nat(1u);
x_15 = l_Lean_Syntax_getArg(x_2, x_14);
@ -3998,10 +3979,6 @@ l_Lean_Elab_Command_elabAbbrev___closed__1 = _init_l_Lean_Elab_Command_elabAbbre
lean_mark_persistent(l_Lean_Elab_Command_elabAbbrev___closed__1);
l_Lean_Elab_Command_elabAbbrev___closed__2 = _init_l_Lean_Elab_Command_elabAbbrev___closed__2();
lean_mark_persistent(l_Lean_Elab_Command_elabAbbrev___closed__2);
l_Lean_Elab_Command_elabAbbrev___closed__3 = _init_l_Lean_Elab_Command_elabAbbrev___closed__3();
lean_mark_persistent(l_Lean_Elab_Command_elabAbbrev___closed__3);
l_Lean_Elab_Command_elabAbbrev___closed__4 = _init_l_Lean_Elab_Command_elabAbbrev___closed__4();
lean_mark_persistent(l_Lean_Elab_Command_elabAbbrev___closed__4);
l_Lean_Elab_Command_elabConstant___closed__1 = _init_l_Lean_Elab_Command_elabConstant___closed__1();
lean_mark_persistent(l_Lean_Elab_Command_elabConstant___closed__1);
l_Lean_Elab_Command_elabConstant___closed__2 = _init_l_Lean_Elab_Command_elabConstant___closed__2();

View file

@ -45,7 +45,6 @@ lean_object* l_Lean_Elab_Term_getDecLevel(lean_object*, lean_object*, lean_objec
lean_object* l_Lean_Elab_Term_ProcessedDoElem_inhabited___closed__1;
extern lean_object* l_Lean_Parser_Term_liftMethod___elambda__1___closed__2;
lean_object* l___private_Lean_Elab_DoNotation_11__processDoElemsAux___main___closed__1;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
lean_object* l_Lean_Elab_Term_mkLambda(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
@ -57,6 +56,7 @@ lean_object* l___private_Lean_Elab_DoNotation_1__mkIdBindFor___closed__3;
lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_do___elambda__1___closed__2;
uint8_t l___private_Lean_Elab_DoNotation_4__hasLiftMethod___main(lean_object*);
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at___private_Lean_Elab_DoNotation_10__mkBind___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -80,16 +80,16 @@ lean_object* l_Lean_Elab_Term_throwUnsupportedSyntax___rarg(lean_object*);
lean_object* l___private_Lean_Elab_DoNotation_5__expandLiftMethodAux___main___closed__4;
extern lean_object* l___private_Lean_Elab_Term_5__expandCDot___main___closed__3;
lean_object* l___private_Lean_Elab_DoNotation_11__processDoElemsAux___main___closed__5;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_DoNotation_10__mkBind(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
extern lean_object* l_Lean_Elab_Term_Quotation_stxQuot_expand___closed__6;
extern lean_object* l_Lean_Parser_Term_doId___elambda__1___closed__2;
lean_object* lean_array_fset(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_DoNotation_10__mkBind___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Lean_Elab_Term_5__expandCDot___main___closed__2;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
lean_object* l_Lean_Elab_Term_elabTermAux___main(lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__3;
lean_object* l_Lean_Elab_Term_logTrace(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
@ -2145,7 +2145,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Lean_Elab_DoNotation_7__expandDoElemsAux___main___closed__1;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -2424,16 +2424,16 @@ lean_ctor_set(x_165, 1, x_164);
x_166 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_167 = lean_array_push(x_166, x_165);
x_168 = lean_array_push(x_167, x_152);
x_169 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_169 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_170 = lean_array_push(x_168, x_169);
x_171 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_171 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_172 = lean_array_push(x_170, x_171);
x_173 = lean_array_push(x_129, x_117);
x_174 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_174, 0, x_131);
lean_ctor_set(x_174, 1, x_173);
x_175 = lean_array_push(x_129, x_174);
x_176 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_176 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_177 = lean_array_push(x_175, x_176);
x_178 = lean_array_push(x_177, x_142);
x_179 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -2441,7 +2441,7 @@ x_180 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_180, 0, x_179);
lean_ctor_set(x_180, 1, x_178);
x_181 = lean_array_push(x_129, x_180);
x_182 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_182 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_183 = lean_array_push(x_181, x_182);
x_184 = l___private_Lean_Elab_DoNotation_7__expandDoElemsAux___main___closed__2;
x_185 = lean_array_push(x_184, x_144);
@ -2513,16 +2513,16 @@ lean_ctor_set(x_219, 1, x_218);
x_220 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_221 = lean_array_push(x_220, x_219);
x_222 = lean_array_push(x_221, x_206);
x_223 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_223 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_224 = lean_array_push(x_222, x_223);
x_225 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_225 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_226 = lean_array_push(x_224, x_225);
x_227 = lean_array_push(x_129, x_117);
x_228 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_228, 0, x_131);
lean_ctor_set(x_228, 1, x_227);
x_229 = lean_array_push(x_129, x_228);
x_230 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_230 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_231 = lean_array_push(x_229, x_230);
x_232 = lean_array_push(x_231, x_142);
x_233 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -2611,16 +2611,16 @@ lean_ctor_set(x_276, 1, x_274);
x_277 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_278 = lean_array_push(x_277, x_276);
x_279 = lean_array_push(x_278, x_262);
x_280 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_280 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_281 = lean_array_push(x_279, x_280);
x_282 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_282 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_283 = lean_array_push(x_281, x_282);
x_284 = lean_array_push(x_260, x_117);
x_285 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_285, 0, x_275);
lean_ctor_set(x_285, 1, x_284);
x_286 = lean_array_push(x_260, x_285);
x_287 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_287 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_288 = lean_array_push(x_286, x_287);
x_289 = lean_array_push(x_288, x_249);
x_290 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -2628,7 +2628,7 @@ x_291 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_291, 0, x_290);
lean_ctor_set(x_291, 1, x_289);
x_292 = lean_array_push(x_260, x_291);
x_293 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_293 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_294 = lean_array_push(x_292, x_293);
x_295 = l___private_Lean_Elab_DoNotation_7__expandDoElemsAux___main___closed__2;
x_296 = lean_array_push(x_295, x_253);
@ -2704,16 +2704,16 @@ lean_ctor_set(x_334, 1, x_332);
x_335 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_336 = lean_array_push(x_335, x_334);
x_337 = lean_array_push(x_336, x_320);
x_338 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_338 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_339 = lean_array_push(x_337, x_338);
x_340 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_340 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_341 = lean_array_push(x_339, x_340);
x_342 = lean_array_push(x_318, x_117);
x_343 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_343, 0, x_333);
lean_ctor_set(x_343, 1, x_342);
x_344 = lean_array_push(x_318, x_343);
x_345 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_345 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_346 = lean_array_push(x_344, x_345);
x_347 = lean_array_push(x_346, x_249);
x_348 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -3118,16 +3118,16 @@ lean_ctor_set(x_547, 1, x_546);
x_548 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_549 = lean_array_push(x_548, x_547);
x_550 = lean_array_push(x_549, x_534);
x_551 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_551 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_552 = lean_array_push(x_550, x_551);
x_553 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_553 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_554 = lean_array_push(x_552, x_553);
x_555 = lean_array_push(x_511, x_499);
x_556 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_556, 0, x_513);
lean_ctor_set(x_556, 1, x_555);
x_557 = lean_array_push(x_511, x_556);
x_558 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_558 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_559 = lean_array_push(x_557, x_558);
x_560 = lean_array_push(x_559, x_524);
x_561 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -3135,7 +3135,7 @@ x_562 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_562, 0, x_561);
lean_ctor_set(x_562, 1, x_560);
x_563 = lean_array_push(x_511, x_562);
x_564 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_564 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_565 = lean_array_push(x_563, x_564);
x_566 = l___private_Lean_Elab_DoNotation_7__expandDoElemsAux___main___closed__2;
x_567 = lean_array_push(x_566, x_526);
@ -3207,16 +3207,16 @@ lean_ctor_set(x_601, 1, x_600);
x_602 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_603 = lean_array_push(x_602, x_601);
x_604 = lean_array_push(x_603, x_588);
x_605 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_605 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_606 = lean_array_push(x_604, x_605);
x_607 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_607 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_608 = lean_array_push(x_606, x_607);
x_609 = lean_array_push(x_511, x_499);
x_610 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_610, 0, x_513);
lean_ctor_set(x_610, 1, x_609);
x_611 = lean_array_push(x_511, x_610);
x_612 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_612 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_613 = lean_array_push(x_611, x_612);
x_614 = lean_array_push(x_613, x_524);
x_615 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -3305,16 +3305,16 @@ lean_ctor_set(x_658, 1, x_656);
x_659 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_660 = lean_array_push(x_659, x_658);
x_661 = lean_array_push(x_660, x_644);
x_662 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_662 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_663 = lean_array_push(x_661, x_662);
x_664 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_664 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_665 = lean_array_push(x_663, x_664);
x_666 = lean_array_push(x_642, x_499);
x_667 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_667, 0, x_657);
lean_ctor_set(x_667, 1, x_666);
x_668 = lean_array_push(x_642, x_667);
x_669 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_669 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_670 = lean_array_push(x_668, x_669);
x_671 = lean_array_push(x_670, x_631);
x_672 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -3322,7 +3322,7 @@ x_673 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_673, 0, x_672);
lean_ctor_set(x_673, 1, x_671);
x_674 = lean_array_push(x_642, x_673);
x_675 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_675 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_676 = lean_array_push(x_674, x_675);
x_677 = l___private_Lean_Elab_DoNotation_7__expandDoElemsAux___main___closed__2;
x_678 = lean_array_push(x_677, x_635);
@ -3398,16 +3398,16 @@ lean_ctor_set(x_716, 1, x_714);
x_717 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__2;
x_718 = lean_array_push(x_717, x_716);
x_719 = lean_array_push(x_718, x_702);
x_720 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_720 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_721 = lean_array_push(x_719, x_720);
x_722 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_722 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_723 = lean_array_push(x_721, x_722);
x_724 = lean_array_push(x_700, x_499);
x_725 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_725, 0, x_715);
lean_ctor_set(x_725, 1, x_724);
x_726 = lean_array_push(x_700, x_725);
x_727 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_727 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_728 = lean_array_push(x_726, x_727);
x_729 = lean_array_push(x_728, x_631);
x_730 = l_Lean_Parser_Term_matchAlt___closed__2;

View file

@ -30,7 +30,6 @@ lean_object* l_Lean_Syntax_isNatLitAux(lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_Quotation_5__explodeHeadPat(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_Quotation_2__quoteSyntax___main___closed__12;
extern lean_object* l_Lean_Parser_declareBuiltinParser___closed__8;
extern lean_object* l_Lean_Parser_darrow___elambda__1___closed__1;
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
lean_object* l___private_Lean_Elab_Quotation_8__letBindRhss___main___closed__3;
lean_object* l_Array_findMAux___main___at___private_Lean_Elab_Quotation_1__elimAntiquotChoices___main___spec__2___boxed(lean_object*, lean_object*, lean_object*);
@ -105,6 +104,7 @@ lean_object* l___private_Lean_Elab_Quotation_4__getHeadInfo___elambda__3___close
lean_object* l___private_Lean_Elab_Quotation_8__letBindRhss___main___closed__16;
lean_object* l_Lean_Elab_Term_Quotation_stxQuot_expand___closed__2;
lean_object* l___private_Lean_Elab_Quotation_2__quoteSyntax___main___closed__50;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__4;
lean_object* l_Lean_Parser_mkInputContext(lean_object*, lean_object*);
lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
@ -153,6 +153,7 @@ extern lean_object* l_Lean_mkAppStx___closed__8;
lean_object* l_Array_iterateMAux___main___at___private_Lean_Elab_Quotation_2__quoteSyntax___main___spec__1___closed__1;
lean_object* l___private_Lean_Elab_Quotation_4__getHeadInfo___lambda__1___closed__2;
lean_object* l___private_Lean_Elab_Quotation_6__compileStxMatch___main___closed__17;
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
extern lean_object* l_Lean_mkAppStx___closed__7;
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Array_umapMAux___main___at_Lean_Elab_Term_Quotation_match__syntax_expand___spec__1___closed__5;
@ -478,7 +479,6 @@ lean_object* l_Lean_Elab_Term_Quotation_elabStxQuot___closed__1;
extern lean_object* l_Lean_Unhygienic_MonadQuotation___closed__2;
lean_object* lean_get_namespace(lean_object*);
lean_object* l___private_Lean_Elab_Quotation_2__quoteSyntax___main___closed__62;
uint8_t l_Lean_Syntax_isNone(lean_object*);
extern lean_object* l_Lean_TraceState_Inhabited___closed__1;
lean_object* l___private_Lean_Elab_Quotation_2__quoteSyntax___main___closed__49;
extern lean_object* l_Lean_Parser_Syntax_atom___elambda__1___closed__1;
@ -755,35 +755,28 @@ return x_8;
}
else
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12;
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; uint8_t x_13;
x_9 = l_Lean_Syntax_inhabited;
x_10 = lean_unsigned_to_nat(3u);
x_11 = lean_array_get(x_9, x_3, x_10);
x_12 = l_Lean_Syntax_isNone(x_11);
lean_dec(x_11);
if (x_12 == 0)
{
lean_object* x_13;
lean_inc(x_4);
x_13 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_13, 0, x_4);
return x_13;
}
else
x_12 = l_Lean_Parser_mkAntiquot___closed__4;
x_13 = l_Lean_Syntax_isOfKind(x_11, x_12);
if (x_13 == 0)
{
lean_object* x_14;
x_14 = l_Lean_Elab_Term_Quotation_antiquotKind_x3f___closed__1;
return x_14;
}
}
}
else
{
lean_object* x_15;
x_15 = lean_box(0);
lean_inc(x_4);
x_15 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_15, 0, x_4);
return x_15;
}
}
}
else
{
lean_object* x_16;
@ -791,6 +784,13 @@ x_16 = lean_box(0);
return x_16;
}
}
else
{
lean_object* x_17;
x_17 = lean_box(0);
return x_17;
}
}
}
lean_object* l_Lean_Elab_Term_Quotation_antiquotKind_x3f___boxed(lean_object* x_1) {
_start:
@ -815,7 +815,7 @@ return x_3;
else
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = lean_unsigned_to_nat(5u);
x_4 = lean_unsigned_to_nat(4u);
x_5 = l_Lean_Syntax_getArg(x_1, x_4);
x_6 = l_Lean_Syntax_getOptional_x3f(x_5);
lean_dec(x_5);
@ -4029,7 +4029,7 @@ lean_ctor_set(x_48, 0, x_47);
lean_ctor_set(x_48, 1, x_46);
x_49 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_50 = lean_array_push(x_49, x_48);
x_51 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_51 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_52 = lean_array_push(x_50, x_51);
x_53 = l_Lean_Elab_Term_Quotation_stxQuot_expand___closed__22;
lean_inc(x_11);
@ -4214,7 +4214,7 @@ lean_ctor_set(x_149, 0, x_148);
lean_ctor_set(x_149, 1, x_147);
x_150 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_151 = lean_array_push(x_150, x_149);
x_152 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_152 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_153 = lean_array_push(x_151, x_152);
x_154 = l_Lean_Elab_Term_Quotation_stxQuot_expand___closed__22;
lean_inc(x_11);
@ -10983,7 +10983,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Lean_Elab_Quotation_8__letBindRhss___main___closed__12;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -11001,7 +11001,7 @@ lean_object* _init_l___private_Lean_Elab_Quotation_8__letBindRhss___main___close
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Parser_darrow___elambda__1___closed__1;
x_1 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2 = l_Lean_mkAtom(x_1);
return x_2;
}
@ -15330,7 +15330,7 @@ lean_ctor_set(x_335, 0, x_332);
lean_ctor_set(x_335, 1, x_334);
x_336 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_337 = lean_array_push(x_336, x_335);
x_338 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_338 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_339 = lean_array_push(x_337, x_338);
x_340 = lean_array_push(x_339, x_298);
x_341 = lean_alloc_ctor(1, 2, 0);
@ -15685,7 +15685,7 @@ lean_ctor_set(x_437, 0, x_434);
lean_ctor_set(x_437, 1, x_436);
x_438 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_439 = lean_array_push(x_438, x_437);
x_440 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_440 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_441 = lean_array_push(x_439, x_440);
x_442 = lean_array_push(x_441, x_298);
x_443 = lean_alloc_ctor(1, 2, 0);
@ -16012,7 +16012,7 @@ lean_ctor_set(x_534, 0, x_531);
lean_ctor_set(x_534, 1, x_533);
x_535 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_536 = lean_array_push(x_535, x_534);
x_537 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_537 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_538 = lean_array_push(x_536, x_537);
x_539 = lean_array_push(x_538, x_298);
x_540 = lean_alloc_ctor(1, 2, 0);
@ -17634,7 +17634,7 @@ lean_ctor_set(x_997, 0, x_994);
lean_ctor_set(x_997, 1, x_996);
x_998 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_999 = lean_array_push(x_998, x_997);
x_1000 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1000 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1001 = lean_array_push(x_999, x_1000);
x_1002 = lean_array_push(x_1001, x_960);
x_1003 = lean_alloc_ctor(1, 2, 0);
@ -17851,7 +17851,7 @@ lean_ctor_set(x_1060, 0, x_1057);
lean_ctor_set(x_1060, 1, x_1059);
x_1061 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1062 = lean_array_push(x_1061, x_1060);
x_1063 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1063 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1064 = lean_array_push(x_1062, x_1063);
x_1065 = lean_array_push(x_1064, x_960);
x_1066 = lean_alloc_ctor(1, 2, 0);
@ -18038,7 +18038,7 @@ lean_ctor_set(x_1118, 0, x_1115);
lean_ctor_set(x_1118, 1, x_1117);
x_1119 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1120 = lean_array_push(x_1119, x_1118);
x_1121 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1121 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1122 = lean_array_push(x_1120, x_1121);
x_1123 = lean_array_push(x_1122, x_960);
x_1124 = lean_alloc_ctor(1, 2, 0);
@ -19495,7 +19495,7 @@ lean_ctor_set(x_1510, 0, x_1507);
lean_ctor_set(x_1510, 1, x_1509);
x_1511 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1512 = lean_array_push(x_1511, x_1510);
x_1513 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1513 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1514 = lean_array_push(x_1512, x_1513);
x_1515 = lean_array_push(x_1514, x_1473);
x_1516 = lean_alloc_ctor(1, 2, 0);
@ -19712,7 +19712,7 @@ lean_ctor_set(x_1573, 0, x_1570);
lean_ctor_set(x_1573, 1, x_1572);
x_1574 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1575 = lean_array_push(x_1574, x_1573);
x_1576 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1576 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1577 = lean_array_push(x_1575, x_1576);
x_1578 = lean_array_push(x_1577, x_1473);
x_1579 = lean_alloc_ctor(1, 2, 0);
@ -19899,7 +19899,7 @@ lean_ctor_set(x_1631, 0, x_1628);
lean_ctor_set(x_1631, 1, x_1630);
x_1632 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1633 = lean_array_push(x_1632, x_1631);
x_1634 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1634 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1635 = lean_array_push(x_1633, x_1634);
x_1636 = lean_array_push(x_1635, x_1473);
x_1637 = lean_alloc_ctor(1, 2, 0);
@ -21389,7 +21389,7 @@ lean_ctor_set(x_2029, 0, x_2026);
lean_ctor_set(x_2029, 1, x_2028);
x_2030 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_2031 = lean_array_push(x_2030, x_2029);
x_2032 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2032 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_2033 = lean_array_push(x_2031, x_2032);
x_2034 = lean_array_push(x_2033, x_1992);
x_2035 = lean_alloc_ctor(1, 2, 0);
@ -21606,7 +21606,7 @@ lean_ctor_set(x_2092, 0, x_2089);
lean_ctor_set(x_2092, 1, x_2091);
x_2093 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_2094 = lean_array_push(x_2093, x_2092);
x_2095 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2095 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_2096 = lean_array_push(x_2094, x_2095);
x_2097 = lean_array_push(x_2096, x_1992);
x_2098 = lean_alloc_ctor(1, 2, 0);
@ -21793,7 +21793,7 @@ lean_ctor_set(x_2150, 0, x_2147);
lean_ctor_set(x_2150, 1, x_2149);
x_2151 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_2152 = lean_array_push(x_2151, x_2150);
x_2153 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2153 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_2154 = lean_array_push(x_2152, x_2153);
x_2155 = lean_array_push(x_2154, x_1992);
x_2156 = lean_alloc_ctor(1, 2, 0);
@ -23315,7 +23315,7 @@ lean_ctor_set(x_2555, 0, x_2552);
lean_ctor_set(x_2555, 1, x_2554);
x_2556 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_2557 = lean_array_push(x_2556, x_2555);
x_2558 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2558 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_2559 = lean_array_push(x_2557, x_2558);
x_2560 = lean_array_push(x_2559, x_2518);
x_2561 = lean_alloc_ctor(1, 2, 0);
@ -23532,7 +23532,7 @@ lean_ctor_set(x_2618, 0, x_2615);
lean_ctor_set(x_2618, 1, x_2617);
x_2619 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_2620 = lean_array_push(x_2619, x_2618);
x_2621 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2621 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_2622 = lean_array_push(x_2620, x_2621);
x_2623 = lean_array_push(x_2622, x_2518);
x_2624 = lean_alloc_ctor(1, 2, 0);
@ -23719,7 +23719,7 @@ lean_ctor_set(x_2676, 0, x_2673);
lean_ctor_set(x_2676, 1, x_2675);
x_2677 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_2678 = lean_array_push(x_2677, x_2676);
x_2679 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2679 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_2680 = lean_array_push(x_2678, x_2679);
x_2681 = lean_array_push(x_2680, x_2518);
x_2682 = lean_alloc_ctor(1, 2, 0);

View file

@ -159,7 +159,7 @@ extern lean_object* l_Lean_mkAppStx___closed__8;
lean_object* l___private_Lean_Elab_StructInst_21__getForallBody(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_StructInst_Source_inhabited;
lean_object* l_Lean_fmt___at_Lean_Level_LevelToFormat_toResult___main___spec__1(lean_object*);
extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__7;
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
lean_object* l___private_Lean_Elab_Term_3__fromMetaState(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_StructInst_20__mkCtorHeaderAux___main___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
@ -256,7 +256,6 @@ lean_object* l___private_Lean_Elab_StructInst_7__mkStructView(lean_object*, lean
lean_object* l___private_Lean_Elab_StructInst_4__elabModifyOp___closed__24;
lean_object* l___private_Lean_Elab_StructInst_1__expandNonAtomicExplicitSource___closed__4;
lean_object* l_Lean_Elab_Term_StructInst_DefaultFields_reduceProjOf_x3f(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__3;
lean_object* l_Lean_Elab_Term_logTrace(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_List_mapM___main___at___private_Lean_Elab_StructInst_23__mkCtorHeader___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Std_AssocList_contains___main___at___private_Lean_Elab_StructInst_12__mkFieldMap___spec__4___boxed(lean_object*, lean_object*);
@ -499,6 +498,7 @@ lean_object* l_Lean_Elab_Term_StructInst_Field_inhabited___closed__1;
lean_object* l_List_toArrayAux___main___rarg(lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_StructInst_25__elabStructInstAux___closed__3;
lean_object* l___private_Lean_Elab_StructInst_6__toFieldLHS___closed__1;
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__7;
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_arrayToExpr___rarg___closed__2;
@ -2406,7 +2406,7 @@ lean_ctor_set(x_95, 0, x_94);
lean_ctor_set(x_95, 1, x_93);
x_96 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_97 = lean_array_push(x_96, x_95);
x_98 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_98 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_99 = lean_array_push(x_97, x_98);
x_100 = lean_array_push(x_99, x_54);
x_101 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -2640,7 +2640,7 @@ lean_ctor_set(x_236, 0, x_235);
lean_ctor_set(x_236, 1, x_234);
x_237 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_238 = lean_array_push(x_237, x_236);
x_239 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_239 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_240 = lean_array_push(x_238, x_239);
x_241 = lean_array_push(x_240, x_185);
x_242 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -8362,7 +8362,7 @@ lean_object* _init_l_Lean_Elab_Term_StructInst_formatStruct___main___closed__5()
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Parser_Term_match___elambda__1___closed__7;
x_1 = l_Lean_Parser_Term_structInst___elambda__1___closed__7;
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;

View file

@ -128,7 +128,6 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__19;
lean_object* l_Lean_Elab_Command_expandElab___closed__4;
lean_object* l_Lean_mkIdentFrom(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_checkLeftRec___closed__9;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
lean_object* l_Lean_Elab_Command_elabSyntax___closed__16;
lean_object* l___private_Init_LeanInit_14__mapSepElemsMAux___main___at_Lean_Elab_Command_elabMacroRulesAux___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__118;
@ -188,6 +187,7 @@ extern lean_object* l_Lean_mkAppStx___closed__8;
lean_object* l_Lean_Elab_Command_elabMixfix___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabMacroRulesAux___closed__37;
lean_object* l___private_Lean_Elab_Syntax_6__declareSyntaxCatQuotParser___closed__49;
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__5;
lean_object* l___private_Lean_Elab_Syntax_3__withNotFirst(lean_object*);
@ -288,7 +288,6 @@ lean_object* l___private_Lean_Elab_Syntax_9__expandNotationAux(lean_object*, lea
lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__83;
lean_object* l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__2;
extern lean_object* l_Lean_Parser_Command_def___elambda__1___closed__2;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
lean_object* l_Lean_Macro_addMacroScope(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_regTermParserAttribute___closed__1;
extern lean_object* l_Lean_Parser_Command_declValSimple___elambda__1___closed__2;
@ -296,6 +295,7 @@ lean_object* l___private_Lean_Elab_Syntax_10__regTraceClasses(lean_object*);
lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__129;
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_numLitKind___closed__1;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
extern lean_object* l_Lean_Parser_Command_def___elambda__1___closed__1;
extern lean_object* l_Lean_strLitKind___closed__1;
lean_object* l_Array_iterateMAux___main___at___private_Lean_Elab_Syntax_1__mkParserSeq___spec__1___closed__3;
@ -309,6 +309,7 @@ lean_object* l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__1;
lean_object* l_Lean_Elab_Command_elabMacroRules___closed__1;
lean_object* l_Lean_Elab_Command_strLitToPattern___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_expandElab___closed__20;
extern lean_object* l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
lean_object* l_List_filterAux___main___at_Lean_Elab_Term_toParserDescrAux___main___spec__1(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabSyntaxAbbrev___closed__5;
lean_object* l___private_Lean_Elab_Syntax_6__declareSyntaxCatQuotParser___closed__62;
@ -328,7 +329,6 @@ extern lean_object* l_Lean_Parser_Command_attrInstance___elambda__1___closed__2;
lean_object* l_Lean_Elab_Command_expandElab___closed__42;
lean_object* l___private_Lean_Elab_Command_1__ioErrorToMessage(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_Syntax_6__declareSyntaxCatQuotParser___closed__33;
extern lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__3;
lean_object* l_Lean_Elab_Command_elabMacroRules(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__55;
lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__37;
@ -13038,7 +13038,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Command_elabMacroRulesAux___closed__18;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -13385,17 +13385,17 @@ lean_ctor_set(x_87, 0, x_25);
lean_ctor_set(x_87, 1, x_86);
x_88 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_89 = lean_array_push(x_88, x_87);
x_90 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_90 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_91 = lean_array_push(x_89, x_90);
x_92 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_93 = lean_array_push(x_92, x_85);
x_94 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_94 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_95 = lean_array_push(x_93, x_94);
x_96 = lean_array_push(x_95, x_42);
x_97 = lean_unsigned_to_nat(0u);
x_98 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_7, x_7, x_97, x_21);
lean_dec(x_7);
x_99 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_99 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_100 = lean_array_push(x_98, x_99);
x_101 = l_Lean_Elab_Command_elabMacroRulesAux___closed__23;
lean_inc(x_10);
@ -13610,17 +13610,17 @@ lean_ctor_set(x_219, 0, x_157);
lean_ctor_set(x_219, 1, x_218);
x_220 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_221 = lean_array_push(x_220, x_219);
x_222 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_222 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_223 = lean_array_push(x_221, x_222);
x_224 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_225 = lean_array_push(x_224, x_217);
x_226 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_226 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_227 = lean_array_push(x_225, x_226);
x_228 = lean_array_push(x_227, x_174);
x_229 = lean_unsigned_to_nat(0u);
x_230 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_7, x_7, x_229, x_153);
lean_dec(x_7);
x_231 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_231 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_232 = lean_array_push(x_230, x_231);
x_233 = l_Lean_Elab_Command_elabMacroRulesAux___closed__23;
lean_inc(x_10);
@ -16066,7 +16066,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Lean_Elab_Syntax_9__expandNotationAux___closed__4;
x_2 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_2 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -16076,7 +16076,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_Command_elabNoKindMacroRulesAux___closed__3;
x_2 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_2 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_3 = lean_array_push(x_1, x_2);
return x_3;
}
@ -16177,7 +16177,7 @@ x_56 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_56, 0, x_35);
lean_ctor_set(x_56, 1, x_55);
x_57 = lean_array_push(x_39, x_56);
x_58 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_58 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_59 = lean_array_push(x_57, x_58);
x_60 = lean_array_push(x_49, x_23);
x_61 = lean_array_push(x_60, x_51);
@ -16262,7 +16262,7 @@ x_108 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_108, 0, x_81);
lean_ctor_set(x_108, 1, x_107);
x_109 = lean_array_push(x_79, x_108);
x_110 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_110 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_111 = lean_array_push(x_109, x_110);
x_112 = lean_array_push(x_101, x_23);
x_113 = lean_array_push(x_112, x_103);
@ -16346,7 +16346,7 @@ x_155 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_155, 0, x_134);
lean_ctor_set(x_155, 1, x_154);
x_156 = lean_array_push(x_138, x_155);
x_157 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_157 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_158 = lean_array_push(x_156, x_157);
x_159 = lean_array_push(x_148, x_23);
x_160 = lean_array_push(x_159, x_150);
@ -16433,7 +16433,7 @@ x_208 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_208, 0, x_181);
lean_ctor_set(x_208, 1, x_207);
x_209 = lean_array_push(x_179, x_208);
x_210 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_210 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_211 = lean_array_push(x_209, x_210);
x_212 = lean_array_push(x_201, x_23);
x_213 = lean_array_push(x_212, x_203);
@ -17260,7 +17260,7 @@ x_77 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_77, 0, x_50);
lean_ctor_set(x_77, 1, x_76);
x_78 = lean_array_push(x_48, x_77);
x_79 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_79 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_80 = lean_array_push(x_78, x_79);
x_81 = lean_array_push(x_70, x_47);
x_82 = lean_array_push(x_81, x_72);
@ -17339,7 +17339,7 @@ x_126 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_126, 0, x_99);
lean_ctor_set(x_126, 1, x_125);
x_127 = lean_array_push(x_97, x_126);
x_128 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_128 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_129 = lean_array_push(x_127, x_128);
x_130 = lean_array_push(x_129, x_96);
x_131 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -17434,7 +17434,7 @@ x_180 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_180, 0, x_153);
lean_ctor_set(x_180, 1, x_179);
x_181 = lean_array_push(x_151, x_180);
x_182 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_182 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_183 = lean_array_push(x_181, x_182);
x_184 = lean_array_push(x_173, x_150);
x_185 = lean_array_push(x_184, x_175);
@ -17515,7 +17515,7 @@ x_230 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_230, 0, x_203);
lean_ctor_set(x_230, 1, x_229);
x_231 = lean_array_push(x_201, x_230);
x_232 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_232 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_233 = lean_array_push(x_231, x_232);
x_234 = lean_array_push(x_233, x_200);
x_235 = l_Lean_Parser_Term_matchAlt___closed__2;
@ -18828,13 +18828,13 @@ lean_ctor_set(x_153, 0, x_67);
lean_ctor_set(x_153, 1, x_152);
x_154 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_155 = lean_array_push(x_154, x_153);
x_156 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_156 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_157 = lean_array_push(x_155, x_156);
x_158 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_159 = lean_array_push(x_158, x_151);
x_160 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_160 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_161 = lean_array_push(x_159, x_160);
x_162 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_162 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_163 = lean_array_push(x_161, x_162);
x_164 = l_Lean_Elab_Command_expandElab___closed__17;
x_165 = lean_array_push(x_164, x_47);
@ -18856,7 +18856,7 @@ x_176 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_176, 0, x_175);
lean_ctor_set(x_176, 1, x_174);
x_177 = lean_array_push(x_65, x_176);
x_178 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_178 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_179 = lean_array_push(x_177, x_178);
x_180 = l_Lean_Elab_Command_expandElab___closed__22;
x_181 = l_Lean_addMacroScope(x_64, x_180, x_63);
@ -19079,13 +19079,13 @@ lean_ctor_set(x_302, 0, x_215);
lean_ctor_set(x_302, 1, x_301);
x_303 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_304 = lean_array_push(x_303, x_302);
x_305 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_305 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_306 = lean_array_push(x_304, x_305);
x_307 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_308 = lean_array_push(x_307, x_300);
x_309 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_309 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_310 = lean_array_push(x_308, x_309);
x_311 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_311 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_312 = lean_array_push(x_310, x_311);
x_313 = l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__8;
x_314 = lean_array_push(x_313, x_47);
@ -19107,7 +19107,7 @@ x_325 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_325, 0, x_324);
lean_ctor_set(x_325, 1, x_323);
x_326 = lean_array_push(x_213, x_325);
x_327 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_327 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_328 = lean_array_push(x_326, x_327);
x_329 = l_Lean_Elab_Command_expandElab___closed__35;
x_330 = l_Lean_addMacroScope(x_212, x_329, x_211);
@ -19332,13 +19332,13 @@ lean_ctor_set(x_453, 0, x_364);
lean_ctor_set(x_453, 1, x_452);
x_454 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_455 = lean_array_push(x_454, x_453);
x_456 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_456 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_457 = lean_array_push(x_455, x_456);
x_458 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_459 = lean_array_push(x_458, x_449);
x_460 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_460 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_461 = lean_array_push(x_459, x_460);
x_462 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_462 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_463 = lean_array_push(x_461, x_462);
x_464 = l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__8;
x_465 = lean_array_push(x_464, x_47);
@ -19360,7 +19360,7 @@ x_476 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_476, 0, x_475);
lean_ctor_set(x_476, 1, x_474);
x_477 = lean_array_push(x_362, x_476);
x_478 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_478 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_479 = lean_array_push(x_477, x_478);
x_480 = l_Lean_Elab_Command_expandElab___closed__48;
x_481 = l_Lean_addMacroScope(x_361, x_480, x_360);
@ -19628,13 +19628,13 @@ lean_ctor_set(x_620, 0, x_525);
lean_ctor_set(x_620, 1, x_619);
x_621 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_622 = lean_array_push(x_621, x_620);
x_623 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_623 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_624 = lean_array_push(x_622, x_623);
x_625 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_626 = lean_array_push(x_625, x_610);
x_627 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_627 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_628 = lean_array_push(x_626, x_627);
x_629 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_629 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_630 = lean_array_push(x_628, x_629);
x_631 = l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__8;
x_632 = lean_array_push(x_631, x_47);
@ -19693,7 +19693,7 @@ x_664 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_664, 0, x_663);
lean_ctor_set(x_664, 1, x_662);
x_665 = lean_array_push(x_523, x_664);
x_666 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_666 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_667 = lean_array_push(x_665, x_666);
x_668 = l_Lean_Elab_Command_expandElab___closed__48;
x_669 = l_Lean_addMacroScope(x_522, x_668, x_521);
@ -19968,13 +19968,13 @@ lean_ctor_set(x_808, 0, x_722);
lean_ctor_set(x_808, 1, x_807);
x_809 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_810 = lean_array_push(x_809, x_808);
x_811 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_811 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_812 = lean_array_push(x_810, x_811);
x_813 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_814 = lean_array_push(x_813, x_806);
x_815 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_815 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_816 = lean_array_push(x_814, x_815);
x_817 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_817 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_818 = lean_array_push(x_816, x_817);
x_819 = l_Lean_Elab_Command_expandElab___closed__17;
x_820 = lean_array_push(x_819, x_702);
@ -19996,7 +19996,7 @@ x_831 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_831, 0, x_830);
lean_ctor_set(x_831, 1, x_829);
x_832 = lean_array_push(x_720, x_831);
x_833 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_833 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_834 = lean_array_push(x_832, x_833);
x_835 = l_Lean_Elab_Command_expandElab___closed__22;
x_836 = l_Lean_addMacroScope(x_719, x_835, x_718);
@ -20221,13 +20221,13 @@ lean_ctor_set(x_958, 0, x_871);
lean_ctor_set(x_958, 1, x_957);
x_959 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_960 = lean_array_push(x_959, x_958);
x_961 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_961 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_962 = lean_array_push(x_960, x_961);
x_963 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_964 = lean_array_push(x_963, x_956);
x_965 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_965 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_966 = lean_array_push(x_964, x_965);
x_967 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_967 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_968 = lean_array_push(x_966, x_967);
x_969 = l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__8;
x_970 = lean_array_push(x_969, x_702);
@ -20249,7 +20249,7 @@ x_981 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_981, 0, x_980);
lean_ctor_set(x_981, 1, x_979);
x_982 = lean_array_push(x_869, x_981);
x_983 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_983 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_984 = lean_array_push(x_982, x_983);
x_985 = l_Lean_Elab_Command_expandElab___closed__35;
x_986 = l_Lean_addMacroScope(x_868, x_985, x_867);
@ -20476,13 +20476,13 @@ lean_ctor_set(x_1110, 0, x_1021);
lean_ctor_set(x_1110, 1, x_1109);
x_1111 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1112 = lean_array_push(x_1111, x_1110);
x_1113 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1113 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1114 = lean_array_push(x_1112, x_1113);
x_1115 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_1116 = lean_array_push(x_1115, x_1106);
x_1117 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_1117 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_1118 = lean_array_push(x_1116, x_1117);
x_1119 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_1119 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_1120 = lean_array_push(x_1118, x_1119);
x_1121 = l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__8;
x_1122 = lean_array_push(x_1121, x_702);
@ -20504,7 +20504,7 @@ x_1133 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_1133, 0, x_1132);
lean_ctor_set(x_1133, 1, x_1131);
x_1134 = lean_array_push(x_1019, x_1133);
x_1135 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_1135 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_1136 = lean_array_push(x_1134, x_1135);
x_1137 = l_Lean_Elab_Command_expandElab___closed__48;
x_1138 = l_Lean_addMacroScope(x_1018, x_1137, x_1017);
@ -20773,13 +20773,13 @@ lean_ctor_set(x_1278, 0, x_1183);
lean_ctor_set(x_1278, 1, x_1277);
x_1279 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_1280 = lean_array_push(x_1279, x_1278);
x_1281 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_1281 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_1282 = lean_array_push(x_1280, x_1281);
x_1283 = l_Lean_Elab_Command_elabMacroRulesAux___closed__17;
x_1284 = lean_array_push(x_1283, x_1268);
x_1285 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__3;
x_1285 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_1286 = lean_array_push(x_1284, x_1285);
x_1287 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__6;
x_1287 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__7;
x_1288 = lean_array_push(x_1286, x_1287);
x_1289 = l_Lean_Elab_Command_elabMacroRulesAux___lambda__1___closed__8;
x_1290 = lean_array_push(x_1289, x_702);
@ -20838,7 +20838,7 @@ x_1322 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_1322, 0, x_1321);
lean_ctor_set(x_1322, 1, x_1320);
x_1323 = lean_array_push(x_1181, x_1322);
x_1324 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__4;
x_1324 = l___private_Lean_Elab_Binders_11__expandFunBindersAux___main___closed__5;
x_1325 = lean_array_push(x_1323, x_1324);
x_1326 = l_Lean_Elab_Command_expandElab___closed__48;
x_1327 = l_Lean_addMacroScope(x_1180, x_1326, x_1179);

View file

@ -41,6 +41,7 @@ lean_object* l_Lean_Elab_Tactic_mkTacticAttribute(lean_object*);
lean_object* l_Lean_Elab_Tactic_evalSkip___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_getMCtx___rarg(lean_object*);
lean_object* l_Lean_Elab_Tactic_monadQuotation___closed__4;
lean_object* l_Lean_Meta_introN(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Tactic_seq___elambda__1___closed__2;
extern lean_object* l_Lean_MessageData_ofList___closed__3;
lean_object* lean_array_uget(lean_object*, size_t);
@ -344,7 +345,6 @@ lean_object* l_Lean_Elab_Tactic_evalFailIfSuccess(lean_object*, lean_object*, le
lean_object* l_Lean_Elab_Term_whnf___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_unfoldDefinition_x3f___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_evalChoiceAux(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_withFreshMacroScope___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_throwError(lean_object*);
lean_object* l_Lean_Syntax_getPos(lean_object*);
@ -13398,7 +13398,7 @@ x_9 = x_8;
x_10 = l_Array_toList___rarg(x_9);
lean_dec(x_9);
x_11 = 1;
x_12 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_11, x_2, x_5, x_10, x_3, x_4);
x_12 = l_Lean_Meta_introN(x_2, x_5, x_10, x_11, x_3, x_4);
if (lean_obj_tag(x_12) == 0)
{
uint8_t x_13;
@ -13486,7 +13486,7 @@ x_10 = l___private_Lean_Elab_Tactic_Basic_3__getIntrosSize___main(x_8);
lean_dec(x_8);
x_11 = lean_box(0);
x_12 = 1;
x_13 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_12, x_1, x_10, x_11, x_2, x_9);
x_13 = l_Lean_Meta_introN(x_1, x_10, x_11, x_12, x_2, x_9);
if (lean_obj_tag(x_13) == 0)
{
uint8_t x_14;

View file

@ -17,6 +17,7 @@ lean_object* l___private_Lean_Elab_Tactic_Generalize_5__evalGeneralizeFallback__
extern lean_object* l_Lean_Expr_eq_x3f___closed__2;
lean_object* l_Lean_Expr_mvarId_x21(lean_object*);
lean_object* l_Lean_Elab_Tactic_withMVarContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_introN(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_Tactic_Generalize_1__getAuxHypothesisName___boxed(lean_object*);
lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_evalGeneralizeAux___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -45,12 +46,11 @@ extern lean_object* l_Lean_Elab_Tactic_tacticElabAttribute;
extern lean_object* l_Lean_Meta_mkEqRefl___closed__2;
lean_object* l_Lean_Elab_Tactic_evalGeneralizeAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_assertExt___lambda__1___closed__1;
lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Tactic_evalGeneralize(lean_object*);
lean_object* l_Lean_Elab_Tactic_save(lean_object*);
lean_object* l_Lean_Meta_generalize___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_commitWhen___at___private_Lean_Meta_ExprDefEq_1__isDefEqEta___spec__1___closed__1;
lean_object* l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getLevel(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkForall(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_elabTerm(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
@ -182,13 +182,13 @@ lean_dec(x_17);
x_26 = l_Lean_Meta_assignExprMVar(x_1, x_24, x_4, x_18);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_27; uint8_t x_28; lean_object* x_29; lean_object* x_30;
lean_object* x_27; lean_object* x_28; uint8_t x_29; lean_object* x_30;
x_27 = lean_ctor_get(x_26, 1);
lean_inc(x_27);
lean_dec(x_26);
x_28 = 0;
x_29 = lean_unsigned_to_nat(2u);
x_30 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_28, x_25, x_29, x_19, x_4, x_27);
x_28 = lean_unsigned_to_nat(2u);
x_29 = 0;
x_30 = l_Lean_Meta_introN(x_25, x_28, x_19, x_29, x_4, x_27);
lean_dec(x_4);
if (lean_obj_tag(x_30) == 0)
{
@ -391,11 +391,13 @@ return x_2;
lean_object* _init_l___private_Lean_Elab_Tactic_Generalize_4__evalGeneralizeWithEq___lambda__1___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l___private_Lean_Elab_Tactic_Generalize_4__evalGeneralizeWithEq___lambda__1___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l___private_Lean_Elab_Tactic_Generalize_4__evalGeneralizeWithEq___lambda__1___closed__3;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* l___private_Lean_Elab_Tactic_Generalize_4__evalGeneralizeWithEq___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) {
@ -462,7 +464,7 @@ lean_ctor_set(x_24, 0, x_21);
lean_ctor_set(x_24, 1, x_23);
x_25 = l_Lean_Expr_eq_x3f___closed__2;
x_26 = l_Lean_mkConst(x_25, x_24);
x_27 = l_Lean_Meta_commitWhen___at___private_Lean_Meta_ExprDefEq_1__isDefEqEta___spec__1___closed__1;
x_27 = l_Lean_Meta_assertExt___lambda__1___closed__1;
lean_inc(x_1);
lean_inc(x_18);
x_28 = l_Lean_mkApp3(x_26, x_18, x_1, x_27);
@ -736,7 +738,7 @@ lean_ctor_set(x_15, 0, x_9);
lean_ctor_set(x_15, 1, x_14);
x_16 = l_Lean_Expr_eq_x3f___closed__2;
x_17 = l_Lean_mkConst(x_16, x_15);
x_18 = l_Lean_Meta_commitWhen___at___private_Lean_Meta_ExprDefEq_1__isDefEqEta___spec__1___closed__1;
x_18 = l_Lean_Meta_assertExt___lambda__1___closed__1;
lean_inc(x_2);
lean_inc(x_5);
x_19 = l_Lean_mkApp3(x_17, x_5, x_2, x_18);

View file

@ -150,7 +150,7 @@ lean_object* l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__
uint8_t l_List_foldr___main___at___private_Lean_Elab_Tactic_Induction_11__checkAltCtorNames___spec__1(lean_object*, uint8_t, lean_object*);
lean_object* l___private_Lean_Elab_Tactic_Induction_17__checkCasesResultAux___main___closed__9;
uint8_t l_Lean_Syntax_isMissing(lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_Tactic_Induction_13__getRecInfoDefault(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_evalGeneralizeAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Array_contains___at___private_Lean_Class_1__checkOutParam___main___spec__1(lean_object*, lean_object*);
@ -892,87 +892,89 @@ return x_14;
}
else
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18;
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19;
lean_dec(x_3);
x_15 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__1;
x_16 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__4;
x_17 = l_Lean_Meta_throwTacticEx___rarg(x_15, x_2, x_16, x_4, x_5);
x_18 = !lean_is_exclusive(x_17);
if (x_18 == 0)
x_17 = lean_box(0);
x_18 = l_Lean_Meta_throwTacticEx___rarg(x_15, x_2, x_16, x_17, x_4, x_5);
x_19 = !lean_is_exclusive(x_18);
if (x_19 == 0)
{
return x_17;
return x_18;
}
else
{
lean_object* x_19; lean_object* x_20; lean_object* x_21;
x_19 = lean_ctor_get(x_17, 0);
x_20 = lean_ctor_get(x_17, 1);
lean_object* x_20; lean_object* x_21; lean_object* x_22;
x_20 = lean_ctor_get(x_18, 0);
x_21 = lean_ctor_get(x_18, 1);
lean_inc(x_21);
lean_inc(x_20);
lean_inc(x_19);
lean_dec(x_17);
x_21 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set(x_21, 1, x_20);
return x_21;
lean_dec(x_18);
x_22 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_22, 0, x_20);
lean_ctor_set(x_22, 1, x_21);
return x_22;
}
}
}
else
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; uint8_t x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29;
x_22 = lean_ctor_get(x_3, 0);
x_23 = lean_ctor_get(x_3, 1);
lean_object* x_23; lean_object* x_24; lean_object* x_25; uint8_t x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30;
x_23 = lean_ctor_get(x_3, 0);
x_24 = lean_ctor_get(x_3, 1);
lean_inc(x_24);
lean_inc(x_23);
lean_inc(x_22);
lean_dec(x_3);
x_24 = l_Lean_Expr_fvarId_x21(x_1);
x_25 = l_Array_contains___at___private_Lean_Class_1__checkOutParam___main___spec__1(x_22, x_24);
lean_dec(x_24);
x_26 = lean_array_get_size(x_22);
lean_dec(x_22);
x_27 = lean_box(0);
x_28 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_28, 0, x_23);
lean_ctor_set(x_28, 1, x_27);
x_29 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_29, 0, x_26);
x_25 = l_Lean_Expr_fvarId_x21(x_1);
x_26 = l_Array_contains___at___private_Lean_Class_1__checkOutParam___main___spec__1(x_23, x_25);
lean_dec(x_25);
x_27 = lean_array_get_size(x_23);
lean_dec(x_23);
x_28 = lean_box(0);
x_29 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_29, 0, x_24);
lean_ctor_set(x_29, 1, x_28);
if (x_25 == 0)
{
lean_object* x_30;
lean_dec(x_2);
x_30 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_30, 0, x_29);
lean_ctor_set(x_30, 1, x_5);
return x_30;
lean_ctor_set(x_30, 0, x_27);
lean_ctor_set(x_30, 1, x_29);
if (x_26 == 0)
{
lean_object* x_31;
lean_dec(x_2);
x_31 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_31, 0, x_30);
lean_ctor_set(x_31, 1, x_5);
return x_31;
}
else
{
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_dec(x_29);
x_31 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__1;
x_32 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__4;
x_33 = l_Lean_Meta_throwTacticEx___rarg(x_31, x_2, x_32, x_4, x_5);
x_34 = lean_ctor_get(x_33, 0);
lean_inc(x_34);
x_35 = lean_ctor_get(x_33, 1);
lean_inc(x_35);
if (lean_is_exclusive(x_33)) {
lean_ctor_release(x_33, 0);
lean_ctor_release(x_33, 1);
x_36 = x_33;
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_dec(x_30);
x_32 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__1;
x_33 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__4;
x_34 = lean_box(0);
x_35 = l_Lean_Meta_throwTacticEx___rarg(x_32, x_2, x_33, x_34, x_4, x_5);
x_36 = lean_ctor_get(x_35, 0);
lean_inc(x_36);
x_37 = lean_ctor_get(x_35, 1);
lean_inc(x_37);
if (lean_is_exclusive(x_35)) {
lean_ctor_release(x_35, 0);
lean_ctor_release(x_35, 1);
x_38 = x_35;
} else {
lean_dec_ref(x_33);
x_36 = lean_box(0);
lean_dec_ref(x_35);
x_38 = lean_box(0);
}
if (lean_is_scalar(x_36)) {
x_37 = lean_alloc_ctor(1, 2, 0);
if (lean_is_scalar(x_38)) {
x_39 = lean_alloc_ctor(1, 2, 0);
} else {
x_37 = x_36;
x_39 = x_38;
}
lean_ctor_set(x_37, 0, x_34);
lean_ctor_set(x_37, 1, x_35);
return x_37;
lean_ctor_set(x_39, 0, x_36);
lean_ctor_set(x_39, 1, x_37);
return x_39;
}
}
}
@ -1585,68 +1587,68 @@ uint8_t x_6;
x_6 = !lean_is_exclusive(x_5);
if (x_6 == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_17;
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_18;
x_7 = lean_ctor_get(x_5, 0);
x_8 = lean_ctor_get(x_5, 1);
x_17 = l_Lean_Expr_getAppFn___main(x_7);
if (lean_obj_tag(x_17) == 4)
x_18 = l_Lean_Expr_getAppFn___main(x_7);
if (lean_obj_tag(x_18) == 4)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_18 = lean_ctor_get(x_17, 0);
lean_inc(x_18);
lean_dec(x_17);
x_19 = lean_ctor_get(x_8, 0);
lean_object* x_19; lean_object* x_20; lean_object* x_21;
x_19 = lean_ctor_get(x_18, 0);
lean_inc(x_19);
x_20 = lean_environment_find(x_19, x_18);
if (lean_obj_tag(x_20) == 0)
lean_dec(x_18);
x_20 = lean_ctor_get(x_8, 0);
lean_inc(x_20);
x_21 = lean_environment_find(x_20, x_19);
if (lean_obj_tag(x_21) == 0)
{
lean_object* x_21;
lean_object* x_22;
lean_free_object(x_5);
x_21 = lean_box(0);
x_9 = x_21;
goto block_16;
x_22 = lean_box(0);
x_9 = x_22;
goto block_17;
}
else
{
lean_object* x_22;
x_22 = lean_ctor_get(x_20, 0);
lean_inc(x_22);
lean_dec(x_20);
if (lean_obj_tag(x_22) == 5)
{
lean_object* x_23;
x_23 = lean_ctor_get(x_21, 0);
lean_inc(x_23);
lean_dec(x_21);
if (lean_obj_tag(x_23) == 5)
{
lean_object* x_24;
lean_dec(x_7);
lean_dec(x_3);
lean_dec(x_1);
x_23 = lean_ctor_get(x_22, 0);
lean_inc(x_23);
lean_dec(x_22);
lean_ctor_set(x_5, 0, x_23);
x_24 = lean_ctor_get(x_23, 0);
lean_inc(x_24);
lean_dec(x_23);
lean_ctor_set(x_5, 0, x_24);
return x_5;
}
else
{
lean_object* x_24;
lean_dec(x_22);
lean_object* x_25;
lean_dec(x_23);
lean_free_object(x_5);
x_24 = lean_box(0);
x_9 = x_24;
goto block_16;
x_25 = lean_box(0);
x_9 = x_25;
goto block_17;
}
}
}
else
{
lean_object* x_25;
lean_dec(x_17);
lean_object* x_26;
lean_dec(x_18);
lean_free_object(x_5);
x_25 = lean_box(0);
x_9 = x_25;
goto block_16;
x_26 = lean_box(0);
x_9 = x_26;
goto block_17;
}
block_16:
block_17:
{
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_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_dec(x_9);
x_10 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_10, 0, x_7);
@ -1656,114 +1658,116 @@ x_13 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_11);
x_14 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__1;
x_15 = l_Lean_Meta_throwTacticEx___rarg(x_14, x_1, x_13, x_3, x_8);
x_15 = lean_box(0);
x_16 = l_Lean_Meta_throwTacticEx___rarg(x_14, x_1, x_13, x_15, x_3, x_8);
lean_dec(x_3);
return x_15;
return x_16;
}
}
else
{
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_36;
x_26 = lean_ctor_get(x_5, 0);
x_27 = lean_ctor_get(x_5, 1);
lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_38;
x_27 = lean_ctor_get(x_5, 0);
x_28 = lean_ctor_get(x_5, 1);
lean_inc(x_28);
lean_inc(x_27);
lean_inc(x_26);
lean_dec(x_5);
x_36 = l_Lean_Expr_getAppFn___main(x_26);
if (lean_obj_tag(x_36) == 4)
x_38 = l_Lean_Expr_getAppFn___main(x_27);
if (lean_obj_tag(x_38) == 4)
{
lean_object* x_37; lean_object* x_38; lean_object* x_39;
x_37 = lean_ctor_get(x_36, 0);
lean_inc(x_37);
lean_dec(x_36);
x_38 = lean_ctor_get(x_27, 0);
lean_inc(x_38);
x_39 = lean_environment_find(x_38, x_37);
if (lean_obj_tag(x_39) == 0)
lean_object* x_39; lean_object* x_40; lean_object* x_41;
x_39 = lean_ctor_get(x_38, 0);
lean_inc(x_39);
lean_dec(x_38);
x_40 = lean_ctor_get(x_28, 0);
lean_inc(x_40);
x_41 = lean_environment_find(x_40, x_39);
if (lean_obj_tag(x_41) == 0)
{
lean_object* x_40;
x_40 = lean_box(0);
x_28 = x_40;
goto block_35;
lean_object* x_42;
x_42 = lean_box(0);
x_29 = x_42;
goto block_37;
}
else
{
lean_object* x_41;
x_41 = lean_ctor_get(x_39, 0);
lean_inc(x_41);
lean_dec(x_39);
if (lean_obj_tag(x_41) == 5)
lean_object* x_43;
x_43 = lean_ctor_get(x_41, 0);
lean_inc(x_43);
lean_dec(x_41);
if (lean_obj_tag(x_43) == 5)
{
lean_object* x_42; lean_object* x_43;
lean_dec(x_26);
lean_object* x_44; lean_object* x_45;
lean_dec(x_27);
lean_dec(x_3);
lean_dec(x_1);
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_dec(x_41);
x_43 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_43, 0, x_42);
lean_ctor_set(x_43, 1, x_27);
return x_43;
x_44 = lean_ctor_get(x_43, 0);
lean_inc(x_44);
lean_dec(x_43);
x_45 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_45, 0, x_44);
lean_ctor_set(x_45, 1, x_28);
return x_45;
}
else
{
lean_object* x_44;
lean_dec(x_41);
x_44 = lean_box(0);
x_28 = x_44;
goto block_35;
lean_object* x_46;
lean_dec(x_43);
x_46 = lean_box(0);
x_29 = x_46;
goto block_37;
}
}
}
else
{
lean_object* x_45;
lean_dec(x_36);
x_45 = lean_box(0);
x_28 = x_45;
goto block_35;
lean_object* x_47;
lean_dec(x_38);
x_47 = lean_box(0);
x_29 = x_47;
goto block_37;
}
block_35:
block_37:
{
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_dec(x_28);
x_29 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_29, 0, x_26);
x_30 = l_Lean_indentExpr(x_29);
x_31 = l_Lean_Elab_Tactic_getInductiveValFromMajor___lambda__1___closed__3;
x_32 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_32, 0, x_31);
lean_ctor_set(x_32, 1, x_30);
x_33 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__1;
x_34 = l_Lean_Meta_throwTacticEx___rarg(x_33, x_1, x_32, x_3, x_27);
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_dec(x_29);
x_30 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_30, 0, x_27);
x_31 = l_Lean_indentExpr(x_30);
x_32 = l_Lean_Elab_Tactic_getInductiveValFromMajor___lambda__1___closed__3;
x_33 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_33, 0, x_32);
lean_ctor_set(x_33, 1, x_31);
x_34 = l___private_Lean_Elab_Tactic_Induction_6__generalizeVars___lambda__1___closed__1;
x_35 = lean_box(0);
x_36 = l_Lean_Meta_throwTacticEx___rarg(x_34, x_1, x_33, x_35, x_3, x_28);
lean_dec(x_3);
return x_34;
return x_36;
}
}
}
else
{
uint8_t x_46;
uint8_t x_48;
lean_dec(x_3);
lean_dec(x_1);
x_46 = !lean_is_exclusive(x_5);
if (x_46 == 0)
x_48 = !lean_is_exclusive(x_5);
if (x_48 == 0)
{
return x_5;
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49;
x_47 = lean_ctor_get(x_5, 0);
x_48 = lean_ctor_get(x_5, 1);
lean_inc(x_48);
lean_inc(x_47);
lean_object* x_49; lean_object* x_50; lean_object* x_51;
x_49 = lean_ctor_get(x_5, 0);
x_50 = lean_ctor_get(x_5, 1);
lean_inc(x_50);
lean_inc(x_49);
lean_dec(x_5);
x_49 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_49, 0, x_47);
lean_ctor_set(x_49, 1, x_48);
return x_49;
x_51 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_51, 0, x_49);
lean_ctor_set(x_51, 1, x_50);
return x_51;
}
}
}

View file

@ -29,7 +29,7 @@ lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_getMainGoal(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Tactic_tacticElabAttribute;
extern lean_object* l_Lean_Parser_Tactic_injection___elambda__1___closed__1;
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Elab_Tactic_Injection_2__checkUnusedIds___closed__4;
lean_object* l_Lean_Meta_injection___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Tactic_evalInjection(lean_object*, lean_object*, lean_object*);
@ -172,7 +172,7 @@ uint8_t x_5;
x_5 = l_List_isEmpty___rarg(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; lean_object* x_12;
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;
x_6 = l_List_toString___at_Lean_Elab_OpenDecl_HasToString___spec__2(x_2);
x_7 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_7, 0, x_6);
@ -183,19 +183,20 @@ x_10 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_10, 0, x_9);
lean_ctor_set(x_10, 1, x_8);
x_11 = l___private_Lean_Elab_Tactic_Injection_2__checkUnusedIds___closed__1;
x_12 = l_Lean_Meta_throwTacticEx___rarg(x_11, x_1, x_10, x_3, x_4);
return x_12;
x_12 = lean_box(0);
x_13 = l_Lean_Meta_throwTacticEx___rarg(x_11, x_1, x_10, x_12, x_3, x_4);
return x_13;
}
else
{
lean_object* x_13; lean_object* x_14;
lean_object* x_14; lean_object* x_15;
lean_dec(x_2);
lean_dec(x_1);
x_13 = lean_box(0);
x_14 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_14, 0, x_13);
lean_ctor_set(x_14, 1, x_4);
return x_14;
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;
}
}
}

View file

@ -52,7 +52,6 @@ extern lean_object* l_Lean_Parser_Term_explicit___elambda__1___closed__2;
lean_object* l_Lean_Elab_Term_elabNum___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_declareBuiltinParser___closed__8;
lean_object* l_Lean_Elab_Term_State_inhabited;
extern lean_object* l_Lean_Parser_darrow___elambda__1___closed__1;
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
lean_object* l_Lean_mkSort(lean_object*);
lean_object* l_Lean_Elab_Term_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*);
@ -74,7 +73,6 @@ lean_object* l_Lean_Elab_Term_mkTermElabAttribute___closed__7;
lean_object* l_Lean_Elab_Term_assignExprMVar___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_ppGoal___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_getFVarLocalDecl_x21___boxed(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_hasSorry___main___closed__1;
lean_object* l_Lean_Elab_Term_elabUsingElabFns___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_mkTermElabAttribute___closed__3;
lean_object* l_Lean_Elab_Term_synthesizeInstMVarCore___closed__2;
@ -114,6 +112,7 @@ lean_object* l_Lean_mkMVar(lean_object*);
extern lean_object* l_Array_empty___closed__1;
lean_object* l___private_Lean_Elab_Term_11__elabUsingElabFnsAux___main(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* lean_environment_find(lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_mkSorry___closed__4;
lean_object* l_Lean_Elab_Term_tryCoe___closed__2;
lean_object* l_Lean_Elab_Term_resolveName___closed__3;
lean_object* l___private_Lean_Elab_Term_20__resolveLocalNameAux(lean_object*, lean_object*, lean_object*);
@ -176,7 +175,6 @@ lean_object* l___regBuiltin_Lean_Elab_Term_elabParen(lean_object*);
extern lean_object* l_String_splitAux___main___closed__1;
lean_object* l_Lean_Elab_Term_logTrace___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_getAppArgs___closed__1;
lean_object* l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1;
lean_object* l_Lean_Elab_Term_mkFreshAnonymousName___rarg___closed__1;
lean_object* l___private_Lean_Elab_Term_21__resolveLocalName___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_isTypeFormer(lean_object*, lean_object*, lean_object*, lean_object*);
@ -232,6 +230,7 @@ lean_object* l_Lean_Elab_Term_MetaHasEval___rarg___closed__6;
extern lean_object* l_Lean_levelZero;
lean_object* l_Lean_Elab_Term_mkExpectedTypeHint(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_TermElabResult_inhabited___closed__1;
lean_object* l_Lean_Elab_Term_expandCDot_x3f___closed__4;
lean_object* l___private_Lean_Elab_Term_3__fromMetaState(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_Elab_Term_elabUsingElabFns___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -293,6 +292,7 @@ lean_object* l___private_Lean_Elab_Term_18__mkPairsAux___main___closed__3;
lean_object* l_Lean_Elab_Term_tryPostponeIfNoneOrMVar(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabParen___closed__4;
lean_object* l_Lean_Elab_Term_elabLevel(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_Exception_getRef(lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Term_elabNamedHole(lean_object*);
lean_object* l_Lean_Elab_Term_Lean_Elab_MonadMacroAdapter___lambda__1(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_monadLog___closed__1;
@ -656,7 +656,6 @@ lean_object* l_Lean_Name_toExprAux___main(lean_object*);
lean_object* l___regBuiltin_Lean_Elab_Term_elabBadCDot(lean_object*);
lean_object* l_Lean_Elab_Term_elabUsingElabFns___closed__3;
lean_object* l_Lean_Elab_Term_elabTerm___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_boolToExpr___lambda__1___closed__5;
uint8_t l___private_Lean_Elab_Term_14__isLambdaWithImplicit(lean_object*);
extern lean_object* l___private_Lean_Elab_Util_4__regTraceClasses___closed__3;
extern lean_object* l_Lean_EnvExtension_setState___closed__1;
@ -872,6 +871,7 @@ lean_object* l_Lean_Elab_Term_mkTacticMVar___closed__1;
lean_object* l_Lean_Elab_Term_throwTypeMismatchError___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_List_foldlM___main___at___private_Lean_Elab_Term_23__mkConsts___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__4;
extern lean_object* l_Lean_Meta_mkSorry___closed__2;
extern lean_object* l_EStateM_MonadState___closed__2;
extern lean_object* l_Lean_Parser_Term_arrayLit___elambda__1___closed__2;
lean_object* l_Lean_Elab_Term_getOptions___boxed(lean_object*, lean_object*);
@ -4351,15 +4351,35 @@ return x_6;
lean_object* l___private_Lean_Elab_Term_2__fromMetaException(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; uint8_t x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_4 = l_Lean_Meta_Exception_toMessageData(x_3);
x_5 = 2;
x_6 = l___private_Lean_Elab_Term_1__mkMessageAux(x_1, x_2, x_4, x_5);
x_7 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_7, 0, x_6);
x_8 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_8, 0, x_7);
return x_8;
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = l_Lean_Meta_Exception_getRef(x_3);
x_5 = l_Lean_Syntax_getPos(x_4);
x_6 = l_Lean_Meta_Exception_toMessageData(x_3);
if (lean_obj_tag(x_5) == 0)
{
uint8_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
lean_dec(x_4);
x_7 = 2;
x_8 = l___private_Lean_Elab_Term_1__mkMessageAux(x_1, x_2, x_6, x_7);
x_9 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_9, 0, x_8);
x_10 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_10, 0, x_9);
return x_10;
}
else
{
uint8_t x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
lean_dec(x_5);
x_11 = 2;
x_12 = l___private_Lean_Elab_Term_1__mkMessageAux(x_1, x_4, x_6, x_11);
lean_dec(x_4);
x_13 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_13, 0, x_12);
x_14 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_14, 0, x_13);
return x_14;
}
}
}
lean_object* l___private_Lean_Elab_Term_2__fromMetaException___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
@ -12284,9 +12304,17 @@ return x_3;
lean_object* _init_l_Lean_Elab_Term_expandCDot_x3f___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("=>");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Term_expandCDot_x3f___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_SourceInfo_inhabited___closed__1;
x_2 = l_Lean_Parser_darrow___elambda__1___closed__1;
x_2 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_3 = lean_alloc_ctor(2, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
@ -12336,7 +12364,7 @@ lean_ctor_set(x_16, 0, x_15);
lean_ctor_set(x_16, 1, x_14);
x_17 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_18 = lean_array_push(x_17, x_16);
x_19 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_19 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_20 = lean_array_push(x_18, x_19);
x_21 = lean_array_push(x_20, x_11);
x_22 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -12370,7 +12398,7 @@ lean_ctor_set(x_32, 0, x_31);
lean_ctor_set(x_32, 1, x_30);
x_33 = l_Lean_Elab_Term_expandCDot_x3f___closed__2;
x_34 = lean_array_push(x_33, x_32);
x_35 = l_Lean_Elab_Term_expandCDot_x3f___closed__3;
x_35 = l_Lean_Elab_Term_expandCDot_x3f___closed__4;
x_36 = lean_array_push(x_34, x_35);
x_37 = lean_array_push(x_36, x_27);
x_38 = l_Lean_Parser_Term_fun___elambda__1___closed__2;
@ -17395,16 +17423,6 @@ return x_15;
}
}
}
lean_object* _init_l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_boolToExpr___lambda__1___closed__5;
x_3 = l_Lean_mkConst(x_2, x_1);
return x_3;
}
}
lean_object* l___private_Lean_Elab_Term_9__exceptionToSorry(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
@ -17453,9 +17471,9 @@ x_12 = lean_box(0);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_10);
lean_ctor_set(x_13, 1, x_12);
x_14 = l_Lean_Expr_hasSorry___main___closed__1;
x_14 = l_Lean_Meta_mkSorry___closed__2;
x_15 = l_Lean_mkConst(x_14, x_13);
x_16 = l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1;
x_16 = l_Lean_Meta_mkSorry___closed__4;
x_17 = l_Lean_mkAppB(x_15, x_6, x_16);
x_18 = lean_ctor_get(x_2, 4);
lean_inc(x_18);
@ -17522,9 +17540,9 @@ x_33 = lean_box(0);
x_34 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_34, 0, x_31);
lean_ctor_set(x_34, 1, x_33);
x_35 = l_Lean_Expr_hasSorry___main___closed__1;
x_35 = l_Lean_Meta_mkSorry___closed__2;
x_36 = l_Lean_mkConst(x_35, x_34);
x_37 = l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1;
x_37 = l_Lean_Meta_mkSorry___closed__4;
x_38 = l_Lean_mkAppB(x_36, x_6, x_37);
x_39 = lean_ctor_get(x_2, 4);
lean_inc(x_39);
@ -31367,6 +31385,8 @@ l_Lean_Elab_Term_expandCDot_x3f___closed__2 = _init_l_Lean_Elab_Term_expandCDot_
lean_mark_persistent(l_Lean_Elab_Term_expandCDot_x3f___closed__2);
l_Lean_Elab_Term_expandCDot_x3f___closed__3 = _init_l_Lean_Elab_Term_expandCDot_x3f___closed__3();
lean_mark_persistent(l_Lean_Elab_Term_expandCDot_x3f___closed__3);
l_Lean_Elab_Term_expandCDot_x3f___closed__4 = _init_l_Lean_Elab_Term_expandCDot_x3f___closed__4();
lean_mark_persistent(l_Lean_Elab_Term_expandCDot_x3f___closed__4);
l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1 = _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1);
l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2 = _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2();
@ -31425,8 +31445,6 @@ l_Lean_Elab_Term_tryLiftAndCoe___closed__6 = _init_l_Lean_Elab_Term_tryLiftAndCo
lean_mark_persistent(l_Lean_Elab_Term_tryLiftAndCoe___closed__6);
l_Lean_Elab_Term_tryLiftAndCoe___closed__7 = _init_l_Lean_Elab_Term_tryLiftAndCoe___closed__7();
lean_mark_persistent(l_Lean_Elab_Term_tryLiftAndCoe___closed__7);
l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1 = _init_l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1();
lean_mark_persistent(l___private_Lean_Elab_Term_9__exceptionToSorry___closed__1);
l___private_Lean_Elab_Term_10__postponeElabTerm___closed__1 = _init_l___private_Lean_Elab_Term_10__postponeElabTerm___closed__1();
lean_mark_persistent(l___private_Lean_Elab_Term_10__postponeElabTerm___closed__1);
l___private_Lean_Elab_Term_10__postponeElabTerm___closed__2 = _init_l___private_Lean_Elab_Term_10__postponeElabTerm___closed__2();

View file

@ -1,33 +0,0 @@
// Lean compiler output
// Module: Lean.EqnCompiler
// Imports: Init Lean.EqnCompiler.MatchPattern
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_EqnCompiler_MatchPattern(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Lean_EqnCompiler(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_EqnCompiler_MatchPattern(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus
}
#endif

View file

@ -54,6 +54,7 @@ lean_object* lean_array_get_size(lean_object*);
lean_object* l_Lean_KernelException_toMessageData___closed__43;
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* l_Lean_MessageData_formatAux___main(lean_object*, lean_object*);
lean_object* l_Lean_MessageData_coeOfList___closed__1;
lean_object* l_Lean_KernelException_toMessageData___closed__16;
lean_object* l_Lean_MessageData_ofList(lean_object*);
extern lean_object* l_Lean_formatKVMap___closed__1;
@ -70,6 +71,7 @@ uint8_t l_Array_anyRangeMAux___main___at_Lean_MessageLog_hasErrors___spec__5(lea
lean_object* l_Lean_KernelException_toMessageData___closed__37;
extern lean_object* l_Lean_Format_sbracket___closed__2;
lean_object* lean_message_string(lean_object*);
lean_object* l_Lean_MessageData_coeOfList;
extern lean_object* l_EStateM_Result_toString___rarg___closed__2;
extern lean_object* l_Lean_LocalContext_Inhabited___closed__2;
lean_object* l_Lean_MessageLog_toList(lean_object*);
@ -153,6 +155,7 @@ lean_object* l_Lean_KernelException_toMessageData___closed__50;
lean_object* l_Lean_MessageData_getSyntaxMaxDepth(lean_object*);
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
lean_object* l_Lean_KernelException_toMessageData___closed__8;
lean_object* l_List_map___main___at_Lean_MessageData_coeOfListExpr___spec__1(lean_object*);
lean_object* l_Lean_fmt___at_Lean_Message_toString___spec__1(lean_object*);
lean_object* l_Lean_MessageLog_empty;
lean_object* l_Lean_KernelException_toMessageData___closed__4;
@ -190,6 +193,7 @@ lean_object* l_Array_toList___rarg(lean_object*);
lean_object* l_Lean_KernelException_toMessageData___closed__13;
lean_object* l_Lean_MessageData_arrayExpr_toMessageData___main___closed__2;
lean_object* l_Lean_MessageLog_forM(lean_object*);
lean_object* l_Lean_MessageData_coeOfListExpr(lean_object*);
uint8_t l_Lean_MessageLog_hasErrors(lean_object*);
lean_object* lean_string_length(lean_object*);
lean_object* l_Lean_Message_Inhabited___closed__1;
@ -681,7 +685,6 @@ lean_ctor_set(x_1, 0, x_68);
x_69 = 0;
x_70 = lean_unsigned_to_nat(0u);
x_71 = l_Lean_Syntax_formatStxAux___main(x_1, x_69, x_70, x_66);
lean_dec(x_1);
return x_71;
}
else
@ -703,7 +706,6 @@ lean_ctor_set(x_76, 0, x_75);
x_77 = 0;
x_78 = lean_unsigned_to_nat(0u);
x_79 = l_Lean_Syntax_formatStxAux___main(x_76, x_77, x_78, x_73);
lean_dec(x_76);
return x_79;
}
}
@ -1380,6 +1382,76 @@ lean_dec(x_1);
return x_2;
}
}
lean_object* _init_l_Lean_MessageData_coeOfList___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_MessageData_ofList___boxed), 1, 0);
return x_1;
}
}
lean_object* _init_l_Lean_MessageData_coeOfList() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_MessageData_coeOfList___closed__1;
return x_1;
}
}
lean_object* l_List_map___main___at_Lean_MessageData_coeOfListExpr___spec__1(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
{
uint8_t x_3;
x_3 = !lean_is_exclusive(x_1);
if (x_3 == 0)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_4 = lean_ctor_get(x_1, 0);
x_5 = lean_ctor_get(x_1, 1);
x_6 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_6, 0, x_4);
x_7 = l_List_map___main___at_Lean_MessageData_coeOfListExpr___spec__1(x_5);
lean_ctor_set(x_1, 1, x_7);
lean_ctor_set(x_1, 0, x_6);
return x_1;
}
else
{
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_8 = lean_ctor_get(x_1, 0);
x_9 = lean_ctor_get(x_1, 1);
lean_inc(x_9);
lean_inc(x_8);
lean_dec(x_1);
x_10 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_10, 0, x_8);
x_11 = l_List_map___main___at_Lean_MessageData_coeOfListExpr___spec__1(x_9);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_10);
lean_ctor_set(x_12, 1, x_11);
return x_12;
}
}
}
}
lean_object* l_Lean_MessageData_coeOfListExpr(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = l_List_map___main___at_Lean_MessageData_coeOfListExpr___spec__1(x_1);
x_3 = l_Lean_MessageData_ofList(x_2);
lean_dec(x_2);
return x_3;
}
}
lean_object* lean_mk_message(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
@ -3358,6 +3430,10 @@ l_Lean_MessageData_ofList___closed__3 = _init_l_Lean_MessageData_ofList___closed
lean_mark_persistent(l_Lean_MessageData_ofList___closed__3);
l_Lean_MessageData_ofList___closed__4 = _init_l_Lean_MessageData_ofList___closed__4();
lean_mark_persistent(l_Lean_MessageData_ofList___closed__4);
l_Lean_MessageData_coeOfList___closed__1 = _init_l_Lean_MessageData_coeOfList___closed__1();
lean_mark_persistent(l_Lean_MessageData_coeOfList___closed__1);
l_Lean_MessageData_coeOfList = _init_l_Lean_MessageData_coeOfList();
lean_mark_persistent(l_Lean_MessageData_coeOfList);
l_Lean_Message_toString___closed__1 = _init_l_Lean_Message_toString___closed__1();
lean_mark_persistent(l_Lean_Message_toString___closed__1);
l_Lean_Message_toString___closed__2 = _init_l_Lean_Message_toString___closed__2();

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Lean.Meta
// Imports: Init Lean.Meta.Basic Lean.Meta.LevelDefEq Lean.Meta.WHNF Lean.Meta.InferType Lean.Meta.FunInfo Lean.Meta.ExprDefEq Lean.Meta.DiscrTree Lean.Meta.Reduce Lean.Meta.Instances Lean.Meta.AbstractMVars Lean.Meta.SynthInstance Lean.Meta.AppBuilder Lean.Meta.Tactic Lean.Meta.Message Lean.Meta.KAbstract Lean.Meta.RecursorInfo Lean.Meta.GeneralizeTelescope
// Imports: Init Lean.Meta.Basic Lean.Meta.LevelDefEq Lean.Meta.WHNF Lean.Meta.InferType Lean.Meta.FunInfo Lean.Meta.ExprDefEq Lean.Meta.DiscrTree Lean.Meta.Reduce Lean.Meta.Instances Lean.Meta.AbstractMVars Lean.Meta.SynthInstance Lean.Meta.AppBuilder Lean.Meta.Tactic Lean.Meta.Message Lean.Meta.KAbstract Lean.Meta.RecursorInfo Lean.Meta.GeneralizeTelescope Lean.Meta.EqnCompiler Lean.Meta.ReduceEval
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -31,6 +31,8 @@ lean_object* initialize_Lean_Meta_Message(lean_object*);
lean_object* initialize_Lean_Meta_KAbstract(lean_object*);
lean_object* initialize_Lean_Meta_RecursorInfo(lean_object*);
lean_object* initialize_Lean_Meta_GeneralizeTelescope(lean_object*);
lean_object* initialize_Lean_Meta_EqnCompiler(lean_object*);
lean_object* initialize_Lean_Meta_ReduceEval(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Lean_Meta(lean_object* w) {
lean_object * res;
@ -90,6 +92,12 @@ lean_dec_ref(res);
res = initialize_Lean_Meta_GeneralizeTelescope(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_EqnCompiler(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_ReduceEval(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -15,6 +15,7 @@ extern "C" {
#endif
extern lean_object* l_Lean_Name_toString___closed__1;
extern lean_object* l_Lean_getStructureCtor___closed__2;
lean_object* l_Lean_Meta_mkLt___closed__4;
extern lean_object* l_Lean_Expr_eq_x3f___closed__2;
lean_object* l_Lean_Expr_mvarId_x21(lean_object*);
lean_object* l_Lean_Meta_mkHEqSymm___closed__2;
@ -27,17 +28,21 @@ lean_object* l_Lean_mkApp6(lean_object*, lean_object*, lean_object*, lean_object
lean_object* l___private_Lean_Expr_3__getAppArgsAux___main(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkHEqSymm___closed__1;
lean_object* l_Lean_Meta_mkEqSymm___closed__1;
lean_object* l_Lean_Meta_mkLe___closed__4;
extern lean_object* l_Lean_MessageData_ofList___closed__3;
lean_object* l_Lean_Meta_mkDecideProof___closed__1;
lean_object* l_Lean_Format_pretty(lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_AppBuilder_4__mkAppMAux___main___closed__3;
lean_object* l_Lean_Meta_mkProjection___main___closed__6;
lean_object* l_Lean_Meta_mkAppM(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkDecideProof___closed__2;
lean_object* l_Lean_Meta_mkPure___closed__2;
lean_object* l_Lean_Meta_mkHEqSymm___closed__4;
lean_object* l_Lean_Meta_mkCongr___closed__2;
lean_object* l_Lean_Meta_mkPure___closed__4;
extern lean_object* l_Array_empty___closed__1;
lean_object* lean_environment_find(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkSorry___closed__4;
lean_object* l_Lean_Meta_mkEqOfHEq___closed__4;
lean_object* l_Lean_Meta_mkPure___closed__1;
lean_object* l_Lean_Meta_mkCongr(lean_object*, lean_object*, lean_object*, lean_object*);
@ -54,6 +59,7 @@ extern lean_object* l___private_Lean_Meta_Basic_11__regTraceClasses___closed__2;
lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* l___private_Lean_Meta_AppBuilder_4__mkAppMAux___main___closed__4;
lean_object* l_Lean_Meta_mkLe(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppFn___main(lean_object*);
lean_object* l_Lean_Meta_mkEqNDRec___closed__5;
extern lean_object* l_Lean_Expr_getAppArgs___closed__1;
@ -79,12 +85,14 @@ lean_object* l___private_Lean_Util_Trace_2__addNode___at___private_Lean_Meta_Lev
lean_object* l_Lean_Expr_getAppNumArgsAux___main(lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__68;
lean_object* l_Lean_Meta_mkAppM___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_boolToExpr___lambda__1___closed__3;
lean_object* l_Lean_Meta_mkProjection___main___closed__9;
lean_object* lean_array_fget(lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_AppBuilder_6__mkAppOptMAux___main(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_AppBuilder_8__getDecLevel___closed__3;
lean_object* lean_expr_instantiate_rev_range(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkSorry(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongrArg___closed__1;
lean_object* l_Lean_Meta_mkProjection___main___closed__8;
lean_object* l_Lean_Meta_mkEqSymm___closed__2;
@ -112,16 +120,20 @@ lean_object* l___private_Lean_Meta_AppBuilder_8__getDecLevel___closed__4;
lean_object* l___private_Lean_Util_Trace_3__getResetTraces___at___private_Lean_Meta_LevelDefEq_10__processPostponedStep___spec__6___rarg(lean_object*);
lean_object* l_Lean_Meta_mkNoConfusion___closed__8;
lean_object* l_Lean_Meta_mkId(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkDecideProof___closed__4;
lean_object* l_Lean_Meta_mkListLit___closed__2;
extern lean_object* l_Lean_MessageData_coeOfArrayExpr___closed__2;
lean_object* l_Lean_Meta_mkHEqRefl___closed__1;
lean_object* l_Lean_Meta_mkArrayLit(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkEqTrans___closed__1;
lean_object* l_Lean_Meta_mkEqRec___closed__1;
extern lean_object* l_Lean_mkDecIsTrue___closed__2;
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_getStructureFields(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkEqNDRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkListLit___closed__1;
lean_object* l_Lean_Meta_mkLe___closed__3;
lean_object* l_Lean_Meta_mkDecideProof(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Options_empty;
extern lean_object* l_Lean_mkRecFor___closed__1;
lean_object* l___private_Lean_Meta_AppBuilder_8__getDecLevel___closed__2;
@ -150,6 +162,7 @@ lean_object* l_Array_iterateMAux___main___at___private_Lean_Meta_AppBuilder_6__m
lean_object* l_Lean_Meta_mkCongrFun___closed__4;
lean_object* l_Lean_Meta_mkEqOfHEq___closed__2;
lean_object* l_Lean_Meta_mkEqRefl___closed__2;
extern lean_object* l_Lean_boolToExpr___lambda__1___closed__6;
lean_object* l___private_Lean_Meta_AppBuilder_2__hasTypeMsg(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkProjection(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongrArg___closed__5;
@ -179,6 +192,7 @@ lean_object* l_Lean_Meta_mkNoConfusion___closed__6;
lean_object* l_Lean_mkApp5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkAppM___closed__1;
extern lean_object* l_Std_PersistentHashMap_mkCollisionNode___rarg___closed__1;
extern lean_object* l_Lean_boolToExpr___lambda__1___closed__5;
lean_object* l_List_mapM___main___at___private_Lean_Meta_AppBuilder_5__mkFun___spec__1(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_MetavarContext_incDepth(lean_object*);
lean_object* l_Lean_Meta_mkEqMPR(lean_object*, lean_object*, lean_object*, lean_object*);
@ -195,6 +209,8 @@ lean_object* l_Lean_Meta_mkCongrArg(lean_object*, lean_object*, lean_object*, le
lean_object* l___private_Lean_Meta_AppBuilder_4__mkAppMAux___main___closed__2;
lean_object* l___private_Lean_Meta_AppBuilder_3__mkAppMFinal___closed__1;
extern lean_object* l_Lean_mkAppStx___closed__9;
lean_object* l_Lean_Meta_mkLt___closed__1;
lean_object* l_Lean_Meta_mkSorry___closed__3;
lean_object* l___private_Lean_Meta_AppBuilder_6__mkAppOptMAux___main___closed__5;
lean_object* l_Lean_Meta_mkEqOfHEq___closed__3;
lean_object* l___private_Lean_Meta_AppBuilder_3__mkAppMFinal___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -202,11 +218,13 @@ lean_object* l_Lean_Meta_mkEqMPR___closed__1;
lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_AppBuilder_6__mkAppOptMAux___main___closed__3;
lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkLt___closed__2;
lean_object* l_Lean_Meta_getConstInfo(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkNoConfusion(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Expr_hasLooseBVars(lean_object*);
lean_object* l_Lean_Meta_getMVarDecl(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_KernelException_toMessageData___closed__12;
lean_object* l_Lean_Meta_mkDecideProof___closed__3;
lean_object* l_Lean_Meta_instantiateMVars(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_isSubobjectField_x3f(lean_object*, lean_object*, lean_object*);
lean_object* lean_mk_array(lean_object*, lean_object*);
@ -216,9 +234,11 @@ lean_object* l_Lean_Meta_mkExpectedTypeHint(lean_object*, lean_object*, lean_obj
lean_object* l_Lean_Meta_whnfD(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_arrayToExpr___rarg___lambda__1___closed__2;
lean_object* l_Lean_Meta_mkFreshLevelMVar___rarg(lean_object*);
extern lean_object* l_Lean_mkOptionalNode___closed__2;
lean_object* l___private_Lean_Meta_AppBuilder_7__mkListLitAux(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkHEq(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkEqOfHEq___closed__5;
lean_object* l_Lean_Meta_mkLt___closed__3;
lean_object* l_Lean_Meta_mkHEqTrans___closed__1;
lean_object* l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Name_toStringWithSep___main(lean_object*, lean_object*);
@ -230,19 +250,25 @@ lean_object* l_Lean_mkAppB(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkProjection___main___closed__10;
lean_object* l_Lean_mkApp8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_indentExpr(lean_object*);
lean_object* l_Lean_Meta_mkLe___closed__2;
lean_object* l_Lean_Meta_mkListLit(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Level_format(lean_object*);
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkProjection___main___closed__5;
lean_object* l_Lean_Meta_mkEqOfHEq(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkSorry___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongrFun___closed__5;
lean_object* l_Lean_Meta_mkNoConfusion___closed__7;
lean_object* l_Lean_Meta_mkSorry___closed__2;
lean_object* l_Lean_Meta_mkLe___closed__1;
lean_object* l___private_Lean_Meta_AppBuilder_6__mkAppOptMAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongrFun___closed__3;
extern lean_object* l_Lean_listToExpr___rarg___closed__6;
lean_object* l_Lean_mkApp3(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkEqOfHEq___closed__6;
lean_object* l_Array_iterateMAux___main___at___private_Lean_Meta_AppBuilder_6__mkAppOptMAux___main___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkLt(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkSorry___closed__1;
lean_object* l___private_Lean_Meta_AppBuilder_3__mkAppMFinal___closed__2;
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkProjection___main___closed__3;
@ -14287,6 +14313,439 @@ return x_34;
}
}
}
lean_object* _init_l_Lean_Meta_mkSorry___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("sorryAx");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkSorry___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkSorry___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Meta_mkSorry___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_boolToExpr___lambda__1___closed__3;
x_3 = l_Lean_mkConst(x_2, x_1);
return x_3;
}
}
lean_object* _init_l_Lean_Meta_mkSorry___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_boolToExpr___lambda__1___closed__5;
x_3 = l_Lean_mkConst(x_2, x_1);
return x_3;
}
}
lean_object* l_Lean_Meta_mkSorry(lean_object* x_1, uint8_t x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
lean_inc(x_1);
x_5 = l_Lean_Meta_getLevel(x_1, x_3, x_4);
if (lean_obj_tag(x_5) == 0)
{
uint8_t x_6;
x_6 = !lean_is_exclusive(x_5);
if (x_6 == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_7 = lean_ctor_get(x_5, 0);
x_8 = lean_box(0);
x_9 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_9, 0, x_7);
lean_ctor_set(x_9, 1, x_8);
x_10 = l_Lean_Meta_mkSorry___closed__2;
x_11 = l_Lean_mkConst(x_10, x_9);
if (x_2 == 0)
{
lean_object* x_12; lean_object* x_13;
x_12 = l_Lean_Meta_mkSorry___closed__3;
x_13 = l_Lean_mkAppB(x_11, x_1, x_12);
lean_ctor_set(x_5, 0, x_13);
return x_5;
}
else
{
lean_object* x_14; lean_object* x_15;
x_14 = l_Lean_Meta_mkSorry___closed__4;
x_15 = l_Lean_mkAppB(x_11, x_1, x_14);
lean_ctor_set(x_5, 0, x_15);
return x_5;
}
}
else
{
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_16 = lean_ctor_get(x_5, 0);
x_17 = lean_ctor_get(x_5, 1);
lean_inc(x_17);
lean_inc(x_16);
lean_dec(x_5);
x_18 = lean_box(0);
x_19 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_19, 0, x_16);
lean_ctor_set(x_19, 1, x_18);
x_20 = l_Lean_Meta_mkSorry___closed__2;
x_21 = l_Lean_mkConst(x_20, x_19);
if (x_2 == 0)
{
lean_object* x_22; lean_object* x_23; lean_object* x_24;
x_22 = l_Lean_Meta_mkSorry___closed__3;
x_23 = l_Lean_mkAppB(x_21, x_1, x_22);
x_24 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_24, 0, x_23);
lean_ctor_set(x_24, 1, x_17);
return x_24;
}
else
{
lean_object* x_25; lean_object* x_26; lean_object* x_27;
x_25 = l_Lean_Meta_mkSorry___closed__4;
x_26 = l_Lean_mkAppB(x_21, x_1, x_25);
x_27 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_27, 0, x_26);
lean_ctor_set(x_27, 1, x_17);
return x_27;
}
}
}
else
{
uint8_t x_28;
lean_dec(x_1);
x_28 = !lean_is_exclusive(x_5);
if (x_28 == 0)
{
return x_5;
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31;
x_29 = lean_ctor_get(x_5, 0);
x_30 = lean_ctor_get(x_5, 1);
lean_inc(x_30);
lean_inc(x_29);
lean_dec(x_5);
x_31 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_31, 0, x_29);
lean_ctor_set(x_31, 1, x_30);
return x_31;
}
}
}
}
lean_object* l_Lean_Meta_mkSorry___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
uint8_t x_5; lean_object* x_6;
x_5 = lean_unbox(x_2);
lean_dec(x_2);
x_6 = l_Lean_Meta_mkSorry(x_1, x_5, x_3, x_4);
return x_6;
}
}
lean_object* _init_l_Lean_Meta_mkDecideProof___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("decide");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkDecideProof___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_mkDecIsTrue___closed__2;
x_2 = l_Lean_Meta_mkDecideProof___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Meta_mkDecideProof___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("ofDecideEqTrue");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkDecideProof___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkDecideProof___closed__3;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_mkDecideProof(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 = l_Lean_mkOptionalNode___closed__2;
x_5 = lean_array_push(x_4, x_1);
x_6 = l_Lean_Meta_mkDecideProof___closed__2;
lean_inc(x_2);
x_7 = l_Lean_Meta_mkAppM(x_6, x_5, x_2, x_3);
lean_dec(x_5);
if (lean_obj_tag(x_7) == 0)
{
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_8 = lean_ctor_get(x_7, 0);
lean_inc(x_8);
x_9 = lean_ctor_get(x_7, 1);
lean_inc(x_9);
lean_dec(x_7);
x_10 = l_Lean_boolToExpr___lambda__1___closed__6;
lean_inc(x_2);
x_11 = l_Lean_Meta_mkEq(x_8, x_10, x_2, x_9);
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_2);
x_14 = l_Lean_Meta_mkEqRefl(x_10, x_2, x_13);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
x_16 = lean_ctor_get(x_14, 1);
lean_inc(x_16);
lean_dec(x_14);
lean_inc(x_2);
x_17 = l_Lean_Meta_mkExpectedTypeHint(x_15, x_12, x_2, x_16);
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22;
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 = lean_array_push(x_4, x_18);
x_21 = l_Lean_Meta_mkDecideProof___closed__4;
x_22 = l_Lean_Meta_mkAppM(x_21, x_20, x_2, x_19);
lean_dec(x_20);
return x_22;
}
else
{
uint8_t x_23;
lean_dec(x_2);
x_23 = !lean_is_exclusive(x_17);
if (x_23 == 0)
{
return x_17;
}
else
{
lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_24 = lean_ctor_get(x_17, 0);
x_25 = lean_ctor_get(x_17, 1);
lean_inc(x_25);
lean_inc(x_24);
lean_dec(x_17);
x_26 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_26, 0, x_24);
lean_ctor_set(x_26, 1, x_25);
return x_26;
}
}
}
else
{
uint8_t x_27;
lean_dec(x_12);
lean_dec(x_2);
x_27 = !lean_is_exclusive(x_14);
if (x_27 == 0)
{
return x_14;
}
else
{
lean_object* x_28; lean_object* x_29; lean_object* x_30;
x_28 = lean_ctor_get(x_14, 0);
x_29 = lean_ctor_get(x_14, 1);
lean_inc(x_29);
lean_inc(x_28);
lean_dec(x_14);
x_30 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_30, 0, x_28);
lean_ctor_set(x_30, 1, x_29);
return x_30;
}
}
}
else
{
uint8_t x_31;
lean_dec(x_2);
x_31 = !lean_is_exclusive(x_11);
if (x_31 == 0)
{
return x_11;
}
else
{
lean_object* x_32; lean_object* x_33; lean_object* x_34;
x_32 = lean_ctor_get(x_11, 0);
x_33 = lean_ctor_get(x_11, 1);
lean_inc(x_33);
lean_inc(x_32);
lean_dec(x_11);
x_34 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_34, 0, x_32);
lean_ctor_set(x_34, 1, x_33);
return x_34;
}
}
}
else
{
uint8_t x_35;
lean_dec(x_2);
x_35 = !lean_is_exclusive(x_7);
if (x_35 == 0)
{
return x_7;
}
else
{
lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_36 = lean_ctor_get(x_7, 0);
x_37 = lean_ctor_get(x_7, 1);
lean_inc(x_37);
lean_inc(x_36);
lean_dec(x_7);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_36);
lean_ctor_set(x_38, 1, x_37);
return x_38;
}
}
}
}
lean_object* _init_l_Lean_Meta_mkLt___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("HasLess");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkLt___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkLt___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Meta_mkLt___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("Less");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkLt___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Meta_mkLt___closed__2;
x_2 = l_Lean_Meta_mkLt___closed__3;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_mkLt(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;
x_5 = l_Lean_mkAppStx___closed__9;
x_6 = lean_array_push(x_5, x_1);
x_7 = lean_array_push(x_6, x_2);
x_8 = l_Lean_Meta_mkLt___closed__4;
x_9 = l_Lean_Meta_mkAppM(x_8, x_7, x_3, x_4);
lean_dec(x_7);
return x_9;
}
}
lean_object* _init_l_Lean_Meta_mkLe___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("HasLessEq");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkLe___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkLe___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Meta_mkLe___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("LessEq");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_mkLe___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Meta_mkLe___closed__2;
x_2 = l_Lean_Meta_mkLe___closed__3;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_mkLe(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;
x_5 = l_Lean_mkAppStx___closed__9;
x_6 = lean_array_push(x_5, x_1);
x_7 = lean_array_push(x_6, x_2);
x_8 = l_Lean_Meta_mkLe___closed__4;
x_9 = l_Lean_Meta_mkAppM(x_8, x_7, x_3, x_4);
lean_dec(x_7);
return x_9;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Structure(lean_object*);
lean_object* initialize_Lean_Util_Recognizers(lean_object*);
@ -14500,6 +14959,38 @@ l_Lean_Meta_mkArrayLit___closed__1 = _init_l_Lean_Meta_mkArrayLit___closed__1();
lean_mark_persistent(l_Lean_Meta_mkArrayLit___closed__1);
l_Lean_Meta_mkArrayLit___closed__2 = _init_l_Lean_Meta_mkArrayLit___closed__2();
lean_mark_persistent(l_Lean_Meta_mkArrayLit___closed__2);
l_Lean_Meta_mkSorry___closed__1 = _init_l_Lean_Meta_mkSorry___closed__1();
lean_mark_persistent(l_Lean_Meta_mkSorry___closed__1);
l_Lean_Meta_mkSorry___closed__2 = _init_l_Lean_Meta_mkSorry___closed__2();
lean_mark_persistent(l_Lean_Meta_mkSorry___closed__2);
l_Lean_Meta_mkSorry___closed__3 = _init_l_Lean_Meta_mkSorry___closed__3();
lean_mark_persistent(l_Lean_Meta_mkSorry___closed__3);
l_Lean_Meta_mkSorry___closed__4 = _init_l_Lean_Meta_mkSorry___closed__4();
lean_mark_persistent(l_Lean_Meta_mkSorry___closed__4);
l_Lean_Meta_mkDecideProof___closed__1 = _init_l_Lean_Meta_mkDecideProof___closed__1();
lean_mark_persistent(l_Lean_Meta_mkDecideProof___closed__1);
l_Lean_Meta_mkDecideProof___closed__2 = _init_l_Lean_Meta_mkDecideProof___closed__2();
lean_mark_persistent(l_Lean_Meta_mkDecideProof___closed__2);
l_Lean_Meta_mkDecideProof___closed__3 = _init_l_Lean_Meta_mkDecideProof___closed__3();
lean_mark_persistent(l_Lean_Meta_mkDecideProof___closed__3);
l_Lean_Meta_mkDecideProof___closed__4 = _init_l_Lean_Meta_mkDecideProof___closed__4();
lean_mark_persistent(l_Lean_Meta_mkDecideProof___closed__4);
l_Lean_Meta_mkLt___closed__1 = _init_l_Lean_Meta_mkLt___closed__1();
lean_mark_persistent(l_Lean_Meta_mkLt___closed__1);
l_Lean_Meta_mkLt___closed__2 = _init_l_Lean_Meta_mkLt___closed__2();
lean_mark_persistent(l_Lean_Meta_mkLt___closed__2);
l_Lean_Meta_mkLt___closed__3 = _init_l_Lean_Meta_mkLt___closed__3();
lean_mark_persistent(l_Lean_Meta_mkLt___closed__3);
l_Lean_Meta_mkLt___closed__4 = _init_l_Lean_Meta_mkLt___closed__4();
lean_mark_persistent(l_Lean_Meta_mkLt___closed__4);
l_Lean_Meta_mkLe___closed__1 = _init_l_Lean_Meta_mkLe___closed__1();
lean_mark_persistent(l_Lean_Meta_mkLe___closed__1);
l_Lean_Meta_mkLe___closed__2 = _init_l_Lean_Meta_mkLe___closed__2();
lean_mark_persistent(l_Lean_Meta_mkLe___closed__2);
l_Lean_Meta_mkLe___closed__3 = _init_l_Lean_Meta_mkLe___closed__3();
lean_mark_persistent(l_Lean_Meta_mkLe___closed__3);
l_Lean_Meta_mkLe___closed__4 = _init_l_Lean_Meta_mkLe___closed__4();
lean_mark_persistent(l_Lean_Meta_mkLe___closed__4);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Lean.Meta.Basic
// Imports: Init Lean.Data.LOption Lean.Environment Lean.Class Lean.ReducibilityAttrs Lean.Util.Trace Lean.Util.RecDepth Lean.Util.Closure Lean.Meta.Exception Lean.Meta.DiscrTreeTypes Lean.Eval
// Imports: Init Lean.Data.LOption Lean.Environment Lean.Class Lean.ReducibilityAttrs Lean.Util.Trace Lean.Util.RecDepth Lean.Util.Closure Lean.Compiler.InlineAttrs Lean.Meta.Exception Lean.Meta.DiscrTreeTypes Lean.Eval
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -128,9 +128,9 @@ lean_object* l_Lean_Meta_mkInferTypeRef___lambda__1(lean_object*, lean_object*,
lean_object* l_Array_forMAux___main___at_IO_runMeta___spec__5___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_isReadOnlyLevelMVar___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_Basic_11__regTraceClasses___closed__4;
lean_object* l_Lean_Meta_setInlineAttribute___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_isReducible(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkAuxDefinitionFor(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4;
lean_object* l___private_Lean_Meta_Basic_5__forallTelescopeReducingAux___at_Lean_Meta_forallBoundedTelescope___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_InfoCacheKey_Hashable___boxed(lean_object*);
lean_object* l_Lean_Meta_getConstNoEx(lean_object*, lean_object*, lean_object*);
@ -153,6 +153,7 @@ lean_object* l_Lean_Meta_MetaM_inhabited___rarg(lean_object*);
lean_object* l_Lean_Meta_TransparencyMode_Hashable___closed__1;
lean_object* l_Lean_Meta_getEnv___rarg(lean_object*);
lean_object* l_Lean_MetavarContext_hasAssignableMVar___main(lean_object*, lean_object*);
lean_object* l_Lean_Meta_ofExcept(lean_object*, lean_object*);
lean_object* l_Lean_Meta_instantiateForall(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_IO_FS_Handle_putStrLn___rarg___closed__1;
lean_object* l_Lean_Meta_getConfig___boxed(lean_object*, lean_object*);
@ -165,6 +166,7 @@ lean_object* l_Lean_Meta_withNewLocalInstances___rarg(lean_object*, lean_object*
lean_object* l_Lean_Meta_withNewLocalInstance___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_run___rarg___closed__5;
lean_object* l___private_Lean_Meta_Basic_7__forallMetaTelescopeReducingAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Compiler_inlineAttrs;
lean_object* l_Lean_mkAuxDefinition(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t);
lean_object* l_Lean_Meta_throwEx___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_dbgTrace___rarg___closed__1;
@ -194,7 +196,7 @@ lean_object* l___private_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___rarg
lean_object* l___private_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___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*);
lean_object* l___private_Lean_Meta_Basic_2__getTraceState(lean_object*);
uint8_t l_Lean_Meta_InfoCacheKey_HasBeq(lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwOther___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwOther___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_MetavarContext_instantiateLevelMVars___main(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkWHNFRef___lambda__1___closed__2;
lean_object* l_Lean_Meta_mkInferTypeRef___lambda__1___closed__2;
@ -208,7 +210,7 @@ lean_object* l___private_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main
lean_object* l_Lean_Expr_headBeta(lean_object*);
lean_object* l_Lean_Meta_mkMetaExtension___closed__2;
lean_object* l___private_Lean_Meta_Basic_7__forallMetaTelescopeReducingAux___main(uint8_t, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwOther___rarg___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwOther___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkMetaExtension___closed__1;
lean_object* l_Lean_Meta_getOptions___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkInferTypeRef___lambda__1___boxed(lean_object*, lean_object*, lean_object*);
@ -284,6 +286,7 @@ lean_object* l_IO_Prim_Ref_get___boxed(lean_object*, lean_object*, lean_object*)
lean_object* l_Lean_Meta_mkFreshId___rarg(lean_object*);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTelescopeReducing___spec__3(lean_object*);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallBoundedTelescope___spec__5(lean_object*);
lean_object* l_Lean_Meta_ofExcept___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_tracer___closed__4;
lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTelescopeReducing___spec__4___rarg(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_Meta_getParamNames___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
@ -356,6 +359,7 @@ lean_object* l___private_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux(lean_o
lean_object* l_Lean_Meta_resettingSynthInstanceCache(lean_object*);
lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
uint8_t l_Lean_Expr_hasMVar(lean_object*);
lean_object* l_Lean_Meta_ofExcept___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_tracer___closed__2;
lean_object* l___private_Lean_Meta_Basic_7__forallMetaTelescopeReducingAux(uint8_t, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkIsExprDefEqAuxRef___lambda__1___closed__4;
@ -447,6 +451,7 @@ lean_object* l___private_Lean_Meta_Basic_8__lambdaMetaTelescopeAux___main___boxe
lean_object* l_Lean_Meta_withNewMCtxDepth(lean_object*);
lean_object* l_Lean_Meta_shouldReduceReducibleOnly(lean_object*, lean_object*);
lean_object* l_Lean_Meta_getMCtx___rarg(lean_object*);
lean_object* l_Lean_EnumAttributes_setValue___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_Exception_Inhabited___closed__2;
lean_object* l_IO_print___at_IO_runMeta___spec__2(lean_object*, lean_object*);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallBoundedTelescope___spec__4___rarg(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*);
@ -454,6 +459,7 @@ lean_object* l_Lean_Meta_whnfD(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkWHNFRef___closed__1;
lean_object* l_Lean_Meta_mkFreshLevelMVar___rarg(lean_object*);
extern lean_object* l_Lean_MetavarContext_Inhabited___closed__1;
lean_object* l_Lean_Meta_setInlineAttribute(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTelescope___spec__3(lean_object*);
lean_object* l_Lean_Meta_mkMetaExtension___closed__3;
lean_object* l_Lean_Meta_isClassQuick___main___closed__1;
@ -954,11 +960,13 @@ return x_2;
lean_object* _init_l_Lean_Meta_withIncRecDepth___rarg___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Meta_withIncRecDepth___rarg___closed__2;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_withIncRecDepth___rarg___closed__2;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_withIncRecDepth___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
@ -1320,11 +1328,13 @@ return x_2;
lean_object* _init_l_Lean_Meta_mkWHNFRef___lambda__1___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Meta_mkWHNFRef___lambda__1___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkWHNFRef___lambda__1___closed__3;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_mkWHNFRef___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
@ -1396,11 +1406,13 @@ return x_2;
lean_object* _init_l_Lean_Meta_mkInferTypeRef___lambda__1___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Meta_mkInferTypeRef___lambda__1___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkInferTypeRef___lambda__1___closed__3;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_mkInferTypeRef___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
@ -1472,11 +1484,13 @@ return x_2;
lean_object* _init_l_Lean_Meta_mkIsExprDefEqAuxRef___lambda__1___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Meta_mkIsExprDefEqAuxRef___lambda__1___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_mkIsExprDefEqAuxRef___lambda__1___closed__3;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_mkIsExprDefEqAuxRef___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
@ -3066,50 +3080,100 @@ lean_dec(x_2);
return x_4;
}
}
lean_object* l_Lean_Meta_throwOther___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
lean_object* l_Lean_Meta_throwOther___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_4 = lean_ctor_get(x_3, 0);
lean_inc(x_4);
x_5 = lean_ctor_get(x_3, 1);
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;
x_5 = lean_ctor_get(x_4, 0);
lean_inc(x_5);
x_6 = lean_ctor_get(x_2, 1);
x_7 = lean_ctor_get(x_2, 0);
x_8 = lean_ctor_get(x_7, 0);
lean_inc(x_8);
x_6 = lean_ctor_get(x_4, 1);
lean_inc(x_6);
x_9 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_9, 0, x_4);
lean_ctor_set(x_9, 1, x_5);
lean_ctor_set(x_9, 2, x_6);
lean_ctor_set(x_9, 3, x_8);
x_10 = lean_alloc_ctor(6, 2, 0);
lean_ctor_set(x_10, 0, x_9);
lean_ctor_set(x_10, 1, x_1);
x_11 = lean_alloc_ctor(22, 1, 0);
x_7 = lean_ctor_get(x_3, 1);
x_8 = lean_ctor_get(x_3, 0);
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
lean_inc(x_7);
x_10 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_10, 0, x_5);
lean_ctor_set(x_10, 1, x_6);
lean_ctor_set(x_10, 2, x_7);
lean_ctor_set(x_10, 3, x_9);
x_11 = lean_alloc_ctor(6, 2, 0);
lean_ctor_set(x_11, 0, x_10);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_11);
lean_ctor_set(x_12, 1, x_3);
return x_12;
lean_ctor_set(x_11, 1, x_1);
x_12 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_12, 0, x_2);
lean_ctor_set(x_12, 1, x_11);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_4);
return x_13;
}
}
lean_object* l_Lean_Meta_throwOther(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_throwOther___rarg___boxed), 3, 0);
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_throwOther___rarg___boxed), 4, 0);
return x_2;
}
}
lean_object* l_Lean_Meta_throwOther___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
lean_object* l_Lean_Meta_throwOther___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_4;
x_4 = l_Lean_Meta_throwOther___rarg(x_1, x_2, x_3);
lean_object* x_5;
x_5 = l_Lean_Meta_throwOther___rarg(x_1, x_2, x_3, x_4);
lean_dec(x_3);
return x_5;
}
}
lean_object* l_Lean_Meta_ofExcept___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
if (lean_obj_tag(x_2) == 0)
{
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_2, 0);
lean_inc(x_5);
lean_dec(x_2);
return x_4;
x_6 = lean_apply_1(x_1, x_5);
x_7 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_7, 0, x_6);
x_8 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_8, 0, x_7);
x_9 = lean_box(0);
x_10 = l_Lean_Meta_throwOther___rarg(x_8, x_9, x_3, x_4);
return x_10;
}
else
{
lean_object* x_11; lean_object* x_12;
lean_dec(x_1);
x_11 = lean_ctor_get(x_2, 0);
lean_inc(x_11);
lean_dec(x_2);
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;
}
}
}
lean_object* l_Lean_Meta_ofExcept(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = lean_alloc_closure((void*)(l_Lean_Meta_ofExcept___rarg___boxed), 4, 0);
return x_3;
}
}
lean_object* l_Lean_Meta_ofExcept___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_Lean_Meta_ofExcept___rarg(x_1, x_2, x_3, x_4);
lean_dec(x_3);
return x_5;
}
}
lean_object* l_Lean_Meta_throwBug___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
@ -47089,6 +47153,51 @@ return x_13;
}
}
}
lean_object* l_Lean_Meta_setInlineAttribute(lean_object* x_1, uint8_t 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_ctor_get(x_4, 0);
lean_inc(x_5);
x_6 = l_Lean_Compiler_inlineAttrs;
x_7 = lean_box(x_2);
x_8 = l_Lean_EnumAttributes_setValue___rarg(x_6, x_5, x_1, x_7);
if (lean_obj_tag(x_8) == 0)
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
lean_dec(x_8);
x_10 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_10, 0, x_9);
x_11 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_11, 0, x_10);
x_12 = lean_box(0);
x_13 = l_Lean_Meta_throwOther___rarg(x_11, x_12, x_3, x_4);
return x_13;
}
else
{
lean_object* x_14; lean_object* x_15;
x_14 = lean_ctor_get(x_8, 0);
lean_inc(x_14);
lean_dec(x_8);
x_15 = l_Lean_Meta_setEnv(x_14, x_3, x_4);
return x_15;
}
}
}
lean_object* l_Lean_Meta_setInlineAttribute___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
uint8_t x_5; lean_object* x_6;
x_5 = lean_unbox(x_2);
lean_dec(x_2);
x_6 = l_Lean_Meta_setInlineAttribute(x_1, x_5, x_3, x_4);
lean_dec(x_3);
return x_6;
}
}
lean_object* _init_l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__1() {
_start:
{
@ -47117,16 +47226,6 @@ lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* _init_l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* l___private_Lean_Meta_Basic_10__instantiateForallAux___main(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
@ -47177,59 +47276,43 @@ goto _start;
}
else
{
uint8_t x_18;
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21;
lean_dec(x_11);
lean_dec(x_9);
lean_dec(x_4);
lean_dec(x_2);
x_18 = !lean_is_exclusive(x_10);
if (x_18 == 0)
{
lean_object* x_19; lean_object* x_20;
x_19 = lean_ctor_get(x_10, 0);
lean_dec(x_19);
x_20 = l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4;
lean_ctor_set_tag(x_10, 1);
lean_ctor_set(x_10, 0, x_20);
return x_10;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = lean_ctor_get(x_10, 1);
lean_inc(x_21);
x_18 = lean_ctor_get(x_10, 1);
lean_inc(x_18);
lean_dec(x_10);
x_22 = l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4;
x_23 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_23, 0, x_22);
lean_ctor_set(x_23, 1, x_21);
return x_23;
}
x_19 = l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__3;
x_20 = lean_box(0);
x_21 = l_Lean_Meta_throwOther___rarg(x_19, x_20, x_4, x_18);
lean_dec(x_4);
return x_21;
}
}
else
{
uint8_t x_24;
uint8_t x_22;
lean_dec(x_9);
lean_dec(x_4);
lean_dec(x_2);
x_24 = !lean_is_exclusive(x_10);
if (x_24 == 0)
x_22 = !lean_is_exclusive(x_10);
if (x_22 == 0)
{
return x_10;
}
else
{
lean_object* x_25; lean_object* x_26; lean_object* x_27;
x_25 = lean_ctor_get(x_10, 0);
x_26 = lean_ctor_get(x_10, 1);
lean_inc(x_26);
lean_inc(x_25);
lean_object* x_23; lean_object* x_24; lean_object* x_25;
x_23 = lean_ctor_get(x_10, 0);
x_24 = lean_ctor_get(x_10, 1);
lean_inc(x_24);
lean_inc(x_23);
lean_dec(x_10);
x_27 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_27, 0, x_25);
lean_ctor_set(x_27, 1, x_26);
return x_27;
x_25 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_25, 0, x_23);
lean_ctor_set(x_25, 1, x_24);
return x_25;
}
}
}
@ -48184,6 +48267,7 @@ lean_object* initialize_Lean_ReducibilityAttrs(lean_object*);
lean_object* initialize_Lean_Util_Trace(lean_object*);
lean_object* initialize_Lean_Util_RecDepth(lean_object*);
lean_object* initialize_Lean_Util_Closure(lean_object*);
lean_object* initialize_Lean_Compiler_InlineAttrs(lean_object*);
lean_object* initialize_Lean_Meta_Exception(lean_object*);
lean_object* initialize_Lean_Meta_DiscrTreeTypes(lean_object*);
lean_object* initialize_Lean_Eval(lean_object*);
@ -48216,6 +48300,9 @@ lean_dec_ref(res);
res = initialize_Lean_Util_Closure(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Compiler_InlineAttrs(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_Exception(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
@ -48355,8 +48442,6 @@ l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__2 = _init_
lean_mark_persistent(l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__2);
l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__3 = _init_l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__3();
lean_mark_persistent(l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__3);
l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4 = _init_l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4();
lean_mark_persistent(l___private_Lean_Meta_Basic_10__instantiateForallAux___main___closed__4);
l___private_Lean_Meta_Basic_11__regTraceClasses___closed__1 = _init_l___private_Lean_Meta_Basic_11__regTraceClasses___closed__1();
lean_mark_persistent(l___private_Lean_Meta_Basic_11__regTraceClasses___closed__1);
l___private_Lean_Meta_Basic_11__regTraceClasses___closed__2 = _init_l___private_Lean_Meta_Basic_11__regTraceClasses___closed__2();

View file

@ -0,0 +1,60 @@
// Lean compiler output
// Module: Lean.Meta.EqnCompiler
// Imports: Init Lean.Meta.EqnCompiler.MatchPattern Lean.Meta.EqnCompiler.DepElim Lean.Meta.EqnCompiler.CaseValues Lean.Meta.EqnCompiler.CaseArraySizes
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*);
extern lean_object* l___private_Lean_Meta_EqnCompiler_DepElim_6__withMotive___rarg___closed__2;
lean_object* l___private_Lean_Meta_EqnCompiler_1__regTraceClasses(lean_object*);
lean_object* l___private_Lean_Meta_EqnCompiler_1__regTraceClasses(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = l___private_Lean_Meta_EqnCompiler_DepElim_6__withMotive___rarg___closed__2;
x_3 = l_Lean_registerTraceClass(x_2, x_1);
return x_3;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Meta_EqnCompiler_MatchPattern(lean_object*);
lean_object* initialize_Lean_Meta_EqnCompiler_DepElim(lean_object*);
lean_object* initialize_Lean_Meta_EqnCompiler_CaseValues(lean_object*);
lean_object* initialize_Lean_Meta_EqnCompiler_CaseArraySizes(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Lean_Meta_EqnCompiler(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_EqnCompiler_MatchPattern(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_EqnCompiler_DepElim(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_EqnCompiler_CaseValues(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_EqnCompiler_CaseArraySizes(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = l___private_Lean_Meta_EqnCompiler_1__regTraceClasses(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus
}
#endif

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

@ -0,0 +1,741 @@
// Lean compiler output
// Module: Lean.Meta.EqnCompiler.MVarRenaming
// Imports: Init Lean.Util.ReplaceExpr
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
lean_object* lean_expr_update_forall(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_unreachable_x21___rarg(lean_object*);
uint8_t l_USize_decEq(size_t, size_t);
lean_object* lean_array_uget(lean_object*, size_t);
lean_object* lean_expr_update_mdata(lean_object*, lean_object*);
uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*);
extern lean_object* l_Option_get_x21___rarg___closed__3;
lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
lean_object* l_Lean_mkMVar(lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_find_x3f(lean_object*, lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_apply(lean_object*, lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_insert(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Name_inhabited;
uint8_t l_Lean_Meta_MVarRenaming_isEmpty(lean_object*);
lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_find_x21___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(lean_object*, size_t, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___closed__2;
lean_object* l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_find_x3f___boxed(lean_object*, lean_object*);
lean_object* lean_expr_update_let(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Expr_Data_binderInfo(uint64_t);
lean_object* lean_expr_update_proj(lean_object*, lean_object*);
lean_object* l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1(lean_object*, lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_isEmpty___boxed(lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_apply___boxed(lean_object*, lean_object*);
size_t l_USize_mod(size_t, size_t);
size_t lean_ptr_addr(lean_object*);
lean_object* l_Lean_Meta_MVarRenaming_find_x21(lean_object*, lean_object*);
uint8_t l_Lean_Expr_hasMVar(lean_object*);
lean_object* lean_panic_fn(lean_object*, lean_object*);
lean_object* lean_expr_update_lambda(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* lean_expr_update_app(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_ReplaceImpl_initCache;
uint8_t l_Lean_Meta_MVarRenaming_isEmpty(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
uint8_t x_2;
x_2 = 1;
return x_2;
}
else
{
uint8_t x_3;
x_3 = 0;
return x_3;
}
}
}
lean_object* l_Lean_Meta_MVarRenaming_isEmpty___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3;
x_2 = l_Lean_Meta_MVarRenaming_isEmpty(x_1);
lean_dec(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
lean_object* l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_3;
x_3 = lean_box(0);
return x_3;
}
else
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; uint8_t x_8;
x_4 = lean_ctor_get(x_1, 0);
x_5 = lean_ctor_get(x_1, 1);
x_6 = lean_ctor_get(x_1, 2);
x_7 = lean_ctor_get(x_1, 3);
x_8 = l_Lean_Name_quickLt(x_2, x_5);
if (x_8 == 0)
{
uint8_t x_9;
x_9 = l_Lean_Name_quickLt(x_5, x_2);
if (x_9 == 0)
{
lean_object* x_10;
lean_inc(x_6);
x_10 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_10, 0, x_6);
return x_10;
}
else
{
x_1 = x_7;
goto _start;
}
}
else
{
x_1 = x_4;
goto _start;
}
}
}
}
lean_object* l_Lean_Meta_MVarRenaming_find_x3f(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1(x_1, x_2);
return x_3;
}
}
lean_object* l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* l_Lean_Meta_MVarRenaming_find_x3f___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Lean_Meta_MVarRenaming_find_x3f(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* l_Lean_Meta_MVarRenaming_find_x21(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1(x_1, x_2);
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = l_Lean_Name_inhabited;
x_5 = l_Option_get_x21___rarg___closed__3;
x_6 = lean_panic_fn(x_4, x_5);
return x_6;
}
else
{
lean_object* x_7;
x_7 = lean_ctor_get(x_3, 0);
lean_inc(x_7);
lean_dec(x_3);
return x_7;
}
}
}
lean_object* l_Lean_Meta_MVarRenaming_find_x21___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Lean_Meta_MVarRenaming_find_x21(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* l_Lean_Meta_MVarRenaming_insert(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(x_1, x_2, x_3);
return x_4;
}
}
lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(lean_object* x_1, size_t x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
size_t x_5; size_t x_6; lean_object* x_7; lean_object* x_159; lean_object* x_160; lean_object* x_167; size_t x_168; uint8_t x_169;
x_5 = lean_ptr_addr(x_3);
x_6 = x_2 == 0 ? 0 : x_5 % x_2;
x_159 = lean_ctor_get(x_4, 0);
lean_inc(x_159);
x_167 = lean_array_uget(x_159, x_6);
x_168 = lean_ptr_addr(x_167);
lean_dec(x_167);
x_169 = x_168 == x_5;
if (x_169 == 0)
{
if (lean_obj_tag(x_3) == 2)
{
lean_object* x_170; lean_object* x_171;
x_170 = lean_ctor_get(x_3, 0);
lean_inc(x_170);
x_171 = l_Std_RBNode_find___main___at_Lean_Meta_MVarRenaming_find_x3f___spec__1(x_1, x_170);
lean_dec(x_170);
if (lean_obj_tag(x_171) == 0)
{
lean_inc(x_3);
x_160 = x_3;
goto block_166;
}
else
{
lean_object* x_172; lean_object* x_173;
x_172 = lean_ctor_get(x_171, 0);
lean_inc(x_172);
lean_dec(x_171);
x_173 = l_Lean_mkMVar(x_172);
x_160 = x_173;
goto block_166;
}
}
else
{
lean_object* x_174;
lean_dec(x_159);
x_174 = lean_box(0);
x_7 = x_174;
goto block_158;
}
}
else
{
lean_object* x_175; lean_object* x_176; lean_object* x_177;
lean_dec(x_159);
lean_dec(x_3);
x_175 = lean_ctor_get(x_4, 1);
lean_inc(x_175);
x_176 = lean_array_uget(x_175, x_6);
lean_dec(x_175);
x_177 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_177, 0, x_176);
lean_ctor_set(x_177, 1, x_4);
return x_177;
}
block_158:
{
lean_dec(x_7);
switch (lean_obj_tag(x_3)) {
case 5:
{
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14;
x_8 = lean_ctor_get(x_3, 0);
lean_inc(x_8);
x_9 = lean_ctor_get(x_3, 1);
lean_inc(x_9);
x_10 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_8, x_4);
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 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_9, x_12);
x_14 = !lean_is_exclusive(x_13);
if (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_13, 0);
x_16 = lean_ctor_get(x_13, 1);
x_17 = lean_ctor_get(x_16, 0);
lean_inc(x_17);
lean_inc(x_3);
x_18 = lean_array_uset(x_17, x_6, x_3);
x_19 = lean_ctor_get(x_16, 1);
lean_inc(x_19);
lean_dec(x_16);
x_20 = lean_expr_update_app(x_3, x_11, x_15);
lean_inc(x_20);
x_21 = lean_array_uset(x_19, x_6, x_20);
x_22 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_22, 0, x_18);
lean_ctor_set(x_22, 1, x_21);
lean_ctor_set(x_13, 1, x_22);
lean_ctor_set(x_13, 0, x_20);
return x_13;
}
else
{
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;
x_23 = lean_ctor_get(x_13, 0);
x_24 = lean_ctor_get(x_13, 1);
lean_inc(x_24);
lean_inc(x_23);
lean_dec(x_13);
x_25 = lean_ctor_get(x_24, 0);
lean_inc(x_25);
lean_inc(x_3);
x_26 = lean_array_uset(x_25, x_6, x_3);
x_27 = lean_ctor_get(x_24, 1);
lean_inc(x_27);
lean_dec(x_24);
x_28 = lean_expr_update_app(x_3, x_11, x_23);
lean_inc(x_28);
x_29 = lean_array_uset(x_27, x_6, x_28);
x_30 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_30, 0, x_26);
lean_ctor_set(x_30, 1, x_29);
x_31 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_31, 0, x_28);
lean_ctor_set(x_31, 1, x_30);
return x_31;
}
}
case 6:
{
lean_object* x_32; lean_object* x_33; uint64_t x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; uint8_t x_39;
x_32 = lean_ctor_get(x_3, 1);
lean_inc(x_32);
x_33 = lean_ctor_get(x_3, 2);
lean_inc(x_33);
x_34 = lean_ctor_get_uint64(x_3, sizeof(void*)*3);
x_35 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_32, x_4);
x_36 = lean_ctor_get(x_35, 0);
lean_inc(x_36);
x_37 = lean_ctor_get(x_35, 1);
lean_inc(x_37);
lean_dec(x_35);
x_38 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_33, x_37);
x_39 = !lean_is_exclusive(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; uint8_t x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48;
x_40 = lean_ctor_get(x_38, 0);
x_41 = lean_ctor_get(x_38, 1);
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
lean_inc(x_3);
x_43 = lean_array_uset(x_42, x_6, x_3);
x_44 = lean_ctor_get(x_41, 1);
lean_inc(x_44);
lean_dec(x_41);
x_45 = (uint8_t)((x_34 << 24) >> 61);
x_46 = lean_expr_update_lambda(x_3, x_45, x_36, x_40);
lean_inc(x_46);
x_47 = lean_array_uset(x_44, x_6, x_46);
x_48 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_48, 0, x_43);
lean_ctor_set(x_48, 1, x_47);
lean_ctor_set(x_38, 1, x_48);
lean_ctor_set(x_38, 0, x_46);
return x_38;
}
else
{
lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; uint8_t x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58;
x_49 = lean_ctor_get(x_38, 0);
x_50 = lean_ctor_get(x_38, 1);
lean_inc(x_50);
lean_inc(x_49);
lean_dec(x_38);
x_51 = lean_ctor_get(x_50, 0);
lean_inc(x_51);
lean_inc(x_3);
x_52 = lean_array_uset(x_51, x_6, x_3);
x_53 = lean_ctor_get(x_50, 1);
lean_inc(x_53);
lean_dec(x_50);
x_54 = (uint8_t)((x_34 << 24) >> 61);
x_55 = lean_expr_update_lambda(x_3, x_54, x_36, x_49);
lean_inc(x_55);
x_56 = lean_array_uset(x_53, x_6, x_55);
x_57 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_57, 0, x_52);
lean_ctor_set(x_57, 1, x_56);
x_58 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_58, 0, x_55);
lean_ctor_set(x_58, 1, x_57);
return x_58;
}
}
case 7:
{
lean_object* x_59; lean_object* x_60; uint64_t x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; uint8_t x_66;
x_59 = lean_ctor_get(x_3, 1);
lean_inc(x_59);
x_60 = lean_ctor_get(x_3, 2);
lean_inc(x_60);
x_61 = lean_ctor_get_uint64(x_3, sizeof(void*)*3);
x_62 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_59, x_4);
x_63 = lean_ctor_get(x_62, 0);
lean_inc(x_63);
x_64 = lean_ctor_get(x_62, 1);
lean_inc(x_64);
lean_dec(x_62);
x_65 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_60, x_64);
x_66 = !lean_is_exclusive(x_65);
if (x_66 == 0)
{
lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; uint8_t x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75;
x_67 = lean_ctor_get(x_65, 0);
x_68 = lean_ctor_get(x_65, 1);
x_69 = lean_ctor_get(x_68, 0);
lean_inc(x_69);
lean_inc(x_3);
x_70 = lean_array_uset(x_69, x_6, x_3);
x_71 = lean_ctor_get(x_68, 1);
lean_inc(x_71);
lean_dec(x_68);
x_72 = (uint8_t)((x_61 << 24) >> 61);
x_73 = lean_expr_update_forall(x_3, x_72, x_63, x_67);
lean_inc(x_73);
x_74 = lean_array_uset(x_71, x_6, x_73);
x_75 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_75, 0, x_70);
lean_ctor_set(x_75, 1, x_74);
lean_ctor_set(x_65, 1, x_75);
lean_ctor_set(x_65, 0, x_73);
return x_65;
}
else
{
lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; uint8_t x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85;
x_76 = lean_ctor_get(x_65, 0);
x_77 = lean_ctor_get(x_65, 1);
lean_inc(x_77);
lean_inc(x_76);
lean_dec(x_65);
x_78 = lean_ctor_get(x_77, 0);
lean_inc(x_78);
lean_inc(x_3);
x_79 = lean_array_uset(x_78, x_6, x_3);
x_80 = lean_ctor_get(x_77, 1);
lean_inc(x_80);
lean_dec(x_77);
x_81 = (uint8_t)((x_61 << 24) >> 61);
x_82 = lean_expr_update_forall(x_3, x_81, x_63, x_76);
lean_inc(x_82);
x_83 = lean_array_uset(x_80, x_6, x_82);
x_84 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_84, 0, x_79);
lean_ctor_set(x_84, 1, x_83);
x_85 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_85, 0, x_82);
lean_ctor_set(x_85, 1, x_84);
return x_85;
}
}
case 8:
{
lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; uint8_t x_96;
x_86 = lean_ctor_get(x_3, 1);
lean_inc(x_86);
x_87 = lean_ctor_get(x_3, 2);
lean_inc(x_87);
x_88 = lean_ctor_get(x_3, 3);
lean_inc(x_88);
x_89 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_86, x_4);
x_90 = lean_ctor_get(x_89, 0);
lean_inc(x_90);
x_91 = lean_ctor_get(x_89, 1);
lean_inc(x_91);
lean_dec(x_89);
x_92 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_87, x_91);
x_93 = lean_ctor_get(x_92, 0);
lean_inc(x_93);
x_94 = lean_ctor_get(x_92, 1);
lean_inc(x_94);
lean_dec(x_92);
x_95 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_88, x_94);
x_96 = !lean_is_exclusive(x_95);
if (x_96 == 0)
{
lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104;
x_97 = lean_ctor_get(x_95, 0);
x_98 = lean_ctor_get(x_95, 1);
x_99 = lean_ctor_get(x_98, 0);
lean_inc(x_99);
lean_inc(x_3);
x_100 = lean_array_uset(x_99, x_6, x_3);
x_101 = lean_ctor_get(x_98, 1);
lean_inc(x_101);
lean_dec(x_98);
x_102 = lean_expr_update_let(x_3, x_90, x_93, x_97);
lean_inc(x_102);
x_103 = lean_array_uset(x_101, x_6, x_102);
x_104 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_104, 0, x_100);
lean_ctor_set(x_104, 1, x_103);
lean_ctor_set(x_95, 1, x_104);
lean_ctor_set(x_95, 0, x_102);
return x_95;
}
else
{
lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113;
x_105 = lean_ctor_get(x_95, 0);
x_106 = lean_ctor_get(x_95, 1);
lean_inc(x_106);
lean_inc(x_105);
lean_dec(x_95);
x_107 = lean_ctor_get(x_106, 0);
lean_inc(x_107);
lean_inc(x_3);
x_108 = lean_array_uset(x_107, x_6, x_3);
x_109 = lean_ctor_get(x_106, 1);
lean_inc(x_109);
lean_dec(x_106);
x_110 = lean_expr_update_let(x_3, x_90, x_93, x_105);
lean_inc(x_110);
x_111 = lean_array_uset(x_109, x_6, x_110);
x_112 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_112, 0, x_108);
lean_ctor_set(x_112, 1, x_111);
x_113 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_113, 0, x_110);
lean_ctor_set(x_113, 1, x_112);
return x_113;
}
}
case 10:
{
lean_object* x_114; lean_object* x_115; uint8_t x_116;
x_114 = lean_ctor_get(x_3, 1);
lean_inc(x_114);
x_115 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_114, x_4);
x_116 = !lean_is_exclusive(x_115);
if (x_116 == 0)
{
lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124;
x_117 = lean_ctor_get(x_115, 0);
x_118 = lean_ctor_get(x_115, 1);
x_119 = lean_ctor_get(x_118, 0);
lean_inc(x_119);
lean_inc(x_3);
x_120 = lean_array_uset(x_119, x_6, x_3);
x_121 = lean_ctor_get(x_118, 1);
lean_inc(x_121);
lean_dec(x_118);
x_122 = lean_expr_update_mdata(x_3, x_117);
lean_inc(x_122);
x_123 = lean_array_uset(x_121, x_6, x_122);
x_124 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_124, 0, x_120);
lean_ctor_set(x_124, 1, x_123);
lean_ctor_set(x_115, 1, x_124);
lean_ctor_set(x_115, 0, x_122);
return x_115;
}
else
{
lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133;
x_125 = lean_ctor_get(x_115, 0);
x_126 = lean_ctor_get(x_115, 1);
lean_inc(x_126);
lean_inc(x_125);
lean_dec(x_115);
x_127 = lean_ctor_get(x_126, 0);
lean_inc(x_127);
lean_inc(x_3);
x_128 = lean_array_uset(x_127, x_6, x_3);
x_129 = lean_ctor_get(x_126, 1);
lean_inc(x_129);
lean_dec(x_126);
x_130 = lean_expr_update_mdata(x_3, x_125);
lean_inc(x_130);
x_131 = lean_array_uset(x_129, x_6, x_130);
x_132 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_132, 0, x_128);
lean_ctor_set(x_132, 1, x_131);
x_133 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_133, 0, x_130);
lean_ctor_set(x_133, 1, x_132);
return x_133;
}
}
case 11:
{
lean_object* x_134; lean_object* x_135; uint8_t x_136;
x_134 = lean_ctor_get(x_3, 2);
lean_inc(x_134);
x_135 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_2, x_134, x_4);
x_136 = !lean_is_exclusive(x_135);
if (x_136 == 0)
{
lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144;
x_137 = lean_ctor_get(x_135, 0);
x_138 = lean_ctor_get(x_135, 1);
x_139 = lean_ctor_get(x_138, 0);
lean_inc(x_139);
lean_inc(x_3);
x_140 = lean_array_uset(x_139, x_6, x_3);
x_141 = lean_ctor_get(x_138, 1);
lean_inc(x_141);
lean_dec(x_138);
x_142 = lean_expr_update_proj(x_3, x_137);
lean_inc(x_142);
x_143 = lean_array_uset(x_141, x_6, x_142);
x_144 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_144, 0, x_140);
lean_ctor_set(x_144, 1, x_143);
lean_ctor_set(x_135, 1, x_144);
lean_ctor_set(x_135, 0, x_142);
return x_135;
}
else
{
lean_object* x_145; lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153;
x_145 = lean_ctor_get(x_135, 0);
x_146 = lean_ctor_get(x_135, 1);
lean_inc(x_146);
lean_inc(x_145);
lean_dec(x_135);
x_147 = lean_ctor_get(x_146, 0);
lean_inc(x_147);
lean_inc(x_3);
x_148 = lean_array_uset(x_147, x_6, x_3);
x_149 = lean_ctor_get(x_146, 1);
lean_inc(x_149);
lean_dec(x_146);
x_150 = lean_expr_update_proj(x_3, x_145);
lean_inc(x_150);
x_151 = lean_array_uset(x_149, x_6, x_150);
x_152 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_152, 0, x_148);
lean_ctor_set(x_152, 1, x_151);
x_153 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_153, 0, x_150);
lean_ctor_set(x_153, 1, x_152);
return x_153;
}
}
case 12:
{
lean_object* x_154; lean_object* x_155; lean_object* x_156;
lean_dec(x_3);
x_154 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___closed__2;
x_155 = l_unreachable_x21___rarg(x_154);
x_156 = lean_apply_1(x_155, x_4);
return x_156;
}
default:
{
lean_object* x_157;
x_157 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_157, 0, x_3);
lean_ctor_set(x_157, 1, x_4);
return x_157;
}
}
}
block_166:
{
lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165;
x_161 = lean_array_uset(x_159, x_6, x_3);
x_162 = lean_ctor_get(x_4, 1);
lean_inc(x_162);
lean_dec(x_4);
lean_inc(x_160);
x_163 = lean_array_uset(x_162, x_6, x_160);
x_164 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_164, 0, x_161);
lean_ctor_set(x_164, 1, x_163);
x_165 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_165, 0, x_160);
lean_ctor_set(x_165, 1, x_164);
return x_165;
}
}
}
lean_object* l_Lean_Meta_MVarRenaming_apply(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3;
x_3 = l_Lean_Expr_hasMVar(x_2);
if (x_3 == 0)
{
return x_2;
}
else
{
if (lean_obj_tag(x_1) == 0)
{
return x_2;
}
else
{
size_t x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_4 = 8192;
x_5 = l_Lean_Expr_ReplaceImpl_initCache;
x_6 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_4, x_2, x_5);
x_7 = lean_ctor_get(x_6, 0);
lean_inc(x_7);
lean_dec(x_6);
return x_7;
}
}
}
}
lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
size_t x_5; lean_object* x_6;
x_5 = lean_unbox_usize(x_2);
lean_dec(x_2);
x_6 = l_Lean_Expr_ReplaceImpl_replaceUnsafeM___main___at_Lean_Meta_MVarRenaming_apply___spec__1(x_1, x_5, x_3, x_4);
lean_dec(x_1);
return x_6;
}
}
lean_object* l_Lean_Meta_MVarRenaming_apply___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l_Lean_Meta_MVarRenaming_apply(x_1, x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Util_ReplaceExpr(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Lean_Meta_EqnCompiler_MVarRenaming(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Util_ReplaceExpr(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus
}
#endif

View file

@ -1,5 +1,5 @@
// Lean compiler output
// Module: Lean.EqnCompiler.MatchPattern
// Module: Lean.Meta.EqnCompiler.MatchPattern
// Imports: Init Lean.Attributes
#include <lean/lean.h>
#if defined(__clang__)
@ -124,7 +124,7 @@ return x_4;
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Attributes(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Lean_EqnCompiler_MatchPattern(lean_object* w) {
lean_object* initialize_Lean_Meta_EqnCompiler_MatchPattern(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;

View file

@ -62,6 +62,7 @@ lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__68;
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__73;
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__32;
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__10;
lean_object* l_Lean_Meta_Exception_getRef(lean_object*);
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__20;
lean_object* l_Lean_mkProj(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__57;
@ -108,6 +109,7 @@ lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__75;
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__26;
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__58;
lean_object* l_Lean_fmt___at_Lean_Message_toString___spec__1(lean_object*);
lean_object* l_Lean_Meta_Exception_getRef___boxed(lean_object*);
lean_object* l_List_toStringAux___main___at_Lean_Meta_Exception_toStr___spec__2___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__14;
lean_object* l_Lean_Meta_Exception_toTraceMessageData___closed__28;
@ -173,11 +175,13 @@ return x_2;
lean_object* _init_l_Lean_Meta_Exception_Inhabited___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Meta_Exception_Inhabited___closed__1;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_Exception_Inhabited___closed__1;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Meta_Exception_Inhabited() {
@ -188,6 +192,42 @@ x_1 = l_Lean_Meta_Exception_Inhabited___closed__2;
return x_1;
}
}
lean_object* l_Lean_Meta_Exception_getRef(lean_object* x_1) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 18:
{
lean_object* x_2;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
return x_2;
}
case 22:
{
lean_object* x_3;
x_3 = lean_ctor_get(x_1, 0);
lean_inc(x_3);
return x_3;
}
default:
{
lean_object* x_4;
x_4 = lean_box(0);
return x_4;
}
}
}
}
lean_object* l_Lean_Meta_Exception_getRef___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Meta_Exception_getRef(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* l_List_toStringAux___main___at_Lean_Meta_Exception_toStr___spec__2(uint8_t x_1, lean_object* x_2) {
_start:
{
@ -615,7 +655,7 @@ return x_53;
case 18:
{
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_54 = lean_ctor_get(x_1, 0);
x_54 = lean_ctor_get(x_1, 1);
lean_inc(x_54);
lean_dec(x_1);
x_55 = l_Lean_Name_toString___closed__1;
@ -651,7 +691,7 @@ return x_63;
case 22:
{
lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67;
x_64 = lean_ctor_get(x_1, 0);
x_64 = lean_ctor_get(x_1, 1);
lean_inc(x_64);
lean_dec(x_1);
x_65 = l_Lean_fmt___at_Lean_Message_toString___spec__1(x_64);
@ -1946,11 +1986,11 @@ return x_132;
case 18:
{
lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; lean_object* x_142;
x_133 = lean_ctor_get(x_1, 0);
x_133 = lean_ctor_get(x_1, 1);
lean_inc(x_133);
x_134 = lean_ctor_get(x_1, 2);
x_134 = lean_ctor_get(x_1, 3);
lean_inc(x_134);
x_135 = lean_ctor_get(x_1, 3);
x_135 = lean_ctor_get(x_1, 4);
lean_inc(x_135);
lean_dec(x_1);
x_136 = lean_alloc_ctor(4, 1, 0);
@ -2013,7 +2053,7 @@ return x_154;
default:
{
lean_object* x_155;
x_155 = lean_ctor_get(x_1, 0);
x_155 = lean_ctor_get(x_1, 1);
lean_inc(x_155);
lean_dec(x_1);
return x_155;

View file

@ -63,6 +63,7 @@ lean_object* l_Lean_mkProj(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_Exception_mkLetTypeMismatchMessage___closed__1;
lean_object* l_Lean_Meta_Exception_toMessageData___closed__48;
lean_object* l_Lean_Meta_Exception_toMessageData___closed__34;
lean_object* l_Lean_Meta_throwOther___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_MessageData_Inhabited;
lean_object* l_Lean_Meta_Exception_mkLetTypeMismatchMessage___closed__2;
lean_object* l_Lean_KernelException_toMessageData(lean_object*, lean_object*);
@ -155,7 +156,6 @@ lean_object* l_Lean_Meta_Exception_toMessageData___closed__20;
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* l_IO_println___at_IO_runMeta___spec__1(lean_object*, lean_object*);
extern lean_object* l_Lean_KernelException_toMessageData___closed__39;
lean_object* l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4;
lean_object* _init_l___private_Lean_Meta_Message_1__run_x3f___rarg___closed__1() {
_start:
{
@ -302,20 +302,11 @@ lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* _init_l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
lean_inc(x_2);
x_4 = l_Lean_Meta_whnf(x_1, x_2, x_3);
if (lean_obj_tag(x_4) == 0)
{
@ -325,6 +316,7 @@ lean_inc(x_5);
if (lean_obj_tag(x_5) == 7)
{
uint8_t x_6;
lean_dec(x_2);
x_6 = !lean_is_exclusive(x_4);
if (x_6 == 0)
{
@ -354,53 +346,39 @@ return x_11;
}
else
{
uint8_t x_12;
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
lean_dec(x_5);
x_12 = !lean_is_exclusive(x_4);
if (x_12 == 0)
{
lean_object* x_13; lean_object* x_14;
x_13 = lean_ctor_get(x_4, 0);
lean_dec(x_13);
x_14 = l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4;
lean_ctor_set_tag(x_4, 1);
lean_ctor_set(x_4, 0, x_14);
return x_4;
}
else
{
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_4, 1);
lean_inc(x_15);
x_12 = lean_ctor_get(x_4, 1);
lean_inc(x_12);
lean_dec(x_4);
x_16 = l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4;
x_17 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_17, 0, x_16);
lean_ctor_set(x_17, 1, x_15);
return x_17;
}
x_13 = l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__3;
x_14 = lean_box(0);
x_15 = l_Lean_Meta_throwOther___rarg(x_13, x_14, x_2, x_12);
lean_dec(x_2);
return x_15;
}
}
else
{
uint8_t x_18;
x_18 = !lean_is_exclusive(x_4);
if (x_18 == 0)
uint8_t x_16;
lean_dec(x_2);
x_16 = !lean_is_exclusive(x_4);
if (x_16 == 0)
{
return x_4;
}
else
{
lean_object* x_19; lean_object* x_20; lean_object* x_21;
x_19 = lean_ctor_get(x_4, 0);
x_20 = lean_ctor_get(x_4, 1);
lean_inc(x_20);
lean_inc(x_19);
lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_17 = lean_ctor_get(x_4, 0);
x_18 = lean_ctor_get(x_4, 1);
lean_inc(x_18);
lean_inc(x_17);
lean_dec(x_4);
x_21 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set(x_21, 1, x_20);
return x_21;
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;
}
}
}
@ -1695,13 +1673,13 @@ return x_124;
case 18:
{
lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139;
x_125 = lean_ctor_get(x_1, 0);
x_125 = lean_ctor_get(x_1, 1);
lean_inc(x_125);
x_126 = lean_ctor_get(x_1, 1);
x_126 = lean_ctor_get(x_1, 2);
lean_inc(x_126);
x_127 = lean_ctor_get(x_1, 2);
x_127 = lean_ctor_get(x_1, 3);
lean_inc(x_127);
x_128 = lean_ctor_get(x_1, 3);
x_128 = lean_ctor_get(x_1, 4);
lean_inc(x_128);
lean_dec(x_1);
x_129 = lean_alloc_ctor(4, 1, 0);
@ -1773,7 +1751,7 @@ return x_151;
default:
{
lean_object* x_152;
x_152 = lean_ctor_get(x_1, 0);
x_152 = lean_ctor_get(x_1, 1);
lean_inc(x_152);
lean_dec(x_1);
return x_152;
@ -2218,8 +2196,6 @@ l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__2 = _init
lean_mark_persistent(l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__2);
l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__3 = _init_l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__3();
lean_mark_persistent(l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__3);
l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4 = _init_l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4();
lean_mark_persistent(l___private_Lean_Meta_Message_3__inferDomain_x3f___lambda__1___closed__4);
l___private_Lean_Meta_Message_3__inferDomain_x3f___closed__1 = _init_l___private_Lean_Meta_Message_3__inferDomain_x3f___closed__1();
lean_mark_persistent(l___private_Lean_Meta_Message_3__inferDomain_x3f___closed__1);
l_Lean_Meta_Exception_mkAppTypeMismatchMessage___closed__1 = _init_l_Lean_Meta_Exception_mkAppTypeMismatchMessage___closed__1();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -128,7 +128,6 @@ lean_object* l_Std_AssocList_contains___main___at_Lean_Meta_SynthInstance_MkTabl
extern lean_object* l_Lean_Meta_AbstractMVarsResult_inhabited___closed__1;
lean_object* l_Lean_Meta_setSynthPendingRef___closed__1;
uint8_t l_Lean_Meta_SynthInstance_Waiter_isRoot(lean_object*);
extern lean_object* l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
lean_object* lean_array_fget(lean_object*, lean_object*);
lean_object* lean_expr_instantiate_rev_range(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_Inhabited___closed__1;
@ -345,6 +344,7 @@ extern lean_object* l_Lean_Meta_Exception_Inhabited___closed__2;
uint8_t l_Lean_MetavarContext_isExprAssignable(lean_object*, lean_object*);
lean_object* l_Lean_MonadTracerAdapter_addTrace___at_Lean_Meta_isLevelDefEqAux___main___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_SynthInstance_Answer_inhabited___closed__1;
extern lean_object* l_Lean_Compiler_checkIsDefinition___closed__5;
lean_object* l_Lean_Meta_mkFreshLevelMVar___rarg(lean_object*);
extern lean_object* l_Lean_MetavarContext_Inhabited___closed__1;
extern lean_object* l_Lean_mkOptionalNode___closed__2;
@ -401,7 +401,7 @@ lean_object* l_Lean_Meta_SynthInstance_mkInferTCGoalsLRAttr___lambda__1(lean_obj
_start:
{
lean_object* x_3;
x_3 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_3 = l_Lean_Compiler_checkIsDefinition___closed__5;
return x_3;
}
}
@ -5159,7 +5159,7 @@ lean_ctor_set(x_99, 1, x_75);
lean_ctor_set(x_99, 2, x_97);
lean_ctor_set(x_99, 3, x_77);
lean_ctor_set(x_99, 4, x_98);
x_100 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_100 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_15 = x_100;
x_16 = x_99;
goto block_71;
@ -5178,7 +5178,7 @@ lean_dec(x_12);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_101 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_101 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_15 = x_101;
x_16 = x_72;
goto block_71;
@ -5310,7 +5310,7 @@ lean_ctor_set(x_134, 1, x_109);
lean_ctor_set(x_134, 2, x_132);
lean_ctor_set(x_134, 3, x_111);
lean_ctor_set(x_134, 4, x_133);
x_135 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_135 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_15 = x_135;
x_16 = x_134;
goto block_71;
@ -5329,7 +5329,7 @@ lean_dec(x_12);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_136 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_136 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_15 = x_136;
x_16 = x_124;
goto block_71;
@ -5721,7 +5721,7 @@ lean_ctor_set(x_230, 1, x_204);
lean_ctor_set(x_230, 2, x_228);
lean_ctor_set(x_230, 3, x_206);
lean_ctor_set(x_230, 4, x_229);
x_231 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_231 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_167 = x_231;
x_168 = x_230;
goto block_201;
@ -5740,7 +5740,7 @@ lean_dec(x_12);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_232 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_232 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_167 = x_232;
x_168 = x_220;
goto block_201;
@ -17773,7 +17773,7 @@ if (x_92 == 0)
lean_object* x_94;
lean_dec(x_19);
lean_dec(x_15);
x_94 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_94 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_36 = x_94;
x_37 = x_93;
goto block_91;
@ -18199,7 +18199,7 @@ if (x_201 == 0)
lean_object* x_203;
lean_dec(x_19);
lean_dec(x_15);
x_203 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_203 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_167 = x_203;
x_168 = x_202;
goto block_200;
@ -18591,7 +18591,7 @@ if (x_294 == 0)
lean_object* x_296;
lean_dec(x_19);
lean_dec(x_15);
x_296 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_296 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_260 = x_296;
x_261 = x_295;
goto block_293;
@ -19098,7 +19098,7 @@ if (x_408 == 0)
lean_object* x_410;
lean_dec(x_349);
lean_dec(x_346);
x_410 = l_Nat_forMAux___main___at___private_Lean_MetavarContext_10__collectDeps___spec__50___closed__1;
x_410 = l_Lean_Compiler_checkIsDefinition___closed__5;
x_374 = x_410;
x_375 = x_409;
goto block_407;
@ -21230,11 +21230,13 @@ return x_2;
lean_object* _init_l___private_Lean_Meta_SynthInstance_4__preprocessArgs___main___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l___private_Lean_Meta_SynthInstance_4__preprocessArgs___main___closed__3;
x_2 = lean_alloc_ctor(22, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l___private_Lean_Meta_SynthInstance_4__preprocessArgs___main___closed__3;
x_3 = lean_alloc_ctor(22, 2, 0);
lean_ctor_set(x_3, 0, x_1);
lean_ctor_set(x_3, 1, x_2);
return x_3;
}
}
lean_object* l___private_Lean_Meta_SynthInstance_4__preprocessArgs___main(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {

View file

@ -67,7 +67,7 @@ lean_object* l___private_Lean_Meta_Tactic_Apply_2__getExpectedNumArgs(lean_objec
lean_object* l_Lean_Meta_postprocessAppMVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_forallMetaTelescopeReducing(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
extern uint8_t l_Lean_BinderInfo_inhabited;
lean_object* l_Lean_Meta_synthInstance(lean_object*, lean_object*, lean_object*);
@ -376,7 +376,7 @@ return x_2;
lean_object* l___private_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; 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_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;
x_6 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_6, 0, x_2);
x_7 = l_Lean_indentExpr(x_6);
@ -399,8 +399,9 @@ x_16 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_16, 0, x_13);
lean_ctor_set(x_16, 1, x_15);
x_17 = l___private_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__2;
x_18 = l_Lean_Meta_throwTacticEx___rarg(x_17, x_1, x_16, x_4, x_5);
return x_18;
x_18 = lean_box(0);
x_19 = l_Lean_Meta_throwTacticEx___rarg(x_17, x_1, x_16, x_18, x_4, x_5);
return x_19;
}
}
lean_object* l___private_Lean_Meta_Tactic_Apply_3__throwApplyError(lean_object* x_1) {
@ -513,140 +514,141 @@ x_31 = lean_unbox(x_30);
lean_dec(x_30);
if (x_31 == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35;
lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36;
lean_dec(x_12);
x_32 = lean_ctor_get(x_29, 1);
lean_inc(x_32);
lean_dec(x_29);
x_33 = l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3;
x_34 = l_Lean_Meta_throwTacticEx___rarg(x_1, x_2, x_33, x_7, x_32);
x_34 = lean_box(0);
x_35 = l_Lean_Meta_throwTacticEx___rarg(x_1, x_2, x_33, x_34, x_7, x_32);
lean_dec(x_7);
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
x_36 = !lean_is_exclusive(x_35);
if (x_36 == 0)
{
return x_34;
return x_35;
}
else
{
lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_36 = lean_ctor_get(x_34, 0);
x_37 = lean_ctor_get(x_34, 1);
lean_object* x_37; lean_object* x_38; lean_object* x_39;
x_37 = lean_ctor_get(x_35, 0);
x_38 = lean_ctor_get(x_35, 1);
lean_inc(x_38);
lean_inc(x_37);
lean_inc(x_36);
lean_dec(x_34);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_36);
lean_ctor_set(x_38, 1, x_37);
return x_38;
lean_dec(x_35);
x_39 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_39, 0, x_37);
lean_ctor_set(x_39, 1, x_38);
return x_39;
}
}
else
{
lean_object* x_39;
x_39 = lean_ctor_get(x_29, 1);
lean_inc(x_39);
lean_object* x_40;
x_40 = lean_ctor_get(x_29, 1);
lean_inc(x_40);
lean_dec(x_29);
x_6 = x_12;
x_8 = x_39;
x_8 = x_40;
goto _start;
}
}
else
{
uint8_t x_41;
uint8_t x_42;
lean_dec(x_12);
lean_dec(x_7);
lean_dec(x_2);
lean_dec(x_1);
x_41 = !lean_is_exclusive(x_29);
if (x_41 == 0)
x_42 = !lean_is_exclusive(x_29);
if (x_42 == 0)
{
return x_29;
}
else
{
lean_object* x_42; lean_object* x_43; lean_object* x_44;
x_42 = lean_ctor_get(x_29, 0);
x_43 = lean_ctor_get(x_29, 1);
lean_object* x_43; lean_object* x_44; lean_object* x_45;
x_43 = lean_ctor_get(x_29, 0);
x_44 = lean_ctor_get(x_29, 1);
lean_inc(x_44);
lean_inc(x_43);
lean_inc(x_42);
lean_dec(x_29);
x_44 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_44, 0, x_42);
lean_ctor_set(x_44, 1, x_43);
return x_44;
x_45 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_45, 0, x_43);
lean_ctor_set(x_45, 1, x_44);
return x_45;
}
}
}
else
{
uint8_t x_45;
uint8_t x_46;
lean_dec(x_22);
lean_dec(x_12);
lean_dec(x_7);
lean_dec(x_2);
lean_dec(x_1);
x_45 = !lean_is_exclusive(x_26);
if (x_45 == 0)
x_46 = !lean_is_exclusive(x_26);
if (x_46 == 0)
{
return x_26;
}
else
{
lean_object* x_46; lean_object* x_47; lean_object* x_48;
x_46 = lean_ctor_get(x_26, 0);
x_47 = lean_ctor_get(x_26, 1);
lean_object* x_47; lean_object* x_48; lean_object* x_49;
x_47 = lean_ctor_get(x_26, 0);
x_48 = lean_ctor_get(x_26, 1);
lean_inc(x_48);
lean_inc(x_47);
lean_inc(x_46);
lean_dec(x_26);
x_48 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_48, 0, x_46);
lean_ctor_set(x_48, 1, x_47);
return x_48;
x_49 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_49, 0, x_47);
lean_ctor_set(x_49, 1, x_48);
return x_49;
}
}
}
else
{
uint8_t x_49;
uint8_t x_50;
lean_dec(x_22);
lean_dec(x_12);
lean_dec(x_7);
lean_dec(x_2);
lean_dec(x_1);
x_49 = !lean_is_exclusive(x_23);
if (x_49 == 0)
x_50 = !lean_is_exclusive(x_23);
if (x_50 == 0)
{
return x_23;
}
else
{
lean_object* x_50; lean_object* x_51; lean_object* x_52;
x_50 = lean_ctor_get(x_23, 0);
x_51 = lean_ctor_get(x_23, 1);
lean_object* x_51; lean_object* x_52; lean_object* x_53;
x_51 = lean_ctor_get(x_23, 0);
x_52 = lean_ctor_get(x_23, 1);
lean_inc(x_52);
lean_inc(x_51);
lean_inc(x_50);
lean_dec(x_23);
x_52 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_52, 0, x_50);
lean_ctor_set(x_52, 1, x_51);
return x_52;
x_53 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_53, 0, x_51);
lean_ctor_set(x_53, 1, x_52);
return x_53;
}
}
}
}
else
{
lean_object* x_53; lean_object* x_54;
lean_object* x_54; lean_object* x_55;
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_2);
lean_dec(x_1);
x_53 = lean_box(0);
x_54 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_54, 0, x_53);
lean_ctor_set(x_54, 1, x_8);
return x_54;
x_54 = lean_box(0);
x_55 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_55, 0, x_54);
lean_ctor_set(x_55, 1, x_8);
return x_55;
}
}
}

View file

@ -14,6 +14,7 @@
extern "C" {
#endif
lean_object* l_Lean_Meta_assert(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_eq_x3f___closed__2;
lean_object* l_Lean_Expr_mvarId_x21(lean_object*);
lean_object* l_Lean_Meta_assert___closed__2;
lean_object* l_Lean_Meta_withLocalContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -22,21 +23,32 @@ lean_object* l_Lean_Meta_define(lean_object*, lean_object*, lean_object*, lean_o
lean_object* l_Lean_Meta_getMVarTag(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assert___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assert___closed__1;
lean_object* l_Lean_Meta_mkEqRefl(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assert___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_Meta_define___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assertExt___lambda__1___closed__1;
lean_object* l_Lean_Meta_assertExt(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assertExt___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_mkApp(lean_object*, lean_object*);
lean_object* l_Lean_Meta_getLevel(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_define___closed__2;
lean_object* l_Lean_Meta_assertExt___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkForall(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Meta_define___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_define___closed__1;
lean_object* l_Lean_mkLet(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t);
lean_object* l_Lean_Meta_getMVarDecl(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_define___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assertExt___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkAppB(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkBVar(lean_object*);
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
lean_object* l_Lean_mkApp3(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assert___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:
{
@ -572,6 +584,357 @@ lean_dec(x_5);
return x_7;
}
}
lean_object* _init_l_Lean_Meta_assertExt___lambda__1___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = lean_unsigned_to_nat(0u);
x_2 = l_Lean_mkBVar(x_1);
return x_2;
}
}
lean_object* l_Lean_Meta_assertExt___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9;
lean_inc(x_1);
x_9 = l_Lean_Meta_checkNotAssigned(x_1, x_2, x_7, x_8);
if (lean_obj_tag(x_9) == 0)
{
lean_object* x_10; lean_object* x_11;
x_10 = lean_ctor_get(x_9, 1);
lean_inc(x_10);
lean_dec(x_9);
lean_inc(x_1);
x_11 = l_Lean_Meta_getMVarTag(x_1, x_7, 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_1);
x_14 = l_Lean_Meta_getMVarType(x_1, x_7, x_13);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_14, 0);
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_3);
x_17 = l_Lean_Meta_getLevel(x_3, x_7, x_16);
if (lean_obj_tag(x_17) == 0)
{
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; uint8_t x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33;
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 = lean_box(0);
x_21 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_21, 0, x_18);
lean_ctor_set(x_21, 1, x_20);
x_22 = l_Lean_Expr_eq_x3f___closed__2;
x_23 = l_Lean_mkConst(x_22, x_21);
x_24 = l_Lean_Meta_assertExt___lambda__1___closed__1;
lean_inc(x_4);
lean_inc(x_3);
x_25 = l_Lean_mkApp3(x_23, x_3, x_24, x_4);
x_26 = 0;
x_27 = l_Lean_mkForall(x_5, x_26, x_25, x_15);
x_28 = l_Lean_mkForall(x_6, x_26, x_3, x_27);
x_29 = 2;
lean_inc(x_7);
x_30 = l_Lean_Meta_mkFreshExprMVar(x_28, x_12, x_29, x_7, x_19);
x_31 = lean_ctor_get(x_30, 0);
lean_inc(x_31);
x_32 = lean_ctor_get(x_30, 1);
lean_inc(x_32);
lean_dec(x_30);
lean_inc(x_7);
lean_inc(x_4);
x_33 = l_Lean_Meta_mkEqRefl(x_4, x_7, x_32);
if (lean_obj_tag(x_33) == 0)
{
lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_34 = lean_ctor_get(x_33, 0);
lean_inc(x_34);
x_35 = lean_ctor_get(x_33, 1);
lean_inc(x_35);
lean_dec(x_33);
lean_inc(x_31);
x_36 = l_Lean_mkAppB(x_31, x_4, x_34);
x_37 = l_Lean_Expr_mvarId_x21(x_31);
lean_dec(x_31);
x_38 = l_Lean_Meta_assignExprMVar(x_1, x_36, x_7, x_35);
lean_dec(x_7);
if (lean_obj_tag(x_38) == 0)
{
uint8_t x_39;
x_39 = !lean_is_exclusive(x_38);
if (x_39 == 0)
{
lean_object* x_40;
x_40 = lean_ctor_get(x_38, 0);
lean_dec(x_40);
lean_ctor_set(x_38, 0, x_37);
return x_38;
}
else
{
lean_object* x_41; lean_object* x_42;
x_41 = lean_ctor_get(x_38, 1);
lean_inc(x_41);
lean_dec(x_38);
x_42 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_42, 0, x_37);
lean_ctor_set(x_42, 1, x_41);
return x_42;
}
}
else
{
uint8_t x_43;
lean_dec(x_37);
x_43 = !lean_is_exclusive(x_38);
if (x_43 == 0)
{
return x_38;
}
else
{
lean_object* x_44; lean_object* x_45; lean_object* x_46;
x_44 = lean_ctor_get(x_38, 0);
x_45 = lean_ctor_get(x_38, 1);
lean_inc(x_45);
lean_inc(x_44);
lean_dec(x_38);
x_46 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_46, 0, x_44);
lean_ctor_set(x_46, 1, x_45);
return x_46;
}
}
}
else
{
uint8_t x_47;
lean_dec(x_31);
lean_dec(x_7);
lean_dec(x_4);
lean_dec(x_1);
x_47 = !lean_is_exclusive(x_33);
if (x_47 == 0)
{
return x_33;
}
else
{
lean_object* x_48; lean_object* x_49; lean_object* x_50;
x_48 = lean_ctor_get(x_33, 0);
x_49 = lean_ctor_get(x_33, 1);
lean_inc(x_49);
lean_inc(x_48);
lean_dec(x_33);
x_50 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_50, 0, x_48);
lean_ctor_set(x_50, 1, x_49);
return x_50;
}
}
}
else
{
uint8_t x_51;
lean_dec(x_15);
lean_dec(x_12);
lean_dec(x_7);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_1);
x_51 = !lean_is_exclusive(x_17);
if (x_51 == 0)
{
return x_17;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54;
x_52 = lean_ctor_get(x_17, 0);
x_53 = lean_ctor_get(x_17, 1);
lean_inc(x_53);
lean_inc(x_52);
lean_dec(x_17);
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
{
uint8_t x_55;
lean_dec(x_12);
lean_dec(x_7);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_1);
x_55 = !lean_is_exclusive(x_14);
if (x_55 == 0)
{
return x_14;
}
else
{
lean_object* x_56; lean_object* x_57; lean_object* x_58;
x_56 = lean_ctor_get(x_14, 0);
x_57 = lean_ctor_get(x_14, 1);
lean_inc(x_57);
lean_inc(x_56);
lean_dec(x_14);
x_58 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_58, 0, x_56);
lean_ctor_set(x_58, 1, x_57);
return x_58;
}
}
}
else
{
uint8_t x_59;
lean_dec(x_7);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_1);
x_59 = !lean_is_exclusive(x_11);
if (x_59 == 0)
{
return x_11;
}
else
{
lean_object* x_60; lean_object* x_61; lean_object* x_62;
x_60 = lean_ctor_get(x_11, 0);
x_61 = lean_ctor_get(x_11, 1);
lean_inc(x_61);
lean_inc(x_60);
lean_dec(x_11);
x_62 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_62, 0, x_60);
lean_ctor_set(x_62, 1, x_61);
return x_62;
}
}
}
else
{
uint8_t x_63;
lean_dec(x_7);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_1);
x_63 = !lean_is_exclusive(x_9);
if (x_63 == 0)
{
return x_9;
}
else
{
lean_object* x_64; lean_object* x_65; lean_object* x_66;
x_64 = lean_ctor_get(x_9, 0);
x_65 = lean_ctor_get(x_9, 1);
lean_inc(x_65);
lean_inc(x_64);
lean_dec(x_9);
x_66 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_66, 0, x_64);
lean_ctor_set(x_66, 1, x_65);
return x_66;
}
}
}
}
lean_object* l_Lean_Meta_assertExt(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
lean_object* x_8; lean_object* x_9; lean_object* x_10;
x_8 = l_Lean_Meta_assert___closed__2;
lean_inc(x_1);
x_9 = lean_alloc_closure((void*)(l_Lean_Meta_assertExt___lambda__1___boxed), 8, 6);
lean_closure_set(x_9, 0, x_1);
lean_closure_set(x_9, 1, x_8);
lean_closure_set(x_9, 2, x_3);
lean_closure_set(x_9, 3, x_4);
lean_closure_set(x_9, 4, x_5);
lean_closure_set(x_9, 5, x_2);
x_10 = l_Lean_Meta_getMVarDecl(x_1, x_6, x_7);
if (lean_obj_tag(x_10) == 0)
{
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
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 = lean_ctor_get(x_11, 1);
lean_inc(x_13);
x_14 = lean_ctor_get(x_11, 4);
lean_inc(x_14);
lean_dec(x_11);
x_15 = l_Lean_Meta_withLocalContext___rarg(x_13, x_14, x_9, x_6, x_12);
return x_15;
}
else
{
uint8_t x_16;
lean_dec(x_9);
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;
}
}
}
}
lean_object* l_Lean_Meta_assertExt___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9;
x_9 = l_Lean_Meta_assertExt___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
lean_dec(x_6);
lean_dec(x_5);
return x_9;
}
}
lean_object* l_Lean_Meta_assertExt___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
lean_object* x_8;
x_8 = l_Lean_Meta_assertExt(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
lean_dec(x_6);
return x_8;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Meta_Tactic_Util(lean_object*);
static bool _G_initialized = false;
@ -593,6 +956,8 @@ l_Lean_Meta_define___closed__1 = _init_l_Lean_Meta_define___closed__1();
lean_mark_persistent(l_Lean_Meta_define___closed__1);
l_Lean_Meta_define___closed__2 = _init_l_Lean_Meta_define___closed__2();
lean_mark_persistent(l_Lean_Meta_define___closed__2);
l_Lean_Meta_assertExt___lambda__1___closed__1 = _init_l_Lean_Meta_assertExt___lambda__1___closed__1();
lean_mark_persistent(l_Lean_Meta_assertExt___lambda__1___closed__1);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -33,7 +33,7 @@ lean_object* l_Lean_LocalContext_findDeclRevM_x3f___at_Lean_Meta_assumptionAux__
lean_object* l_Std_PersistentArray_findSomeRevMAux___main___at_Lean_Meta_assumptionAux___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Std_PersistentArray_findSomeRevM_x3f___at_Lean_Meta_assumptionAux___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_LocalDecl_type(lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assumptionAux___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assumptionAux___closed__1;
@ -1035,64 +1035,65 @@ x_6 = lean_unbox(x_5);
lean_dec(x_5);
if (x_6 == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_7 = lean_ctor_get(x_4, 1);
lean_inc(x_7);
lean_dec(x_4);
x_8 = l_Lean_Meta_assumptionAux___closed__2;
x_9 = l_Lean_Meta_Exception_Inhabited___closed__1;
x_10 = l_Lean_Meta_throwTacticEx___rarg(x_8, x_1, x_9, x_2, x_7);
return x_10;
x_10 = lean_box(0);
x_11 = l_Lean_Meta_throwTacticEx___rarg(x_8, x_1, x_9, x_10, x_2, x_7);
return x_11;
}
else
{
uint8_t x_11;
uint8_t x_12;
lean_dec(x_1);
x_11 = !lean_is_exclusive(x_4);
if (x_11 == 0)
x_12 = !lean_is_exclusive(x_4);
if (x_12 == 0)
{
lean_object* x_12; lean_object* x_13;
x_12 = lean_ctor_get(x_4, 0);
lean_dec(x_12);
x_13 = lean_box(0);
lean_ctor_set(x_4, 0, x_13);
lean_object* x_13; lean_object* x_14;
x_13 = lean_ctor_get(x_4, 0);
lean_dec(x_13);
x_14 = lean_box(0);
lean_ctor_set(x_4, 0, x_14);
return x_4;
}
else
{
lean_object* x_14; lean_object* x_15; lean_object* x_16;
x_14 = lean_ctor_get(x_4, 1);
lean_inc(x_14);
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_4, 1);
lean_inc(x_15);
lean_dec(x_4);
x_15 = lean_box(0);
x_16 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_16, 0, x_15);
lean_ctor_set(x_16, 1, x_14);
return x_16;
x_16 = lean_box(0);
x_17 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_17, 0, x_16);
lean_ctor_set(x_17, 1, x_15);
return x_17;
}
}
}
else
{
uint8_t x_17;
uint8_t x_18;
lean_dec(x_1);
x_17 = !lean_is_exclusive(x_4);
if (x_17 == 0)
x_18 = !lean_is_exclusive(x_4);
if (x_18 == 0)
{
return x_4;
}
else
{
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_18 = lean_ctor_get(x_4, 0);
x_19 = lean_ctor_get(x_4, 1);
lean_object* x_19; lean_object* x_20; lean_object* x_21;
x_19 = lean_ctor_get(x_4, 0);
x_20 = lean_ctor_get(x_4, 1);
lean_inc(x_20);
lean_inc(x_19);
lean_inc(x_18);
lean_dec(x_4);
x_20 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_20, 0, x_18);
lean_ctor_set(x_20, 1, x_19);
return x_20;
x_21 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set(x_21, 1, x_20);
return x_21;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -52,7 +52,7 @@ lean_object* l_Std_PersistentArray_forMAux___main___at_Lean_Meta_clear___spec__3
lean_object* l_Array_forMAux___main___at_Lean_Meta_clear___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkFreshExprMVarAt(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_MetavarContext_exprDependsOn(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_forMAux___main___at_Lean_Meta_clear___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned(lean_object*, lean_object*, lean_object*, lean_object*);
@ -281,7 +281,7 @@ goto _start;
}
else
{
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_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; uint8_t x_36;
lean_dec(x_15);
lean_dec(x_4);
x_23 = l_Lean_LocalDecl_toExpr(x_17);
@ -306,24 +306,25 @@ x_32 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8;
x_33 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set(x_33, 1, x_32);
x_34 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_33, x_7, x_8);
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
x_34 = lean_box(0);
x_35 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_33, x_34, x_7, x_8);
x_36 = !lean_is_exclusive(x_35);
if (x_36 == 0)
{
return x_34;
return x_35;
}
else
{
lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_36 = lean_ctor_get(x_34, 0);
x_37 = lean_ctor_get(x_34, 1);
lean_object* x_37; lean_object* x_38; lean_object* x_39;
x_37 = lean_ctor_get(x_35, 0);
x_38 = lean_ctor_get(x_35, 1);
lean_inc(x_38);
lean_inc(x_37);
lean_inc(x_36);
lean_dec(x_34);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_36);
lean_ctor_set(x_38, 1, x_37);
return x_38;
lean_dec(x_35);
x_39 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_39, 0, x_37);
lean_ctor_set(x_39, 1, x_38);
return x_39;
}
}
}
@ -416,7 +417,7 @@ goto _start;
}
else
{
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_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; uint8_t x_36;
lean_dec(x_15);
lean_dec(x_4);
x_23 = l_Lean_LocalDecl_toExpr(x_17);
@ -441,24 +442,25 @@ x_32 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8;
x_33 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set(x_33, 1, x_32);
x_34 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_33, x_7, x_8);
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
x_34 = lean_box(0);
x_35 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_33, x_34, x_7, x_8);
x_36 = !lean_is_exclusive(x_35);
if (x_36 == 0)
{
return x_34;
return x_35;
}
else
{
lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_36 = lean_ctor_get(x_34, 0);
x_37 = lean_ctor_get(x_34, 1);
lean_object* x_37; lean_object* x_38; lean_object* x_39;
x_37 = lean_ctor_get(x_35, 0);
x_38 = lean_ctor_get(x_35, 1);
lean_inc(x_38);
lean_inc(x_37);
lean_inc(x_36);
lean_dec(x_34);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_36);
lean_ctor_set(x_38, 1, x_37);
return x_38;
lean_dec(x_35);
x_39 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_39, 0, x_37);
lean_ctor_set(x_39, 1, x_38);
return x_39;
}
}
}
@ -649,46 +651,47 @@ lean_inc(x_8);
x_9 = l_Lean_LocalContext_contains(x_8, x_3);
if (x_9 == 0)
{
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; uint8_t x_90;
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; lean_object* x_91; uint8_t x_92;
lean_dec(x_8);
x_83 = l_Lean_mkFVar(x_3);
x_84 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_84, 0, x_83);
x_85 = l_Lean_Meta_clear___lambda__1___closed__6;
x_86 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_86, 0, x_85);
lean_ctor_set(x_86, 1, x_84);
x_87 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8;
x_88 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_88, 0, x_86);
lean_ctor_set(x_88, 1, x_87);
x_89 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_88, x_4, x_7);
x_84 = l_Lean_mkFVar(x_3);
x_85 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_85, 0, x_84);
x_86 = l_Lean_Meta_clear___lambda__1___closed__6;
x_87 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_87, 0, x_86);
lean_ctor_set(x_87, 1, x_85);
x_88 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8;
x_89 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_89, 0, x_87);
lean_ctor_set(x_89, 1, x_88);
x_90 = lean_box(0);
x_91 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_89, x_90, x_4, x_7);
lean_dec(x_4);
x_90 = !lean_is_exclusive(x_89);
if (x_90 == 0)
x_92 = !lean_is_exclusive(x_91);
if (x_92 == 0)
{
return x_89;
return x_91;
}
else
{
lean_object* x_91; lean_object* x_92; lean_object* x_93;
x_91 = lean_ctor_get(x_89, 0);
x_92 = lean_ctor_get(x_89, 1);
lean_inc(x_92);
lean_inc(x_91);
lean_dec(x_89);
x_93 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_93, 0, x_91);
lean_ctor_set(x_93, 1, x_92);
return x_93;
lean_object* x_93; lean_object* x_94; lean_object* x_95;
x_93 = lean_ctor_get(x_91, 0);
x_94 = lean_ctor_get(x_91, 1);
lean_inc(x_94);
lean_inc(x_93);
lean_dec(x_91);
x_95 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_95, 0, x_93);
lean_ctor_set(x_95, 1, x_94);
return x_95;
}
}
else
{
x_10 = x_7;
goto block_82;
goto block_83;
}
block_82:
block_83:
{
lean_object* x_11;
lean_inc(x_1);
@ -741,7 +744,7 @@ goto block_58;
}
else
{
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; uint8_t x_66;
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; uint8_t x_67;
lean_dec(x_23);
lean_dec(x_20);
lean_dec(x_12);
@ -756,25 +759,26 @@ x_63 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8;
x_64 = lean_alloc_ctor(9, 2, 0);
lean_ctor_set(x_64, 0, x_62);
lean_ctor_set(x_64, 1, x_63);
x_65 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_64, x_4, x_19);
x_65 = lean_box(0);
x_66 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_64, x_65, x_4, x_19);
lean_dec(x_4);
x_66 = !lean_is_exclusive(x_65);
if (x_66 == 0)
x_67 = !lean_is_exclusive(x_66);
if (x_67 == 0)
{
return x_65;
return x_66;
}
else
{
lean_object* x_67; lean_object* x_68; lean_object* x_69;
x_67 = lean_ctor_get(x_65, 0);
x_68 = lean_ctor_get(x_65, 1);
lean_object* x_68; lean_object* x_69; lean_object* x_70;
x_68 = lean_ctor_get(x_66, 0);
x_69 = lean_ctor_get(x_66, 1);
lean_inc(x_69);
lean_inc(x_68);
lean_inc(x_67);
lean_dec(x_65);
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;
lean_dec(x_66);
x_70 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_70, 0, x_68);
lean_ctor_set(x_70, 1, x_69);
return x_70;
}
}
block_58:
@ -916,7 +920,7 @@ return x_57;
}
else
{
uint8_t x_70;
uint8_t x_71;
lean_dec(x_14);
lean_dec(x_12);
lean_dec(x_8);
@ -924,29 +928,29 @@ lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_70 = !lean_is_exclusive(x_17);
if (x_70 == 0)
x_71 = !lean_is_exclusive(x_17);
if (x_71 == 0)
{
return x_17;
}
else
{
lean_object* x_71; lean_object* x_72; lean_object* x_73;
x_71 = lean_ctor_get(x_17, 0);
x_72 = lean_ctor_get(x_17, 1);
lean_object* x_72; lean_object* x_73; lean_object* x_74;
x_72 = lean_ctor_get(x_17, 0);
x_73 = lean_ctor_get(x_17, 1);
lean_inc(x_73);
lean_inc(x_72);
lean_inc(x_71);
lean_dec(x_17);
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;
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;
}
}
}
else
{
uint8_t x_74;
uint8_t x_75;
lean_dec(x_14);
lean_dec(x_12);
lean_dec(x_8);
@ -954,79 +958,79 @@ lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_74 = !lean_is_exclusive(x_15);
if (x_74 == 0)
x_75 = !lean_is_exclusive(x_15);
if (x_75 == 0)
{
return x_15;
}
else
{
lean_object* x_75; lean_object* x_76; lean_object* x_77;
x_75 = lean_ctor_get(x_15, 0);
x_76 = lean_ctor_get(x_15, 1);
lean_object* x_76; lean_object* x_77; lean_object* x_78;
x_76 = lean_ctor_get(x_15, 0);
x_77 = lean_ctor_get(x_15, 1);
lean_inc(x_77);
lean_inc(x_76);
lean_inc(x_75);
lean_dec(x_15);
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_78 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_78, 0, x_76);
lean_ctor_set(x_78, 1, x_77);
return x_78;
}
}
}
else
{
uint8_t x_78;
uint8_t x_79;
lean_dec(x_8);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_78 = !lean_is_exclusive(x_11);
if (x_78 == 0)
x_79 = !lean_is_exclusive(x_11);
if (x_79 == 0)
{
return x_11;
}
else
{
lean_object* x_79; lean_object* x_80; lean_object* x_81;
x_79 = lean_ctor_get(x_11, 0);
x_80 = lean_ctor_get(x_11, 1);
lean_object* x_80; lean_object* x_81; lean_object* x_82;
x_80 = lean_ctor_get(x_11, 0);
x_81 = lean_ctor_get(x_11, 1);
lean_inc(x_81);
lean_inc(x_80);
lean_inc(x_79);
lean_dec(x_11);
x_81 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_81, 0, x_79);
lean_ctor_set(x_81, 1, x_80);
return x_81;
x_82 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_82, 0, x_80);
lean_ctor_set(x_82, 1, x_81);
return x_82;
}
}
}
}
else
{
uint8_t x_94;
uint8_t x_96;
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_94 = !lean_is_exclusive(x_6);
if (x_94 == 0)
x_96 = !lean_is_exclusive(x_6);
if (x_96 == 0)
{
return x_6;
}
else
{
lean_object* x_95; lean_object* x_96; lean_object* x_97;
x_95 = lean_ctor_get(x_6, 0);
x_96 = lean_ctor_get(x_6, 1);
lean_inc(x_96);
lean_inc(x_95);
lean_object* x_97; lean_object* x_98; lean_object* x_99;
x_97 = lean_ctor_get(x_6, 0);
x_98 = lean_ctor_get(x_6, 1);
lean_inc(x_98);
lean_inc(x_97);
lean_dec(x_6);
x_97 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_97, 0, x_95);
lean_ctor_set(x_97, 1, x_96);
return x_97;
x_99 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_99, 0, x_97);
lean_ctor_set(x_99, 1, x_98);
return x_99;
}
}
}

View file

@ -23,7 +23,7 @@ lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_generalize___lambda__1___closed__3;
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_Meta_generalize(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_generalize___closed__2;
@ -152,38 +152,39 @@ lean_dec(x_19);
x_22 = l_Lean_Expr_hasLooseBVars(x_20);
if (x_22 == 0)
{
lean_object* x_60; lean_object* x_61; uint8_t x_62;
lean_object* x_61; lean_object* x_62; lean_object* x_63; uint8_t x_64;
lean_dec(x_20);
lean_dec(x_10);
lean_dec(x_3);
x_60 = l_Lean_Meta_generalize___lambda__1___closed__6;
x_61 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_60, x_5, x_21);
x_61 = l_Lean_Meta_generalize___lambda__1___closed__6;
x_62 = lean_box(0);
x_63 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_61, x_62, x_5, x_21);
lean_dec(x_5);
x_62 = !lean_is_exclusive(x_61);
if (x_62 == 0)
x_64 = !lean_is_exclusive(x_63);
if (x_64 == 0)
{
return x_61;
return x_63;
}
else
{
lean_object* x_63; lean_object* x_64; lean_object* x_65;
x_63 = lean_ctor_get(x_61, 0);
x_64 = lean_ctor_get(x_61, 1);
lean_inc(x_64);
lean_inc(x_63);
lean_dec(x_61);
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;
lean_object* x_65; lean_object* x_66; lean_object* x_67;
x_65 = lean_ctor_get(x_63, 0);
x_66 = lean_ctor_get(x_63, 1);
lean_inc(x_66);
lean_inc(x_65);
lean_dec(x_63);
x_67 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_67, 0, x_65);
lean_ctor_set(x_67, 1, x_66);
return x_67;
}
}
else
{
x_23 = x_21;
goto block_59;
goto block_60;
}
block_59:
block_60:
{
lean_object* x_24;
lean_inc(x_5);
@ -208,7 +209,7 @@ x_31 = lean_unbox(x_30);
lean_dec(x_30);
if (x_31 == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35;
lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36;
lean_dec(x_28);
lean_dec(x_10);
lean_dec(x_3);
@ -216,234 +217,235 @@ x_32 = lean_ctor_get(x_29, 1);
lean_inc(x_32);
lean_dec(x_29);
x_33 = l_Lean_Meta_generalize___lambda__1___closed__3;
x_34 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_33, x_5, x_32);
x_34 = lean_box(0);
x_35 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_33, x_34, x_5, x_32);
lean_dec(x_5);
x_35 = !lean_is_exclusive(x_34);
if (x_35 == 0)
x_36 = !lean_is_exclusive(x_35);
if (x_36 == 0)
{
return x_34;
return x_35;
}
else
{
lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_36 = lean_ctor_get(x_34, 0);
x_37 = lean_ctor_get(x_34, 1);
lean_object* x_37; lean_object* x_38; lean_object* x_39;
x_37 = lean_ctor_get(x_35, 0);
x_38 = lean_ctor_get(x_35, 1);
lean_inc(x_38);
lean_inc(x_37);
lean_inc(x_36);
lean_dec(x_34);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_36);
lean_ctor_set(x_38, 1, x_37);
return x_38;
lean_dec(x_35);
x_39 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_39, 0, x_37);
lean_ctor_set(x_39, 1, x_38);
return x_39;
}
}
else
{
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_40; uint8_t 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_dec(x_2);
x_39 = lean_ctor_get(x_29, 1);
lean_inc(x_39);
x_40 = lean_ctor_get(x_29, 1);
lean_inc(x_40);
lean_dec(x_29);
x_40 = 2;
x_41 = 2;
lean_inc(x_5);
x_41 = l_Lean_Meta_mkFreshExprMVar(x_28, x_10, x_40, x_5, x_39);
x_42 = lean_ctor_get(x_41, 0);
lean_inc(x_42);
x_43 = lean_ctor_get(x_41, 1);
x_42 = l_Lean_Meta_mkFreshExprMVar(x_28, x_10, x_41, x_5, x_40);
x_43 = lean_ctor_get(x_42, 0);
lean_inc(x_43);
lean_dec(x_41);
lean_inc(x_42);
x_44 = l_Lean_mkApp(x_42, x_3);
x_45 = l_Lean_Expr_mvarId_x21(x_42);
x_44 = lean_ctor_get(x_42, 1);
lean_inc(x_44);
lean_dec(x_42);
x_46 = l_Lean_Meta_assignExprMVar(x_1, x_44, x_5, x_43);
lean_inc(x_43);
x_45 = l_Lean_mkApp(x_43, x_3);
x_46 = l_Lean_Expr_mvarId_x21(x_43);
lean_dec(x_43);
x_47 = l_Lean_Meta_assignExprMVar(x_1, x_45, x_5, x_44);
lean_dec(x_5);
if (lean_obj_tag(x_46) == 0)
if (lean_obj_tag(x_47) == 0)
{
uint8_t x_47;
x_47 = !lean_is_exclusive(x_46);
if (x_47 == 0)
uint8_t x_48;
x_48 = !lean_is_exclusive(x_47);
if (x_48 == 0)
{
lean_object* x_48;
x_48 = lean_ctor_get(x_46, 0);
lean_dec(x_48);
lean_ctor_set(x_46, 0, x_45);
return x_46;
lean_object* x_49;
x_49 = lean_ctor_get(x_47, 0);
lean_dec(x_49);
lean_ctor_set(x_47, 0, x_46);
return x_47;
}
else
{
lean_object* x_49; lean_object* x_50;
x_49 = lean_ctor_get(x_46, 1);
lean_inc(x_49);
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(0, 2, 0);
lean_ctor_set(x_51, 0, x_46);
lean_ctor_set(x_51, 1, x_50);
return x_51;
}
}
else
{
uint8_t x_52;
lean_dec(x_46);
x_50 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_50, 0, x_45);
lean_ctor_set(x_50, 1, x_49);
return x_50;
}
x_52 = !lean_is_exclusive(x_47);
if (x_52 == 0)
{
return x_47;
}
else
{
uint8_t x_51;
lean_dec(x_45);
x_51 = !lean_is_exclusive(x_46);
if (x_51 == 0)
{
return x_46;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54;
x_52 = lean_ctor_get(x_46, 0);
x_53 = lean_ctor_get(x_46, 1);
lean_object* x_53; lean_object* x_54; lean_object* x_55;
x_53 = lean_ctor_get(x_47, 0);
x_54 = lean_ctor_get(x_47, 1);
lean_inc(x_54);
lean_inc(x_53);
lean_inc(x_52);
lean_dec(x_46);
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;
lean_dec(x_47);
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;
}
}
}
}
else
{
uint8_t x_55;
uint8_t x_56;
lean_dec(x_20);
lean_dec(x_10);
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_55 = !lean_is_exclusive(x_24);
if (x_55 == 0)
x_56 = !lean_is_exclusive(x_24);
if (x_56 == 0)
{
return x_24;
}
else
{
lean_object* x_56; lean_object* x_57; lean_object* x_58;
x_56 = lean_ctor_get(x_24, 0);
x_57 = lean_ctor_get(x_24, 1);
lean_object* x_57; lean_object* x_58; lean_object* x_59;
x_57 = lean_ctor_get(x_24, 0);
x_58 = lean_ctor_get(x_24, 1);
lean_inc(x_58);
lean_inc(x_57);
lean_inc(x_56);
lean_dec(x_24);
x_58 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_58, 0, x_56);
lean_ctor_set(x_58, 1, x_57);
return x_58;
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
{
uint8_t x_66;
uint8_t x_68;
lean_dec(x_10);
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_66 = !lean_is_exclusive(x_19);
if (x_66 == 0)
x_68 = !lean_is_exclusive(x_19);
if (x_68 == 0)
{
return x_19;
}
else
{
lean_object* x_67; lean_object* x_68; lean_object* x_69;
x_67 = lean_ctor_get(x_19, 0);
x_68 = lean_ctor_get(x_19, 1);
lean_inc(x_68);
lean_inc(x_67);
lean_object* x_69; lean_object* x_70; lean_object* x_71;
x_69 = lean_ctor_get(x_19, 0);
x_70 = lean_ctor_get(x_19, 1);
lean_inc(x_70);
lean_inc(x_69);
lean_dec(x_19);
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;
x_71 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_71, 0, x_69);
lean_ctor_set(x_71, 1, x_70);
return x_71;
}
}
}
else
{
uint8_t x_70;
uint8_t x_72;
lean_dec(x_10);
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_70 = !lean_is_exclusive(x_12);
if (x_70 == 0)
x_72 = !lean_is_exclusive(x_12);
if (x_72 == 0)
{
return x_12;
}
else
{
lean_object* x_71; lean_object* x_72; lean_object* x_73;
x_71 = lean_ctor_get(x_12, 0);
x_72 = lean_ctor_get(x_12, 1);
lean_inc(x_72);
lean_inc(x_71);
lean_object* x_73; lean_object* x_74; lean_object* x_75;
x_73 = lean_ctor_get(x_12, 0);
x_74 = lean_ctor_get(x_12, 1);
lean_inc(x_74);
lean_inc(x_73);
lean_dec(x_12);
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;
x_75 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_75, 0, x_73);
lean_ctor_set(x_75, 1, x_74);
return x_75;
}
}
}
else
{
uint8_t x_74;
uint8_t x_76;
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_74 = !lean_is_exclusive(x_9);
if (x_74 == 0)
x_76 = !lean_is_exclusive(x_9);
if (x_76 == 0)
{
return x_9;
}
else
{
lean_object* x_75; lean_object* x_76; lean_object* x_77;
x_75 = lean_ctor_get(x_9, 0);
x_76 = lean_ctor_get(x_9, 1);
lean_inc(x_76);
lean_inc(x_75);
lean_object* x_77; lean_object* x_78; lean_object* x_79;
x_77 = lean_ctor_get(x_9, 0);
x_78 = lean_ctor_get(x_9, 1);
lean_inc(x_78);
lean_inc(x_77);
lean_dec(x_9);
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_79 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_79, 0, x_77);
lean_ctor_set(x_79, 1, x_78);
return x_79;
}
}
}
else
{
uint8_t x_78;
uint8_t x_80;
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_78 = !lean_is_exclusive(x_7);
if (x_78 == 0)
x_80 = !lean_is_exclusive(x_7);
if (x_80 == 0)
{
return x_7;
}
else
{
lean_object* x_79; lean_object* x_80; lean_object* x_81;
x_79 = lean_ctor_get(x_7, 0);
x_80 = lean_ctor_get(x_7, 1);
lean_inc(x_80);
lean_inc(x_79);
lean_object* x_81; lean_object* x_82; lean_object* x_83;
x_81 = lean_ctor_get(x_7, 0);
x_82 = lean_ctor_get(x_7, 1);
lean_inc(x_82);
lean_inc(x_81);
lean_dec(x_7);
x_81 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_81, 0, x_79);
lean_ctor_set(x_81, 1, x_80);
return x_81;
x_83 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_83, 0, x_81);
lean_ctor_set(x_83, 1, x_82);
return x_83;
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -73,7 +73,7 @@ lean_object* l_Lean_Meta_mkAuxName___closed__1;
lean_object* l_Lean_LocalDecl_type(lean_object*);
lean_object* lean_local_ctx_mk_local_decl(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t);
lean_object* l_Array_umapMAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_introNCore___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned(lean_object*, lean_object*, lean_object*, lean_object*);
@ -155,7 +155,7 @@ uint8_t x_11;
x_11 = l_Lean_Expr_isForall(x_8);
if (x_11 == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14;
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
@ -165,15 +165,16 @@ lean_dec(x_3);
lean_dec(x_2);
x_12 = l_Lean_Meta_introNCoreAux___main___rarg___lambda__1___closed__2;
x_13 = l_Lean_Meta_introNCoreAux___main___rarg___lambda__1___closed__5;
x_14 = l_Lean_Meta_throwTacticEx___rarg(x_12, x_1, x_13, x_9, x_10);
x_14 = lean_box(0);
x_15 = l_Lean_Meta_throwTacticEx___rarg(x_12, x_1, x_13, x_14, x_9, x_10);
lean_dec(x_9);
return x_14;
return x_15;
}
else
{
lean_object* x_15;
x_15 = l_Lean_Meta_introNCoreAux___main___rarg(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
return x_15;
lean_object* x_16;
x_16 = l_Lean_Meta_introNCoreAux___main___rarg(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
return x_16;
}
}
}
@ -2927,7 +2928,7 @@ uint8_t x_11;
x_11 = l_Lean_Expr_isForall(x_8);
if (x_11 == 0)
{
lean_object* x_12; lean_object* x_13; lean_object* x_14;
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
@ -2936,15 +2937,16 @@ lean_dec(x_4);
lean_dec(x_3);
x_12 = l_Lean_Meta_introNCoreAux___main___rarg___lambda__1___closed__2;
x_13 = l_Lean_Meta_introNCoreAux___main___rarg___lambda__1___closed__5;
x_14 = l_Lean_Meta_throwTacticEx___rarg(x_12, x_1, x_13, x_9, x_10);
x_14 = lean_box(0);
x_15 = l_Lean_Meta_throwTacticEx___rarg(x_12, x_1, x_13, x_14, x_9, x_10);
lean_dec(x_9);
return x_14;
return x_15;
}
else
{
lean_object* x_15;
x_15 = l_Lean_Meta_introNCoreAux___main___at_Lean_Meta_introN___spec__2(x_2, x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
return x_15;
lean_object* x_16;
x_16 = l_Lean_Meta_introNCoreAux___main___at_Lean_Meta_introN___spec__2(x_2, x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
return x_16;
}
}
}
@ -5438,9 +5440,29 @@ return x_19;
lean_object* l_Lean_Meta_introN(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7;
x_7 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_4, x_1, x_2, x_3, x_5, x_6);
return x_7;
lean_object* x_7; uint8_t x_8;
x_7 = lean_unsigned_to_nat(0u);
x_8 = lean_nat_dec_eq(x_2, x_7);
if (x_8 == 0)
{
lean_object* x_9;
x_9 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_4, x_1, x_2, x_3, x_5, x_6);
return x_9;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
lean_dec(x_3);
lean_dec(x_2);
x_10 = l_Array_empty___closed__1;
x_11 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_11, 0, x_10);
lean_ctor_set(x_11, 1, x_1);
x_12 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_12, 0, x_11);
lean_ctor_set(x_12, 1, x_6);
return x_12;
}
}
}
lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_introN___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) {
@ -5520,14 +5542,14 @@ return x_8;
lean_object* l_Lean_Meta_intro(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; uint8_t x_7; lean_object* x_8; lean_object* x_9;
lean_object* x_5; lean_object* x_6; lean_object* x_7; uint8_t x_8; lean_object* x_9;
x_5 = lean_box(0);
x_6 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_6, 0, x_2);
lean_ctor_set(x_6, 1, x_5);
x_7 = 1;
x_8 = lean_unsigned_to_nat(1u);
x_9 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_7, x_1, x_8, x_6, x_3, x_4);
x_7 = lean_unsigned_to_nat(1u);
x_8 = 1;
x_9 = l_Lean_Meta_introN(x_1, x_7, x_6, x_8, x_3, x_4);
if (lean_obj_tag(x_9) == 0)
{
uint8_t x_10;
@ -5643,7 +5665,7 @@ _start:
lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_5 = lean_box(0);
x_6 = lean_unsigned_to_nat(1u);
x_7 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_2, x_1, x_6, x_5, x_3, x_4);
x_7 = l_Lean_Meta_introN(x_1, x_6, x_5, x_2, x_3, x_4);
if (lean_obj_tag(x_7) == 0)
{
uint8_t x_8;

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.Meta.Tactic.Util
// Imports: Init Lean.Meta.Basic Lean.Meta.LevelDefEq
// Imports: Init Lean.Meta.Basic Lean.Meta.AppBuilder Lean.Meta.LevelDefEq
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -16,8 +16,10 @@ extern "C" {
lean_object* l_Lean_Meta_restore(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_setMVarTag___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*);
lean_object* l_Lean_Meta_appendTagSuffix(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx(lean_object*);
lean_object* l_Lean_Meta_orelse___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_withLocalContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned___closed__3;
lean_object* l_Lean_Meta_checkNotAssigned___closed__1;
lean_object* l_Lean_Meta_getMVarTag(lean_object*, lean_object*, lean_object*);
@ -26,19 +28,29 @@ lean_object* l_Lean_Meta_Meta_hasOrelse___closed__1;
lean_object* l_Lean_Meta_orelse(lean_object*);
extern lean_object* l___private_Lean_Meta_Basic_11__regTraceClasses___closed__2;
lean_object* l_Lean_MetavarContext_setMVarUserName(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_admit___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_ppGoal(lean_object*, lean_object*, lean_object*);
uint8_t lean_metavar_ctx_is_expr_assigned(lean_object*, lean_object*);
lean_object* l_Lean_ppGoal(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkSorry(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Name_append___main(lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_Tactic_Util_1__regTraceClasses(lean_object*);
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_Meta_getMVarType___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_admit___closed__1;
lean_object* l_Lean_Meta_admit___lambda__1(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Meta_appendTagSuffix___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_admit___closed__2;
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Meta_Meta_hasOrelse(lean_object*);
lean_object* l_Lean_Meta_admit(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Meta_admit___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getMVarDecl(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_Tactic_Util_1__regTraceClasses___closed__2;
lean_object* l_Lean_Meta_mkFreshExprSyntheticOpaqueMVar(lean_object*, lean_object*, lean_object*, lean_object*);
@ -172,6 +184,60 @@ lean_dec(x_3);
return x_5;
}
}
lean_object* l_Lean_Meta_appendTagSuffix(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
lean_inc(x_1);
x_5 = l_Lean_Meta_getMVarTag(x_1, x_3, x_4);
if (lean_obj_tag(x_5) == 0)
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
x_6 = lean_ctor_get(x_5, 0);
lean_inc(x_6);
x_7 = lean_ctor_get(x_5, 1);
lean_inc(x_7);
lean_dec(x_5);
x_8 = l_Lean_Name_append___main(x_6, x_2);
lean_dec(x_6);
x_9 = l_Lean_Meta_setMVarTag(x_1, x_8, x_3, x_7);
return x_9;
}
else
{
uint8_t x_10;
lean_dec(x_2);
lean_dec(x_1);
x_10 = !lean_is_exclusive(x_5);
if (x_10 == 0)
{
return x_5;
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_11 = lean_ctor_get(x_5, 0);
x_12 = lean_ctor_get(x_5, 1);
lean_inc(x_12);
lean_inc(x_11);
lean_dec(x_5);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_11);
lean_ctor_set(x_13, 1, x_12);
return x_13;
}
}
}
}
lean_object* l_Lean_Meta_appendTagSuffix___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
x_5 = l_Lean_Meta_appendTagSuffix(x_1, x_2, x_3, x_4);
lean_dec(x_3);
return x_5;
}
}
lean_object* l_Lean_Meta_mkFreshExprSyntheticOpaqueMVar(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
@ -181,54 +247,55 @@ x_6 = l_Lean_Meta_mkFreshExprMVar(x_1, x_2, x_5, x_3, x_4);
return x_6;
}
}
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
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;
x_6 = lean_ctor_get(x_5, 0);
lean_inc(x_6);
x_7 = lean_ctor_get(x_5, 1);
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;
x_7 = lean_ctor_get(x_6, 0);
lean_inc(x_7);
x_8 = lean_ctor_get(x_4, 1);
x_9 = lean_ctor_get(x_4, 0);
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
x_8 = lean_ctor_get(x_6, 1);
lean_inc(x_8);
x_11 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_11, 0, x_6);
lean_ctor_set(x_11, 1, x_7);
lean_ctor_set(x_11, 2, x_8);
lean_ctor_set(x_11, 3, x_10);
x_9 = lean_ctor_get(x_5, 1);
x_10 = lean_ctor_get(x_5, 0);
x_11 = lean_ctor_get(x_10, 0);
lean_inc(x_11);
x_12 = lean_alloc_ctor(6, 2, 0);
lean_ctor_set(x_12, 0, x_11);
lean_ctor_set(x_12, 1, x_3);
x_13 = lean_alloc_ctor(18, 4, 0);
lean_ctor_set(x_13, 0, x_1);
lean_ctor_set(x_13, 1, x_2);
lean_ctor_set(x_13, 2, x_12);
lean_ctor_set(x_13, 3, x_11);
x_14 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_14, 0, x_13);
lean_ctor_set(x_14, 1, x_5);
return x_14;
lean_inc(x_9);
x_12 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_12, 0, x_7);
lean_ctor_set(x_12, 1, x_8);
lean_ctor_set(x_12, 2, x_9);
lean_ctor_set(x_12, 3, x_11);
lean_inc(x_12);
x_13 = lean_alloc_ctor(6, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_3);
x_14 = lean_alloc_ctor(18, 5, 0);
lean_ctor_set(x_14, 0, x_4);
lean_ctor_set(x_14, 1, x_1);
lean_ctor_set(x_14, 2, x_2);
lean_ctor_set(x_14, 3, x_13);
lean_ctor_set(x_14, 4, x_12);
x_15 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_15, 0, x_14);
lean_ctor_set(x_15, 1, x_6);
return x_15;
}
}
lean_object* l_Lean_Meta_throwTacticEx(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_throwTacticEx___rarg___boxed), 5, 0);
x_2 = lean_alloc_closure((void*)(l_Lean_Meta_throwTacticEx___rarg___boxed), 6, 0);
return x_2;
}
}
lean_object* l_Lean_Meta_throwTacticEx___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
lean_object* l_Lean_Meta_throwTacticEx___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) {
_start:
{
lean_object* x_6;
x_6 = l_Lean_Meta_throwTacticEx___rarg(x_1, x_2, x_3, x_4, x_5);
lean_dec(x_4);
return x_6;
lean_object* x_7;
x_7 = l_Lean_Meta_throwTacticEx___rarg(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_5);
return x_7;
}
}
lean_object* _init_l_Lean_Meta_checkNotAssigned___closed__1() {
@ -280,10 +347,11 @@ return x_8;
}
else
{
lean_object* x_9; lean_object* x_10;
lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_9 = l_Lean_Meta_checkNotAssigned___closed__3;
x_10 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_9, x_3, x_4);
return x_10;
x_10 = lean_box(0);
x_11 = l_Lean_Meta_throwTacticEx___rarg(x_2, x_1, x_9, x_10, x_3, x_4);
return x_11;
}
}
}
@ -473,8 +541,260 @@ x_3 = l_Lean_registerTraceClass(x_2, x_1);
return x_3;
}
}
lean_object* l_Lean_Meta_admit___lambda__1(lean_object* x_1, lean_object* x_2, uint8_t x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6;
lean_inc(x_1);
x_6 = l_Lean_Meta_checkNotAssigned(x_1, x_2, x_4, x_5);
if (lean_obj_tag(x_6) == 0)
{
lean_object* x_7; lean_object* x_8;
x_7 = lean_ctor_get(x_6, 1);
lean_inc(x_7);
lean_dec(x_6);
lean_inc(x_1);
x_8 = l_Lean_Meta_getMVarType(x_1, x_4, x_7);
if (lean_obj_tag(x_8) == 0)
{
lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
x_10 = lean_ctor_get(x_8, 1);
lean_inc(x_10);
lean_dec(x_8);
lean_inc(x_4);
x_11 = l_Lean_Meta_mkSorry(x_9, x_3, x_4, 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);
x_14 = l_Lean_Meta_assignExprMVar(x_1, x_12, x_4, x_13);
lean_dec(x_4);
if (lean_obj_tag(x_14) == 0)
{
uint8_t x_15;
x_15 = !lean_is_exclusive(x_14);
if (x_15 == 0)
{
lean_object* x_16; lean_object* x_17;
x_16 = lean_ctor_get(x_14, 0);
lean_dec(x_16);
x_17 = lean_box(0);
lean_ctor_set(x_14, 0, x_17);
return x_14;
}
else
{
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_18 = lean_ctor_get(x_14, 1);
lean_inc(x_18);
lean_dec(x_14);
x_19 = lean_box(0);
x_20 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_20, 0, x_19);
lean_ctor_set(x_20, 1, x_18);
return x_20;
}
}
else
{
uint8_t x_21;
x_21 = !lean_is_exclusive(x_14);
if (x_21 == 0)
{
return x_14;
}
else
{
lean_object* x_22; lean_object* x_23; lean_object* x_24;
x_22 = lean_ctor_get(x_14, 0);
x_23 = lean_ctor_get(x_14, 1);
lean_inc(x_23);
lean_inc(x_22);
lean_dec(x_14);
x_24 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_24, 0, x_22);
lean_ctor_set(x_24, 1, x_23);
return x_24;
}
}
}
else
{
uint8_t x_25;
lean_dec(x_4);
lean_dec(x_1);
x_25 = !lean_is_exclusive(x_11);
if (x_25 == 0)
{
return x_11;
}
else
{
lean_object* x_26; lean_object* x_27; lean_object* x_28;
x_26 = lean_ctor_get(x_11, 0);
x_27 = lean_ctor_get(x_11, 1);
lean_inc(x_27);
lean_inc(x_26);
lean_dec(x_11);
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_4);
lean_dec(x_1);
x_29 = !lean_is_exclusive(x_8);
if (x_29 == 0)
{
return x_8;
}
else
{
lean_object* x_30; lean_object* x_31; lean_object* x_32;
x_30 = lean_ctor_get(x_8, 0);
x_31 = lean_ctor_get(x_8, 1);
lean_inc(x_31);
lean_inc(x_30);
lean_dec(x_8);
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_4);
lean_dec(x_1);
x_33 = !lean_is_exclusive(x_6);
if (x_33 == 0)
{
return x_6;
}
else
{
lean_object* x_34; lean_object* x_35; lean_object* x_36;
x_34 = lean_ctor_get(x_6, 0);
x_35 = lean_ctor_get(x_6, 1);
lean_inc(x_35);
lean_inc(x_34);
lean_dec(x_6);
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;
}
}
}
}
lean_object* _init_l_Lean_Meta_admit___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("admit");
return x_1;
}
}
lean_object* _init_l_Lean_Meta_admit___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Meta_admit___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Meta_admit(lean_object* x_1, uint8_t 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 = l_Lean_Meta_admit___closed__2;
x_6 = lean_box(x_2);
lean_inc(x_1);
x_7 = lean_alloc_closure((void*)(l_Lean_Meta_admit___lambda__1___boxed), 5, 3);
lean_closure_set(x_7, 0, x_1);
lean_closure_set(x_7, 1, x_5);
lean_closure_set(x_7, 2, x_6);
x_8 = l_Lean_Meta_getMVarDecl(x_1, x_3, x_4);
if (lean_obj_tag(x_8) == 0)
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
x_10 = lean_ctor_get(x_8, 1);
lean_inc(x_10);
lean_dec(x_8);
x_11 = lean_ctor_get(x_9, 1);
lean_inc(x_11);
x_12 = lean_ctor_get(x_9, 4);
lean_inc(x_12);
lean_dec(x_9);
x_13 = l_Lean_Meta_withLocalContext___rarg(x_11, x_12, x_7, x_3, x_10);
return x_13;
}
else
{
uint8_t x_14;
lean_dec(x_7);
x_14 = !lean_is_exclusive(x_8);
if (x_14 == 0)
{
return x_8;
}
else
{
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_8, 0);
x_16 = lean_ctor_get(x_8, 1);
lean_inc(x_16);
lean_inc(x_15);
lean_dec(x_8);
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_object* l_Lean_Meta_admit___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
uint8_t x_6; lean_object* x_7;
x_6 = lean_unbox(x_3);
lean_dec(x_3);
x_7 = l_Lean_Meta_admit___lambda__1(x_1, x_2, x_6, x_4, x_5);
return x_7;
}
}
lean_object* l_Lean_Meta_admit___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
uint8_t x_5; lean_object* x_6;
x_5 = lean_unbox(x_2);
lean_dec(x_2);
x_6 = l_Lean_Meta_admit(x_1, x_5, x_3, x_4);
lean_dec(x_3);
return x_6;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Meta_Basic(lean_object*);
lean_object* initialize_Lean_Meta_AppBuilder(lean_object*);
lean_object* initialize_Lean_Meta_LevelDefEq(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Lean_Meta_Tactic_Util(lean_object* w) {
@ -487,6 +807,9 @@ lean_dec_ref(res);
res = initialize_Lean_Meta_Basic(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_AppBuilder(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Meta_LevelDefEq(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
@ -505,6 +828,10 @@ lean_mark_persistent(l___private_Lean_Meta_Tactic_Util_1__regTraceClasses___clos
res = l___private_Lean_Meta_Tactic_Util_1__regTraceClasses(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Meta_admit___closed__1 = _init_l_Lean_Meta_admit___closed__1();
lean_mark_persistent(l_Lean_Meta_admit___closed__1);
l_Lean_Meta_admit___closed__2 = _init_l_Lean_Meta_admit___closed__2();
lean_mark_persistent(l_Lean_Meta_admit___closed__2);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -108,7 +108,7 @@ lean_object* l_Lean_Meta_setWHNFRef(lean_object*);
lean_object* l___private_Lean_Util_WHNF_7__deltaDefinition___at_Lean_Meta_unfoldDefinition_x3f___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Meta_WHNF_1__useWHNFCache___boxed(lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwOther___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_throwOther___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Std_PersistentHashMap_insertAux___main___rarg___closed__3;
lean_object* l_Array_shrink___main___rarg(lean_object*, lean_object*);
lean_object* l_Lean_Meta_getConstNoEx___boxed(lean_object*, lean_object*, lean_object*);
@ -11074,7 +11074,7 @@ lean_inc(x_5);
x_6 = l_Lean_Environment_evalConstCheck___rarg(x_5, x_1, x_2);
if (lean_obj_tag(x_6) == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11;
x_7 = lean_ctor_get(x_6, 0);
lean_inc(x_7);
lean_dec(x_6);
@ -11082,19 +11082,20 @@ x_8 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_8, 0, x_7);
x_9 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_9, 0, x_8);
x_10 = l_Lean_Meta_throwOther___rarg(x_9, x_3, x_4);
return x_10;
x_10 = lean_box(0);
x_11 = l_Lean_Meta_throwOther___rarg(x_9, x_10, x_3, x_4);
return x_11;
}
else
{
lean_object* x_11; lean_object* x_12;
x_11 = lean_ctor_get(x_6, 0);
lean_inc(x_11);
lean_object* x_12; lean_object* x_13;
x_12 = lean_ctor_get(x_6, 0);
lean_inc(x_12);
lean_dec(x_6);
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_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_4);
return x_13;
}
}
}

View file

@ -78,7 +78,6 @@ lean_object* l_Lean_Parser_Term_stxQuot___closed__8;
extern lean_object* l_Lean_Parser_Term_matchAlt___closed__3;
lean_object* l_Lean_Parser_Command_structImplicitBinder___closed__2;
lean_object* l_Lean_Parser_Command_extends___elambda__1___closed__7;
extern lean_object* l_Lean_Parser_Term_structInst___closed__1;
lean_object* l_Lean_Parser_Command_end___elambda__1(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Command_openRenamingItem___elambda__1___closed__4;
lean_object* l_Lean_Parser_Command_extends___closed__1;
@ -179,6 +178,7 @@ lean_object* l_Lean_Parser_Command_synth___closed__2;
lean_object* l_Lean_Parser_Command_check___elambda__1___closed__6;
lean_object* l_Lean_Parser_Command_attrInstance___elambda__1___closed__3;
lean_object* l_Lean_Parser_Command_inferMod___closed__1;
extern lean_object* l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_object* l_Lean_Parser_Command_abbrev___elambda__1___closed__9;
lean_object* l_Lean_Parser_Command_declaration___closed__3;
lean_object* l_Lean_Parser_Command_theorem___elambda__1___closed__9;
@ -417,7 +417,6 @@ lean_object* l_Lean_Parser_Command_declValEqns___elambda__1(lean_object*, lean_o
lean_object* l_Lean_Parser_Command_structExplicitBinder___closed__9;
lean_object* l_Lean_Parser_Command_attribute___closed__6;
lean_object* l_Lean_Parser_Command_variables___elambda__1___closed__9;
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__5;
lean_object* l_Lean_Parser_Command_openHiding___closed__8;
lean_object* l_Lean_Parser_Command_attrArg___closed__4;
lean_object* l_Lean_Parser_Command_declaration___elambda__1(lean_object*, lean_object*);
@ -1033,10 +1032,12 @@ lean_object* l_Lean_Parser_Command_attribute___elambda__1___closed__1;
lean_object* l_Lean_Parser_Command_axiom___closed__1;
lean_object* l_Lean_Parser_Command_exit___closed__3;
lean_object* l_Lean_Parser_Command_unsafe___elambda__1(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_implicitBinder___closed__1;
lean_object* l_Lean_Parser_Command_mutualElement___closed__2;
lean_object* l_Lean_Parser_Command_variable___closed__7;
lean_object* l_Lean_Parser_Command_private___elambda__1___closed__7;
lean_object* l_Lean_Parser_Command_noncomputable___elambda__1___closed__6;
extern lean_object* l_Lean_Parser_Term_implicitBinder___closed__2;
lean_object* l_Lean_Parser_Command_structure___closed__13;
lean_object* l_Lean_Parser_Command_check___closed__2;
lean_object* l_Lean_Parser_Command_constant___elambda__1___closed__7;
@ -1083,7 +1084,6 @@ lean_object* l_Lean_Parser_Command_end___elambda__1___closed__3;
lean_object* l___regBuiltinParser_Lean_Parser_Command_open(lean_object*);
lean_object* l_Lean_Parser_Command_variable___closed__5;
lean_object* l_Lean_Parser_Command_variable___elambda__1___closed__5;
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__17;
lean_object* l_Lean_Parser_Command_def___closed__2;
lean_object* l_Lean_Parser_mkAntiquot(lean_object*, lean_object*, uint8_t);
lean_object* l_Lean_Parser_Command_init__quot___elambda__1___closed__3;
@ -13425,13 +13425,13 @@ lean_object* x_59; lean_object* x_60; uint8_t x_61;
x_59 = lean_ctor_get(x_58, 1);
lean_inc(x_59);
lean_dec(x_58);
x_60 = l_Lean_Parser_Term_structInst___elambda__1___closed__5;
x_60 = l_Lean_Parser_Term_implicitBinder___closed__1;
x_61 = lean_string_dec_eq(x_59, x_60);
lean_dec(x_59);
if (x_61 == 0)
{
lean_object* x_62; lean_object* x_63;
x_62 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_62 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_inc(x_10);
x_63 = l_Lean_Parser_ParserState_mkErrorsAt(x_55, x_62, x_10);
x_23 = x_63;
@ -13447,7 +13447,7 @@ else
{
lean_object* x_64; lean_object* x_65;
lean_dec(x_58);
x_64 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_64 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_inc(x_10);
x_65 = l_Lean_Parser_ParserState_mkErrorsAt(x_55, x_64, x_10);
x_23 = x_65;
@ -13458,7 +13458,7 @@ else
{
lean_object* x_66; lean_object* x_67;
lean_dec(x_56);
x_66 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_66 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_inc(x_10);
x_67 = l_Lean_Parser_ParserState_mkErrorsAt(x_55, x_66, x_10);
x_23 = x_67;
@ -13692,13 +13692,13 @@ lean_object* x_132; lean_object* x_133; uint8_t x_134;
x_132 = lean_ctor_get(x_131, 1);
lean_inc(x_132);
lean_dec(x_131);
x_133 = l_Lean_Parser_Term_structInst___elambda__1___closed__5;
x_133 = l_Lean_Parser_Term_implicitBinder___closed__1;
x_134 = lean_string_dec_eq(x_132, x_133);
lean_dec(x_132);
if (x_134 == 0)
{
lean_object* x_135; lean_object* x_136;
x_135 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_135 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_inc(x_81);
x_136 = l_Lean_Parser_ParserState_mkErrorsAt(x_128, x_135, x_81);
x_96 = x_136;
@ -13714,7 +13714,7 @@ else
{
lean_object* x_137; lean_object* x_138;
lean_dec(x_131);
x_137 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_137 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_inc(x_81);
x_138 = l_Lean_Parser_ParserState_mkErrorsAt(x_128, x_137, x_81);
x_96 = x_138;
@ -13725,7 +13725,7 @@ else
{
lean_object* x_139; lean_object* x_140;
lean_dec(x_129);
x_139 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_139 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_inc(x_81);
x_140 = l_Lean_Parser_ParserState_mkErrorsAt(x_128, x_139, x_81);
x_96 = x_140;
@ -13900,7 +13900,7 @@ lean_object* _init_l_Lean_Parser_Command_inferMod___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Parser_Term_structInst___closed__1;
x_1 = l_Lean_Parser_Term_implicitBinder___closed__2;
x_2 = l_Lean_Parser_Term_explicitUniv___closed__4;
x_3 = l_Lean_Parser_andthenInfo(x_1, x_2);
return x_3;
@ -17457,13 +17457,13 @@ lean_object* x_99; lean_object* x_100; uint8_t x_101;
x_99 = lean_ctor_get(x_98, 1);
lean_inc(x_99);
lean_dec(x_98);
x_100 = l_Lean_Parser_Term_structInst___elambda__1___closed__5;
x_100 = l_Lean_Parser_Term_implicitBinder___closed__1;
x_101 = lean_string_dec_eq(x_99, x_100);
lean_dec(x_99);
if (x_101 == 0)
{
lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106;
x_102 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_102 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_103 = l_Lean_Parser_ParserState_mkErrorsAt(x_95, x_102, x_94);
x_104 = lean_ctor_get(x_103, 0);
lean_inc(x_104);
@ -17498,7 +17498,7 @@ else
{
lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114;
lean_dec(x_98);
x_110 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_110 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_111 = l_Lean_Parser_ParserState_mkErrorsAt(x_95, x_110, x_94);
x_112 = lean_ctor_get(x_111, 0);
lean_inc(x_112);
@ -17517,7 +17517,7 @@ else
{
lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119;
lean_dec(x_96);
x_115 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_115 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_116 = l_Lean_Parser_ParserState_mkErrorsAt(x_95, x_115, x_94);
x_117 = lean_ctor_get(x_116, 0);
lean_inc(x_117);
@ -17917,13 +17917,13 @@ lean_object* x_234; lean_object* x_235; uint8_t x_236;
x_234 = lean_ctor_get(x_233, 1);
lean_inc(x_234);
lean_dec(x_233);
x_235 = l_Lean_Parser_Term_structInst___elambda__1___closed__5;
x_235 = l_Lean_Parser_Term_implicitBinder___closed__1;
x_236 = lean_string_dec_eq(x_234, x_235);
lean_dec(x_234);
if (x_236 == 0)
{
lean_object* x_237; lean_object* x_238; lean_object* x_239; lean_object* x_240; lean_object* x_241;
x_237 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_237 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_238 = l_Lean_Parser_ParserState_mkErrorsAt(x_230, x_237, x_229);
x_239 = lean_ctor_get(x_238, 0);
lean_inc(x_239);
@ -17958,7 +17958,7 @@ else
{
lean_object* x_245; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249;
lean_dec(x_233);
x_245 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_245 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_246 = l_Lean_Parser_ParserState_mkErrorsAt(x_230, x_245, x_229);
x_247 = lean_ctor_get(x_246, 0);
lean_inc(x_247);
@ -17977,7 +17977,7 @@ else
{
lean_object* x_250; lean_object* x_251; lean_object* x_252; lean_object* x_253; lean_object* x_254;
lean_dec(x_231);
x_250 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_250 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_251 = l_Lean_Parser_ParserState_mkErrorsAt(x_230, x_250, x_229);
x_252 = lean_ctor_get(x_251, 0);
lean_inc(x_252);
@ -18326,7 +18326,7 @@ lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
x_1 = l_Lean_Parser_Command_declModifiers;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_Term_structInst___closed__1;
x_3 = l_Lean_Parser_Term_implicitBinder___closed__2;
x_4 = l_Lean_Parser_andthenInfo(x_2, x_3);
return x_4;
}

File diff suppressed because it is too large Load diff

View file

@ -110,6 +110,7 @@ lean_object* l___regBuiltinParser_Lean_Parser_Syntax_many(lean_object*);
lean_object* l_Lean_Parser_Syntax_orelse___elambda__1___closed__1;
lean_object* l_Lean_Parser_Command_macroTailTactic___closed__3;
lean_object* l_Lean_Parser_Command_prefix;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__17;
lean_object* l_Lean_Parser_Command_infixr___closed__1;
lean_object* l_Lean_Parser_Command_elab__rules___closed__7;
extern lean_object* l_Lean_Parser_ident;
@ -140,7 +141,6 @@ lean_object* l_Lean_Parser_ParserState_mkTrailingNode(lean_object*, lean_object*
lean_object* l_Lean_Parser_Command_mixfix___elambda__1(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Syntax_cat___closed__2;
lean_object* l_Lean_Parser_Command_notation___closed__10;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__4;
lean_object* l_Lean_Parser_addBuiltinParser(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Parser_regBuiltinSyntaxParserAttr___closed__1;
lean_object* l_Lean_Parser_Command_macroHead___closed__2;
@ -191,6 +191,7 @@ lean_object* l_Lean_Parser_Command_syntaxAbbrev;
lean_object* l_Lean_Parser_Syntax_char___closed__2;
lean_object* l_Lean_Parser_Command_postfix___elambda__1___closed__8;
lean_object* l_Lean_Parser_Syntax_try___elambda__1___closed__8;
extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__7;
lean_object* l_Lean_Parser_checkPrecFn(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Parser_Command_elab__rules___closed__5;
lean_object* l_Lean_Parser_Syntax_char___elambda__1___closed__5;
@ -227,12 +228,10 @@ lean_object* l_Lean_Parser_Command_reserve___elambda__1___closed__5;
lean_object* l_Lean_Parser_Syntax_paren___closed__1;
lean_object* l_Lean_Parser_Command_macroArg;
lean_object* l_Lean_Parser_Command_macro__rules___elambda__1___closed__1;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__5;
lean_object* l_Lean_Parser_Command_macro__rules___elambda__1___closed__2;
lean_object* l_Lean_Parser_Command_infix___closed__4;
lean_object* l_Lean_Parser_Syntax_char___elambda__1___closed__3;
lean_object* l_Lean_Parser_Command_elabTail___closed__8;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__15;
lean_object* l_Lean_Parser_Command_prefix___closed__4;
lean_object* l_Lean_Parser_Command_syntaxAbbrev___closed__8;
lean_object* l_Lean_Parser_Command_infixl___closed__3;
@ -456,6 +455,7 @@ lean_object* l_Lean_Parser_Command_elab___elambda__1___closed__7;
lean_object* l_Lean_Parser_Syntax_atom;
lean_object* l_Lean_Parser_Syntax_sepBy___elambda__1___closed__8;
lean_object* l_Lean_Parser_Command_syntaxAbbrev___elambda__1___closed__2;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__7;
lean_object* l_Lean_Parser_Command_macroTailCommand___closed__1;
lean_object* l_Lean_Parser_Command_identPrec___closed__4;
lean_object* l_Lean_Parser_Command_syntax___closed__1;
@ -499,6 +499,7 @@ lean_object* l_Lean_Parser_Syntax_num___elambda__1___closed__2;
extern lean_object* l_Lean_Parser_Term_structInstArrayRef___closed__2;
lean_object* l_Lean_Parser_Syntax_paren___closed__2;
lean_object* l_Lean_Parser_Command_mixfixKind___elambda__1(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_mkAntiquot___closed__16;
extern lean_object* l_Lean_Parser_Term_haveAssign___closed__1;
lean_object* l___regBuiltinParser_Lean_Parser_Syntax_num(lean_object*);
lean_object* l_Lean_Parser_Command_elabTail___elambda__1___closed__1;
@ -550,8 +551,6 @@ lean_object* l_Lean_Parser_Command_infix___elambda__1___closed__2;
lean_object* l_Lean_Parser_Command_macro__rules___elambda__1(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Command_elab__rules___closed__8;
lean_object* l_Lean_Parser_Command_syntaxCat___closed__5;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__14;
extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__9;
lean_object* l_Lean_Parser_Command_macroTailTactic___closed__6;
lean_object* l_Lean_Parser_Command_notation___closed__1;
lean_object* l_Lean_Parser_Command_macroTailCommand___closed__4;
@ -645,6 +644,7 @@ lean_object* l_Lean_Parser_Command_macroArgSimple___closed__2;
lean_object* l_Lean_Parser_Command_reserve___closed__7;
lean_object* l_Lean_Parser_Syntax_many;
lean_object* l_Lean_Parser_Syntax_try___closed__1;
extern lean_object* l_Lean_Parser_mkAntiquot___closed__6;
lean_object* l_Lean_Parser_Command_identPrec___elambda__1___closed__3;
lean_object* l_Lean_Parser_Syntax_lookahead___closed__1;
lean_object* l_Lean_Parser_Command_infix___elambda__1___closed__5;
@ -1270,7 +1270,7 @@ lean_object* x_24; lean_object* x_25; uint8_t x_26;
x_24 = lean_ctor_get(x_23, 1);
lean_inc(x_24);
lean_dec(x_23);
x_25 = l_Lean_Parser_mkAntiquot___closed__4;
x_25 = l_Lean_Parser_mkAntiquot___closed__6;
x_26 = lean_string_dec_eq(x_24, x_25);
lean_dec(x_24);
if (x_26 == 0)
@ -1412,7 +1412,7 @@ lean_object* x_62; lean_object* x_63; uint8_t x_64;
x_62 = lean_ctor_get(x_61, 1);
lean_inc(x_62);
lean_dec(x_61);
x_63 = l_Lean_Parser_mkAntiquot___closed__4;
x_63 = l_Lean_Parser_mkAntiquot___closed__6;
x_64 = lean_string_dec_eq(x_62, x_63);
lean_dec(x_62);
if (x_64 == 0)
@ -1498,7 +1498,7 @@ lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
x_1 = l_Lean_Parser_precedenceLit;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_mkAntiquot___closed__5;
x_3 = l_Lean_Parser_mkAntiquot___closed__7;
x_4 = l_Lean_Parser_andthenInfo(x_3, x_2);
return x_4;
}
@ -5514,7 +5514,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Char_HasRepr___closed__1;
x_2 = l_Lean_Parser_mkAntiquot___closed__14;
x_2 = l_Lean_Parser_mkAntiquot___closed__16;
x_3 = lean_string_append(x_1, x_2);
return x_3;
}
@ -5574,7 +5574,7 @@ lean_object* x_13; lean_object* x_14; uint8_t x_15;
x_13 = lean_ctor_get(x_12, 1);
lean_inc(x_13);
lean_dec(x_12);
x_14 = l_Lean_Parser_mkAntiquot___closed__14;
x_14 = l_Lean_Parser_mkAntiquot___closed__16;
x_15 = lean_string_dec_eq(x_13, x_14);
lean_dec(x_13);
if (x_15 == 0)
@ -5634,7 +5634,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Parser_Syntax_many___elambda__1___closed__2;
x_2 = l_Lean_Parser_mkAntiquot___closed__15;
x_2 = l_Lean_Parser_mkAntiquot___closed__17;
x_3 = l_Lean_Parser_nodeInfo(x_1, x_2);
return x_3;
}
@ -11381,7 +11381,7 @@ lean_object* l_Lean_Parser_Command_macro__rules___elambda__1(lean_object* x_1, l
_start:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; uint8_t x_7;
x_3 = l_Lean_Parser_Term_match___elambda__1___closed__9;
x_3 = l_Lean_Parser_Term_match___elambda__1___closed__7;
x_4 = lean_ctor_get(x_3, 1);
lean_inc(x_4);
x_5 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__4;
@ -11705,7 +11705,7 @@ lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_obj
x_1 = l_Lean_Parser_Command_optKind;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_Term_match___elambda__1___closed__9;
x_3 = l_Lean_Parser_Term_match___elambda__1___closed__7;
x_4 = lean_ctor_get(x_3, 0);
lean_inc(x_4);
x_5 = l_Lean_Parser_andthenInfo(x_2, x_4);
@ -13781,7 +13781,7 @@ lean_object* x_21; lean_object* x_22; uint8_t x_23;
x_21 = lean_ctor_get(x_20, 1);
lean_inc(x_21);
lean_dec(x_20);
x_22 = l_Lean_Parser_mkAntiquot___closed__4;
x_22 = l_Lean_Parser_mkAntiquot___closed__6;
x_23 = lean_string_dec_eq(x_21, x_22);
lean_dec(x_21);
if (x_23 == 0)
@ -13945,7 +13945,7 @@ lean_object* x_69; lean_object* x_70; uint8_t x_71;
x_69 = lean_ctor_get(x_68, 1);
lean_inc(x_69);
lean_dec(x_68);
x_70 = l_Lean_Parser_mkAntiquot___closed__4;
x_70 = l_Lean_Parser_mkAntiquot___closed__6;
x_71 = lean_string_dec_eq(x_69, x_70);
lean_dec(x_69);
if (x_71 == 0)
@ -14047,7 +14047,7 @@ lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
x_1 = l_Lean_Parser_Syntax_try___closed__2;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_mkAntiquot___closed__5;
x_3 = l_Lean_Parser_mkAntiquot___closed__7;
x_4 = l_Lean_Parser_andthenInfo(x_3, x_2);
return x_4;
}
@ -16972,7 +16972,7 @@ lean_object* l_Lean_Parser_Command_elab__rules___elambda__1(lean_object* x_1, le
_start:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; uint8_t x_7;
x_3 = l_Lean_Parser_Term_match___elambda__1___closed__9;
x_3 = l_Lean_Parser_Term_match___elambda__1___closed__7;
x_4 = lean_ctor_get(x_3, 1);
lean_inc(x_4);
x_5 = l_Lean_Parser_Command_elab__rules___elambda__1___closed__4;
@ -17660,7 +17660,7 @@ lean_object* _init_l_Lean_Parser_Command_elab__rules___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
x_1 = l_Lean_Parser_Term_match___elambda__1___closed__9;
x_1 = l_Lean_Parser_Term_match___elambda__1___closed__7;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_Command_elab__rules___closed__2;

View file

@ -37,12 +37,12 @@ lean_object* l_Lean_Parser_Tactic_withIds___closed__3;
lean_object* l_Lean_Parser_Tactic_revert___closed__2;
lean_object* l_Lean_Parser_Tactic_generalize___closed__1;
lean_object* l_Lean_Parser_Tactic_intro___closed__8;
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_object* l_Lean_Parser_Tactic_inductionAlt___closed__11;
lean_object* l_Lean_Parser_Tactic_case___closed__6;
lean_object* l_Lean_Parser_andthenInfo(lean_object*, lean_object*);
lean_object* l_Lean_Parser_ParserState_mkError(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_apply___closed__2;
extern lean_object* l_Lean_Parser_Term_structInst___closed__1;
lean_object* l_Lean_Parser_Tactic_skip___closed__6;
lean_object* l_Lean_Parser_Tactic_clear___elambda__1___closed__2;
lean_object* l_Lean_Parser_Tactic_generalize___closed__2;
@ -76,13 +76,13 @@ lean_object* l_Lean_Parser_Tactic_inductionAlt___closed__8;
lean_object* l___regBuiltinParser_Lean_Parser_Tactic_nestedTacticBlock(lean_object*);
lean_object* l_Lean_Parser_Tactic_withAlts___closed__4;
extern lean_object* l_Lean_Parser_Term_subst___elambda__1___closed__1;
extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__8;
lean_object* l_Lean_Parser_Tactic_withAlts___closed__1;
extern lean_object* l_Lean_Parser_Term_explicitUniv___elambda__1___closed__7;
lean_object* l_Lean_Parser_Tactic_clear___closed__6;
lean_object* l_Lean_Parser_Tactic_assumption___elambda__1___closed__6;
lean_object* l_Lean_Parser_Tactic_inductionAlt___closed__16;
lean_object* l_Lean_Parser_Tactic_nestedTacticBlock___elambda__1___closed__4;
extern lean_object* l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
lean_object* l_Lean_Parser_sepBy1Fn___at_Lean_Parser_Tactic_inductionAlts___elambda__1___spec__11(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_inductionAlts;
lean_object* l_Lean_Parser_ParserState_pushSyntax(lean_object*, lean_object*);
@ -196,7 +196,6 @@ lean_object* l_Lean_Parser_Tactic_failIfSuccess___closed__7;
extern lean_object* l_Lean_Parser_antiquotNestedExpr___elambda__1___closed__4;
lean_object* l_Lean_Parser_Tactic_inductionAlts___elambda__1(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_traceState___closed__5;
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__5;
lean_object* l_Lean_Parser_Tactic_inductionAlt___closed__10;
lean_object* l_Lean_Parser_sepBy1Fn___at_Lean_Parser_Tactic_inductionAlts___elambda__1___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_clear___closed__3;
@ -299,7 +298,6 @@ lean_object* l_Lean_Parser_Tactic_injection___elambda__1___closed__7;
lean_object* l_Lean_Parser_Tactic_apply___elambda__1___closed__1;
lean_object* l_Lean_Parser_Tactic_intro___elambda__1(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_nestedTacticBlockCurly___closed__1;
extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__12;
lean_object* l_Lean_Parser_Tactic_revert___closed__6;
lean_object* l_Lean_Parser_Tactic_exact___elambda__1___closed__1;
lean_object* l_Lean_Parser_Tactic_generalize___closed__11;
@ -308,7 +306,6 @@ lean_object* l_Lean_Parser_orelseInfo(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_majorPremise___closed__3;
extern lean_object* l_Lean_Parser_termParser___closed__2;
lean_object* lean_name_mk_string(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_match___closed__2;
lean_object* l_Lean_Parser_Tactic_cases___closed__8;
lean_object* l_Lean_Parser_Tactic_usingRec___elambda__1___closed__5;
lean_object* l_Lean_Parser_Tactic_apply___elambda__1___closed__7;
@ -341,6 +338,7 @@ lean_object* l_Lean_Parser_Tactic_induction___elambda__1___closed__5;
lean_object* l_Lean_Parser_Tactic_majorPremise___elambda__1___closed__2;
lean_object* l_Lean_Parser_Tactic_exact___elambda__1___closed__5;
lean_object* l_Lean_Parser_Tactic_injection___closed__3;
extern lean_object* l_Lean_Parser_Term_structInst___closed__2;
extern lean_object* l___private_Lean_Parser_Parser_2__sepByFnAux___main___at_Lean_Parser_Term_matchAlts___elambda__1___spec__2___closed__2;
lean_object* l_Lean_Parser_Tactic_nestedTacticBlock;
extern lean_object* l_Lean_Parser_Term_explicitUniv___closed__4;
@ -499,11 +497,14 @@ lean_object* l_String_trim(lean_object*);
lean_object* l_Lean_Parser_Tactic_nonEmptySeq___elambda__1(lean_object*, lean_object*);
lean_object* l_Lean_Parser_Tactic_apply___closed__1;
lean_object* l___regBuiltinParser_Lean_Parser_Tactic_assumption(lean_object*);
extern lean_object* l_Lean_Parser_Term_implicitBinder___closed__1;
extern lean_object* l_Lean_Parser_Term_matchAlts___closed__1;
lean_object* l_Lean_Parser_Tactic_underscoreFn___closed__2;
lean_object* l_Lean_Parser_Tactic_inductionAlt___closed__13;
extern lean_object* l_Lean_Parser_Term_implicitBinder___closed__2;
lean_object* l_Lean_Parser_Tactic_generalize___closed__7;
lean_object* l_Lean_Parser_Tactic_induction___closed__4;
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__8;
lean_object* l_Lean_Parser_Tactic_inductionAlt___closed__2;
lean_object* l_Lean_Parser_Tactic_induction___closed__8;
lean_object* l_Lean_Parser_Tactic_apply___elambda__1(lean_object*, lean_object*);
@ -515,7 +516,6 @@ extern lean_object* l_Lean_Parser_Tactic_seq___closed__1;
lean_object* l_Lean_Parser_Tactic_exact___closed__2;
lean_object* l_Lean_Parser_Tactic_intro___closed__2;
lean_object* l___private_Lean_Parser_Parser_2__sepByFnAux___main___at_Lean_Parser_Tactic_inductionAlts___elambda__1___spec__4(lean_object*, lean_object*, uint8_t, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__17;
extern lean_object* l_Lean_Parser_Term_namedHole___closed__6;
lean_object* l_Lean_Parser_mkAntiquot(lean_object*, lean_object*, uint8_t);
lean_object* l_Lean_Parser_Tactic_nestedTacticBlock___closed__5;
@ -9594,13 +9594,13 @@ lean_object* x_31; lean_object* x_32; uint8_t x_33;
x_31 = lean_ctor_get(x_30, 1);
lean_inc(x_31);
lean_dec(x_30);
x_32 = l_Lean_Parser_Term_match___elambda__1___closed__8;
x_32 = l_Lean_Parser_Term_structInst___elambda__1___closed__8;
x_33 = lean_string_dec_eq(x_31, x_32);
lean_dec(x_31);
if (x_33 == 0)
{
lean_object* x_34; lean_object* x_35;
x_34 = l_Lean_Parser_Term_match___elambda__1___closed__12;
x_34 = l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_inc(x_5);
x_35 = l_Lean_Parser_ParserState_mkErrorsAt(x_27, x_34, x_5);
x_6 = x_35;
@ -9616,7 +9616,7 @@ else
{
lean_object* x_36; lean_object* x_37;
lean_dec(x_30);
x_36 = l_Lean_Parser_Term_match___elambda__1___closed__12;
x_36 = l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_inc(x_5);
x_37 = l_Lean_Parser_ParserState_mkErrorsAt(x_27, x_36, x_5);
x_6 = x_37;
@ -9627,7 +9627,7 @@ else
{
lean_object* x_38; lean_object* x_39;
lean_dec(x_28);
x_38 = l_Lean_Parser_Term_match___elambda__1___closed__12;
x_38 = l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_inc(x_5);
x_39 = l_Lean_Parser_ParserState_mkErrorsAt(x_27, x_38, x_5);
x_6 = x_39;
@ -9714,7 +9714,7 @@ lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
x_1 = l_Lean_Parser_Tactic_inductionAlts;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_Term_match___closed__2;
x_3 = l_Lean_Parser_Term_structInst___closed__2;
x_4 = l_Lean_Parser_andthenInfo(x_3, x_2);
return x_4;
}
@ -11166,13 +11166,13 @@ lean_object* x_43; lean_object* x_44; uint8_t x_45;
x_43 = lean_ctor_get(x_42, 1);
lean_inc(x_43);
lean_dec(x_42);
x_44 = l_Lean_Parser_Term_match___elambda__1___closed__8;
x_44 = l_Lean_Parser_Term_structInst___elambda__1___closed__8;
x_45 = lean_string_dec_eq(x_43, x_44);
lean_dec(x_43);
if (x_45 == 0)
{
lean_object* x_46; lean_object* x_47;
x_46 = l_Lean_Parser_Term_match___elambda__1___closed__12;
x_46 = l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_inc(x_5);
x_47 = l_Lean_Parser_ParserState_mkErrorsAt(x_39, x_46, x_5);
x_6 = x_47;
@ -11188,7 +11188,7 @@ else
{
lean_object* x_48; lean_object* x_49;
lean_dec(x_42);
x_48 = l_Lean_Parser_Term_match___elambda__1___closed__12;
x_48 = l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_inc(x_5);
x_49 = l_Lean_Parser_ParserState_mkErrorsAt(x_39, x_48, x_5);
x_6 = x_49;
@ -11199,7 +11199,7 @@ else
{
lean_object* x_50; lean_object* x_51;
lean_dec(x_40);
x_50 = l_Lean_Parser_Term_match___elambda__1___closed__12;
x_50 = l_Lean_Parser_Term_structInst___elambda__1___closed__20;
lean_inc(x_5);
x_51 = l_Lean_Parser_ParserState_mkErrorsAt(x_39, x_50, x_5);
x_6 = x_51;
@ -11337,7 +11337,7 @@ lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
x_1 = l_Lean_Parser_Tactic_ident_x27;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l_Lean_Parser_Term_match___closed__2;
x_3 = l_Lean_Parser_Term_structInst___closed__2;
x_4 = l_Lean_Parser_andthenInfo(x_3, x_2);
return x_4;
}
@ -12911,13 +12911,13 @@ lean_object* x_47; lean_object* x_48; uint8_t x_49;
x_47 = lean_ctor_get(x_46, 1);
lean_inc(x_47);
lean_dec(x_46);
x_48 = l_Lean_Parser_Term_structInst___elambda__1___closed__5;
x_48 = l_Lean_Parser_Term_implicitBinder___closed__1;
x_49 = lean_string_dec_eq(x_47, x_48);
lean_dec(x_47);
if (x_49 == 0)
{
lean_object* x_50; lean_object* x_51;
x_50 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_50 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_51 = l_Lean_Parser_ParserState_mkErrorsAt(x_43, x_50, x_42);
x_11 = x_51;
goto block_41;
@ -12933,7 +12933,7 @@ else
{
lean_object* x_52; lean_object* x_53;
lean_dec(x_46);
x_52 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_52 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_53 = l_Lean_Parser_ParserState_mkErrorsAt(x_43, x_52, x_42);
x_11 = x_53;
goto block_41;
@ -12943,7 +12943,7 @@ else
{
lean_object* x_54; lean_object* x_55;
lean_dec(x_44);
x_54 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_54 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_55 = l_Lean_Parser_ParserState_mkErrorsAt(x_43, x_54, x_42);
x_11 = x_55;
goto block_41;
@ -13126,13 +13126,13 @@ lean_object* x_112; lean_object* x_113; uint8_t x_114;
x_112 = lean_ctor_get(x_111, 1);
lean_inc(x_112);
lean_dec(x_111);
x_113 = l_Lean_Parser_Term_structInst___elambda__1___closed__5;
x_113 = l_Lean_Parser_Term_implicitBinder___closed__1;
x_114 = lean_string_dec_eq(x_112, x_113);
lean_dec(x_112);
if (x_114 == 0)
{
lean_object* x_115; lean_object* x_116;
x_115 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_115 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_116 = l_Lean_Parser_ParserState_mkErrorsAt(x_108, x_115, x_107);
x_70 = x_116;
goto block_106;
@ -13148,7 +13148,7 @@ else
{
lean_object* x_117; lean_object* x_118;
lean_dec(x_111);
x_117 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_117 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_118 = l_Lean_Parser_ParserState_mkErrorsAt(x_108, x_117, x_107);
x_70 = x_118;
goto block_106;
@ -13158,7 +13158,7 @@ else
{
lean_object* x_119; lean_object* x_120;
lean_dec(x_109);
x_119 = l_Lean_Parser_Term_structInst___elambda__1___closed__17;
x_119 = l_Lean_Parser_Term_bracketedDoSeq___elambda__1___closed__7;
x_120 = l_Lean_Parser_ParserState_mkErrorsAt(x_108, x_119, x_107);
x_70 = x_120;
goto block_106;
@ -13302,7 +13302,7 @@ lean_object* _init_l_Lean_Parser_Tactic_nestedTacticBlockCurly___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Parser_Term_structInst___closed__1;
x_1 = l_Lean_Parser_Term_implicitBinder___closed__2;
x_2 = l_Lean_Parser_Tactic_nestedTacticBlockCurly___closed__1;
x_3 = l_Lean_Parser_andthenInfo(x_1, x_2);
return x_3;

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Lean.PrettyPrinter
// Imports: Init Lean.PrettyPrinter.Parenthesizer Lean.PrettyPrinter.Formatter
// Imports: Init Lean.Delaborator Lean.PrettyPrinter.Parenthesizer Lean.PrettyPrinter.Formatter
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -13,7 +13,507 @@
#ifdef __cplusplus
extern "C" {
#endif
extern lean_object* l_Lean_Parser_builtinTokenTable;
lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2;
lean_object* l_Lean_PrettyPrinter_formatTerm(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_extract___rarg(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Array_empty___closed__1;
lean_object* lean_io_ref_get(lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_ppExpr(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* l_Lean_PrettyPrinter_parenthesizeCommand(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_parenthesizeTerm(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__1;
extern lean_object* l_Lean_ppExprFnRef;
extern lean_object* l_Lean_Meta_run___rarg___closed__5;
extern lean_object* l_Lean_Parser_Module_header___elambda__1___closed__2;
lean_object* lean_array_fget(lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_ppModule(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_ppCommand(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_ppTerm(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_format(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_delab(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_formatCommand(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Std_PersistentArray_empty___closed__3;
lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__4;
lean_object* l_Lean_PrettyPrinter_ppModule___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_ppModule___closed__1;
lean_object* l_Lean_Syntax_getArgs(lean_object*);
lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2;
lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1;
lean_object* l_Lean_PrettyPrinter_registerPPTerm(lean_object*);
extern lean_object* l_Lean_TraceState_Inhabited___closed__1;
lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3;
lean_object* l_Lean_Meta_Exception_toStr(lean_object*);
lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*);
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
extern lean_object* l_Lean_NameGenerator_Inhabited___closed__3;
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* l_Lean_PrettyPrinter_ppTerm(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
lean_inc(x_3);
x_5 = l_Lean_PrettyPrinter_parenthesizeTerm(x_2, x_3, x_4);
if (lean_obj_tag(x_5) == 0)
{
lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_6 = lean_ctor_get(x_5, 0);
lean_inc(x_6);
x_7 = lean_ctor_get(x_5, 1);
lean_inc(x_7);
lean_dec(x_5);
x_8 = l_Lean_PrettyPrinter_formatTerm(x_1, x_6, x_3, x_7);
return x_8;
}
else
{
uint8_t x_9;
lean_dec(x_3);
lean_dec(x_1);
x_9 = !lean_is_exclusive(x_5);
if (x_9 == 0)
{
return x_5;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_10 = lean_ctor_get(x_5, 0);
x_11 = lean_ctor_get(x_5, 1);
lean_inc(x_11);
lean_inc(x_10);
lean_dec(x_5);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_10);
lean_ctor_set(x_12, 1, x_11);
return x_12;
}
}
}
}
lean_object* l_Lean_PrettyPrinter_ppExpr(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5; lean_object* x_6;
x_5 = lean_box(0);
lean_inc(x_3);
x_6 = l_Lean_delab(x_2, x_5, x_3, x_4);
if (lean_obj_tag(x_6) == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9;
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_Lean_PrettyPrinter_ppTerm(x_1, x_7, x_3, x_8);
return x_9;
}
else
{
uint8_t x_10;
lean_dec(x_3);
lean_dec(x_1);
x_10 = !lean_is_exclusive(x_6);
if (x_10 == 0)
{
return x_6;
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_11 = lean_ctor_get(x_6, 0);
x_12 = lean_ctor_get(x_6, 1);
lean_inc(x_12);
lean_inc(x_11);
lean_dec(x_6);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_11);
lean_ctor_set(x_13, 1, x_12);
return x_13;
}
}
}
}
lean_object* l_Lean_PrettyPrinter_ppCommand(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
lean_inc(x_3);
x_5 = l_Lean_PrettyPrinter_parenthesizeCommand(x_2, x_3, x_4);
if (lean_obj_tag(x_5) == 0)
{
lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_6 = lean_ctor_get(x_5, 0);
lean_inc(x_6);
x_7 = lean_ctor_get(x_5, 1);
lean_inc(x_7);
lean_dec(x_5);
x_8 = l_Lean_PrettyPrinter_formatCommand(x_1, x_6, x_3, x_7);
return x_8;
}
else
{
uint8_t x_9;
lean_dec(x_3);
lean_dec(x_1);
x_9 = !lean_is_exclusive(x_5);
if (x_9 == 0)
{
return x_5;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_10 = lean_ctor_get(x_5, 0);
x_11 = lean_ctor_get(x_5, 1);
lean_inc(x_11);
lean_inc(x_10);
lean_dec(x_5);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_10);
lean_ctor_set(x_12, 1, x_11);
return x_12;
}
}
}
}
lean_object* _init_l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("\n\n");
return x_1;
}
}
lean_object* _init_l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__1;
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___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, lean_object* x_7) {
_start:
{
lean_object* x_8; uint8_t x_9;
x_8 = lean_array_get_size(x_3);
x_9 = lean_nat_dec_lt(x_4, x_8);
lean_dec(x_8);
if (x_9 == 0)
{
lean_object* x_10;
lean_dec(x_6);
lean_dec(x_4);
lean_dec(x_1);
x_10 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_10, 0, x_5);
lean_ctor_set(x_10, 1, x_7);
return x_10;
}
else
{
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_11 = lean_array_fget(x_3, x_4);
x_12 = lean_unsigned_to_nat(1u);
x_13 = lean_nat_add(x_4, x_12);
lean_dec(x_4);
lean_inc(x_6);
lean_inc(x_1);
x_14 = l_Lean_PrettyPrinter_ppCommand(x_1, x_11, x_6, x_7);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; uint8_t x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
x_16 = lean_ctor_get(x_14, 1);
lean_inc(x_16);
lean_dec(x_14);
x_17 = 0;
x_18 = l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2;
x_19 = lean_alloc_ctor(4, 2, 1);
lean_ctor_set(x_19, 0, x_5);
lean_ctor_set(x_19, 1, x_18);
lean_ctor_set_uint8(x_19, sizeof(void*)*2, x_17);
x_20 = lean_alloc_ctor(4, 2, 1);
lean_ctor_set(x_20, 0, x_19);
lean_ctor_set(x_20, 1, x_15);
lean_ctor_set_uint8(x_20, sizeof(void*)*2, x_17);
x_4 = x_13;
x_5 = x_20;
x_7 = x_16;
goto _start;
}
else
{
uint8_t x_22;
lean_dec(x_13);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_1);
x_22 = !lean_is_exclusive(x_14);
if (x_22 == 0)
{
return x_14;
}
else
{
lean_object* x_23; lean_object* x_24; lean_object* x_25;
x_23 = lean_ctor_get(x_14, 0);
x_24 = lean_ctor_get(x_14, 1);
lean_inc(x_24);
lean_inc(x_23);
lean_dec(x_14);
x_25 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_25, 0, x_23);
lean_ctor_set(x_25, 1, x_24);
return x_25;
}
}
}
}
}
lean_object* _init_l_Lean_PrettyPrinter_ppModule___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Parser_Module_header___elambda__1___closed__2;
x_3 = l_Lean_mkConst(x_2, x_1);
return x_3;
}
}
lean_object* l_Lean_PrettyPrinter_ppModule(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(0u);
x_6 = l_Lean_Syntax_getArg(x_2, x_5);
x_7 = l_Lean_PrettyPrinter_ppModule___closed__1;
lean_inc(x_3);
lean_inc(x_1);
x_8 = l_Lean_PrettyPrinter_format(x_1, x_7, x_6, x_3, x_4);
if (lean_obj_tag(x_8) == 0)
{
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;
x_9 = lean_ctor_get(x_8, 0);
lean_inc(x_9);
x_10 = lean_ctor_get(x_8, 1);
lean_inc(x_10);
lean_dec(x_8);
x_11 = l_Lean_Syntax_getArgs(x_2);
x_12 = lean_array_get_size(x_11);
x_13 = lean_unsigned_to_nat(1u);
x_14 = l_Array_extract___rarg(x_11, x_13, x_12);
lean_dec(x_12);
lean_dec(x_11);
x_15 = l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1(x_1, x_2, x_14, x_5, x_9, x_3, x_10);
lean_dec(x_14);
return x_15;
}
else
{
uint8_t x_16;
lean_dec(x_3);
lean_dec(x_1);
x_16 = !lean_is_exclusive(x_8);
if (x_16 == 0)
{
return x_8;
}
else
{
lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_17 = lean_ctor_get(x_8, 0);
x_18 = lean_ctor_get(x_8, 1);
lean_inc(x_18);
lean_inc(x_17);
lean_dec(x_8);
x_19 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_19, 0, x_17);
lean_ctor_set(x_19, 1, x_18);
return x_19;
}
}
}
}
lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___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) {
_start:
{
lean_object* x_8;
x_8 = l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7);
lean_dec(x_3);
lean_dec(x_2);
return x_8;
}
}
lean_object* l_Lean_PrettyPrinter_ppModule___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
x_5 = l_Lean_PrettyPrinter_ppModule(x_1, x_2, x_3, x_4);
lean_dec(x_2);
return x_5;
}
}
lean_object* _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("<pretty printer error: ");
return x_1;
}
}
lean_object* _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1;
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string(">");
return x_1;
}
}
lean_object* _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3;
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* l_Lean_PrettyPrinter_registerPPTerm___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:
{
uint8_t x_7; uint8_t 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;
x_7 = 0;
x_8 = 1;
x_9 = lean_alloc_ctor(0, 1, 7);
lean_ctor_set(x_9, 0, x_5);
lean_ctor_set_uint8(x_9, sizeof(void*)*1, x_7);
lean_ctor_set_uint8(x_9, sizeof(void*)*1 + 1, x_7);
lean_ctor_set_uint8(x_9, sizeof(void*)*1 + 2, x_7);
lean_ctor_set_uint8(x_9, sizeof(void*)*1 + 3, x_7);
lean_ctor_set_uint8(x_9, sizeof(void*)*1 + 4, x_7);
lean_ctor_set_uint8(x_9, sizeof(void*)*1 + 5, x_7);
lean_ctor_set_uint8(x_9, sizeof(void*)*1 + 6, x_8);
x_10 = l_Array_empty___closed__1;
x_11 = lean_unsigned_to_nat(0u);
x_12 = lean_unsigned_to_nat(1000u);
x_13 = lean_alloc_ctor(0, 5, 0);
lean_ctor_set(x_13, 0, x_9);
lean_ctor_set(x_13, 1, x_4);
lean_ctor_set(x_13, 2, x_10);
lean_ctor_set(x_13, 3, x_11);
lean_ctor_set(x_13, 4, x_12);
x_14 = l_Lean_Meta_run___rarg___closed__5;
x_15 = l_Lean_NameGenerator_Inhabited___closed__3;
x_16 = l_Lean_TraceState_Inhabited___closed__1;
x_17 = l_Std_PersistentArray_empty___closed__3;
x_18 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_18, 0, x_2);
lean_ctor_set(x_18, 1, x_3);
lean_ctor_set(x_18, 2, x_14);
lean_ctor_set(x_18, 3, x_15);
lean_ctor_set(x_18, 4, x_16);
lean_ctor_set(x_18, 5, x_17);
x_19 = l_Lean_PrettyPrinter_ppExpr(x_1, x_6, x_13, x_18);
if (lean_obj_tag(x_19) == 0)
{
lean_object* x_20;
x_20 = lean_ctor_get(x_19, 0);
lean_inc(x_20);
lean_dec(x_19);
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;
x_21 = lean_ctor_get(x_19, 0);
lean_inc(x_21);
lean_dec(x_19);
x_22 = l_Lean_Meta_Exception_toStr(x_21);
x_23 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_23, 0, x_22);
x_24 = l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2;
x_25 = lean_alloc_ctor(4, 2, 1);
lean_ctor_set(x_25, 0, x_24);
lean_ctor_set(x_25, 1, x_23);
lean_ctor_set_uint8(x_25, sizeof(void*)*2, x_7);
x_26 = l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__4;
x_27 = lean_alloc_ctor(4, 2, 1);
lean_ctor_set(x_27, 0, x_25);
lean_ctor_set(x_27, 1, x_26);
lean_ctor_set_uint8(x_27, sizeof(void*)*2, x_7);
return x_27;
}
}
}
lean_object* l_Lean_PrettyPrinter_registerPPTerm(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = l_Lean_Parser_builtinTokenTable;
x_3 = lean_io_ref_get(x_2, x_1);
if (lean_obj_tag(x_3) == 0)
{
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_3, 0);
lean_inc(x_4);
x_5 = lean_ctor_get(x_3, 1);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_registerPPTerm___lambda__1), 6, 1);
lean_closure_set(x_6, 0, x_4);
x_7 = l_Lean_ppExprFnRef;
x_8 = lean_io_ref_set(x_7, x_6, x_5);
return x_8;
}
else
{
uint8_t x_9;
x_9 = !lean_is_exclusive(x_3);
if (x_9 == 0)
{
return x_3;
}
else
{
lean_object* x_10; lean_object* x_11; lean_object* x_12;
x_10 = lean_ctor_get(x_3, 0);
x_11 = lean_ctor_get(x_3, 1);
lean_inc(x_11);
lean_inc(x_10);
lean_dec(x_3);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_10);
lean_ctor_set(x_12, 1, x_11);
return x_12;
}
}
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Delaborator(lean_object*);
lean_object* initialize_Lean_PrettyPrinter_Parenthesizer(lean_object*);
lean_object* initialize_Lean_PrettyPrinter_Formatter(lean_object*);
static bool _G_initialized = false;
@ -24,12 +524,29 @@ _G_initialized = true;
res = initialize_Init(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_Delaborator(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_PrettyPrinter_Parenthesizer(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Lean_PrettyPrinter_Formatter(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__1 = _init_l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__1();
lean_mark_persistent(l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__1);
l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2 = _init_l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2();
lean_mark_persistent(l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2);
l_Lean_PrettyPrinter_ppModule___closed__1 = _init_l_Lean_PrettyPrinter_ppModule___closed__1();
lean_mark_persistent(l_Lean_PrettyPrinter_ppModule___closed__1);
l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1 = _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1();
lean_mark_persistent(l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1);
l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2 = _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2();
lean_mark_persistent(l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2);
l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3 = _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3();
lean_mark_persistent(l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3);
l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__4 = _init_l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__4();
lean_mark_persistent(l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__4);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

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

@ -14,7 +14,6 @@
extern "C" {
#endif
lean_object* l_Lean_MetavarContext_instantiateMVars(lean_object*, lean_object*);
lean_object* l_Lean_PPExprFnRef;
extern lean_object* l_Lean_verboseOption___closed__3;
lean_object* lean_io_mk_ref(lean_object*, lean_object*);
lean_object* lean_io_ref_get(lean_object*, lean_object*);
@ -24,6 +23,7 @@ extern lean_object* l_String_splitAux___main___closed__1;
lean_object* l_Lean_ppExprExt___elambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkPPExprFnExtension(lean_object*);
lean_object* l_Lean_mkPPExprFnExtension___closed__1;
lean_object* l_Lean_ppExprFnRef;
lean_object* l_Lean_mkPPExprFnRef___closed__1;
uint8_t l_Lean_KVMap_getBool(lean_object*, lean_object*, uint8_t);
lean_object* l_Lean_ppExprExt___closed__3;
@ -332,7 +332,7 @@ lean_object* _init_l_Lean_mkPPExprFnExtension___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_PPExprFnRef;
x_1 = l_Lean_ppExprFnRef;
x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___boxed), 3, 2);
lean_closure_set(x_2, 0, lean_box(0));
lean_closure_set(x_2, 1, x_1);
@ -529,8 +529,8 @@ l_Lean_mkPPExprFnRef___closed__1 = _init_l_Lean_mkPPExprFnRef___closed__1();
lean_mark_persistent(l_Lean_mkPPExprFnRef___closed__1);
res = l_Lean_mkPPExprFnRef(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
l_Lean_PPExprFnRef = lean_io_result_get_value(res);
lean_mark_persistent(l_Lean_PPExprFnRef);
l_Lean_ppExprFnRef = lean_io_result_get_value(res);
lean_mark_persistent(l_Lean_ppExprFnRef);
lean_dec_ref(res);
l_Lean_registerEnvExtensionUnsafe___at_Lean_mkPPExprFnExtension___spec__1___closed__1 = _init_l_Lean_registerEnvExtensionUnsafe___at_Lean_mkPPExprFnExtension___spec__1___closed__1();
lean_mark_persistent(l_Lean_registerEnvExtensionUnsafe___at_Lean_mkPPExprFnExtension___spec__1___closed__1);

View file

@ -37,7 +37,6 @@ lean_object* l_Lean_modPathToFilePath___main___closed__2;
lean_object* l_Lean_findOLean(lean_object*, lean_object*);
lean_object* l_Lean_modPathToFilePath___main___closed__1;
lean_object* l_Lean_modPathToFilePath___main(lean_object*);
lean_object* l_IO_currentDir___at_Lean_moduleNameOfFileName___spec__1(lean_object*);
lean_object* lean_io_current_dir(lean_object*);
lean_object* l_Lean_getBuiltinSearchPath___closed__1;
lean_object* l_Lean_addSearchPathFromEnv___closed__1;
@ -54,21 +53,22 @@ lean_object* l_Lean_modPathToFilePath___main___boxed(lean_object*);
lean_object* l_Lean_moduleNameOfFileName___closed__4;
extern uint32_t l_System_FilePath_pathSeparator;
uint32_t lean_string_utf8_get(lean_object*, lean_object*);
lean_object* lean_module_name_of_file(lean_object*, lean_object*);
lean_object* lean_module_name_of_file(lean_object*, lean_object*, lean_object*);
lean_object* l_IO_appDir___at_Lean_getBuiltinSearchPath___spec__1(lean_object*);
lean_object* l_String_split___at_System_FilePath_splitSearchPath___spec__2(lean_object*);
lean_object* l_Lean_realPathNormalized(lean_object*, lean_object*);
lean_object* l_IO_getEnv___at_Lean_addSearchPathFromEnv___spec__1(lean_object*, lean_object*);
lean_object* lean_init_search_path(lean_object*, lean_object*);
lean_object* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__2(lean_object*, lean_object*);
lean_object* l_Lean_moduleNameOfFileName___closed__3;
lean_object* l_List_findM_x3f___main___at_Lean_findOLean___spec__2___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_IO_isDir___at_Lean_findOLean___spec__1(lean_object*, lean_object*);
extern lean_object* l_Option_HasRepr___rarg___closed__3;
lean_object* l_Lean_findOLean___closed__1;
uint8_t l_UInt32_decEq(uint32_t, uint32_t);
lean_object* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(lean_object*, lean_object*);
lean_object* l_Lean_findOLean___boxed(lean_object*, lean_object*);
uint8_t l_String_isPrefixOf(lean_object*, lean_object*);
lean_object* l_IO_currentDir___at_Lean_moduleNameOfFileName___spec__2(lean_object*);
lean_object* lean_panic_fn(lean_object*, lean_object*);
lean_object* l_Lean_addSearchPathFromEnv(lean_object*, lean_object*);
lean_object* l_Lean_getBuiltinSearchPath___closed__2;
@ -926,15 +926,7 @@ lean_dec(x_1);
return x_3;
}
}
lean_object* l_IO_currentDir___at_Lean_moduleNameOfFileName___spec__1(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_io_current_dir(x_1);
return x_2;
}
}
lean_object* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__2(lean_object* x_1, lean_object* x_2) {
lean_object* l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_2) == 0)
@ -956,6 +948,14 @@ goto _start;
}
}
}
lean_object* l_IO_currentDir___at_Lean_moduleNameOfFileName___spec__2(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_io_current_dir(x_1);
return x_2;
}
}
lean_object* _init_l_Lean_moduleNameOfFileName___closed__1() {
_start:
{
@ -984,32 +984,76 @@ lean_object* _init_l_Lean_moduleNameOfFileName___closed__4() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("' must be contained in current directory (");
x_1 = lean_mk_string("' must be contained in root directory (");
return x_1;
}
}
lean_object* lean_module_name_of_file(lean_object* x_1, lean_object* x_2) {
lean_object* lean_module_name_of_file(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_3;
x_3 = l_Lean_realPathNormalized(x_1, x_2);
if (lean_obj_tag(x_3) == 0)
lean_object* x_4;
x_4 = l_Lean_realPathNormalized(x_1, x_3);
if (lean_obj_tag(x_4) == 0)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = lean_ctor_get(x_3, 0);
lean_inc(x_4);
x_5 = lean_ctor_get(x_3, 1);
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_5 = lean_ctor_get(x_4, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = lean_io_current_dir(x_5);
if (lean_obj_tag(x_6) == 0)
x_6 = lean_ctor_get(x_4, 1);
lean_inc(x_6);
lean_dec(x_4);
if (lean_obj_tag(x_2) == 0)
{
lean_object* x_7; lean_object* x_8; lean_object* x_9;
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);
lean_object* x_87;
x_87 = lean_io_current_dir(x_6);
if (lean_obj_tag(x_87) == 0)
{
lean_object* x_88; lean_object* x_89;
x_88 = lean_ctor_get(x_87, 0);
lean_inc(x_88);
x_89 = lean_ctor_get(x_87, 1);
lean_inc(x_89);
lean_dec(x_87);
x_7 = x_88;
x_8 = x_89;
goto block_86;
}
else
{
uint8_t x_90;
lean_dec(x_5);
x_90 = !lean_is_exclusive(x_87);
if (x_90 == 0)
{
return x_87;
}
else
{
lean_object* x_91; lean_object* x_92; lean_object* x_93;
x_91 = lean_ctor_get(x_87, 0);
x_92 = lean_ctor_get(x_87, 1);
lean_inc(x_92);
lean_inc(x_91);
lean_dec(x_87);
x_93 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_93, 0, x_91);
lean_ctor_set(x_93, 1, x_92);
return x_93;
}
}
}
else
{
lean_object* x_94;
x_94 = lean_ctor_get(x_2, 0);
lean_inc(x_94);
lean_dec(x_2);
x_7 = x_94;
x_8 = x_6;
goto block_86;
}
block_86:
{
lean_object* x_9;
x_9 = l_Lean_realPathNormalized(x_7, x_8);
if (lean_obj_tag(x_9) == 0)
{
@ -1026,9 +1070,9 @@ if (lean_is_exclusive(x_9)) {
lean_dec_ref(x_9);
x_12 = lean_box(0);
}
x_13 = l_String_isPrefixOf(x_10, x_4);
x_13 = l_String_isPrefixOf(x_10, x_5);
x_14 = lean_string_length(x_10);
x_15 = l_String_drop(x_4, x_14);
x_15 = l_String_drop(x_5, x_14);
lean_dec(x_14);
x_16 = lean_unsigned_to_nat(0u);
x_17 = lean_string_utf8_get(x_15, x_16);
@ -1097,8 +1141,8 @@ if (lean_obj_tag(x_24) == 0)
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_dec(x_15);
x_25 = l_Lean_moduleNameOfFileName___closed__1;
x_26 = lean_string_append(x_25, x_4);
lean_dec(x_4);
x_26 = lean_string_append(x_25, x_5);
lean_dec(x_5);
x_27 = l_Lean_moduleNameOfFileName___closed__2;
x_28 = lean_string_append(x_26, x_27);
x_29 = lean_alloc_ctor(18, 1, 0);
@ -1116,7 +1160,7 @@ return x_30;
else
{
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_dec(x_4);
lean_dec(x_5);
x_31 = lean_ctor_get(x_24, 0);
lean_inc(x_31);
lean_dec(x_24);
@ -1126,7 +1170,7 @@ lean_dec(x_15);
x_33 = l___private_Lean_Util_Path_1__pathSep;
x_34 = l_String_splitOn(x_32, x_33);
x_35 = lean_box(0);
x_36 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__2(x_35, x_34);
x_36 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(x_35, x_34);
if (lean_is_scalar(x_12)) {
x_37 = lean_alloc_ctor(0, 2, 0);
} else {
@ -1142,8 +1186,8 @@ else
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_dec(x_15);
x_38 = l_Lean_moduleNameOfFileName___closed__3;
x_39 = lean_string_append(x_38, x_4);
lean_dec(x_4);
x_39 = lean_string_append(x_38, x_5);
lean_dec(x_5);
x_40 = l_Lean_moduleNameOfFileName___closed__4;
x_41 = lean_string_append(x_39, x_40);
x_42 = lean_string_append(x_41, x_10);
@ -1179,8 +1223,8 @@ if (lean_obj_tag(x_50) == 0)
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_dec(x_48);
x_51 = l_Lean_moduleNameOfFileName___closed__1;
x_52 = lean_string_append(x_51, x_4);
lean_dec(x_4);
x_52 = lean_string_append(x_51, x_5);
lean_dec(x_5);
x_53 = l_Lean_moduleNameOfFileName___closed__2;
x_54 = lean_string_append(x_52, x_53);
x_55 = lean_alloc_ctor(18, 1, 0);
@ -1198,7 +1242,7 @@ return x_56;
else
{
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_dec(x_4);
lean_dec(x_5);
x_57 = lean_ctor_get(x_50, 0);
lean_inc(x_57);
lean_dec(x_50);
@ -1208,7 +1252,7 @@ lean_dec(x_48);
x_59 = l___private_Lean_Util_Path_1__pathSep;
x_60 = l_String_splitOn(x_58, x_59);
x_61 = lean_box(0);
x_62 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__2(x_61, x_60);
x_62 = l_List_foldl___main___at_Lean_moduleNameOfFileName___spec__1(x_61, x_60);
if (lean_is_scalar(x_12)) {
x_63 = lean_alloc_ctor(0, 2, 0);
} else {
@ -1224,8 +1268,8 @@ else
lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72;
lean_dec(x_15);
x_64 = l_Lean_moduleNameOfFileName___closed__3;
x_65 = lean_string_append(x_64, x_4);
lean_dec(x_4);
x_65 = lean_string_append(x_64, x_5);
lean_dec(x_5);
x_66 = l_Lean_moduleNameOfFileName___closed__4;
x_67 = lean_string_append(x_65, x_66);
x_68 = lean_string_append(x_67, x_10);
@ -1252,7 +1296,7 @@ return x_72;
else
{
uint8_t x_82;
lean_dec(x_4);
lean_dec(x_5);
x_82 = !lean_is_exclusive(x_9);
if (x_82 == 0)
{
@ -1273,50 +1317,28 @@ return x_85;
}
}
}
}
else
{
uint8_t x_86;
uint8_t x_95;
lean_dec(x_2);
x_95 = !lean_is_exclusive(x_4);
if (x_95 == 0)
{
return x_4;
}
else
{
lean_object* x_96; lean_object* x_97; lean_object* x_98;
x_96 = lean_ctor_get(x_4, 0);
x_97 = lean_ctor_get(x_4, 1);
lean_inc(x_97);
lean_inc(x_96);
lean_dec(x_4);
x_86 = !lean_is_exclusive(x_6);
if (x_86 == 0)
{
return x_6;
}
else
{
lean_object* x_87; lean_object* x_88; lean_object* x_89;
x_87 = lean_ctor_get(x_6, 0);
x_88 = lean_ctor_get(x_6, 1);
lean_inc(x_88);
lean_inc(x_87);
lean_dec(x_6);
x_89 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_89, 0, x_87);
lean_ctor_set(x_89, 1, x_88);
return x_89;
}
}
}
else
{
uint8_t x_90;
x_90 = !lean_is_exclusive(x_3);
if (x_90 == 0)
{
return x_3;
}
else
{
lean_object* x_91; lean_object* x_92; lean_object* x_93;
x_91 = lean_ctor_get(x_3, 0);
x_92 = lean_ctor_get(x_3, 1);
lean_inc(x_92);
lean_inc(x_91);
lean_dec(x_3);
x_93 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_93, 0, x_91);
lean_ctor_set(x_93, 1, x_92);
return x_93;
x_98 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_98, 0, x_96);
lean_ctor_set(x_98, 1, x_97);
return x_98;
}
}
}