chore: update stage0

This commit is contained in:
Leonardo de Moura 2020-01-10 15:22:16 -08:00
parent f783115d21
commit 6fc158f550
61 changed files with 23436 additions and 17720 deletions

View file

@ -0,0 +1,39 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
-/
prelude
import Init.Data.Nat
namespace Lean
inductive Occurrences
| all
| pos (idxs : List Nat)
| neg (idxs : List Nat)
namespace Occurrences
instance : Inhabited Occurrences := ⟨all⟩
def contains : Occurrences → Nat → Bool
| all, _ => true
| pos idxs, idx => idxs.contains idx
| neg idxs, idx => !idxs.contains idx
def isAll : Occurrences → Bool
| all => true
| _ => false
def beq : Occurrences → Occurrences → Bool
| all, all => true
| pos is₁, pos is₂ => is₁ == is₂
| neg is₁, neg is₂ => is₁ == is₂
| _, _ => false
instance : HasBeq Occurrences := ⟨beq⟩
end Occurrences
end Lean

View file

@ -14,28 +14,28 @@ namespace Term
@[builtinTermElab dollar] def elabDollar : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
| `($f $ $a) => `($f $a)
| _ => throwUnexpectedSyntax stx "application"
| _ => throwUnsupportedSyntax
@[builtinTermElab dollarProj] def elabDollarProj : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
| `($term $.$field) => `($(term).$field)
| _ => throwUnexpectedSyntax stx "$."
| _ => throwUnsupportedSyntax
@[builtinTermElab «if»] def elabIf : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
| `(if $h : $cond then $t else $e) => let h := mkTermIdFromIdent h; `(dite $cond (fun $h => $t) (fun $h => $e))
| `(if $cond then $t else $e) => `(ite $cond $t $e)
| _ => throwUnexpectedSyntax stx "if-then-else"
| _ => throwUnsupportedSyntax
@[builtinTermElab subtype] def elabSubtype : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
| `({ $x : $type // $p }) => let x := mkTermIdFromIdent x; `(Subtype (fun ($x : $type) => $p))
| `({ $x // $p }) => let x := mkTermIdFromIdent x; `(Subtype (fun ($x : _) => $p))
| _ => throwUnexpectedSyntax stx "subtype"
| _ => throwUnsupportedSyntax
@[builtinTermElab anonymousCtor] def elabAnoymousCtor : TermElab :=
fun stx expectedType? => do
let ref := stx.val;
let ref := stx;
tryPostponeIfNoneOrMVar expectedType?;
match expectedType? with
| none => throwError ref "invalid constructor ⟨...⟩, expected type must be known"
@ -59,7 +59,7 @@ match expectedType? with
@[builtinTermElab «show»] def elabShow : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
| `(show $type from $val) => let thisId := mkTermId stx `this; `((fun ($thisId : $type) => $thisId) $val)
| _ => throwUnexpectedSyntax stx "show-from"
| _ => throwUnsupportedSyntax
@[builtinTermElab «have»] def elabHave : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
@ -67,7 +67,7 @@ adaptExpander $ fun stx => match_syntax stx with
| `(have $type := $val; $body) => let thisId := mkTermId stx `this; `((fun ($thisId : $type) => $body) $val)
| `(have $x : $type from $val; $body) => let x := mkTermIdFromIdent x; `((fun ($x : $type) => $body) $val)
| `(have $x : $type := $val; $body) => let x := mkTermIdFromIdent x; `((fun ($x : $type) => $body) $val)
| _ => throwUnexpectedSyntax stx "have"
| _ => throwUnsupportedSyntax
@[termElab «where»] def elabWhere : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
@ -76,7 +76,7 @@ adaptExpander $ fun stx => match_syntax stx with
decls.foldrM
(fun decl body => `(let $decl; $body))
body
| _ => throwUnexpectedSyntax stx "where"
| _ => throwUnsupportedSyntax
@[termElab «parser!»] def elabParserMacro : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
@ -90,7 +90,7 @@ adaptExpander $ fun stx => match_syntax stx with
`(HasOrelse.orelse (Lean.Parser.mkAntiquot $s (some $kind) true) (Lean.Parser.leadingNode $kind $e))
| none => throwError stx "invalid `parser!` macro, it must be used in definitions"
| _ => throwError stx "invalid `parser!` macro, unexpected declaration name"
| _ => throwUnexpectedSyntax stx "parser!"
| _ => throwUnsupportedSyntax
@[termElab «tparser!»] def elabTParserMacro : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
@ -99,7 +99,7 @@ adaptExpander $ fun stx => match_syntax stx with
match declName? with
| some declName => let kind := quote declName; `(Lean.Parser.trailingNode $kind $e)
| none => throwError stx "invalid `tparser!` macro, it must be used in definitions"
| _ => throwUnexpectedSyntax stx "tparser!"
| _ => throwUnsupportedSyntax
def elabInfix (f : Syntax) : TermElab :=
fun stx expectedType? => do

View file

@ -44,9 +44,11 @@ structure Context :=
(macroStack : List Syntax := [])
(currMacroScope : MacroScope := 0)
instance Exception.inhabited : Inhabited Exception := ⟨Exception.error $ arbitrary _⟩
abbrev CommandElabCoreM (ε) := ReaderT Context (EIO ε)
abbrev CommandElabM := CommandElabCoreM Exception
abbrev CommandElab := SyntaxNode → CommandElabM Unit
abbrev CommandElab := Syntax → CommandElabM Unit
def mkMessageAux (ctx : Context) (ref : Syntax) (msgData : MessageData) (severity : MessageSeverity) : Message :=
mkMessageCore ctx.fileName ctx.fileMap msgData severity (ref.getPos.getD ctx.cmdPos)
@ -55,7 +57,7 @@ private def ioErrorToMessage (ctx : Context) (ref : Syntax) (err : IO.Error) : M
mkMessageAux ctx ref (toString err) MessageSeverity.error
@[inline] def liftIOCore {α} (ctx : Context) (ref : Syntax) (x : IO α) : EIO Exception α :=
EIO.adaptExcept (ioErrorToMessage ctx ref) x
EIO.adaptExcept (fun ex => Exception.error $ ioErrorToMessage ctx ref ex) x
@[inline] def liftIO {α} (ref : Syntax) (x : IO α) : CommandElabM α :=
fun ctx => liftIOCore ctx ref x
@ -121,13 +123,7 @@ def throwError {α} (ref : Syntax) (msgData : MessageData) : CommandElabM α :=
ref ← getBetterRef ref;
msgData ← addMacroStack msgData;
msg ← mkMessage msgData MessageSeverity.error ref;
throw msg
def throwUnexpectedSyntax {α} (ref : Syntax) (expectedMsg : Option String := none) : CommandElabM α := do
refFmt ← prettyPrint ref;
match expectedMsg with
| none => throwError ref ("unexpected syntax" ++ MessageData.nest 2 (Format.line ++ refFmt))
| some ex => throwError ref ("unexpected syntax, expected '" ++ ex ++ "'" ++ MessageData.nest 2 (Format.line ++ refFmt))
throw (Exception.error msg)
protected def getCurrMacroScope : CommandElabM Nat := do
ctx ← read;
@ -184,16 +180,25 @@ def mkCommandElabAttribute : IO CommandElabAttribute :=
mkElabAttribute CommandElab `commandElab `Lean.Parser.Command `Lean.Elab.Command.CommandElab "command" builtinCommandElabTable
@[init mkCommandElabAttribute] constant commandElabAttribute : CommandElabAttribute := arbitrary _
private def elabCommandUsing (stx : Syntax) : List CommandElab → CommandElabM Unit
| [] => do
refFmt ← prettyPrint stx;
throwError stx ("unexpected syntax" ++ MessageData.nest 2 (Format.line ++ refFmt))
| (elabFn::elabFns) => catch (elabFn stx)
(fun ex => match ex with
| Exception.error _ => throw ex
| Exception.unsupportedSyntax => elabCommandUsing elabFns)
def elabCommand (stx : Syntax) : CommandElabM Unit :=
stx.ifNode
(fun n => do
s ← get;
let table := (commandElabAttribute.ext.getState s.env).table;
let k := n.getKind;
match table.find? k with
| some elab => elab n
| none => throwError stx ("command '" ++ toString k ++ "' has not been implemented"))
(fun _ => throwError stx ("unexpected command"))
match stx with
| Syntax.node _ _ => do
s ← get;
let table := (commandElabAttribute.ext.getState s.env).table;
let k := stx.getKind;
match table.find? k with
| some elabFns => elabCommandUsing stx elabFns
| none => throwError stx ("command '" ++ toString k ++ "' has not been implemented")
| _ => throwError stx "unexpected command"
/- Elaborate `x` with `stx` on the macro stack -/
@[inline] def withMacroExpansion {α} (stx : Syntax) (x : CommandElabM α) : CommandElabM α :=
@ -201,8 +206,8 @@ adaptReader (fun (ctx : Context) => { macroStack := stx :: ctx.macroStack, .. ct
/-- Adapt a syntax transformation to a regular, command-producing elaborator. -/
def adaptExpander (exp : Syntax → CommandElabM Syntax) : CommandElab :=
fun stx => withMacroExpansion stx.val $ do
stx ← exp stx.val;
fun stx => withMacroExpansion stx $ do
stx ← exp stx;
elabCommand stx
private def mkTermContext (ctx : Context) (s : State) (declName? : Option Name) : Term.Context :=
@ -228,9 +233,10 @@ s.scopes.head!.varDecls
private def toCommandResult {α} (ctx : Context) (s : State) (result : EStateM.Result Term.Exception Term.State α) : EStateM.Result Exception State α :=
match result with
| EStateM.Result.ok a newS => EStateM.Result.ok a { env := newS.env, messages := newS.messages, nextMacroScope := newS.nextMacroScope, .. s }
| EStateM.Result.error (Term.Exception.error ex) newS => EStateM.Result.error ex { env := newS.env, messages := newS.messages, nextMacroScope := newS.nextMacroScope, .. s }
| EStateM.Result.error Term.Exception.postpone newS => unreachable!
| EStateM.Result.ok a newS => EStateM.Result.ok a { env := newS.env, messages := newS.messages, nextMacroScope := newS.nextMacroScope, .. s }
| EStateM.Result.error (Term.Exception.ex ex) newS =>
EStateM.Result.error ex { env := newS.env, messages := newS.messages, nextMacroScope := newS.nextMacroScope, .. s }
| EStateM.Result.error Term.Exception.postpone newS => unreachable!
instance CommandElabM.inhabited {α} : Inhabited (CommandElabM α) :=
⟨throw $ arbitrary _⟩
@ -239,12 +245,14 @@ instance CommandElabM.inhabited {α} : Inhabited (CommandElabM α) :=
ctx ← read;
s ← get;
match (Term.elabBinders (getVarDecls s) elab (mkTermContext ctx s declName?)).run (mkTermState s) with
| EStateM.Result.ok a newS => do modify $ fun s => { env := newS.env, messages := newS.messages, .. s }; pure a
| EStateM.Result.error (Term.Exception.error ex) newS => do modify $ fun s => { env := newS.env, messages := newS.messages, .. s }; throw ex
| EStateM.Result.error Term.Exception.postpone newS => unreachable!
| EStateM.Result.ok a newS => do modify $ fun s => { env := newS.env, messages := newS.messages, .. s }; pure a
| EStateM.Result.error (Term.Exception.ex ex) newS => do modify $ fun s => { env := newS.env, messages := newS.messages, .. s }; throw ex
| EStateM.Result.error Term.Exception.postpone newS => unreachable!
@[inline] def withLogging (x : CommandElabM Unit) : CommandElabM Unit :=
catch x (fun ex => do logMessage ex; pure ())
catch x (fun ex => match ex with
| Exception.error ex => do logMessage ex; pure ()
| Exception.unsupportedSyntax => unreachable!)
@[inline] def catchExceptions (x : CommandElabM Unit) : CommandElabCoreM Empty Unit :=
fun ctx => EIO.catchExceptions (withLogging x ctx) (fun _ => pure ())
@ -276,15 +284,15 @@ private def addNamespace (ref : Syntax) (header : Name) : CommandElabM Unit :=
addScopes ref "namespace" true header
@[builtinCommandElab «namespace»] def elabNamespace : CommandElab :=
fun stx => match_syntax stx.val with
| `(namespace $n) => addNamespace stx.val n.getId
| _ => throwUnexpectedSyntax stx.val "namespace"
fun stx => match_syntax stx with
| `(namespace $n) => addNamespace stx n.getId
| _ => throw Exception.unsupportedSyntax
@[builtinCommandElab «section»] def elabSection : CommandElab :=
fun stx => match_syntax stx.val with
| `(section $header:ident) => addScopes stx.val "section" false header.getId
fun stx => match_syntax stx with
| `(section $header:ident) => addScopes stx "section" false header.getId
| `(section) => do currNamespace ← getCurrNamespace; addScope "section" "" currNamespace
| _ => throwUnexpectedSyntax stx.val "section"
| _ => throw Exception.unsupportedSyntax
def getScopes : CommandElabM (List Scope) := do
s ← get; pure s.scopes
@ -299,8 +307,8 @@ private def checkEndHeader : Name → List Scope → Bool
| _, _ => false
@[builtinCommandElab «end»] def elabEnd : CommandElab :=
fun n => do
let header? := (n.getArg 1).getOptionalIdent?;
fun stx => do
let header? := (stx.getArg 1).getOptionalIdent?;
let endSize := match header? with
| none => 1
| some n => n.getNumParts;
@ -310,11 +318,11 @@ fun n => do
else do {
-- we keep "root" scope
modify $ fun s => { scopes := s.scopes.drop (s.scopes.length - 1), .. s };
throwError n.val "invalid 'end', insufficient scopes"
throwError stx "invalid 'end', insufficient scopes"
};
match header? with
| none => unless (checkAnonymousScope scopes) $ throwError n.val "invalid 'end', name is missing"
| some header => unless (checkEndHeader header scopes) $ throwError n.val "invalid 'end', name mismatch"
| 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
addNamespace ref ns;
@ -359,7 +367,7 @@ fun stx => do
| Except.ok env => setEnv env
| Except.error ex => do
opts ← getOptions;
throwError stx.val (ex.toMessageData opts)
throwError stx (ex.toMessageData opts)
def getOpenDecls : CommandElabM (List OpenDecl) := do
scope ← getScope; pure scope.openDecls
@ -373,7 +381,7 @@ currNamespace ← getCurrNamespace;
openDecls ← getOpenDecls;
match Elab.resolveNamespace env currNamespace openDecls id with
| some ns => pure ns
| none => throwErrorUsingCmdPos ("unknown namespace '" ++ toString id ++ "'")
| none => throw Exception.unsupportedSyntax
@[builtinCommandElab «export»] def elabExport : CommandElab :=
fun stx => do
@ -381,7 +389,7 @@ fun stx => do
let id := stx.getIdAt 1;
ns ← resolveNamespace id;
currNamespace ← getCurrNamespace;
when (ns == currNamespace) $ throwError stx.val "invalid 'export', self export";
when (ns == currNamespace) $ throwError stx "invalid 'export', self export";
env ← getEnv;
let ids := (stx.getArg 3).getArgs;
aliases ← ids.foldlM
@ -493,20 +501,20 @@ fun stx => do
runTermElabM none $ fun _ => do
e ← Term.elabTerm term none;
Term.synthesizeSyntheticMVars false;
type ← Term.inferType stx.val e;
logInfo stx.val (e ++ " : " ++ type);
type ← Term.inferType stx e;
logInfo stx (e ++ " : " ++ type);
pure ()
@[builtinCommandElab «synth»] def elabSynth : CommandElab :=
fun stx => do
let ref := stx.val;
let ref := stx;
let term := stx.getArg 1;
runTermElabM `_synth_cmd $ fun _ => do
inst ← Term.elabTerm term none;
Term.synthesizeSyntheticMVars false;
inst ← Term.instantiateMVars ref inst;
val ← Term.liftMetaM ref $ Meta.synthInstance inst;
logInfo stx.val val;
logInfo stx val;
pure ()
def setOption (ref : Syntax) (optionName : Name) (val : DataValue) : CommandElabM Unit := do
@ -517,7 +525,7 @@ modifyScope $ fun scope => { opts := scope.opts.insert optionName val, .. scope
@[builtinCommandElab «set_option»] def elabSetOption : CommandElab :=
fun stx => do
let ref := stx.val;
let ref := stx;
let optionName := stx.getIdAt 1;
let val := stx.getArg 2;
match val.isStrLit? with

View file

@ -153,7 +153,7 @@ fun stx => do
else if declKind == `Lean.Parser.Command.structure then
elabStructure modifiers decl
else
throwError stx.val "unexpected declaration"
throwError stx "unexpected declaration"
end Command
end Elab

View file

@ -123,7 +123,7 @@ if kind == `Lean.Parser.Command.declValSimple then
else if kind == `Lean.Parser.Command.declValEqns then
Term.throwError defVal "equations have not been implemented yet"
else
Term.throwUnexpectedSyntax defVal "definition body"
Term.throwUnsupportedSyntax
def elabDefLike (view : DefView) : CommandElabM Unit :=
let ref := view.ref;

View file

@ -9,7 +9,16 @@ import Init.Lean.Meta
namespace Lean
namespace Elab
abbrev Exception := Message
inductive Exception
| error : Message → Exception
| unsupportedSyntax : Exception
instance Exception.inhabited : Inhabited Exception := ⟨Exception.error $ arbitrary _⟩
instance Exception.hasToString : HasToString Exception :=
⟨fun ex => match ex with
| Exception.error msg => toString msg
| Exception.unsupportedSyntax => "unsupported syntax"⟩
def mkMessageCore (fileName : String) (fileMap : FileMap) (msgData : MessageData) (severity : MessageSeverity) (pos : String.Pos) : Message :=
let pos := fileMap.toPosition pos;
@ -17,7 +26,7 @@ let pos := fileMap.toPosition pos;
def mkExceptionCore (fileName : String) (fileMap : FileMap) (msgData : MessageData) (pos : String.Pos) : Exception :=
let pos := fileMap.toPosition pos;
{ fileName := fileName, pos := pos, data := msgData, severity := MessageSeverity.error }
Exception.error { fileName := fileName, pos := pos, data := msgData, severity := MessageSeverity.error }
end Elab
end Lean

View file

@ -68,12 +68,12 @@ def logInfo [MonadLog m] (stx : Syntax) (msgData : MessageData) : m Unit :=
log stx MessageSeverity.information msgData
def throwError {α} [MonadPosInfo m] [MonadExcept Exception m] (ref : Syntax) (msgData : MessageData) : m α := do
msg ← mkMessage msgData MessageSeverity.error ref; throw msg
msg ← mkMessage msgData MessageSeverity.error ref; throw (Exception.error msg)
def throwErrorUsingCmdPos {α} [MonadPosInfo m] [MonadExcept Exception m] (msgData : MessageData) : m α := do
cmdPos ← getCmdPos;
msg ← mkMessageAt msgData MessageSeverity.error cmdPos;
throw msg
throw (Exception.error msg)
end Elab
end Lean

View file

@ -315,19 +315,19 @@ private def letBindRhss (cont : List Alt → TermElabM Syntax) : List Alt → Li
stx ← withFreshMacroScope $ letBindRhss alts ((pats, rhs')::altsRev');
`(let rhs := $rhs; $stx)
def match_syntax.expand (stx : SyntaxNode) : TermElabM Syntax := do
def match_syntax.expand (stx : Syntax) : TermElabM Syntax := do
let discr := stx.getArg 1;
let alts := stx.getArg 3;
alts ← alts.getArgs.mapM $ fun alt => do {
let pats := alt.getArg 1;
pat ← if pats.getArgs.size == 1 then pure $ pats.getArg 0
else throwError stx.val "match_syntax: expected exactly one pattern per alternative";
else throwError stx "match_syntax: expected exactly one pattern per alternative";
let pat := if pat.isOfKind `Lean.Parser.Term.stxQuot then pat.setArg 1 $ elimAntiquotChoices $ pat.getArg 1 else pat;
let rhs := alt.getArg 3;
pure ([pat], rhs)
};
-- letBindRhss (compileStxMatch stx.val [discr]) alts.toList []
compileStxMatch stx.val [discr] alts.toList
-- letBindRhss (compileStxMatch stx [discr]) alts.toList []
compileStxMatch stx [discr] alts.toList
@[builtinTermElab «match_syntax»] def elabMatchSyntax : TermElab :=
fun stx expectedType? => do

View file

@ -61,12 +61,12 @@ instance State.inhabited : Inhabited State := ⟨{ env := arbitrary _ }⟩
Remark: `Exception.postpone` is used only when `mayPostpone == true` in the `Context`. -/
inductive Exception
| error : Elab.Exception → Exception
| ex : Elab.Exception → Exception
| postpone : Exception
instance Exception.inhabited : Inhabited Exception := ⟨Exception.postpone⟩
instance Exception.hasToString : HasToString Exception :=
⟨fun ex => match ex with | Exception.postpone => "postponed" | Exception.error ex => toString ex⟩
⟨fun ex => match ex with | Exception.postpone => "postponed" | Exception.ex ex => toString ex⟩
/-
Term elaborator Monad. In principle, we could track statically which methods
@ -74,12 +74,12 @@ instance Exception.hasToString : HasToString Exception :=
`TermElabM`. This would be useful to ensure that `Exception.postpone` does not leak
to `CommandElabM`, but we abandoned this design because it adds unnecessary complexity. -/
abbrev TermElabM := ReaderT Context (EStateM Exception State)
abbrev TermElab := SyntaxNode → Option Expr → TermElabM Expr
abbrev TermElab := Syntax → Option Expr → TermElabM Expr
instance TermElabM.inhabited {α} : Inhabited (TermElabM α) :=
⟨throw $ Exception.postpone⟩
abbrev TermElabResult := EStateM.Result Elab.Exception State Expr
abbrev TermElabResult := EStateM.Result Message State Expr
instance TermElabResult.inhabited : Inhabited TermElabResult := ⟨EStateM.Result.ok (arbitrary _) (arbitrary _)⟩
/--
@ -89,17 +89,17 @@ instance TermElabResult.inhabited : Inhabited TermElabResult := ⟨EStateM.Resul
@[inline] def observing (x : TermElabM Expr) : TermElabM TermElabResult :=
fun ctx s =>
match x ctx s with
| EStateM.Result.error Exception.postpone newS => EStateM.Result.error Exception.postpone newS
| EStateM.Result.error (Exception.error ex) newS => EStateM.Result.ok (EStateM.Result.error ex newS) s
| EStateM.Result.ok e newS => EStateM.Result.ok (EStateM.Result.ok e newS) s
| EStateM.Result.error (Exception.ex (Elab.Exception.error errMsg)) newS => EStateM.Result.ok (EStateM.Result.error errMsg newS) s
| EStateM.Result.error ex newS => EStateM.Result.error ex newS
| EStateM.Result.ok e newS => EStateM.Result.ok (EStateM.Result.ok e newS) s
/--
Apply the result/exception and state captured with `observing`.
We use this method to implement overloaded notation and symbols. -/
def applyResult (result : TermElabResult) : TermElabM Expr :=
match result with
| EStateM.Result.ok e s => do set s; pure e
| EStateM.Result.error ex s => do set s; throw (Exception.error ex)
| EStateM.Result.ok e s => do set s; pure e
| EStateM.Result.error errMsg s => do set s; throw (Exception.ex (Elab.Exception.error errMsg))
def getEnv : TermElabM Environment := do s ← get; pure s.env
def getMCtx : TermElabM MetavarContext := do s ← get; pure s.mctx
@ -150,13 +150,10 @@ def throwError {α} (ref : Syntax) (msgData : MessageData) : TermElabM α := do
ref ← getBetterRef ref;
msgData ← addMacroStack msgData;
msg ← mkMessage msgData MessageSeverity.error ref;
throw (Exception.error msg)
throw (Exception.ex (Elab.Exception.error msg))
def throwUnexpectedSyntax {α} (ref : Syntax) (expectedMsg : Option String := none) : TermElabM α := do
refFmt ← prettyPrint ref;
match expectedMsg with
| none => throwError ref ("unexpected syntax" ++ MessageData.nest 2 (Format.line ++ refFmt))
| some ex => throwError ref ("unexpected syntax, expected '" ++ ex ++ "'" ++ MessageData.nest 2 (Format.line ++ refFmt))
def throwUnsupportedSyntax {α} : TermElabM α :=
throw (Exception.ex Elab.Exception.unsupportedSyntax)
protected def getCurrMacroScope : TermElabM MacroScope := do
ctx ← read;
@ -259,7 +256,7 @@ 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 :=
Exception.error $ mkMessageAux ctx ref ex.toMessageData MessageSeverity.error
Exception.ex $ Elab.Exception.error $ mkMessageAux ctx ref ex.toMessageData MessageSeverity.error
/-- Auxiliary function for `liftMetaM` -/
private def fromMetaState (ref : Syntax) (ctx : Context) (s : State) (newS : Meta.State) (oldTraceState : TraceState) : State :=
@ -310,7 +307,7 @@ def liftLevelM {α} (x : LevelElabM α) : TermElabM α :=
fun ctx s =>
match (x { .. ctx }).run { .. s } with
| EStateM.Result.ok a newS => EStateM.Result.ok a { mctx := newS.mctx, ngen := newS.ngen, .. s }
| EStateM.Result.error ex newS => EStateM.Result.error (Exception.error ex) s
| EStateM.Result.error ex newS => EStateM.Result.error (Exception.ex ex) s
def elabLevel (stx : Syntax) : TermElabM Level :=
liftLevelM $ Level.elabLevel stx
@ -331,8 +328,10 @@ modify $ fun s => { syntheticMVars := { mvarId := mvarId, ref := ref, kind := ki
@[inline] def withoutPostponing {α} (x : TermElabM α) : TermElabM α :=
adaptReader (fun (ctx : Context) => { mayPostpone := false, .. ctx }) x
@[inline] def withNode {α} (stx : Syntax) (x : SyntaxNode → TermElabM α) : TermElabM α :=
stx.ifNode x (fun _ => throwError stx ("term elaborator failed, unexpected syntax: " ++ toString stx))
@[inline] def withNode {α} (stx : Syntax) (x : Syntax → TermElabM α) : TermElabM α :=
match stx with
| Syntax.node _ _ => x stx
| _ => throwError stx ("term elaborator failed, unexpected syntax: " ++ toString stx)
/-- Creates syntax for `(` <ident> `:` <type> `)` -/
def mkExplicitBinder (ident : Syntax) (type : Syntax) : Syntax :=
@ -445,14 +444,14 @@ def expandCDot? : Syntax → TermElabM (Option Syntax)
pure none
| _ => pure none
private def exceptionToSorry (ref : Syntax) (ex : Elab.Exception) (expectedType? : Option Expr) : TermElabM Expr := do
private def exceptionToSorry (ref : Syntax) (errMsg : Message) (expectedType? : Option Expr) : TermElabM Expr := do
expectedType : Expr ← match expectedType? with
| none => mkFreshTypeMVar ref
| some expectedType => pure expectedType;
u ← getLevel ref expectedType;
-- TODO: should be `(sorryAx.{$u} $expectedType true) when we support antiquotations at that place
let syntheticSorry := mkApp2 (mkConst `sorryAx [u]) expectedType (mkConst `Bool.true);
unless ex.data.hasSyntheticSorry $ logMessage ex;
unless errMsg.data.hasSyntheticSorry $ logMessage errMsg;
pure syntheticSorry
/-- If `mayPostpone == true`, throw `Expection.postpone`. -/
@ -476,6 +475,39 @@ ctx ← read;
registerSyntheticMVar stx mvar.mvarId! (SyntheticMVarKind.postponed ctx.macroStack);
pure mvar
/-
Helper function for `elabTerm` is tries the registered elaboration functions for `stxNode` kind until it finds one that supports the syntax or
an error is found. -/
private def elabTermUsing (s : State) (stx : Syntax) (expectedType? : Option Expr) (errToSorry : Bool) (catchExPostpone : Bool)
: List TermElab → TermElabM Expr
| [] => do
refFmt ← prettyPrint stx;
throwError stx ("unexpected syntax" ++ MessageData.nest 2 (Format.line ++ refFmt))
| (elabFn::elabFns) => catch (elabFn stx expectedType?)
(fun ex => match ex with
| Exception.ex (Elab.Exception.error errMsg) => if errToSorry then exceptionToSorry stx errMsg expectedType? else throw ex
| Exception.ex Elab.Exception.unsupportedSyntax => elabTermUsing elabFns
| Exception.postpone =>
if catchExPostpone then do
/- If `elab` threw `Exception.postpone`, we reset any state modifications.
For example, we want to make sure pending synthetic metavariables created by `elab` before
it threw `Exception.postpone` are discarded.
Note that we are also discarding the messages created by `elab`.
For example, consider the expression.
`((f.x a1).x a2).x a3`
Now, suppose the elaboration of `f.x a1` produces an `Exception.postpone`.
Then, a new metavariable `?m` is created. Then, `?m.x a2` also throws `Exception.postpone`
because the type of `?m` is not yet known. Then another, metavariable `?n` is created, and
finally `?n.x a3` also throws `Exception.postpone`. If we did not restore the state, we would
keep "dead" metavariables `?m` and `?n` on the pending synthetic metavariable list. This is
wasteful because when we resume the elaboration of `((f.x a1).x a2).x a3`, we start it from scratch
and new metavariables are created for the nested functions. -/
set s;
postponeElabTerm stx expectedType?
else
throw ex)
/--
Main function for elaborating terms.
It extracts the elaboration methods from the environment using the node kind.
@ -496,32 +528,8 @@ withFreshMacroScope $ withNode stx $ fun node => do
let table := (termElabAttribute.ext.getState s.env).table;
let k := node.getKind;
match table.find? k with
| some elab =>
catch
(elab node expectedType?)
(fun ex => match ex with
| Exception.error err => if errToSorry then exceptionToSorry stx err expectedType? else throw ex
| Exception.postpone =>
if catchExPostpone then do
/- If `elab` threw `Exception.postpone`, we reset any state modifications.
For example, we want to make sure pending synthetic metavariables created by `elab` before
it threw `Exception.postpone` are discarded.
Note that we are also discarding the messages created by `elab`.
For example, consider the expression.
`((f.x a1).x a2).x a3`
Now, suppose the elaboration of `f.x a1` produces an `Exception.postpone`.
Then, a new metavariable `?m` is created. Then, `?m.x a2` also throws `Exception.postpone`
because the type of `?m` is not yet known. Then another, metavariable `?n` is created, and
finally `?n.x a3` also throws `Exception.postpone`. If we did not restore the state, we would
keep "dead" metavariables `?m` and `?n` on the pending synthetic metavariable list. This is
wasteful because when we resume the elaboration of `((f.x a1).x a2).x a3`, we start it from scratch
and new metavariables are created for the nested functions. -/
set s;
postponeElabTerm stx expectedType?
else
throw ex)
| none => throwError stx ("elaboration function for '" ++ toString k ++ "' has not been implemented")
| some elabFns => elabTermUsing s node expectedType? errToSorry catchExPostpone elabFns
| none => throwError stx ("elaboration function for '" ++ toString k ++ "' has not been implemented")
/-- Auxiliary function used to implement `synthesizeSyntheticMVars`. -/
private def resumeElabTerm (stx : Syntax) (expectedType? : Option Expr) (errToSorry := true) : TermElabM Expr :=
@ -529,8 +537,8 @@ elabTerm stx expectedType? false errToSorry
/-- Adapt a syntax transformation to a regular, term-producing elaborator. -/
def adaptExpander (exp : Syntax → TermElabM Syntax) : TermElab :=
fun stx expectedType? => withMacroExpansion stx.val $ do
stx ← exp stx.val;
fun stx expectedType? => withMacroExpansion stx $ do
stx ← exp stx;
elabTerm stx expectedType?
/--
@ -594,8 +602,13 @@ withMVarContext mvarId $ do
assignExprMVar mvarId result;
pure true)
(fun ex => match ex with
| Exception.postpone => pure false
| Exception.error msg => if postponeOnError then do set s; pure false else do logMessage msg; pure true)
| Exception.postpone => pure false
| Exception.ex Elab.Exception.unsupportedSyntax => unreachable!
| Exception.ex (Elab.Exception.error msg) =>
if postponeOnError then do
set s; pure false
else do
logMessage msg; pure true)
/- Try to synthesize metavariable using type class resolution.
This method assumes the local context and local instances of `instMVar` coincide
@ -629,8 +642,8 @@ private def synthesizePendingInstMVar (ref : Syntax) (instMVar : MVarId) : TermE
withMVarContext instMVar $ catch
(synthesizeInstMVarCore ref instMVar)
(fun ex => match ex with
| Exception.error ex => do logMessage ex; pure true
| Exception.postpone => unreachable!)
| Exception.ex (Elab.Exception.error errMsg) => do logMessage errMsg; pure true
| _ => unreachable!)
/--
Return `true` iff `mvarId` is assigned to a term whose the
@ -749,19 +762,32 @@ synthesizeSyntheticMVarsAux mayPostpone ()
/--
If `expectedType?` is `some t`, then ensure `t` and `eType` are definitionally equal.
If they are not, then try coercions. -/
def ensureHasType (ref : Syntax) (expectedType? : Option Expr) (eType : Expr) (e : Expr) : TermElabM Expr :=
If they are not, then try coercions.
Return `some e'` if successful, where `e'` may be different from `e` if coercions have been applied,
and `none` otherwise
-/
def tryEnsureHasType? (ref : Syntax) (expectedType? : Option Expr) (eType : Expr) (e : Expr) : TermElabM (Option Expr) :=
match expectedType? with
| none => pure e
| none => pure (some e)
| some expectedType =>
condM (isDefEq ref eType expectedType)
(pure e)
(pure (some e))
-- TODO try `HasCoe`
(let msg : MessageData :=
"type mismatch" ++ indentExpr e
++ Format.line ++ "has type" ++ indentExpr eType
++ Format.line ++ "but it is expected to have type" ++ indentExpr expectedType;
throwError ref msg)
(pure none)
/--
If `expectedType?` is `some t`, then ensure `t` and `eType` are definitionally equal.
If they are not, then try coercions. -/
def ensureHasType (ref : Syntax) (expectedType? : Option Expr) (eType : Expr) (e : Expr) : TermElabM Expr := do
e? ← tryEnsureHasType? ref expectedType? eType e;
match e? with
| some e => pure e
| none =>
let msg : MessageData :=
"type mismatch" ++ indentExpr e
++ Format.line ++ "has type" ++ indentExpr eType
++ Format.line ++ "but it is expected to have type" ++ indentExpr expectedType?.get!;
throwError ref msg
def mkInstMVar (ref : Syntax) (type : Expr) : TermElabM Expr := do
mvar ← mkFreshExprMVar ref type MetavarKind.synthetic;
@ -784,7 +810,7 @@ fun _ _ => pure $ mkSort levelZero
fun _ _ => pure $ mkSort levelOne
@[builtinTermElab «hole»] def elabHole : TermElab :=
fun stx expectedType? => mkFreshExprMVar stx.val expectedType?
fun stx expectedType? => mkFreshExprMVar stx expectedType?
/-- Main loop for `mkPairs`. -/
private partial def mkPairsAux (elems : Array Syntax) : Nat → Syntax → TermElabM Syntax
@ -817,7 +843,7 @@ match stx? with
@[builtinTermElab paren] def elabParen : TermElab :=
fun stx expectedType? =>
let ref := stx.val;
let ref := stx;
match_syntax ref with
| `(()) => pure $ Lean.mkConst `Unit.unit
| `(($e : $type)) => do
@ -828,8 +854,8 @@ fun stx expectedType? =>
| `(($e)) => elabCDot e expectedType?
| `(($e, $es*)) => do
pairs ← mkPairs (#[e] ++ es.getEvenElems);
withMacroExpansion stx.val (elabTerm pairs expectedType?)
| _ => throwError stx.val "unexpected parentheses notation"
withMacroExpansion stx (elabTerm pairs expectedType?)
| _ => throwError stx "unexpected parentheses notation"
@[builtinTermElab «listLit»] def elabListLit : TermElab :=
fun stx expectedType? => do
@ -843,11 +869,11 @@ fun stx expectedType? => do
@[builtinTermElab «arrayLit»] def elabArrayLit : TermElab :=
fun stx expectedType? => do
match_syntax stx.val with
match_syntax stx with
| `(#[$args*]) => do
newStx ← `(List.toArray [$args*]);
withMacroExpansion stx.val (elabTerm newStx expectedType?)
| _ => throwError stx.val "unexpected array literal syntax"
withMacroExpansion stx (elabTerm newStx expectedType?)
| _ => throwError stx "unexpected array literal syntax"
private partial def resolveLocalNameAux (lctx : LocalContext) : Name → List String → Option (Expr × List String)
| n, projs =>
@ -918,20 +944,20 @@ match result? with
process preresolved
@[builtinTermElab cdot] def elabBadCDot : TermElab :=
fun stx _ => throwError stx.val "invalid occurrence of `·` notation, it must be surrounded by parentheses (e.g. `(· + 1)`)"
fun stx _ => throwError stx "invalid occurrence of `·` notation, it must be surrounded by parentheses (e.g. `(· + 1)`)"
@[builtinTermElab str] def elabStr : TermElab :=
fun stx _ => do
match (stx.getArg 0).isStrLit? with
| some val => pure $ mkStrLit val
| none => throwError stx.val "ill-formed syntax"
| none => throwError stx "ill-formed syntax"
@[builtinTermElab num] def elabNum : TermElab :=
fun stx expectedType? => do
let ref := stx.val;
let ref := stx;
val ← match (stx.getArg 0).isNatLit? with
| some val => pure (mkNatLit val)
| none => throwError stx.val "ill-formed syntax";
| none => throwError stx "ill-formed syntax";
typeMVar ← mkFreshTypeMVar ref MetavarKind.synthetic;
registerSyntheticMVar ref typeMVar.mvarId! (SyntheticMVarKind.withDefault (Lean.mkConst `Nat));
match expectedType? with
@ -946,7 +972,7 @@ fun stx expectedType? => do
fun stx _ => do
match (stx.getArg 0).isCharLit? with
| some val => pure $ mkApp (Lean.mkConst `Char.ofNat) (mkNatLit val.toNat)
| none => throwError stx.val "ill-formed syntax"
| none => throwError stx "ill-formed syntax"
end Term

View file

@ -45,15 +45,21 @@ instMVars.forM $ fun mvarId =>
unlessM (synthesizeInstMVarCore ref mvarId) $
registerSyntheticMVar ref mvarId SyntheticMVarKind.typeClass
private def elabArg (ref : Syntax) (arg : Arg) (expectedType : Expr) : TermElabM Expr :=
private def ensureArgType (ref : Syntax) (f : Expr) (arg : Expr) (expectedType : Expr) : TermElabM Expr := do
argType ← inferType ref arg;
arg? ← tryEnsureHasType? ref expectedType argType arg;
match arg? with
| some arg => pure arg
| none => do
env ← getEnv; mctx ← getMCtx; lctx ← getLCtx; opts ← getOptions;
throwError ref $ Meta.Exception.mkAppTypeMismatchMessage f arg { env := env, mctx := mctx, lctx := lctx, opts := opts }
private def elabArg (ref : Syntax) (f : Expr) (arg : Arg) (expectedType : Expr) : TermElabM Expr :=
match arg with
| Arg.expr val => do
valType ← inferType ref val;
ensureHasType ref expectedType valType val
| Arg.expr val => ensureArgType ref f val expectedType
| Arg.stx val => do
val ← elabTerm val expectedType;
valType ← inferType ref val;
ensureHasType ref expectedType valType val
ensureArgType ref f val expectedType
private partial def elabAppArgsAux (ref : Syntax) (args : Array Arg) (expectedType? : Option Expr) (explicit : Bool)
: Nat → Array NamedArg → Array MVarId → Expr → Expr → TermElabM Expr
@ -71,12 +77,12 @@ private partial def elabAppArgsAux (ref : Syntax) (args : Array Arg) (expectedTy
| some idx => do
let arg := namedArgs.get! idx;
let namedArgs := namedArgs.eraseIdx idx;
argElab ← elabArg ref arg.val d;
argElab ← elabArg ref e arg.val d;
elabAppArgsAux argIdx namedArgs instMVars (b.instantiate1 argElab) (mkApp e argElab)
| none =>
let processExplictArg : Unit → TermElabM Expr := fun _ => do {
if h : argIdx < args.size then do
argElab ← elabArg ref (args.get ⟨argIdx, h⟩) d;
argElab ← elabArg ref e (args.get ⟨argIdx, h⟩) d;
elabAppArgsAux (argIdx + 1) namedArgs instMVars (b.instantiate1 argElab) (mkApp e argElab)
else match d.getOptParamDefault? with
| some defVal => elabAppArgsAux argIdx namedArgs instMVars (b.instantiate1 defVal) (mkApp e defVal)
@ -183,22 +189,23 @@ match eType.getAppFn, lval with
| _, _ =>
throwLValError ref e eType "invalid field notation, type is not of the form (C ...) where C is a constant"
private partial def resolveLValLoop (ref : Syntax) (e : Expr) (lval : LVal) : Expr → Array Elab.Exception → TermElabM LValResolution
private partial def resolveLValLoop (ref : Syntax) (e : Expr) (lval : LVal) : Expr → Array Message → TermElabM LValResolution
| eType, previousExceptions => do
eType ← whnfCore ref eType;
tryPostponeIfMVar eType;
catch (resolveLValAux ref e eType lval)
(fun ex =>
match ex with
| Exception.postpone => throw ex
| Exception.error ex => do
| Exception.postpone => throw ex
| Exception.ex Elab.Exception.unsupportedSyntax => throw ex
| Exception.ex (Elab.Exception.error errMsg) => do
eType? ← unfoldDefinition? ref eType;
match eType? with
| some eType => resolveLValLoop eType (previousExceptions.push ex)
| some eType => resolveLValLoop eType (previousExceptions.push errMsg)
| none => do
previousExceptions.forM $ fun ex =>
logMessage ex;
throw (Exception.error ex))
logMessage errMsg;
throw (Exception.ex (Elab.Exception.error errMsg)))
private def resolveLVal (ref : Syntax) (e : Expr) (lval : LVal) : TermElabM LValResolution := do
eType ← inferType ref e;
@ -325,7 +332,7 @@ private partial def elabAppFn (ref : Syntax) : Syntax → List LVal → Array Na
s ← observing $ elabAppLVals ref f (lvals' ++ lvals) namedArgs args expectedType? explicit;
pure $ acc.push s)
acc
| _ => throwUnexpectedSyntax id "identifier"
| _ => throwUnsupportedSyntax
| _ => do
f ← elabTerm f none;
s ← observing $ elabAppLVals ref f lvals namedArgs args expectedType? explicit;
@ -347,8 +354,8 @@ else
private def mergeFailures {α} (failures : Array TermElabResult) (stx : Syntax) : TermElabM α := do
msgs ← failures.mapM $ fun failure =>
match failure with
| EStateM.Result.ok _ _ => unreachable!
| EStateM.Result.error ex s => toMessageData ex stx;
| EStateM.Result.ok _ _ => unreachable!
| EStateM.Result.error errMsg s => toMessageData errMsg stx;
throwError stx ("overloaded, errors " ++ MessageData.ofArray msgs)
private def elabAppAux (ref : Syntax) (f : Syntax) (namedArgs : Array NamedArg) (args : Array Arg) (expectedType? : Option Expr) : TermElabM Expr := do
@ -388,8 +395,8 @@ private partial def expandApp : Syntax → TermElabM (Syntax × Array NamedArg
@[builtinTermElab app] def elabApp : TermElab :=
fun stx expectedType? => do
(f, namedArgs, args) ← expandApp stx.val;
elabAppAux stx.val f namedArgs args expectedType?
(f, namedArgs, args) ← expandApp stx;
elabAppAux stx f namedArgs args expectedType?
@[builtinTermElab «id»] def elabId : TermElab := elabApp
@[builtinTermElab explicit] def elabExplicit : TermElab := elabApp

View file

@ -36,6 +36,25 @@ else
structure BinderView :=
(id : Syntax) (type : Syntax) (bi : BinderInfo)
/-
Expand `optional (binderDefault <|> binderTactic)`
def binderDefault := parser! " := " >> termParser
def binderTactic := parser! " . " >> termParser
-/
private def expandBinderModifier (type : Syntax) (optBinderModifier : Syntax) : TermElabM Syntax :=
if optBinderModifier.isNone then pure type
else
let modifier := optBinderModifier.getArg 0;
let kind := modifier.getKind;
if kind == `Lean.Parser.Term.binderDefault then do
let defaultVal := modifier.getArg 1;
`(optParam $type $defaultVal)
else if kind == `Lean.Parser.Term.binderTactic then do
throwError modifier "not implemented yet"
else
throwUnsupportedSyntax
private def matchBinder (stx : Syntax) : TermElabM (Array BinderView) :=
withNode stx $ fun node => do
let k := node.getKind;
@ -44,11 +63,12 @@ withNode stx $ fun node => do
let ids := (node.getArg 0).getArgs;
let type := mkHole stx;
ids.mapM $ fun id => do id ← expandBinderIdent id; pure { id := id, type := type, bi := BinderInfo.default }
else if k == `Lean.Parser.Term.explicitBinder then
else if k == `Lean.Parser.Term.explicitBinder then do
-- `(` binderIdent+ binderType (binderDefault <|> binderTactic)? `)`
let ids := (node.getArg 1).getArgs;
let type := expandBinderType (node.getArg 2);
-- TODO handle `binderDefault` and `binderTactic`
let ids := (node.getArg 1).getArgs;
let type := expandBinderType (node.getArg 2);
let optModifier := node.getArg 3;
type ← expandBinderModifier type optModifier;
ids.mapM $ fun id => do id ← expandBinderIdent id; pure { id := id, type := type, bi := BinderInfo.default }
else if k == `Lean.Parser.Term.implicitBinder then
-- `{` binderIdent+ binderType `}`
@ -118,17 +138,17 @@ else do
elabBinders #[binder] (fun fvars => x (fvars.get! 1))
@[builtinTermElab «forall»] def elabForall : TermElab :=
fun stx _ => match_syntax stx.val with
fun stx _ => match_syntax stx with
| `(forall $binders*, $term) =>
elabBinders binders $ fun xs => do
e ← elabType term;
mkForall stx.val xs e
| _ => throwUnexpectedSyntax stx.val "forall"
mkForall stx xs e
| _ => throwUnsupportedSyntax
@[builtinTermElab arrow] def elabArrow : TermElab :=
adaptExpander $ fun stx => match_syntax stx with
| `($dom:term -> $rng) => `(forall (a : $dom), $rng)
| _ => throwUnexpectedSyntax stx "->"
| _ => throwUnsupportedSyntax
@[builtinTermElab depArrow] def elabDepArrow : TermElab :=
fun stx _ =>
@ -137,7 +157,7 @@ fun stx _ =>
let term := stx.getArg 2;
elabBinders #[binder] $ fun xs => do
e ← elabType term;
mkForall stx.val xs e
mkForall stx xs e
/-- Main loop `getFunBinderIds?` -/
private partial def getFunBinderIdsAux? : Bool → Syntax → Array Syntax → TermElabM (Option (Array Syntax))
@ -231,7 +251,7 @@ fun stx expectedType? => do
elabBinders binders $ fun xs => do
-- TODO: expected type
e ← elabTerm body none;
mkLambda stx.val xs e
mkLambda stx xs e
def withLetDecl {α} (ref : Syntax) (n : Name) (type : Expr) (val : Expr) (k : Expr → TermElabM α) : TermElabM α := do
fvarId ← mkFreshFVarId;
@ -284,7 +304,7 @@ throwError decl "not implemented yet"
@[builtinTermElab «let»] def elabLet : TermElab :=
fun stx expectedType? => do
-- `let` decl `;` body
let ref := stx.val;
let ref := stx;
let decl := stx.getArg 1;
let body := stx.getArg 3;
let declKind := decl.getKind;

View file

@ -37,7 +37,12 @@ structure ElabAttributeOLeanEntry :=
structure ElabAttributeEntry (γ : Type) extends ElabAttributeOLeanEntry :=
(elabFn : γ)
abbrev ElabFnTable (γ : Type) := SMap SyntaxNodeKind γ
abbrev ElabFnTable (γ : Type) := SMap SyntaxNodeKind (List γ)
def ElabFnTable.insert {γ} (table : ElabFnTable γ) (k : SyntaxNodeKind) (f : γ) : ElabFnTable γ :=
match table.find? k with
| some fs => table.insert k (f::fs)
| none => table.insert k [f]
structure ElabAttributeExtensionState (γ : Type) :=
(newEntries : List ElabAttributeOLeanEntry := [])
@ -75,8 +80,8 @@ match env.find? constName with
@[implementedBy mkElabFnOfConstantUnsafe]
constant mkElabFnOfConstant (γ : Type) (env : Environment) (typeName : Name) (constName : Name) : ExceptT String Id γ := throw ""
private def ElabAttribute.addImportedParsers {γ} (typeName : Name) (builtinTableRef : IO.Ref (ElabFnTable γ)) (env : Environment) (es : Array (Array ElabAttributeOLeanEntry))
: IO (ElabAttributeExtensionState γ) := do
private def ElabAttribute.addImportedParsers {γ} (typeName : Name) (builtinTableRef : IO.Ref (ElabFnTable γ))
(env : Environment) (es : Array (Array ElabAttributeOLeanEntry)) : IO (ElabAttributeExtensionState γ) := do
table ← builtinTableRef.get;
table ← es.foldlM
(fun table entries =>

View file

@ -0,0 +1,84 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
-/
prelude
import Init.Lean.Expr
namespace Lean
inductive HeadIndex
| fvar (fvarId : FVarId)
| mvar (mvarId : MVarId)
| const (constName : Name)
| proj (structName : Name) (idx : Nat)
| lit (litVal : Literal)
| sort
| lam
| forallE
namespace HeadIndex
instance : Inhabited HeadIndex := ⟨sort⟩
def HeadIndex.hash : HeadIndex → USize
| fvar fvarId => mixHash 11 $ hash fvarId
| mvar mvarId => mixHash 13 $ hash mvarId
| const constName => mixHash 17 $ hash constName
| proj structName idx => mixHash 19 $ mixHash (hash structName) (hash idx)
| lit litVal => mixHash 23 $ hash litVal
| sort => 29
| lam => 31
| forallE => 37
instance : Hashable HeadIndex := ⟨HeadIndex.hash⟩
def HeadIndex.beq : HeadIndex → HeadIndex → Bool
| fvar id₁, fvar id₂ => id₁ == id₂
| mvar id₁, mvar id₂ => id₁ == id₂
| const id₁, const id₂ => id₁ == id₂
| proj s₁ i₁, proj s₂ i₂ => s₁ == s₂ && i₁ == i₂
| lit v₁, lit v₂ => v₁ == v₂
| sort, sort => true
| lam, lam => true
| forallE, forallE => true
| _, _ => false
instance : HasBeq HeadIndex := ⟨HeadIndex.beq⟩
end HeadIndex
namespace Expr
def head : Expr → Expr
| app f _ _ => head f
| letE _ _ _ b _ => head b
| mdata _ e _ => head e
| e => e
private def headNumArgsAux : Expr → Nat → Nat
| app f _ _, n => headNumArgsAux f (n + 1)
| letE _ _ _ b _, n => headNumArgsAux b n
| mdata _ e _, n => headNumArgsAux e n
| _, n => n
def headNumArgs (e : Expr) : Nat :=
headNumArgsAux e 0
def toHeadIndex : Expr → HeadIndex
| mvar mvarId _ => HeadIndex.mvar mvarId
| fvar fvarId _ => HeadIndex.fvar fvarId
| const constName _ _ => HeadIndex.const constName
| proj structName idx _ _ => HeadIndex.proj structName idx
| sort _ _ => HeadIndex.sort
| lam _ _ _ _ => HeadIndex.lam
| forallE _ _ _ _ => HeadIndex.forallE
| lit v _ => HeadIndex.lit v
| app f _ _ => toHeadIndex f
| letE _ _ _ b _ => toHeadIndex b
| mdata _ e _ => toHeadIndex e
| _ => panic! "unexpected expression kind"
end Expr
end Lean

View file

@ -7,7 +7,7 @@ prelude
import Init.System.IO
import Init.Lean.Attributes
import Init.Lean.Syntax
import Init.Lean.Util.Message
import Init.Lean.Message
namespace Lean

View file

@ -18,6 +18,7 @@ import Init.Lean.Meta.SynthInstance
import Init.Lean.Meta.AppBuilder
import Init.Lean.Meta.Tactic
import Init.Lean.Meta.Message
import Init.Lean.Meta.KAbstract
namespace Lean
export Meta (MetaM)

View file

@ -251,7 +251,7 @@ ctx ← read; pure $ ctx.config.transparency == TransparencyMode.reducible
@[inline] def getTransparency : MetaM TransparencyMode := do
ctx ← read; pure $ ctx.config.transparency
@[inline] private def getOptions : MetaM Options := do
@[inline] def getOptions : MetaM Options := do
ctx ← read; pure ctx.config.opts
-- Remark: wanted to use `private`, but in C++ parser, `private` declarations do not shadow outer public ones.

View file

@ -42,7 +42,7 @@ namespace DiscrTree
That is, we don't reduce `HasAdd.add Nat Nat.HasAdd a b` into `Nat.add a b`.
We say the `HasAdd.add` applications are the de-facto canonical forms in
the metaprogramming framework.
Moreover, it is the metaprammer resposability to re-pack applications such as
Moreover, it is the metaprogrammer's responsibility to re-pack applications such as
`Nat.add a b` into `HasAdd.add Nat Nat.hasAdd a b`.
Remark: we store the arity in the keys

View file

@ -6,7 +6,7 @@ Authors: Leonardo de Moura
prelude
import Init.Lean.Environment
import Init.Lean.MetavarContext
import Init.Lean.Util.Message
import Init.Lean.Message
namespace Lean
namespace Meta

View file

@ -0,0 +1,42 @@
/-
Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
-/
prelude
import Init.Lean.Data.Occurrences
import Init.Lean.HeadIndex
import Init.Lean.Meta.ExprDefEq
namespace Lean
namespace Meta
private partial def kabstractAux (occs : Occurrences) (p : Expr) (pHeadIdx : HeadIndex) (pNumArgs : Nat) : Expr → Nat → StateT Nat MetaM Expr
| e, offset =>
let visitChildren : Unit → StateT Nat MetaM Expr := fun _ =>
match e with
| Expr.app f a _ => do f ← kabstractAux f offset; a ← kabstractAux a offset; pure $ e.updateApp! f a
| Expr.mdata _ b _ => do b ← kabstractAux b offset; pure $ e.updateMData! b
| Expr.proj _ _ b _ => do b ← kabstractAux b offset; pure $ e.updateProj! b
| Expr.letE _ t v b _ => do t ← kabstractAux t offset; v ← kabstractAux v offset; b ← kabstractAux b (offset+1); pure $ e.updateLet! t v b
| Expr.lam _ d b _ => do d ← kabstractAux d offset; b ← kabstractAux b (offset+1); pure $ e.updateLambdaE! d b
| Expr.forallE _ d b _ => do d ← kabstractAux d offset; b ← kabstractAux b (offset+1); pure $ e.updateForallE! d b
| e => pure e;
if e.hasLooseBVars then visitChildren ()
else if e.toHeadIndex == pHeadIdx && e.headNumArgs == pNumArgs then
condM (liftM $ isDefEq e p)
(do i ← get;
set (i+1);
if occs.contains i then
pure (mkBVar offset)
else
visitChildren ())
(visitChildren ())
else
visitChildren ()
def kabstract (e : Expr) (p : Expr) (occs : Occurrences := Occurrences.all) : MetaM Expr :=
(kabstractAux occs p p.toHeadIndex p.headNumArgs e 0).run' 1
end Meta
end Lean

View file

@ -51,31 +51,29 @@ partial def evalNat : Expr → Option Nat
| _ => none
/- Quick function for converting `e` into `s + k` s.t. `e` is definitionally equal to `Nat.add s k`. -/
private partial def getOffset : Expr → Expr × Nat
| e@(Expr.app _ a _) =>
private partial def getOffsetAux : Expr → Bool → Option (Expr × Nat)
| e@(Expr.app _ a _), top =>
let fn := e.getAppFn;
match fn with
| Expr.const c _ _ =>
let nargs := e.getAppNumArgs;
if c == `Nat.succ && nargs == 1 then
let (s, k) := getOffset a;
(s, k+1)
else if c == `Nat.add && nargs == 2 then
match evalNat (e.getArg! 1) with
| none => (e, 0)
| some v =>
let (s, k) := getOffset (e.getArg! 0);
(s, k+v)
else if c == `HasAdd.add && nargs == 4 then
match evalNat (e.getArg! 3) with
| none => (e, 0)
| some v =>
let (s, k) := getOffset (e.getArg! 0);
(s, k+v)
else
(e, 0)
| _ => (e, 0)
| e => (e, 0)
if c == `Nat.succ && nargs == 1 then do
(s, k) ← getOffsetAux a false;
pure (s, k+1)
else if c == `Nat.add && nargs == 2 then do
v ← evalNat (e.getArg! 1);
(s, k) ← getOffsetAux (e.getArg! 0) false;
pure (s, k+v)
else if c == `HasAdd.add && nargs == 4 then do
v ← evalNat (e.getArg! 3);
(s, k) ← getOffsetAux (e.getArg! 2) false;
pure (s, k+v)
else if top then none else pure (e, 0)
| _ => if top then none else pure (e, 0)
| e, top => if top then none else pure (e, 0)
private def getOffset (e : Expr) : Option (Expr × Nat) :=
getOffsetAux e true
private partial def isOffset : Expr → Option (Expr × Nat)
| e@(Expr.app _ a _) =>
@ -84,7 +82,7 @@ private partial def isOffset : Expr → Option (Expr × Nat)
| Expr.const c _ _ =>
let nargs := e.getAppNumArgs;
if (c == `Nat.succ && nargs == 1) || (c == `Nat.add && nargs == 2) || (c == `HasAdd.add && nargs == 4) then
some (getOffset e)
getOffset e
else none
| _ => none
| _ => none

View file

@ -324,7 +324,7 @@ def wakeUp (answer : Answer) : Waiter → SynthM Unit
def isNewAnswer (oldAnswers : Array Answer) (answer : Answer) : Bool :=
oldAnswers.all $ fun oldAnswer => do
-- Remark: isDefEq here is too expensive. TODO: if `==` is to imprecise, add some light normalization to `resultType` at `addAnswer`
-- Remark: isDefEq here is too expensive. TODO: if `==` is too imprecise, add some light normalization to `resultType` at `addAnswer`
-- iseq ← isDefEq oldAnswer.resultType answer.resultType; pure (!iseq)
oldAnswer.resultType != answer.resultType
@ -421,15 +421,16 @@ else pure false
def getResult : SynthM (Option Expr) := do
s ← get; pure s.result
partial def synth : Nat → SynthM (Option Expr)
def synth : Nat → SynthM (Option Expr)
| 0 => do
trace! `Meta.synthInstance "synthInstance is out of fuel";
pure none
| n+1 => do
| fuel+1 => do
trace! `Meta.synthInstance ("remaining fuel " ++ toString fuel);
condM step
(do result? ← getResult;
match result? with
| none => synth n
| none => synth fuel
| some result => pure result)
(do trace! `Meta.synthInstance "failed";
pure none)
@ -511,7 +512,16 @@ forallTelescope type $ fun xs typeBody =>
pure type
| _ => pure type
def synthInstance? (type : Expr) (fuel : Nat := 10000) : MetaM (Option Expr) := do
@[init] def maxStepsOption : IO Unit :=
registerOption `synthInstance.maxSteps { defValue := (10000 : Nat), group := "", descr := "maximum steps for the type class instance synthesis procedure" }
private def getMaxSteps (opts : Options) : Nat :=
opts.getNat `synthInstance.maxSteps 10000
def synthInstance? (type : Expr) : MetaM (Option Expr) := do
opts ← getOptions;
let fuel := getMaxSteps opts;
inputConfig ← getConfig;
withConfig (fun config => { transparency := TransparencyMode.reducible, foApprox := true, ctxApprox := true, .. config }) $ do
type ← instantiateMVars type;
@ -543,17 +553,17 @@ withConfig (fun config => { transparency := TransparencyMode.reducible, foApprox
/--
Return `LOption.some r` if succeeded, `LOption.none` if it failed, and `LOption.undef` if
instance cannot be synthesized right now because `type` contains metavariables. -/
def trySynthInstance (type : Expr) (fuel : Nat := 10000) : MetaM (LOption Expr) :=
def trySynthInstance (type : Expr) : MetaM (LOption Expr) :=
adaptReader (fun (ctx : Context) => { config := { isDefEqStuckEx := true, .. ctx.config }, .. ctx }) $
catch
(toLOptionM $ synthInstance? type fuel)
(toLOptionM $ synthInstance? type)
(fun ex => match ex with
| Exception.isExprDefEqStuck _ _ _ => pure LOption.undef
| Exception.isLevelDefEqStuck _ _ _ => pure LOption.undef
| _ => throw ex)
def synthInstance (type : Expr) (fuel : Nat := 10000) : MetaM Expr := do
result? ← synthInstance? type fuel;
def synthInstance (type : Expr) : MetaM Expr := do
result? ← synthInstance? type;
match result? with
| some result => pure result
| none => throwEx $ Exception.synthInstance type

View file

@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura, Sebastian Ullrich
-/
prelude
import Init.Lean.Util.Message
import Init.Lean.Message
import Init.Lean.Parser.Command
namespace Lean

View file

@ -10,7 +10,7 @@ import Init.Lean.Syntax
import Init.Lean.ToExpr
import Init.Lean.Environment
import Init.Lean.Attributes
import Init.Lean.Util.Message
import Init.Lean.Message
import Init.Lean.Parser.Identifier
import Init.Lean.Compiler.InitAttr

View file

@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
prelude
import Init.Lean.Util.Message
import Init.Lean.Message
namespace Lean

View file

@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sebastian Ullrich, Leonardo de Moura
-/
prelude
import Init.Lean.Util.Message
import Init.Lean.Message
universe u
namespace Lean

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,317 @@
// Lean compiler output
// Module: Init.Lean.Data.Occurrences
// Imports: Init.Data.Nat
#include "runtime/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_Occurrences_contains___boxed(lean_object*, lean_object*);
uint8_t l_List_elem___main___at_Lean_Occurrences_contains___spec__1(lean_object*, lean_object*);
uint8_t l_Lean_Occurrences_beq(lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_Occurrences_HasBeq;
uint8_t l_Lean_Occurrences_contains(lean_object*, lean_object*);
uint8_t l_List_beq___main___at_Lean_Occurrences_beq___spec__1(lean_object*, lean_object*);
lean_object* l_Lean_Occurrences_beq___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Occurrences_Inhabited;
lean_object* l_Lean_Occurrences_HasBeq___closed__1;
lean_object* l_List_elem___main___at_Lean_Occurrences_contains___spec__1___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Occurrences_isAll___boxed(lean_object*);
uint8_t l_Lean_Occurrences_isAll(lean_object*);
lean_object* l_List_beq___main___at_Lean_Occurrences_beq___spec__1___boxed(lean_object*, lean_object*);
lean_object* _init_l_Lean_Occurrences_Inhabited() {
_start:
{
lean_object* x_1;
x_1 = lean_box(0);
return x_1;
}
}
uint8_t l_List_elem___main___at_Lean_Occurrences_contains___spec__1(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_2) == 0)
{
uint8_t x_3;
x_3 = 0;
return x_3;
}
else
{
lean_object* x_4; lean_object* x_5; uint8_t x_6;
x_4 = lean_ctor_get(x_2, 0);
x_5 = lean_ctor_get(x_2, 1);
x_6 = lean_nat_dec_eq(x_1, x_4);
if (x_6 == 0)
{
x_2 = x_5;
goto _start;
}
else
{
uint8_t x_8;
x_8 = 1;
return x_8;
}
}
}
}
uint8_t l_Lean_Occurrences_contains(lean_object* x_1, lean_object* x_2) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 0:
{
uint8_t x_3;
x_3 = 1;
return x_3;
}
case 1:
{
lean_object* x_4; uint8_t x_5;
x_4 = lean_ctor_get(x_1, 0);
x_5 = l_List_elem___main___at_Lean_Occurrences_contains___spec__1(x_2, x_4);
return x_5;
}
default:
{
lean_object* x_6; uint8_t x_7;
x_6 = lean_ctor_get(x_1, 0);
x_7 = l_List_elem___main___at_Lean_Occurrences_contains___spec__1(x_2, x_6);
if (x_7 == 0)
{
uint8_t x_8;
x_8 = 1;
return x_8;
}
else
{
uint8_t x_9;
x_9 = 0;
return x_9;
}
}
}
}
}
lean_object* l_List_elem___main___at_Lean_Occurrences_contains___spec__1___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_List_elem___main___at_Lean_Occurrences_contains___spec__1(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
lean_object* l_Lean_Occurrences_contains___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_Lean_Occurrences_contains(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
uint8_t l_Lean_Occurrences_isAll(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_Occurrences_isAll___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3;
x_2 = l_Lean_Occurrences_isAll(x_1);
lean_dec(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
uint8_t l_List_beq___main___at_Lean_Occurrences_beq___spec__1(lean_object* x_1, lean_object* x_2) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
if (lean_obj_tag(x_2) == 0)
{
uint8_t x_3;
x_3 = 1;
return x_3;
}
else
{
uint8_t x_4;
x_4 = 0;
return x_4;
}
}
else
{
if (lean_obj_tag(x_2) == 0)
{
uint8_t x_5;
x_5 = 0;
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10;
x_6 = lean_ctor_get(x_1, 0);
x_7 = lean_ctor_get(x_1, 1);
x_8 = lean_ctor_get(x_2, 0);
x_9 = lean_ctor_get(x_2, 1);
x_10 = lean_nat_dec_eq(x_6, x_8);
if (x_10 == 0)
{
uint8_t x_11;
x_11 = 0;
return x_11;
}
else
{
x_1 = x_7;
x_2 = x_9;
goto _start;
}
}
}
}
}
uint8_t l_Lean_Occurrences_beq(lean_object* x_1, lean_object* x_2) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 0:
{
if (lean_obj_tag(x_2) == 0)
{
uint8_t x_3;
x_3 = 1;
return x_3;
}
else
{
uint8_t x_4;
x_4 = 0;
return x_4;
}
}
case 1:
{
if (lean_obj_tag(x_2) == 1)
{
lean_object* x_5; lean_object* x_6; uint8_t x_7;
x_5 = lean_ctor_get(x_1, 0);
x_6 = lean_ctor_get(x_2, 0);
x_7 = l_List_beq___main___at_Lean_Occurrences_beq___spec__1(x_5, x_6);
return x_7;
}
else
{
uint8_t x_8;
x_8 = 0;
return x_8;
}
}
default:
{
if (lean_obj_tag(x_2) == 2)
{
lean_object* x_9; lean_object* x_10; uint8_t x_11;
x_9 = lean_ctor_get(x_1, 0);
x_10 = lean_ctor_get(x_2, 0);
x_11 = l_List_beq___main___at_Lean_Occurrences_beq___spec__1(x_9, x_10);
return x_11;
}
else
{
uint8_t x_12;
x_12 = 0;
return x_12;
}
}
}
}
}
lean_object* l_List_beq___main___at_Lean_Occurrences_beq___spec__1___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_List_beq___main___at_Lean_Occurrences_beq___spec__1(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
lean_object* l_Lean_Occurrences_beq___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_Lean_Occurrences_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_Lean_Occurrences_HasBeq___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_Occurrences_beq___boxed), 2, 0);
return x_1;
}
}
lean_object* _init_l_Lean_Occurrences_HasBeq() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Occurrences_HasBeq___closed__1;
return x_1;
}
}
lean_object* initialize_Init_Data_Nat(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Data_Occurrences(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init_Data_Nat(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Occurrences_Inhabited = _init_l_Lean_Occurrences_Inhabited();
lean_mark_persistent(l_Lean_Occurrences_Inhabited);
l_Lean_Occurrences_HasBeq___closed__1 = _init_l_Lean_Occurrences_HasBeq___closed__1();
lean_mark_persistent(l_Lean_Occurrences_HasBeq___closed__1);
l_Lean_Occurrences_HasBeq = _init_l_Lean_Occurrences_HasBeq();
lean_mark_persistent(l_Lean_Occurrences_HasBeq);
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

View file

@ -1121,49 +1121,49 @@ return x_2;
lean_object* l_Lean_Elab_Command_elabAttr(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_38; lean_object* x_39; lean_object* x_40;
x_38 = lean_unsigned_to_nat(0u);
x_39 = l_Lean_Syntax_getArg(x_1, x_38);
x_40 = l_Lean_Syntax_isIdOrAtom_x3f(x_39);
if (lean_obj_tag(x_40) == 0)
lean_object* x_4; lean_object* x_5; lean_object* x_40; lean_object* x_41; lean_object* x_42;
x_40 = lean_unsigned_to_nat(0u);
x_41 = l_Lean_Syntax_getArg(x_1, x_40);
x_42 = l_Lean_Syntax_isIdOrAtom_x3f(x_41);
if (lean_obj_tag(x_42) == 0)
{
lean_object* x_41; lean_object* x_42; uint8_t x_43;
lean_object* x_43; lean_object* x_44; uint8_t x_45;
lean_dec(x_1);
x_41 = l_Lean_Elab_Command_elabAttr___closed__6;
x_42 = l_Lean_Elab_Command_throwError___rarg(x_39, x_41, x_2, x_3);
x_43 = !lean_is_exclusive(x_42);
if (x_43 == 0)
x_43 = l_Lean_Elab_Command_elabAttr___closed__6;
x_44 = l_Lean_Elab_Command_throwError___rarg(x_41, x_43, x_2, x_3);
x_45 = !lean_is_exclusive(x_44);
if (x_45 == 0)
{
return x_42;
return x_44;
}
else
{
lean_object* x_44; lean_object* x_45; lean_object* x_46;
x_44 = lean_ctor_get(x_42, 0);
x_45 = lean_ctor_get(x_42, 1);
lean_inc(x_45);
lean_inc(x_44);
lean_dec(x_42);
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
{
lean_object* x_47; lean_object* x_48; lean_object* x_49;
lean_dec(x_39);
x_47 = lean_ctor_get(x_40, 0);
lean_object* x_46; lean_object* x_47; lean_object* x_48;
x_46 = lean_ctor_get(x_44, 0);
x_47 = lean_ctor_get(x_44, 1);
lean_inc(x_47);
lean_dec(x_40);
x_48 = lean_box(0);
x_49 = lean_name_mk_string(x_48, x_47);
x_4 = x_49;
x_5 = x_3;
goto block_37;
lean_inc(x_46);
lean_dec(x_44);
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;
}
block_37:
}
else
{
lean_object* x_49; lean_object* x_50; lean_object* x_51;
lean_dec(x_41);
x_49 = lean_ctor_get(x_42, 0);
lean_inc(x_49);
lean_dec(x_42);
x_50 = lean_box(0);
x_51 = lean_name_mk_string(x_50, x_49);
x_4 = x_51;
x_5 = x_3;
goto block_39;
}
block_39:
{
lean_object* x_6;
lean_inc(x_4);
@ -1256,27 +1256,31 @@ lean_dec(x_4);
x_30 = !lean_is_exclusive(x_6);
if (x_30 == 0)
{
lean_object* x_31; lean_object* x_32;
lean_object* x_31; lean_object* x_32; lean_object* x_33;
x_31 = lean_ctor_get(x_6, 0);
x_32 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_2, x_1, x_31);
lean_dec(x_1);
lean_ctor_set(x_6, 0, x_32);
x_33 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_33, 0, x_32);
lean_ctor_set(x_6, 0, x_33);
return x_6;
}
else
{
lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36;
x_33 = lean_ctor_get(x_6, 0);
x_34 = lean_ctor_get(x_6, 1);
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_6, 0);
x_35 = lean_ctor_get(x_6, 1);
lean_inc(x_35);
lean_inc(x_34);
lean_inc(x_33);
lean_dec(x_6);
x_35 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_2, x_1, x_33);
x_36 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_2, x_1, x_34);
lean_dec(x_1);
x_36 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_36, 0, x_35);
lean_ctor_set(x_36, 1, x_34);
return x_36;
x_37 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_37, 0, x_36);
x_38 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_38, 0, x_37);
lean_ctor_set(x_38, 1, x_35);
return x_38;
}
}
}
@ -2353,85 +2357,93 @@ lean_dec(x_2);
x_41 = !lean_is_exclusive(x_29);
if (x_41 == 0)
{
lean_object* x_42; lean_object* x_43;
lean_object* x_42; lean_object* x_43; lean_object* x_44;
x_42 = lean_ctor_get(x_29, 0);
x_43 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_42);
lean_ctor_set(x_29, 0, x_43);
x_44 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_44, 0, x_43);
lean_ctor_set(x_29, 0, x_44);
return x_29;
}
else
{
lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47;
x_44 = lean_ctor_get(x_29, 0);
x_45 = lean_ctor_get(x_29, 1);
lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49;
x_45 = lean_ctor_get(x_29, 0);
x_46 = lean_ctor_get(x_29, 1);
lean_inc(x_46);
lean_inc(x_45);
lean_inc(x_44);
lean_dec(x_29);
x_46 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_44);
x_47 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_47, 0, x_46);
lean_ctor_set(x_47, 1, x_45);
return x_47;
x_47 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_45);
x_48 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_48, 0, x_47);
x_49 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_49, 0, x_48);
lean_ctor_set(x_49, 1, x_46);
return x_49;
}
}
}
else
{
uint8_t x_48;
uint8_t x_50;
lean_dec(x_15);
lean_dec(x_12);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_2);
x_48 = !lean_is_exclusive(x_22);
if (x_48 == 0)
x_50 = !lean_is_exclusive(x_22);
if (x_50 == 0)
{
return x_22;
}
else
{
lean_object* x_49; lean_object* x_50; lean_object* x_51;
x_49 = lean_ctor_get(x_22, 0);
x_50 = lean_ctor_get(x_22, 1);
lean_inc(x_50);
lean_inc(x_49);
lean_object* x_51; lean_object* x_52; lean_object* x_53;
x_51 = lean_ctor_get(x_22, 0);
x_52 = lean_ctor_get(x_22, 1);
lean_inc(x_52);
lean_inc(x_51);
lean_dec(x_22);
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;
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
{
uint8_t x_52;
uint8_t x_54;
lean_dec(x_12);
lean_dec(x_5);
lean_dec(x_2);
x_52 = !lean_is_exclusive(x_14);
if (x_52 == 0)
x_54 = !lean_is_exclusive(x_14);
if (x_54 == 0)
{
lean_object* x_53; lean_object* x_54;
x_53 = lean_ctor_get(x_14, 0);
x_54 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_53);
lean_ctor_set(x_14, 0, x_54);
lean_object* x_55; lean_object* x_56; lean_object* x_57;
x_55 = lean_ctor_get(x_14, 0);
x_56 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_55);
x_57 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_57, 0, x_56);
lean_ctor_set(x_14, 0, x_57);
return x_14;
}
else
{
lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58;
x_55 = lean_ctor_get(x_14, 0);
x_56 = lean_ctor_get(x_14, 1);
lean_inc(x_56);
lean_inc(x_55);
lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62;
x_58 = lean_ctor_get(x_14, 0);
x_59 = lean_ctor_get(x_14, 1);
lean_inc(x_59);
lean_inc(x_58);
lean_dec(x_14);
x_57 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_55);
x_58 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_58, 0, x_57);
lean_ctor_set(x_58, 1, x_56);
return x_58;
x_60 = l___private_Init_Lean_Elab_Command_1__ioErrorToMessage(x_6, x_1, x_58);
x_61 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_61, 0, x_60);
x_62 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_62, 0, x_61);
lean_ctor_set(x_62, 1, x_59);
return x_62;
}
}
}

View file

@ -15,7 +15,6 @@ extern "C" {
#endif
lean_object* l_Lean_Elab_Command_elabDeclaration(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabConstant___closed__9;
lean_object* l___private_Init_Lean_Elab_Command_13__addScopes___main(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_mkForall(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Command_abbrev___elambda__1___closed__2;
lean_object* l_Lean_Elab_Command_addDecl(lean_object*, lean_object*, lean_object*, lean_object*);
@ -35,7 +34,6 @@ lean_object* l_Lean_Elab_Command_elabAbbrev(lean_object*, lean_object*, lean_obj
extern lean_object* l_Lean_Elab_Command_runTermElabM___rarg___closed__1;
lean_object* l_Lean_Elab_Command_elabExample___closed__1;
lean_object* l_Lean_Elab_Command_elabConstant___closed__1;
extern lean_object* l_Lean_stxInh;
extern lean_object* l_Array_empty___closed__1;
lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabAxiom___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_expandDeclSig(lean_object*);
@ -44,11 +42,11 @@ uint8_t lean_name_eq(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Command_declaration___elambda__1___closed__2;
lean_object* l_Lean_mkIdentFrom(lean_object*, lean_object*);
lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_10__getVarDecls(lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* l_Lean_Elab_Term_mkForallUsedOnly(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabDeclaration___closed__2;
lean_object* lean_string_utf8_byte_size(lean_object*);
lean_object* l___private_Init_Lean_Elab_Term_20__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Command_example___elambda__1___closed__2;
lean_object* l_Lean_Name_getNumParts___main(lean_object*);
lean_object* l_Lean_Elab_Command_elabInductive___rarg(lean_object*);
@ -68,9 +66,9 @@ lean_object* l_Lean_Elab_Command_elabInstance___closed__1;
extern lean_object* l_Lean_Parser_Command_def___elambda__1___closed__2;
extern lean_object* l_Lean_Parser_Command_declValSimple___elambda__1___closed__2;
extern lean_object* l_Lean_Meta_registerInstanceAttr___closed__1;
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabConstant(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabAxiom___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_11__getVarDecls(lean_object*);
lean_object* l_Lean_Elab_Command_expandOptDeclSig(lean_object*);
lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabDeclaration___closed__3;
extern lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__1;
@ -84,6 +82,8 @@ extern lean_object* l___regBuiltinParser_Lean_Parser_Command_antiquot___closed__
lean_object* l_Lean_Elab_Command_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_List_elem___main___at_Lean_Parser_addLeadingParser___spec__7(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabConstant___closed__7;
lean_object* l___private_Init_Lean_Elab_Command_9__mkTermContext(lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Elab_Term_17__synthesizeSyntheticMVar___closed__3;
lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabAxiom___spec__3(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_hole___elambda__1___closed__1;
lean_object* l_Lean_Elab_Command_elabTheorem(lean_object*, lean_object*, lean_object*, lean_object*);
@ -92,7 +92,6 @@ lean_object* l_Lean_Elab_Command_elabDef(lean_object*, lean_object*, lean_object
extern lean_object* l_Lean_Elab_Command_withDeclId___closed__3;
lean_object* l_Lean_Elab_Command_elabAxiom___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_sortDeclLevelParams(lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Elab_Term_16__synthesizeSyntheticMVar___closed__3;
lean_object* l_Lean_Elab_Command_elabClassInductive___boxed(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_mkReducibilityAttrs___closed__4;
lean_object* l_Lean_Elab_Command_elabConstant___closed__10;
@ -124,6 +123,7 @@ lean_object* l_Lean_Elab_Command_getLevelNames(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabModifiers(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_throwAlreadyDeclaredUniverseLevel___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabDefLike(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_14__addScopes___main(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Syntax_foldArgsAuxM___main___at_Lean_Syntax_foldSepRevArgsM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_expandDeclSig___boxed(lean_object*);
lean_object* l_Lean_Elab_Term_elabBinders___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
@ -134,7 +134,6 @@ lean_object* l_Lean_Elab_Command_elabAxiom___lambda__2(lean_object*, lean_object
lean_object* l_Lean_Elab_Command_elabConstant___closed__5;
lean_object* l_Lean_Elab_Command_elabInductive(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabDeclaration___closed__1;
lean_object* l___private_Init_Lean_Elab_Term_19__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabDeclaration___closed__3;
lean_object* l_Lean_Elab_Command_elabConstant___closed__3;
lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabAxiom___spec__2(lean_object*, lean_object*, lean_object*);
@ -144,14 +143,13 @@ lean_object* l_Lean_CollectLevelParams_main___main(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabAxiom___spec__1(lean_object*, lean_object*, lean_object*);
lean_object* lean_name_mk_numeral(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Command_constant___elambda__1___closed__2;
lean_object* l___private_Init_Lean_Elab_Command_9__mkTermState(lean_object*);
lean_object* l_Lean_Elab_Command_elabConstant___closed__8;
extern lean_object* l_Lean_Parser_Command_theorem___elambda__1___closed__2;
lean_object* l_Lean_Elab_Command_elabClassInductive___rarg(lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_3__setState(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_8__mkTermContext(lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Command_declId___elambda__1___closed__2;
lean_object* l___private_Init_Lean_Elab_Command_10__mkTermState(lean_object*);
lean_object* l_Lean_Elab_Command_expandOptDeclSig(lean_object* x_1) {
_start:
{
@ -626,7 +624,7 @@ lean_object* x_15; lean_object* x_16; uint8_t x_17;
lean_dec(x_11);
lean_dec(x_9);
lean_dec(x_8);
x_15 = l___private_Init_Lean_Elab_Term_16__synthesizeSyntheticMVar___closed__3;
x_15 = l___private_Init_Lean_Elab_Term_17__synthesizeSyntheticMVar___closed__3;
x_16 = l_Lean_Elab_Command_throwError___rarg(x_2, x_15, x_3, x_4);
x_17 = !lean_is_exclusive(x_16);
if (x_17 == 0)
@ -3000,7 +2998,7 @@ lean_dec(x_9);
x_12 = 0;
x_13 = lean_box(0);
lean_inc(x_7);
x_14 = l___private_Init_Lean_Elab_Term_19__synthesizeSyntheticMVarsAux___main(x_12, x_13, x_7, x_11);
x_14 = l___private_Init_Lean_Elab_Term_20__synthesizeSyntheticMVarsAux___main(x_12, x_13, x_7, x_11);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
@ -3333,7 +3331,7 @@ x_22 = l_Lean_Parser_Command_namespace___elambda__1___closed__1;
x_23 = 1;
lean_inc(x_3);
lean_inc(x_20);
x_24 = l___private_Init_Lean_Elab_Command_13__addScopes___main(x_6, x_22, x_23, x_20, x_3, x_19);
x_24 = l___private_Init_Lean_Elab_Command_14__addScopes___main(x_6, x_22, x_23, x_20, x_3, x_19);
if (lean_obj_tag(x_24) == 0)
{
lean_object* x_25; lean_object* x_26;
@ -3402,9 +3400,9 @@ lean_inc(x_121);
x_122 = lean_ctor_get(x_120, 1);
lean_inc(x_122);
lean_dec(x_120);
x_123 = l___private_Init_Lean_Elab_Command_10__getVarDecls(x_121);
x_124 = l___private_Init_Lean_Elab_Command_8__mkTermContext(x_3, x_121, x_118);
x_125 = l___private_Init_Lean_Elab_Command_9__mkTermState(x_121);
x_123 = l___private_Init_Lean_Elab_Command_11__getVarDecls(x_121);
x_124 = l___private_Init_Lean_Elab_Command_9__mkTermContext(x_3, x_121, x_118);
x_125 = l___private_Init_Lean_Elab_Command_10__mkTermState(x_121);
lean_dec(x_121);
x_126 = l_Lean_Elab_Term_elabBinders___rarg(x_123, x_119, x_124, x_125);
lean_dec(x_123);
@ -4424,384 +4422,378 @@ return x_2;
lean_object* l_Lean_Elab_Command_elabDeclaration(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_4 = lean_ctor_get(x_1, 1);
lean_inc(x_4);
x_5 = l_Lean_stxInh;
x_6 = lean_unsigned_to_nat(0u);
x_7 = lean_array_get(x_5, x_4, x_6);
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = lean_unsigned_to_nat(0u);
x_5 = l_Lean_Syntax_getArg(x_1, x_4);
lean_inc(x_2);
x_8 = l_Lean_Elab_Command_elabModifiers(x_7, x_2, x_3);
lean_dec(x_7);
if (lean_obj_tag(x_8) == 0)
x_6 = l_Lean_Elab_Command_elabModifiers(x_5, x_2, x_3);
lean_dec(x_5);
if (lean_obj_tag(x_6) == 0)
{
uint8_t x_9;
x_9 = !lean_is_exclusive(x_8);
if (x_9 == 0)
uint8_t x_7;
x_7 = !lean_is_exclusive(x_6);
if (x_7 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16;
x_10 = lean_ctor_get(x_8, 0);
x_11 = lean_ctor_get(x_8, 1);
x_12 = lean_unsigned_to_nat(1u);
x_13 = lean_array_get(x_5, x_4, x_12);
lean_dec(x_4);
lean_inc(x_13);
x_14 = l_Lean_Syntax_getKind(x_13);
x_15 = l_Lean_Parser_Command_abbrev___elambda__1___closed__2;
x_16 = lean_name_eq(x_14, x_15);
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_6, 0);
x_9 = lean_ctor_get(x_6, 1);
x_10 = lean_unsigned_to_nat(1u);
x_11 = l_Lean_Syntax_getArg(x_1, x_10);
lean_inc(x_11);
x_12 = l_Lean_Syntax_getKind(x_11);
x_13 = l_Lean_Parser_Command_abbrev___elambda__1___closed__2;
x_14 = lean_name_eq(x_12, x_13);
if (x_14 == 0)
{
lean_object* x_15; uint8_t x_16;
x_15 = l_Lean_Parser_Command_def___elambda__1___closed__2;
x_16 = lean_name_eq(x_12, x_15);
if (x_16 == 0)
{
lean_object* x_17; uint8_t x_18;
x_17 = l_Lean_Parser_Command_def___elambda__1___closed__2;
x_18 = lean_name_eq(x_14, x_17);
x_17 = l_Lean_Parser_Command_theorem___elambda__1___closed__2;
x_18 = lean_name_eq(x_12, x_17);
if (x_18 == 0)
{
lean_object* x_19; uint8_t x_20;
x_19 = l_Lean_Parser_Command_theorem___elambda__1___closed__2;
x_20 = lean_name_eq(x_14, x_19);
x_19 = l_Lean_Parser_Command_constant___elambda__1___closed__2;
x_20 = lean_name_eq(x_12, x_19);
if (x_20 == 0)
{
lean_object* x_21; uint8_t x_22;
x_21 = l_Lean_Parser_Command_constant___elambda__1___closed__2;
x_22 = lean_name_eq(x_14, x_21);
x_21 = l_Lean_Elab_Command_elabDeclaration___closed__1;
x_22 = lean_name_eq(x_12, x_21);
if (x_22 == 0)
{
lean_object* x_23; uint8_t x_24;
x_23 = l_Lean_Elab_Command_elabDeclaration___closed__1;
x_24 = lean_name_eq(x_14, x_23);
x_23 = l_Lean_Parser_Command_axiom___elambda__1___closed__2;
x_24 = lean_name_eq(x_12, x_23);
if (x_24 == 0)
{
lean_object* x_25; uint8_t x_26;
x_25 = l_Lean_Parser_Command_axiom___elambda__1___closed__2;
x_26 = lean_name_eq(x_14, x_25);
x_25 = l_Lean_Parser_Command_example___elambda__1___closed__2;
x_26 = lean_name_eq(x_12, x_25);
if (x_26 == 0)
{
lean_object* x_27; uint8_t x_28;
x_27 = l_Lean_Parser_Command_example___elambda__1___closed__2;
x_28 = lean_name_eq(x_14, x_27);
lean_dec(x_11);
lean_dec(x_8);
x_27 = l_Lean_Parser_Command_inductive___elambda__1___closed__2;
x_28 = lean_name_eq(x_12, x_27);
if (x_28 == 0)
{
lean_object* x_29; uint8_t x_30;
lean_dec(x_13);
lean_dec(x_10);
x_29 = l_Lean_Parser_Command_inductive___elambda__1___closed__2;
x_30 = lean_name_eq(x_14, x_29);
x_29 = l_Lean_Parser_Command_classInductive___elambda__1___closed__2;
x_30 = lean_name_eq(x_12, x_29);
if (x_30 == 0)
{
lean_object* x_31; uint8_t x_32;
x_31 = l_Lean_Parser_Command_classInductive___elambda__1___closed__2;
x_32 = lean_name_eq(x_14, x_31);
x_31 = l_Lean_Parser_Command_structure___elambda__1___closed__2;
x_32 = lean_name_eq(x_12, x_31);
lean_dec(x_12);
if (x_32 == 0)
{
lean_object* x_33; uint8_t x_34;
x_33 = l_Lean_Parser_Command_structure___elambda__1___closed__2;
x_34 = lean_name_eq(x_14, x_33);
lean_dec(x_14);
if (x_34 == 0)
lean_object* x_33; lean_object* x_34;
lean_free_object(x_6);
x_33 = l_Lean_Elab_Command_elabDeclaration___closed__4;
x_34 = l_Lean_Elab_Command_throwError___rarg(x_1, x_33, x_2, x_9);
return x_34;
}
else
{
lean_object* x_35; lean_object* x_36;
lean_free_object(x_8);
x_35 = l_Lean_Elab_Command_elabDeclaration___closed__4;
x_36 = l_Lean_Elab_Command_throwError___rarg(x_1, x_35, x_2, x_11);
return x_36;
lean_object* x_35;
lean_dec(x_2);
lean_dec(x_1);
x_35 = lean_box(0);
lean_ctor_set(x_6, 0, x_35);
return x_6;
}
}
else
{
lean_object* x_36;
lean_dec(x_12);
lean_dec(x_2);
lean_dec(x_1);
x_36 = lean_box(0);
lean_ctor_set(x_6, 0, x_36);
return x_6;
}
}
else
{
lean_object* x_37;
lean_dec(x_12);
lean_dec(x_2);
lean_dec(x_1);
x_37 = lean_box(0);
lean_ctor_set(x_8, 0, x_37);
return x_8;
lean_ctor_set(x_6, 0, x_37);
return x_6;
}
}
else
{
lean_object* x_38;
lean_dec(x_14);
lean_dec(x_2);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_38 = lean_box(0);
lean_ctor_set(x_8, 0, x_38);
return x_8;
x_38 = l_Lean_Elab_Command_elabExample(x_8, x_11, x_2, x_9);
return x_38;
}
}
else
{
lean_object* x_39;
lean_dec(x_14);
lean_dec(x_2);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_39 = lean_box(0);
lean_ctor_set(x_8, 0, x_39);
return x_8;
x_39 = l_Lean_Elab_Command_elabAxiom(x_8, x_11, x_2, x_9);
return x_39;
}
}
else
{
lean_object* x_40;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_40 = l_Lean_Elab_Command_elabExample(x_10, x_13, x_2, x_11);
x_40 = l_Lean_Elab_Command_elabInstance(x_8, x_11, x_2, x_9);
return x_40;
}
}
else
{
lean_object* x_41;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_41 = l_Lean_Elab_Command_elabAxiom(x_10, x_13, x_2, x_11);
x_41 = l_Lean_Elab_Command_elabConstant(x_8, x_11, x_2, x_9);
return x_41;
}
}
else
{
lean_object* x_42;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_42 = l_Lean_Elab_Command_elabInstance(x_10, x_13, x_2, x_11);
x_42 = l_Lean_Elab_Command_elabTheorem(x_8, x_11, x_2, x_9);
return x_42;
}
}
else
{
lean_object* x_43;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_43 = l_Lean_Elab_Command_elabConstant(x_10, x_13, x_2, x_11);
x_43 = l_Lean_Elab_Command_elabDef(x_8, x_11, x_2, x_9);
return x_43;
}
}
else
{
lean_object* x_44;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_12);
lean_free_object(x_6);
lean_dec(x_1);
x_44 = l_Lean_Elab_Command_elabTheorem(x_10, x_13, x_2, x_11);
x_44 = l_Lean_Elab_Command_elabAbbrev(x_8, x_11, x_2, x_9);
return x_44;
}
}
else
{
lean_object* x_45;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_1);
x_45 = l_Lean_Elab_Command_elabDef(x_10, x_13, x_2, x_11);
return x_45;
}
}
else
{
lean_object* x_46;
lean_dec(x_14);
lean_free_object(x_8);
lean_dec(x_1);
x_46 = l_Lean_Elab_Command_elabAbbrev(x_10, x_13, x_2, x_11);
return x_46;
}
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; uint8_t x_53;
x_47 = lean_ctor_get(x_8, 0);
x_48 = lean_ctor_get(x_8, 1);
lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; uint8_t x_51;
x_45 = lean_ctor_get(x_6, 0);
x_46 = lean_ctor_get(x_6, 1);
lean_inc(x_46);
lean_inc(x_45);
lean_dec(x_6);
x_47 = lean_unsigned_to_nat(1u);
x_48 = l_Lean_Syntax_getArg(x_1, x_47);
lean_inc(x_48);
lean_inc(x_47);
lean_dec(x_8);
x_49 = lean_unsigned_to_nat(1u);
x_50 = lean_array_get(x_5, x_4, x_49);
lean_dec(x_4);
lean_inc(x_50);
x_51 = l_Lean_Syntax_getKind(x_50);
x_52 = l_Lean_Parser_Command_abbrev___elambda__1___closed__2;
x_53 = lean_name_eq(x_51, x_52);
x_49 = l_Lean_Syntax_getKind(x_48);
x_50 = l_Lean_Parser_Command_abbrev___elambda__1___closed__2;
x_51 = lean_name_eq(x_49, x_50);
if (x_51 == 0)
{
lean_object* x_52; uint8_t x_53;
x_52 = l_Lean_Parser_Command_def___elambda__1___closed__2;
x_53 = lean_name_eq(x_49, x_52);
if (x_53 == 0)
{
lean_object* x_54; uint8_t x_55;
x_54 = l_Lean_Parser_Command_def___elambda__1___closed__2;
x_55 = lean_name_eq(x_51, x_54);
x_54 = l_Lean_Parser_Command_theorem___elambda__1___closed__2;
x_55 = lean_name_eq(x_49, x_54);
if (x_55 == 0)
{
lean_object* x_56; uint8_t x_57;
x_56 = l_Lean_Parser_Command_theorem___elambda__1___closed__2;
x_57 = lean_name_eq(x_51, x_56);
x_56 = l_Lean_Parser_Command_constant___elambda__1___closed__2;
x_57 = lean_name_eq(x_49, x_56);
if (x_57 == 0)
{
lean_object* x_58; uint8_t x_59;
x_58 = l_Lean_Parser_Command_constant___elambda__1___closed__2;
x_59 = lean_name_eq(x_51, x_58);
x_58 = l_Lean_Elab_Command_elabDeclaration___closed__1;
x_59 = lean_name_eq(x_49, x_58);
if (x_59 == 0)
{
lean_object* x_60; uint8_t x_61;
x_60 = l_Lean_Elab_Command_elabDeclaration___closed__1;
x_61 = lean_name_eq(x_51, x_60);
x_60 = l_Lean_Parser_Command_axiom___elambda__1___closed__2;
x_61 = lean_name_eq(x_49, x_60);
if (x_61 == 0)
{
lean_object* x_62; uint8_t x_63;
x_62 = l_Lean_Parser_Command_axiom___elambda__1___closed__2;
x_63 = lean_name_eq(x_51, x_62);
x_62 = l_Lean_Parser_Command_example___elambda__1___closed__2;
x_63 = lean_name_eq(x_49, x_62);
if (x_63 == 0)
{
lean_object* x_64; uint8_t x_65;
x_64 = l_Lean_Parser_Command_example___elambda__1___closed__2;
x_65 = lean_name_eq(x_51, x_64);
lean_dec(x_48);
lean_dec(x_45);
x_64 = l_Lean_Parser_Command_inductive___elambda__1___closed__2;
x_65 = lean_name_eq(x_49, x_64);
if (x_65 == 0)
{
lean_object* x_66; uint8_t x_67;
lean_dec(x_50);
lean_dec(x_47);
x_66 = l_Lean_Parser_Command_inductive___elambda__1___closed__2;
x_67 = lean_name_eq(x_51, x_66);
x_66 = l_Lean_Parser_Command_classInductive___elambda__1___closed__2;
x_67 = lean_name_eq(x_49, x_66);
if (x_67 == 0)
{
lean_object* x_68; uint8_t x_69;
x_68 = l_Lean_Parser_Command_classInductive___elambda__1___closed__2;
x_69 = lean_name_eq(x_51, x_68);
x_68 = l_Lean_Parser_Command_structure___elambda__1___closed__2;
x_69 = lean_name_eq(x_49, x_68);
lean_dec(x_49);
if (x_69 == 0)
{
lean_object* x_70; uint8_t x_71;
x_70 = l_Lean_Parser_Command_structure___elambda__1___closed__2;
x_71 = lean_name_eq(x_51, x_70);
lean_dec(x_51);
if (x_71 == 0)
lean_object* x_70; lean_object* x_71;
x_70 = l_Lean_Elab_Command_elabDeclaration___closed__4;
x_71 = l_Lean_Elab_Command_throwError___rarg(x_1, x_70, x_2, x_46);
return x_71;
}
else
{
lean_object* x_72; lean_object* x_73;
x_72 = l_Lean_Elab_Command_elabDeclaration___closed__4;
x_73 = l_Lean_Elab_Command_throwError___rarg(x_1, x_72, x_2, x_48);
lean_dec(x_2);
lean_dec(x_1);
x_72 = lean_box(0);
x_73 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_73, 0, x_72);
lean_ctor_set(x_73, 1, x_46);
return x_73;
}
}
else
{
lean_object* x_74; lean_object* x_75;
lean_dec(x_49);
lean_dec(x_2);
lean_dec(x_1);
x_74 = lean_box(0);
x_75 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_75, 0, x_74);
lean_ctor_set(x_75, 1, x_48);
lean_ctor_set(x_75, 1, x_46);
return x_75;
}
}
else
{
lean_object* x_76; lean_object* x_77;
lean_dec(x_51);
lean_dec(x_49);
lean_dec(x_2);
lean_dec(x_1);
x_76 = lean_box(0);
x_77 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_77, 0, x_76);
lean_ctor_set(x_77, 1, x_48);
lean_ctor_set(x_77, 1, x_46);
return x_77;
}
}
else
{
lean_object* x_78; lean_object* x_79;
lean_dec(x_51);
lean_dec(x_2);
lean_object* x_78;
lean_dec(x_49);
lean_dec(x_1);
x_78 = lean_box(0);
x_79 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_79, 0, x_78);
lean_ctor_set(x_79, 1, x_48);
x_78 = l_Lean_Elab_Command_elabExample(x_45, x_48, x_2, x_46);
return x_78;
}
}
else
{
lean_object* x_79;
lean_dec(x_49);
lean_dec(x_1);
x_79 = l_Lean_Elab_Command_elabAxiom(x_45, x_48, x_2, x_46);
return x_79;
}
}
else
{
lean_object* x_80;
lean_dec(x_51);
lean_dec(x_49);
lean_dec(x_1);
x_80 = l_Lean_Elab_Command_elabExample(x_47, x_50, x_2, x_48);
x_80 = l_Lean_Elab_Command_elabInstance(x_45, x_48, x_2, x_46);
return x_80;
}
}
else
{
lean_object* x_81;
lean_dec(x_51);
lean_dec(x_49);
lean_dec(x_1);
x_81 = l_Lean_Elab_Command_elabAxiom(x_47, x_50, x_2, x_48);
x_81 = l_Lean_Elab_Command_elabConstant(x_45, x_48, x_2, x_46);
return x_81;
}
}
else
{
lean_object* x_82;
lean_dec(x_51);
lean_dec(x_49);
lean_dec(x_1);
x_82 = l_Lean_Elab_Command_elabInstance(x_47, x_50, x_2, x_48);
x_82 = l_Lean_Elab_Command_elabTheorem(x_45, x_48, x_2, x_46);
return x_82;
}
}
else
{
lean_object* x_83;
lean_dec(x_51);
lean_dec(x_49);
lean_dec(x_1);
x_83 = l_Lean_Elab_Command_elabConstant(x_47, x_50, x_2, x_48);
x_83 = l_Lean_Elab_Command_elabDef(x_45, x_48, x_2, x_46);
return x_83;
}
}
else
{
lean_object* x_84;
lean_dec(x_51);
lean_dec(x_49);
lean_dec(x_1);
x_84 = l_Lean_Elab_Command_elabTheorem(x_47, x_50, x_2, x_48);
x_84 = l_Lean_Elab_Command_elabAbbrev(x_45, x_48, x_2, x_46);
return x_84;
}
}
else
{
lean_object* x_85;
lean_dec(x_51);
lean_dec(x_1);
x_85 = l_Lean_Elab_Command_elabDef(x_47, x_50, x_2, x_48);
return x_85;
}
}
else
{
lean_object* x_86;
lean_dec(x_51);
lean_dec(x_1);
x_86 = l_Lean_Elab_Command_elabAbbrev(x_47, x_50, x_2, x_48);
return x_86;
}
}
}
else
{
uint8_t x_87;
lean_dec(x_4);
uint8_t x_85;
lean_dec(x_2);
lean_dec(x_1);
x_87 = !lean_is_exclusive(x_8);
if (x_87 == 0)
x_85 = !lean_is_exclusive(x_6);
if (x_85 == 0)
{
return x_8;
return x_6;
}
else
{
lean_object* x_88; lean_object* x_89; lean_object* x_90;
x_88 = lean_ctor_get(x_8, 0);
x_89 = lean_ctor_get(x_8, 1);
lean_inc(x_89);
lean_inc(x_88);
lean_dec(x_8);
x_90 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_90, 0, x_88);
lean_ctor_set(x_90, 1, x_89);
return x_90;
lean_object* x_86; lean_object* x_87; lean_object* x_88;
x_86 = lean_ctor_get(x_6, 0);
x_87 = lean_ctor_get(x_6, 1);
lean_inc(x_87);
lean_inc(x_86);
lean_dec(x_6);
x_88 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_88, 0, x_86);
lean_ctor_set(x_88, 1, x_87);
return x_88;
}
}
}

View file

@ -13,7 +13,6 @@
#ifdef __cplusplus
extern "C" {
#endif
lean_object* l___private_Init_Lean_Elab_Command_13__addScopes___main(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_mkForall(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_addDecl(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*);
@ -35,13 +34,11 @@ lean_object* l_Lean_Elab_Command_compileDecl(lean_object*, lean_object*, lean_ob
lean_object* l_Array_reverseAux___main___rarg(lean_object*, lean_object*);
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* l___private_Init_Lean_Elab_Command_10__getVarDecls(lean_object*);
lean_object* lean_array_get_size(lean_object*);
extern lean_object* l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
extern lean_object* l_Lean_Parser_Command_declValEqns___elambda__1___closed__2;
lean_object* l_Lean_Elab_Command_elabDefVal___closed__1;
lean_object* l_Lean_Elab_Command_elabDefVal___closed__4;
lean_object* l_Lean_Elab_Command_elabDefVal(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Term_20__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_collectUsedFVarsAtFVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Elab_Command_DefKind_isExample(uint8_t);
lean_object* l_Lean_Name_getNumParts___main(lean_object*);
@ -57,14 +54,15 @@ uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_collectUsedFVarsAtFVars___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_levelMVarToParam(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_withUsedWhen_x27___rarg(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_throwUnexpectedSyntax___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabDefLike___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_throwUnsupportedSyntax___rarg(lean_object*);
lean_object* l_Lean_Elab_Command_DefKind_isTheorem___boxed(lean_object*);
extern lean_object* l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
lean_object* l_Lean_Elab_Term_elabTerm(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Command_declValSimple___elambda__1___closed__2;
lean_object* l_Lean_Expr_fvarId_x21(lean_object*);
lean_object* l_Lean_Elab_Command_elabDefVal___closed__5;
lean_object* l___private_Init_Lean_Elab_Command_11__getVarDecls(lean_object*);
lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__2;
lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__1;
lean_object* l_Lean_Syntax_getId(lean_object*);
@ -82,6 +80,7 @@ uint8_t l_List_elem___main___at_Lean_Parser_addLeadingParser___spec__7(lean_obje
lean_object* l_Lean_LocalInstances_erase(lean_object*, lean_object*);
lean_object* l_Lean_CollectFVars_main___main(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_withUsedWhen_x27(lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_9__mkTermContext(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_DefKind_isDefOrOpaque___boxed(lean_object*);
lean_object* l_Lean_Elab_Term_getLocalInsts(lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Command_modifyScope___closed__1;
@ -108,23 +107,22 @@ lean_object* l_Lean_Elab_Command_getLevelNames(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_removeUnused(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_throwAlreadyDeclaredUniverseLevel___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_elabDefLike(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_14__addScopes___main(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Syntax_foldArgsAuxM___main___at_Lean_Syntax_foldSepRevArgsM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_elabBinders___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_removeUnused___closed__1;
uint8_t l_Lean_NameSet_contains(lean_object*, lean_object*);
lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*);
extern lean_object* l_HashMap_Inhabited___closed__1;
lean_object* l___private_Init_Lean_Elab_Term_19__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Elab_Command_DefKind_isDefOrOpaque(uint8_t);
lean_object* lean_task_pure(lean_object*);
lean_object* l_Lean_CollectLevelParams_main___main(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_DefKind_isExample___boxed(lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_9__mkTermState(lean_object*);
lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabDefLike___spec__1(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Command_mkDef___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_3__setState(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_8__mkTermContext(lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Command_10__mkTermState(lean_object*);
uint8_t l_Lean_Elab_Command_DefKind_isTheorem(uint8_t x_1) {
_start:
{
@ -1468,7 +1466,7 @@ lean_free_object(x_34);
lean_dec(x_36);
lean_dec(x_32);
lean_dec(x_8);
x_55 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_55 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_56 = l_unreachable_x21___rarg(x_55);
x_57 = lean_apply_2(x_56, x_11, x_37);
return x_57;
@ -1567,7 +1565,7 @@ lean_dec(x_70);
lean_dec(x_64);
lean_dec(x_32);
lean_dec(x_8);
x_85 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_85 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_86 = l_unreachable_x21___rarg(x_85);
x_87 = lean_apply_2(x_86, x_11, x_65);
return x_87;
@ -1721,7 +1719,7 @@ lean_inc(x_10);
x_11 = 0;
x_12 = lean_box(0);
lean_inc(x_8);
x_13 = l___private_Init_Lean_Elab_Term_19__synthesizeSyntheticMVarsAux___main(x_11, x_12, x_8, x_9);
x_13 = l___private_Init_Lean_Elab_Term_20__synthesizeSyntheticMVarsAux___main(x_11, x_12, x_8, x_9);
if (lean_obj_tag(x_13) == 0)
{
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22;
@ -1985,7 +1983,7 @@ lean_object* _init_l_Lean_Elab_Command_elabDefVal___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("definition body");
x_1 = lean_mk_string("equations have not been implemented yet");
return x_1;
}
}
@ -1994,7 +1992,7 @@ _start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Command_elabDefVal___closed__1;
x_2 = lean_alloc_ctor(1, 1, 0);
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
@ -2002,26 +2000,8 @@ return x_2;
lean_object* _init_l_Lean_Elab_Command_elabDefVal___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("equations have not been implemented yet");
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Command_elabDefVal___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Command_elabDefVal___closed__3;
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* _init_l_Lean_Elab_Command_elabDefVal___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Command_elabDefVal___closed__4;
x_1 = l_Lean_Elab_Command_elabDefVal___closed__2;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
@ -2044,31 +2024,32 @@ x_9 = lean_name_eq(x_5, x_8);
lean_dec(x_5);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11;
x_10 = l_Lean_Elab_Command_elabDefVal___closed__2;
x_11 = l_Lean_Elab_Term_throwUnexpectedSyntax___rarg(x_1, x_10, x_3, x_4);
return x_11;
}
else
{
lean_object* x_12; lean_object* x_13;
x_12 = l_Lean_Elab_Command_elabDefVal___closed__5;
x_13 = l_Lean_Elab_Term_throwError___rarg(x_1, x_12, x_3, x_4);
return x_13;
}
}
else
{
lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; lean_object* x_18;
lean_dec(x_5);
x_14 = lean_unsigned_to_nat(1u);
x_15 = l_Lean_Syntax_getArg(x_1, x_14);
lean_object* x_10;
lean_dec(x_3);
lean_dec(x_1);
x_16 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_16, 0, x_2);
x_17 = 1;
x_18 = l_Lean_Elab_Term_elabTerm(x_15, x_16, x_17, x_17, x_3, x_4);
return x_18;
x_10 = l_Lean_Elab_Term_throwUnsupportedSyntax___rarg(x_4);
return x_10;
}
else
{
lean_object* x_11; lean_object* x_12;
x_11 = l_Lean_Elab_Command_elabDefVal___closed__3;
x_12 = l_Lean_Elab_Term_throwError___rarg(x_1, x_11, x_3, x_4);
return x_12;
}
}
else
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16; lean_object* x_17;
lean_dec(x_5);
x_13 = lean_unsigned_to_nat(1u);
x_14 = l_Lean_Syntax_getArg(x_1, x_13);
lean_dec(x_1);
x_15 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_15, 0, x_2);
x_16 = 1;
x_17 = l_Lean_Elab_Term_elabTerm(x_14, x_15, x_16, x_16, x_3, x_4);
return x_17;
}
}
}
@ -4436,7 +4417,7 @@ lean_dec(x_26);
x_29 = 0;
x_30 = lean_box(0);
lean_inc(x_8);
x_31 = l___private_Init_Lean_Elab_Term_19__synthesizeSyntheticMVarsAux___main(x_29, x_30, x_8, x_28);
x_31 = l___private_Init_Lean_Elab_Term_20__synthesizeSyntheticMVarsAux___main(x_29, x_30, x_8, x_28);
if (lean_obj_tag(x_31) == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36; uint8_t x_37; lean_object* x_38; lean_object* x_39;
@ -4648,7 +4629,7 @@ x_17 = l_Lean_Parser_Command_namespace___elambda__1___closed__1;
x_18 = 1;
lean_inc(x_2);
lean_inc(x_15);
x_19 = l___private_Init_Lean_Elab_Command_13__addScopes___main(x_5, x_17, x_18, x_15, x_2, x_14);
x_19 = l___private_Init_Lean_Elab_Command_14__addScopes___main(x_5, x_17, x_18, x_15, x_2, x_14);
if (lean_obj_tag(x_19) == 0)
{
lean_object* x_20; lean_object* x_21;
@ -4720,9 +4701,9 @@ lean_inc(x_126);
x_127 = lean_ctor_get(x_125, 1);
lean_inc(x_127);
lean_dec(x_125);
x_128 = l___private_Init_Lean_Elab_Command_10__getVarDecls(x_126);
x_129 = l___private_Init_Lean_Elab_Command_8__mkTermContext(x_2, x_126, x_123);
x_130 = l___private_Init_Lean_Elab_Command_9__mkTermState(x_126);
x_128 = l___private_Init_Lean_Elab_Command_11__getVarDecls(x_126);
x_129 = l___private_Init_Lean_Elab_Command_9__mkTermContext(x_2, x_126, x_123);
x_130 = l___private_Init_Lean_Elab_Command_10__mkTermState(x_126);
lean_dec(x_126);
x_131 = l_Lean_Elab_Term_elabBinders___rarg(x_128, x_124, x_129, x_130);
lean_dec(x_128);
@ -5675,10 +5656,6 @@ l_Lean_Elab_Command_elabDefVal___closed__2 = _init_l_Lean_Elab_Command_elabDefVa
lean_mark_persistent(l_Lean_Elab_Command_elabDefVal___closed__2);
l_Lean_Elab_Command_elabDefVal___closed__3 = _init_l_Lean_Elab_Command_elabDefVal___closed__3();
lean_mark_persistent(l_Lean_Elab_Command_elabDefVal___closed__3);
l_Lean_Elab_Command_elabDefVal___closed__4 = _init_l_Lean_Elab_Command_elabDefVal___closed__4();
lean_mark_persistent(l_Lean_Elab_Command_elabDefVal___closed__4);
l_Lean_Elab_Command_elabDefVal___closed__5 = _init_l_Lean_Elab_Command_elabDefVal___closed__5();
lean_mark_persistent(l_Lean_Elab_Command_elabDefVal___closed__5);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -14,11 +14,63 @@
extern "C" {
#endif
extern lean_object* l_String_splitAux___main___closed__1;
lean_object* l_Lean_Elab_Exception_inhabited___closed__1;
lean_object* l_Lean_Elab_mkMessageCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_mkMessageCore(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*);
lean_object* l_Lean_Elab_Exception_hasToString___closed__1;
lean_object* l_Lean_FileMap_toPosition(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Exception_inhabited;
lean_object* l_Lean_Elab_mkExceptionCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Exception_hasToString(lean_object*);
extern lean_object* l_Lean_Message_Inhabited___closed__2;
lean_object* l_Lean_Elab_mkExceptionCore(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Message_toString(lean_object*);
lean_object* _init_l_Lean_Elab_Exception_inhabited___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Message_Inhabited___closed__2;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* _init_l_Lean_Elab_Exception_inhabited() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Elab_Exception_inhabited___closed__1;
return x_1;
}
}
lean_object* _init_l_Lean_Elab_Exception_hasToString___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("unsupported syntax");
return x_1;
}
}
lean_object* l_Lean_Elab_Exception_hasToString(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
lean_object* x_2; lean_object* x_3;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
lean_dec(x_1);
x_3 = l_Lean_Message_toString(x_2);
return x_3;
}
else
{
lean_object* x_4;
x_4 = l_Lean_Elab_Exception_hasToString___closed__1;
return x_4;
}
}
}
lean_object* l_Lean_Elab_mkMessageCore(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t x_4, lean_object* x_5) {
_start:
{
@ -51,7 +103,7 @@ return x_7;
lean_object* l_Lean_Elab_mkExceptionCore(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; uint8_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
x_5 = l_Lean_FileMap_toPosition(x_2, x_4);
x_6 = lean_box(0);
x_7 = 2;
@ -63,7 +115,9 @@ lean_ctor_set(x_9, 2, x_6);
lean_ctor_set(x_9, 3, x_8);
lean_ctor_set(x_9, 4, x_3);
lean_ctor_set_uint8(x_9, sizeof(void*)*5, x_7);
return x_9;
x_10 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_10, 0, x_9);
return x_10;
}
}
lean_object* l_Lean_Elab_mkExceptionCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
@ -85,6 +139,12 @@ _G_initialized = true;
res = initialize_Init_Lean_Meta(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Elab_Exception_inhabited___closed__1 = _init_l_Lean_Elab_Exception_inhabited___closed__1();
lean_mark_persistent(l_Lean_Elab_Exception_inhabited___closed__1);
l_Lean_Elab_Exception_inhabited = _init_l_Lean_Elab_Exception_inhabited();
lean_mark_persistent(l_Lean_Elab_Exception_inhabited);
l_Lean_Elab_Exception_hasToString___closed__1 = _init_l_Lean_Elab_Exception_hasToString___closed__1();
lean_mark_persistent(l_Lean_Elab_Exception_hasToString___closed__1);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -23,6 +23,7 @@ lean_object* l_Lean_Elab_IO_processCommands(lean_object*, lean_object*, lean_obj
lean_object* l_Lean_Elab_runFrontend(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Frontend_processCommandsAux___rarg___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Frontend_liftIOCore_x21(lean_object*);
extern lean_object* l_Lean_Elab_Command_runTermElabM___rarg___closed__1;
lean_object* lean_io_mk_ref(lean_object*, lean_object*);
lean_object* lean_io_ref_get(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Frontend_runCommandElabM___closed__1;
@ -398,441 +399,573 @@ return x_19;
}
else
{
lean_object* x_20; lean_object* x_21; lean_object* x_22;
lean_object* x_20;
x_20 = lean_ctor_get(x_15, 0);
lean_inc(x_20);
if (lean_obj_tag(x_20) == 0)
{
lean_object* x_21; lean_object* x_22; lean_object* x_23;
x_21 = lean_ctor_get(x_15, 1);
lean_inc(x_21);
lean_dec(x_15);
x_22 = lean_ctor_get(x_20, 0);
lean_inc(x_22);
lean_dec(x_20);
lean_inc(x_14);
x_22 = l___private_Init_Lean_Elab_Command_2__getState(x_14, x_21);
if (lean_obj_tag(x_22) == 0)
x_23 = l___private_Init_Lean_Elab_Command_2__getState(x_14, x_21);
if (lean_obj_tag(x_23) == 0)
{
lean_object* x_23; lean_object* x_24; uint8_t x_25;
x_23 = lean_ctor_get(x_22, 0);
lean_inc(x_23);
x_24 = lean_ctor_get(x_22, 1);
lean_object* x_24; lean_object* x_25; uint8_t x_26;
x_24 = lean_ctor_get(x_23, 0);
lean_inc(x_24);
lean_dec(x_22);
x_25 = !lean_is_exclusive(x_23);
if (x_25 == 0)
x_25 = lean_ctor_get(x_23, 1);
lean_inc(x_25);
lean_dec(x_23);
x_26 = !lean_is_exclusive(x_24);
if (x_26 == 0)
{
lean_object* x_26; lean_object* x_27; lean_object* x_28;
x_26 = lean_ctor_get(x_23, 1);
x_27 = l_PersistentArray_push___rarg(x_26, x_20);
lean_ctor_set(x_23, 1, x_27);
x_28 = l___private_Init_Lean_Elab_Command_3__setState(x_23, x_14, x_24);
if (lean_obj_tag(x_28) == 0)
lean_object* x_27; lean_object* x_28; lean_object* x_29;
x_27 = lean_ctor_get(x_24, 1);
x_28 = l_PersistentArray_push___rarg(x_27, x_22);
lean_ctor_set(x_24, 1, x_28);
x_29 = l___private_Init_Lean_Elab_Command_3__setState(x_24, x_14, x_25);
if (lean_obj_tag(x_29) == 0)
{
uint8_t x_29;
x_29 = !lean_is_exclusive(x_28);
if (x_29 == 0)
uint8_t x_30;
x_30 = !lean_is_exclusive(x_29);
if (x_30 == 0)
{
lean_object* x_30; lean_object* x_31;
x_30 = lean_ctor_get(x_28, 0);
lean_dec(x_30);
x_31 = lean_box(0);
lean_ctor_set(x_28, 0, x_31);
return x_28;
lean_object* x_31; lean_object* x_32;
x_31 = lean_ctor_get(x_29, 0);
lean_dec(x_31);
x_32 = lean_box(0);
lean_ctor_set(x_29, 0, x_32);
return x_29;
}
else
{
lean_object* x_32; lean_object* x_33; lean_object* x_34;
x_32 = lean_ctor_get(x_28, 1);
lean_inc(x_32);
lean_dec(x_28);
x_33 = lean_box(0);
x_34 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_34, 0, x_33);
lean_ctor_set(x_34, 1, x_32);
return x_34;
lean_object* x_33; lean_object* x_34; lean_object* x_35;
x_33 = lean_ctor_get(x_29, 1);
lean_inc(x_33);
lean_dec(x_29);
x_34 = lean_box(0);
x_35 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_35, 0, x_34);
lean_ctor_set(x_35, 1, x_33);
return x_35;
}
}
else
{
uint8_t x_35;
x_35 = !lean_is_exclusive(x_28);
if (x_35 == 0)
uint8_t x_36;
x_36 = !lean_is_exclusive(x_29);
if (x_36 == 0)
{
lean_object* x_36; lean_object* x_37;
x_36 = lean_ctor_get(x_28, 0);
lean_dec(x_36);
x_37 = lean_box(0);
lean_ctor_set_tag(x_28, 0);
lean_ctor_set(x_28, 0, x_37);
return x_28;
lean_object* x_37; lean_object* x_38;
x_37 = lean_ctor_get(x_29, 0);
lean_dec(x_37);
x_38 = lean_box(0);
lean_ctor_set_tag(x_29, 0);
lean_ctor_set(x_29, 0, x_38);
return x_29;
}
else
{
lean_object* x_38; lean_object* x_39; lean_object* x_40;
x_38 = lean_ctor_get(x_28, 1);
lean_inc(x_38);
lean_dec(x_28);
x_39 = lean_box(0);
x_40 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_40, 0, x_39);
lean_ctor_set(x_40, 1, x_38);
return x_40;
lean_object* x_39; lean_object* x_40; lean_object* x_41;
x_39 = lean_ctor_get(x_29, 1);
lean_inc(x_39);
lean_dec(x_29);
x_40 = lean_box(0);
x_41 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_41, 0, x_40);
lean_ctor_set(x_41, 1, x_39);
return x_41;
}
}
}
else
{
lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47;
x_41 = lean_ctor_get(x_23, 0);
x_42 = lean_ctor_get(x_23, 1);
x_43 = lean_ctor_get(x_23, 2);
x_44 = lean_ctor_get(x_23, 3);
lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48;
x_42 = lean_ctor_get(x_24, 0);
x_43 = lean_ctor_get(x_24, 1);
x_44 = lean_ctor_get(x_24, 2);
x_45 = lean_ctor_get(x_24, 3);
lean_inc(x_45);
lean_inc(x_44);
lean_inc(x_43);
lean_inc(x_42);
lean_inc(x_41);
lean_dec(x_23);
x_45 = l_PersistentArray_push___rarg(x_42, x_20);
x_46 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_46, 0, x_41);
lean_ctor_set(x_46, 1, x_45);
lean_ctor_set(x_46, 2, x_43);
lean_ctor_set(x_46, 3, x_44);
x_47 = l___private_Init_Lean_Elab_Command_3__setState(x_46, x_14, x_24);
if (lean_obj_tag(x_47) == 0)
lean_dec(x_24);
x_46 = l_PersistentArray_push___rarg(x_43, x_22);
x_47 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_47, 0, x_42);
lean_ctor_set(x_47, 1, x_46);
lean_ctor_set(x_47, 2, x_44);
lean_ctor_set(x_47, 3, x_45);
x_48 = l___private_Init_Lean_Elab_Command_3__setState(x_47, x_14, x_25);
if (lean_obj_tag(x_48) == 0)
{
lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51;
x_48 = lean_ctor_get(x_47, 1);
lean_inc(x_48);
if (lean_is_exclusive(x_47)) {
lean_ctor_release(x_47, 0);
lean_ctor_release(x_47, 1);
x_49 = x_47;
lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52;
x_49 = lean_ctor_get(x_48, 1);
lean_inc(x_49);
if (lean_is_exclusive(x_48)) {
lean_ctor_release(x_48, 0);
lean_ctor_release(x_48, 1);
x_50 = x_48;
} else {
lean_dec_ref(x_47);
x_49 = lean_box(0);
lean_dec_ref(x_48);
x_50 = lean_box(0);
}
x_50 = lean_box(0);
if (lean_is_scalar(x_49)) {
x_51 = lean_alloc_ctor(0, 2, 0);
x_51 = lean_box(0);
if (lean_is_scalar(x_50)) {
x_52 = lean_alloc_ctor(0, 2, 0);
} else {
x_51 = x_49;
x_52 = x_50;
}
lean_ctor_set(x_51, 0, x_50);
lean_ctor_set(x_51, 1, x_48);
return x_51;
lean_ctor_set(x_52, 0, x_51);
lean_ctor_set(x_52, 1, x_49);
return x_52;
}
else
{
lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55;
x_52 = lean_ctor_get(x_47, 1);
lean_inc(x_52);
if (lean_is_exclusive(x_47)) {
lean_ctor_release(x_47, 0);
lean_ctor_release(x_47, 1);
x_53 = x_47;
lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56;
x_53 = lean_ctor_get(x_48, 1);
lean_inc(x_53);
if (lean_is_exclusive(x_48)) {
lean_ctor_release(x_48, 0);
lean_ctor_release(x_48, 1);
x_54 = x_48;
} else {
lean_dec_ref(x_47);
x_53 = lean_box(0);
lean_dec_ref(x_48);
x_54 = lean_box(0);
}
x_54 = lean_box(0);
if (lean_is_scalar(x_53)) {
x_55 = lean_alloc_ctor(0, 2, 0);
x_55 = lean_box(0);
if (lean_is_scalar(x_54)) {
x_56 = lean_alloc_ctor(0, 2, 0);
} else {
x_55 = x_53;
lean_ctor_set_tag(x_55, 0);
x_56 = x_54;
lean_ctor_set_tag(x_56, 0);
}
lean_ctor_set(x_55, 0, x_54);
lean_ctor_set(x_55, 1, x_52);
return x_55;
lean_ctor_set(x_56, 0, x_55);
lean_ctor_set(x_56, 1, x_53);
return x_56;
}
}
}
else
{
uint8_t x_56;
lean_dec(x_20);
lean_dec(x_14);
x_56 = !lean_is_exclusive(x_22);
if (x_56 == 0)
{
lean_object* x_57; lean_object* x_58;
x_57 = lean_ctor_get(x_22, 0);
lean_dec(x_57);
x_58 = lean_box(0);
lean_ctor_set_tag(x_22, 0);
lean_ctor_set(x_22, 0, x_58);
return x_22;
}
else
{
lean_object* x_59; lean_object* x_60; lean_object* x_61;
x_59 = lean_ctor_get(x_22, 1);
lean_inc(x_59);
uint8_t x_57;
lean_dec(x_22);
x_60 = lean_box(0);
x_61 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_61, 0, x_60);
lean_ctor_set(x_61, 1, x_59);
return x_61;
lean_dec(x_14);
x_57 = !lean_is_exclusive(x_23);
if (x_57 == 0)
{
lean_object* x_58; lean_object* x_59;
x_58 = lean_ctor_get(x_23, 0);
lean_dec(x_58);
x_59 = lean_box(0);
lean_ctor_set_tag(x_23, 0);
lean_ctor_set(x_23, 0, x_59);
return x_23;
}
else
{
lean_object* x_60; lean_object* x_61; lean_object* x_62;
x_60 = lean_ctor_get(x_23, 1);
lean_inc(x_60);
lean_dec(x_23);
x_61 = lean_box(0);
x_62 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_62, 0, x_61);
lean_ctor_set(x_62, 1, x_60);
return x_62;
}
}
}
else
{
lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65;
x_62 = lean_ctor_get(x_5, 1);
lean_inc(x_62);
lean_dec(x_5);
x_63 = l_Lean_Elab_Frontend_runCommandElabM___closed__1;
x_64 = l_unreachable_x21___rarg(x_63);
x_65 = lean_apply_1(x_64, x_62);
if (lean_obj_tag(x_65) == 0)
lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66;
x_63 = lean_ctor_get(x_15, 1);
lean_inc(x_63);
lean_dec(x_15);
x_64 = l_Lean_Elab_Command_runTermElabM___rarg___closed__1;
x_65 = l_unreachable_x21___rarg(x_64);
x_66 = lean_apply_2(x_65, x_14, x_63);
if (lean_obj_tag(x_66) == 0)
{
lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75;
x_66 = lean_ctor_get(x_65, 0);
lean_inc(x_66);
x_67 = lean_ctor_get(x_65, 1);
lean_inc(x_67);
lean_dec(x_65);
x_68 = lean_ctor_get(x_2, 3);
x_69 = lean_ctor_get(x_68, 1);
x_70 = lean_ctor_get(x_68, 2);
x_71 = lean_ctor_get(x_2, 0);
x_72 = lean_box(0);
x_73 = lean_unsigned_to_nat(0u);
lean_inc(x_71);
lean_inc(x_70);
uint8_t x_67;
x_67 = !lean_is_exclusive(x_66);
if (x_67 == 0)
{
return x_66;
}
else
{
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);
x_74 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_74, 0, x_69);
lean_ctor_set(x_74, 1, x_70);
lean_ctor_set(x_74, 2, x_71);
lean_ctor_set(x_74, 3, x_66);
lean_ctor_set(x_74, 4, x_72);
lean_ctor_set(x_74, 5, x_73);
lean_inc(x_74);
x_75 = l_Lean_Elab_Command_elabCommand(x_1, x_74, x_67);
if (lean_obj_tag(x_75) == 0)
{
uint8_t x_76;
lean_dec(x_74);
x_76 = !lean_is_exclusive(x_75);
if (x_76 == 0)
{
return x_75;
lean_inc(x_68);
lean_dec(x_66);
x_70 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_70, 0, x_68);
lean_ctor_set(x_70, 1, x_69);
return x_70;
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79;
x_77 = lean_ctor_get(x_75, 0);
x_78 = lean_ctor_get(x_75, 1);
lean_inc(x_78);
uint8_t x_71;
x_71 = !lean_is_exclusive(x_66);
if (x_71 == 0)
{
lean_object* x_72; lean_object* x_73;
x_72 = lean_ctor_get(x_66, 0);
lean_dec(x_72);
x_73 = lean_box(0);
lean_ctor_set_tag(x_66, 0);
lean_ctor_set(x_66, 0, x_73);
return x_66;
}
else
{
lean_object* x_74; lean_object* x_75; lean_object* x_76;
x_74 = lean_ctor_get(x_66, 1);
lean_inc(x_74);
lean_dec(x_66);
x_75 = lean_box(0);
x_76 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_76, 0, x_75);
lean_ctor_set(x_76, 1, x_74);
return x_76;
}
}
}
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80;
x_77 = lean_ctor_get(x_5, 1);
lean_inc(x_77);
lean_dec(x_75);
x_79 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_79, 0, x_77);
lean_ctor_set(x_79, 1, x_78);
return x_79;
}
}
else
lean_dec(x_5);
x_78 = l_Lean_Elab_Frontend_runCommandElabM___closed__1;
x_79 = l_unreachable_x21___rarg(x_78);
x_80 = lean_apply_1(x_79, x_77);
if (lean_obj_tag(x_80) == 0)
{
lean_object* x_80; lean_object* x_81; lean_object* x_82;
x_80 = lean_ctor_get(x_75, 0);
lean_inc(x_80);
x_81 = lean_ctor_get(x_75, 1);
lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90;
x_81 = lean_ctor_get(x_80, 0);
lean_inc(x_81);
lean_dec(x_75);
lean_inc(x_74);
x_82 = l___private_Init_Lean_Elab_Command_2__getState(x_74, x_81);
if (lean_obj_tag(x_82) == 0)
{
lean_object* x_83; lean_object* x_84; uint8_t x_85;
x_83 = lean_ctor_get(x_82, 0);
lean_inc(x_83);
x_84 = lean_ctor_get(x_82, 1);
x_82 = lean_ctor_get(x_80, 1);
lean_inc(x_82);
lean_dec(x_80);
x_83 = lean_ctor_get(x_2, 3);
x_84 = lean_ctor_get(x_83, 1);
x_85 = lean_ctor_get(x_83, 2);
x_86 = lean_ctor_get(x_2, 0);
x_87 = lean_box(0);
x_88 = lean_unsigned_to_nat(0u);
lean_inc(x_86);
lean_inc(x_85);
lean_inc(x_84);
lean_dec(x_82);
x_85 = !lean_is_exclusive(x_83);
if (x_85 == 0)
x_89 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_89, 0, x_84);
lean_ctor_set(x_89, 1, x_85);
lean_ctor_set(x_89, 2, x_86);
lean_ctor_set(x_89, 3, x_81);
lean_ctor_set(x_89, 4, x_87);
lean_ctor_set(x_89, 5, x_88);
lean_inc(x_89);
x_90 = l_Lean_Elab_Command_elabCommand(x_1, x_89, x_82);
if (lean_obj_tag(x_90) == 0)
{
lean_object* x_86; lean_object* x_87; lean_object* x_88;
x_86 = lean_ctor_get(x_83, 1);
x_87 = l_PersistentArray_push___rarg(x_86, x_80);
lean_ctor_set(x_83, 1, x_87);
x_88 = l___private_Init_Lean_Elab_Command_3__setState(x_83, x_74, x_84);
if (lean_obj_tag(x_88) == 0)
uint8_t x_91;
lean_dec(x_89);
x_91 = !lean_is_exclusive(x_90);
if (x_91 == 0)
{
uint8_t x_89;
x_89 = !lean_is_exclusive(x_88);
if (x_89 == 0)
{
lean_object* x_90; lean_object* x_91;
x_90 = lean_ctor_get(x_88, 0);
lean_dec(x_90);
x_91 = lean_box(0);
lean_ctor_set(x_88, 0, x_91);
return x_88;
return x_90;
}
else
{
lean_object* x_92; lean_object* x_93; lean_object* x_94;
x_92 = lean_ctor_get(x_88, 1);
x_92 = lean_ctor_get(x_90, 0);
x_93 = lean_ctor_get(x_90, 1);
lean_inc(x_93);
lean_inc(x_92);
lean_dec(x_88);
x_93 = lean_box(0);
lean_dec(x_90);
x_94 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_94, 0, x_93);
lean_ctor_set(x_94, 1, x_92);
lean_ctor_set(x_94, 0, x_92);
lean_ctor_set(x_94, 1, x_93);
return x_94;
}
}
else
{
uint8_t x_95;
x_95 = !lean_is_exclusive(x_88);
if (x_95 == 0)
lean_object* x_95;
x_95 = lean_ctor_get(x_90, 0);
lean_inc(x_95);
if (lean_obj_tag(x_95) == 0)
{
lean_object* x_96; lean_object* x_97;
x_96 = lean_ctor_get(x_88, 0);
lean_dec(x_96);
x_97 = lean_box(0);
lean_ctor_set_tag(x_88, 0);
lean_ctor_set(x_88, 0, x_97);
return x_88;
lean_object* x_96; lean_object* x_97; lean_object* x_98;
x_96 = lean_ctor_get(x_90, 1);
lean_inc(x_96);
lean_dec(x_90);
x_97 = lean_ctor_get(x_95, 0);
lean_inc(x_97);
lean_dec(x_95);
lean_inc(x_89);
x_98 = l___private_Init_Lean_Elab_Command_2__getState(x_89, x_96);
if (lean_obj_tag(x_98) == 0)
{
lean_object* x_99; lean_object* x_100; uint8_t x_101;
x_99 = lean_ctor_get(x_98, 0);
lean_inc(x_99);
x_100 = lean_ctor_get(x_98, 1);
lean_inc(x_100);
lean_dec(x_98);
x_101 = !lean_is_exclusive(x_99);
if (x_101 == 0)
{
lean_object* x_102; lean_object* x_103; lean_object* x_104;
x_102 = lean_ctor_get(x_99, 1);
x_103 = l_PersistentArray_push___rarg(x_102, x_97);
lean_ctor_set(x_99, 1, x_103);
x_104 = l___private_Init_Lean_Elab_Command_3__setState(x_99, x_89, x_100);
if (lean_obj_tag(x_104) == 0)
{
uint8_t x_105;
x_105 = !lean_is_exclusive(x_104);
if (x_105 == 0)
{
lean_object* x_106; lean_object* x_107;
x_106 = lean_ctor_get(x_104, 0);
lean_dec(x_106);
x_107 = lean_box(0);
lean_ctor_set(x_104, 0, x_107);
return x_104;
}
else
{
lean_object* x_98; lean_object* x_99; lean_object* x_100;
x_98 = lean_ctor_get(x_88, 1);
lean_inc(x_98);
lean_dec(x_88);
x_99 = lean_box(0);
x_100 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_100, 0, x_99);
lean_ctor_set(x_100, 1, x_98);
return x_100;
}
}
}
else
{
lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107;
x_101 = lean_ctor_get(x_83, 0);
x_102 = lean_ctor_get(x_83, 1);
x_103 = lean_ctor_get(x_83, 2);
x_104 = lean_ctor_get(x_83, 3);
lean_inc(x_104);
lean_inc(x_103);
lean_inc(x_102);
lean_inc(x_101);
lean_dec(x_83);
x_105 = l_PersistentArray_push___rarg(x_102, x_80);
x_106 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_106, 0, x_101);
lean_ctor_set(x_106, 1, x_105);
lean_ctor_set(x_106, 2, x_103);
lean_ctor_set(x_106, 3, x_104);
x_107 = l___private_Init_Lean_Elab_Command_3__setState(x_106, x_74, x_84);
if (lean_obj_tag(x_107) == 0)
{
lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111;
x_108 = lean_ctor_get(x_107, 1);
lean_object* x_108; lean_object* x_109; lean_object* x_110;
x_108 = lean_ctor_get(x_104, 1);
lean_inc(x_108);
if (lean_is_exclusive(x_107)) {
lean_ctor_release(x_107, 0);
lean_ctor_release(x_107, 1);
x_109 = x_107;
} else {
lean_dec_ref(x_107);
x_109 = lean_box(0);
lean_dec(x_104);
x_109 = lean_box(0);
x_110 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_110, 0, x_109);
lean_ctor_set(x_110, 1, x_108);
return x_110;
}
x_110 = lean_box(0);
if (lean_is_scalar(x_109)) {
x_111 = lean_alloc_ctor(0, 2, 0);
} else {
x_111 = x_109;
}
lean_ctor_set(x_111, 0, x_110);
lean_ctor_set(x_111, 1, x_108);
return x_111;
}
else
{
lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115;
x_112 = lean_ctor_get(x_107, 1);
lean_inc(x_112);
if (lean_is_exclusive(x_107)) {
lean_ctor_release(x_107, 0);
lean_ctor_release(x_107, 1);
x_113 = x_107;
} else {
lean_dec_ref(x_107);
x_113 = lean_box(0);
uint8_t x_111;
x_111 = !lean_is_exclusive(x_104);
if (x_111 == 0)
{
lean_object* x_112; lean_object* x_113;
x_112 = lean_ctor_get(x_104, 0);
lean_dec(x_112);
x_113 = lean_box(0);
lean_ctor_set_tag(x_104, 0);
lean_ctor_set(x_104, 0, x_113);
return x_104;
}
x_114 = lean_box(0);
if (lean_is_scalar(x_113)) {
x_115 = lean_alloc_ctor(0, 2, 0);
} else {
x_115 = x_113;
lean_ctor_set_tag(x_115, 0);
}
lean_ctor_set(x_115, 0, x_114);
lean_ctor_set(x_115, 1, x_112);
return x_115;
else
{
lean_object* x_114; lean_object* x_115; lean_object* x_116;
x_114 = lean_ctor_get(x_104, 1);
lean_inc(x_114);
lean_dec(x_104);
x_115 = lean_box(0);
x_116 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_116, 0, x_115);
lean_ctor_set(x_116, 1, x_114);
return x_116;
}
}
}
else
{
uint8_t x_116;
lean_dec(x_80);
lean_dec(x_74);
x_116 = !lean_is_exclusive(x_82);
if (x_116 == 0)
{
lean_object* x_117; lean_object* x_118;
x_117 = lean_ctor_get(x_82, 0);
lean_dec(x_117);
x_118 = lean_box(0);
lean_ctor_set_tag(x_82, 0);
lean_ctor_set(x_82, 0, x_118);
return x_82;
}
else
{
lean_object* x_119; lean_object* x_120; lean_object* x_121;
x_119 = lean_ctor_get(x_82, 1);
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;
x_117 = lean_ctor_get(x_99, 0);
x_118 = lean_ctor_get(x_99, 1);
x_119 = lean_ctor_get(x_99, 2);
x_120 = lean_ctor_get(x_99, 3);
lean_inc(x_120);
lean_inc(x_119);
lean_dec(x_82);
x_120 = lean_box(0);
x_121 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_121, 0, x_120);
lean_ctor_set(x_121, 1, x_119);
return x_121;
}
}
}
}
else
lean_inc(x_118);
lean_inc(x_117);
lean_dec(x_99);
x_121 = l_PersistentArray_push___rarg(x_118, x_97);
x_122 = lean_alloc_ctor(0, 4, 0);
lean_ctor_set(x_122, 0, x_117);
lean_ctor_set(x_122, 1, x_121);
lean_ctor_set(x_122, 2, x_119);
lean_ctor_set(x_122, 3, x_120);
x_123 = l___private_Init_Lean_Elab_Command_3__setState(x_122, x_89, x_100);
if (lean_obj_tag(x_123) == 0)
{
uint8_t x_122;
lean_dec(x_1);
x_122 = !lean_is_exclusive(x_65);
if (x_122 == 0)
{
return x_65;
}
else
{
lean_object* x_123; lean_object* x_124; lean_object* x_125;
x_123 = lean_ctor_get(x_65, 0);
x_124 = lean_ctor_get(x_65, 1);
lean_object* x_124; lean_object* x_125; lean_object* x_126; lean_object* x_127;
x_124 = lean_ctor_get(x_123, 1);
lean_inc(x_124);
lean_inc(x_123);
lean_dec(x_65);
x_125 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_125, 0, x_123);
lean_ctor_set(x_125, 1, x_124);
return x_125;
if (lean_is_exclusive(x_123)) {
lean_ctor_release(x_123, 0);
lean_ctor_release(x_123, 1);
x_125 = x_123;
} else {
lean_dec_ref(x_123);
x_125 = lean_box(0);
}
x_126 = lean_box(0);
if (lean_is_scalar(x_125)) {
x_127 = lean_alloc_ctor(0, 2, 0);
} else {
x_127 = x_125;
}
lean_ctor_set(x_127, 0, x_126);
lean_ctor_set(x_127, 1, x_124);
return x_127;
}
else
{
lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131;
x_128 = lean_ctor_get(x_123, 1);
lean_inc(x_128);
if (lean_is_exclusive(x_123)) {
lean_ctor_release(x_123, 0);
lean_ctor_release(x_123, 1);
x_129 = x_123;
} else {
lean_dec_ref(x_123);
x_129 = lean_box(0);
}
x_130 = lean_box(0);
if (lean_is_scalar(x_129)) {
x_131 = lean_alloc_ctor(0, 2, 0);
} else {
x_131 = x_129;
lean_ctor_set_tag(x_131, 0);
}
lean_ctor_set(x_131, 0, x_130);
lean_ctor_set(x_131, 1, x_128);
return x_131;
}
}
}
else
{
uint8_t x_132;
lean_dec(x_97);
lean_dec(x_89);
x_132 = !lean_is_exclusive(x_98);
if (x_132 == 0)
{
lean_object* x_133; lean_object* x_134;
x_133 = lean_ctor_get(x_98, 0);
lean_dec(x_133);
x_134 = lean_box(0);
lean_ctor_set_tag(x_98, 0);
lean_ctor_set(x_98, 0, x_134);
return x_98;
}
else
{
lean_object* x_135; lean_object* x_136; lean_object* x_137;
x_135 = lean_ctor_get(x_98, 1);
lean_inc(x_135);
lean_dec(x_98);
x_136 = lean_box(0);
x_137 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_137, 0, x_136);
lean_ctor_set(x_137, 1, x_135);
return x_137;
}
}
}
else
{
lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141;
x_138 = lean_ctor_get(x_90, 1);
lean_inc(x_138);
lean_dec(x_90);
x_139 = l_Lean_Elab_Command_runTermElabM___rarg___closed__1;
x_140 = l_unreachable_x21___rarg(x_139);
x_141 = lean_apply_2(x_140, x_89, x_138);
if (lean_obj_tag(x_141) == 0)
{
uint8_t x_142;
x_142 = !lean_is_exclusive(x_141);
if (x_142 == 0)
{
return x_141;
}
else
{
lean_object* x_143; lean_object* x_144; lean_object* x_145;
x_143 = lean_ctor_get(x_141, 0);
x_144 = lean_ctor_get(x_141, 1);
lean_inc(x_144);
lean_inc(x_143);
lean_dec(x_141);
x_145 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_145, 0, x_143);
lean_ctor_set(x_145, 1, x_144);
return x_145;
}
}
else
{
uint8_t x_146;
x_146 = !lean_is_exclusive(x_141);
if (x_146 == 0)
{
lean_object* x_147; lean_object* x_148;
x_147 = lean_ctor_get(x_141, 0);
lean_dec(x_147);
x_148 = lean_box(0);
lean_ctor_set_tag(x_141, 0);
lean_ctor_set(x_141, 0, x_148);
return x_141;
}
else
{
lean_object* x_149; lean_object* x_150; lean_object* x_151;
x_149 = lean_ctor_get(x_141, 1);
lean_inc(x_149);
lean_dec(x_141);
x_150 = lean_box(0);
x_151 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_151, 0, x_150);
lean_ctor_set(x_151, 1, x_149);
return x_151;
}
}
}
}
}
else
{
uint8_t x_152;
lean_dec(x_1);
x_152 = !lean_is_exclusive(x_80);
if (x_152 == 0)
{
return x_80;
}
else
{
lean_object* x_153; lean_object* x_154; lean_object* x_155;
x_153 = lean_ctor_get(x_80, 0);
x_154 = lean_ctor_get(x_80, 1);
lean_inc(x_154);
lean_inc(x_153);
lean_dec(x_80);
x_155 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_155, 0, x_153);
lean_ctor_set(x_155, 1, x_154);
return x_155;
}
}
}

View file

@ -657,21 +657,28 @@ x_6 = l_Lean_Elab_mkMessage___at_Lean_Elab_Level_elabLevel___main___spec__2(x_2,
x_7 = !lean_is_exclusive(x_6);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9;
x_8 = lean_ctor_get(x_6, 0);
x_9 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_9, 0, x_8);
lean_ctor_set_tag(x_6, 1);
lean_ctor_set(x_6, 0, x_9);
return x_6;
}
else
{
lean_object* x_8; lean_object* x_9; lean_object* x_10;
x_8 = lean_ctor_get(x_6, 0);
x_9 = lean_ctor_get(x_6, 1);
lean_inc(x_9);
lean_inc(x_8);
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_10 = lean_ctor_get(x_6, 0);
x_11 = lean_ctor_get(x_6, 1);
lean_inc(x_11);
lean_inc(x_10);
lean_dec(x_6);
x_10 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_10, 0, x_8);
lean_ctor_set(x_10, 1, x_9);
return x_10;
x_12 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_12, 0, x_10);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_11);
return x_13;
}
}
}
@ -684,21 +691,28 @@ x_6 = l_Lean_Elab_mkMessage___at_Lean_Elab_Level_elabLevel___main___spec__2(x_2,
x_7 = !lean_is_exclusive(x_6);
if (x_7 == 0)
{
lean_object* x_8; lean_object* x_9;
x_8 = lean_ctor_get(x_6, 0);
x_9 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_9, 0, x_8);
lean_ctor_set_tag(x_6, 1);
lean_ctor_set(x_6, 0, x_9);
return x_6;
}
else
{
lean_object* x_8; lean_object* x_9; lean_object* x_10;
x_8 = lean_ctor_get(x_6, 0);
x_9 = lean_ctor_get(x_6, 1);
lean_inc(x_9);
lean_inc(x_8);
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_10 = lean_ctor_get(x_6, 0);
x_11 = lean_ctor_get(x_6, 1);
lean_inc(x_11);
lean_inc(x_10);
lean_dec(x_6);
x_10 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_10, 0, x_8);
lean_ctor_set(x_10, 1, x_9);
return x_10;
x_12 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_12, 0, x_10);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_11);
return x_13;
}
}
}

View file

@ -743,12 +743,14 @@ return x_2;
lean_object* l_Lean_Elab_throwError___rarg___lambda__1(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4;
lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_3 = lean_ctor_get(x_1, 0);
lean_inc(x_3);
lean_dec(x_1);
x_4 = lean_apply_2(x_3, lean_box(0), x_2);
return x_4;
x_4 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_4, 0, x_2);
x_5 = lean_apply_2(x_3, lean_box(0), x_4);
return x_5;
}
}
lean_object* l_Lean_Elab_throwError___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) {

View file

@ -46,7 +46,6 @@ extern lean_object* l_Lean_Parser_declareBuiltinParser___closed__8;
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_14__toPreterm(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_10__getAntiquotVarsAux___main(lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__9;
lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabMatchSyntax___closed__1;
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__62;
lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabStxQuot___closed__2;
@ -109,6 +108,7 @@ lean_object* l___private_Init_Lean_Elab_Quotation_12__letBindRhss___main___close
lean_object* l___private_Init_Lean_Elab_Quotation_8__explodeHeadPat___lambda__1___closed__1;
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__49;
lean_object* l___private_Init_Lean_Elab_Quotation_14__toPreterm___main___closed__7;
extern lean_object* l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__4;
lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___closed__11;
lean_object* l_Lean_Elab_Term_stxQuot_expand___closed__12;
lean_object* l_Lean_Parser_mkParserState(lean_object*);
@ -141,7 +141,7 @@ lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__1;
lean_object* lean_array_get_size(lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_8__explodeHeadPat___lambda__1___closed__3;
extern lean_object* l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
extern lean_object* l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__6;
lean_object* l___private_Init_Lean_Elab_Quotation_13__exprPlaceholder;
extern lean_object* l_Lean_Parser_Term_num___elambda__1___closed__1;
lean_object* l_List_range(lean_object*);
@ -150,7 +150,6 @@ lean_object* l_ReaderT_bind___at___private_Init_Lean_Elab_Quotation_1__quoteName
lean_object* l___private_Init_Lean_Elab_Quotation_8__explodeHeadPat___lambda__1___closed__2;
lean_object* lean_string_utf8_extract(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Name_inhabited;
extern lean_object* l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__4;
lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___closed__12;
lean_object* l___private_Init_Lean_Elab_Quotation_14__toPreterm___main(lean_object*, lean_object*, lean_object*);
extern lean_object* l_String_splitAux___main___closed__1;
@ -163,6 +162,7 @@ lean_object* l___private_Init_Lean_Elab_Quotation_12__letBindRhss___main___close
lean_object* l_List_foldl___main___at___private_Init_Lean_Elab_Quotation_14__toPreterm___main___spec__8(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_stxQuot_expand___closed__24;
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__48;
extern lean_object* l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__9;
lean_object* lean_string_utf8_byte_size(lean_object*);
lean_object* l_Lean_mkAtom(lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__2;
@ -270,6 +270,7 @@ lean_object* l___private_Init_Lean_Elab_Quotation_1__quoteName___main___lambda__
lean_object* l_Array_umapMAux___main___at_Lean_Elab_Term_match__syntax_expand___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Parser_Term_letPatDecl___elambda__1___closed__1;
lean_object* l_Lean_Elab_Term_stxQuot_expand___closed__27;
extern lean_object* l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
lean_object* l___private_Init_Lean_Elab_Quotation_14__toPreterm___main___closed__6;
lean_object* l_Lean_Elab_Term_elabTerm(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -290,6 +291,7 @@ lean_object* l_Lean_Elab_Term_stxQuot_expand___closed__8;
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__29;
lean_object* l___private_Init_Lean_Elab_Quotation_14__toPreterm___main___lambda__2___closed__2;
lean_object* l___private_Init_Lean_Elab_Quotation_3__quoteList___main___rarg___lambda__1___closed__5;
extern lean_object* l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__7;
lean_object* l___private_Init_Lean_Elab_Quotation_14__toPreterm___main___lambda__2___closed__1;
lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___closed__20;
lean_object* lean_mk_empty_local_ctx(lean_object*);
@ -318,6 +320,7 @@ lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean
lean_object* l_Lean_Array_HasQuote___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Elab_Term_mkExplicitBinder___closed__5;
extern lean_object* l_Lean_Parser_Term_fun___elambda__1___closed__2;
extern lean_object* l_Lean_Elab_Exception_hasToString___closed__1;
extern lean_object* l_Lean_Parser_Term_explicitUniv___elambda__1___closed__2;
extern lean_object* l_PersistentArray_empty___closed__3;
lean_object* l_Lean_Elab_Term_resolveName(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -462,7 +465,6 @@ lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___cl
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__32;
lean_object* l_Lean_List_HasQuote___rarg(lean_object*);
lean_object* l_Lean_Prod_HasQuote___rarg___lambda__1___closed__4;
extern lean_object* l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__7;
lean_object* l_Lean_LocalContext_mkLambda(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___closed__25;
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__40;
@ -524,6 +526,7 @@ lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabStxQuot___closed__3;
lean_object* l___private_Init_Lean_Elab_Quotation_3__quoteList___main___rarg___lambda__2___closed__2;
lean_object* l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__3;
lean_object* l___private_Init_Lean_Elab_Quotation_8__explodeHeadPat___lambda__1(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__5;
lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__7;
lean_object* l___private_Init_Lean_Elab_Quotation_12__letBindRhss___main___closed__4;
lean_object* l_Lean_Elab_Term_stxQuot_expand___closed__11;
@ -612,7 +615,6 @@ lean_object* l___private_Init_Lean_Elab_Quotation_7__getHeadInfo___lambda__3___b
extern lean_object* l_Lean_Elab_Term_elabArrayLit___closed__7;
lean_object* l___private_Init_Lean_Elab_Quotation_7__getHeadInfo___elambda__2___closed__3;
lean_object* l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___closed__2;
extern lean_object* l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__6;
lean_object* l_List_mapM___main___at___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main___spec__8___closed__3;
lean_object* l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__1;
extern lean_object* l_Lean_NameGenerator_Inhabited___closed__3;
@ -1247,7 +1249,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Elab_rootNamespace___closed__2;
x_2 = l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__4;
x_2 = l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__4;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
@ -1257,7 +1259,7 @@ _start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l_Lean_Prod_HasQuote___rarg___lambda__1___closed__4;
x_2 = l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__6;
x_2 = l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__6;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
@ -1270,7 +1272,7 @@ x_8 = lean_box(0);
x_9 = l_Lean_Prod_HasQuote___rarg___lambda__1___closed__5;
x_10 = lean_name_mk_numeral(x_9, x_5);
x_11 = l_Lean_Prod_HasQuote___rarg___lambda__1___closed__3;
x_12 = l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__9;
x_12 = l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__9;
x_13 = lean_alloc_ctor(3, 4, 0);
lean_ctor_set(x_13, 0, x_8);
lean_ctor_set(x_13, 1, x_11);
@ -2561,12 +2563,12 @@ lean_object* l___private_Init_Lean_Elab_Quotation_3__quoteList___main___at___pri
_start:
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; 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;
x_13 = l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__4;
x_13 = l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__4;
x_14 = lean_name_mk_string(x_1, x_13);
x_15 = l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__6;
x_15 = l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__6;
x_16 = lean_name_mk_string(x_14, x_15);
x_17 = lean_name_mk_numeral(x_16, x_10);
x_18 = l___private_Init_Lean_Elab_Term_20__mkPairsAux___main___closed__7;
x_18 = l___private_Init_Lean_Elab_Term_21__mkPairsAux___main___closed__7;
lean_inc(x_2);
x_19 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_19, 0, x_18);
@ -3416,7 +3418,7 @@ switch (lean_obj_tag(x_1)) {
case 0:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_4 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_5 = l_unreachable_x21___rarg(x_4);
x_6 = lean_apply_2(x_5, x_2, x_3);
return x_6;
@ -5264,48 +5266,46 @@ return x_4;
lean_object* l_Lean_Elab_Term_elabStxQuot(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 = lean_ctor_get(x_1, 1);
x_6 = l_Lean_stxInh;
x_7 = lean_unsigned_to_nat(1u);
x_8 = lean_array_get(x_6, x_5, x_7);
lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_5 = lean_unsigned_to_nat(1u);
x_6 = l_Lean_Syntax_getArg(x_1, x_5);
lean_inc(x_3);
x_9 = l_Lean_Elab_Term_stxQuot_expand(x_8, x_3, x_4);
lean_dec(x_8);
if (lean_obj_tag(x_9) == 0)
x_7 = l_Lean_Elab_Term_stxQuot_expand(x_6, x_3, x_4);
lean_dec(x_6);
if (lean_obj_tag(x_7) == 0)
{
lean_object* x_10; lean_object* x_11; uint8_t x_12; lean_object* x_13;
x_10 = lean_ctor_get(x_9, 0);
lean_inc(x_10);
x_11 = lean_ctor_get(x_9, 1);
lean_inc(x_11);
lean_dec(x_9);
x_12 = 1;
x_13 = l_Lean_Elab_Term_elabTerm(x_10, x_2, x_12, x_12, x_3, x_11);
return x_13;
lean_object* x_8; lean_object* x_9; uint8_t 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 = 1;
x_11 = l_Lean_Elab_Term_elabTerm(x_8, x_2, x_10, x_10, x_3, x_9);
return x_11;
}
else
{
uint8_t x_14;
uint8_t x_12;
lean_dec(x_3);
lean_dec(x_2);
x_14 = !lean_is_exclusive(x_9);
if (x_14 == 0)
x_12 = !lean_is_exclusive(x_7);
if (x_12 == 0)
{
return x_9;
return x_7;
}
else
{
lean_object* x_15; lean_object* x_16; lean_object* x_17;
x_15 = lean_ctor_get(x_9, 0);
x_16 = lean_ctor_get(x_9, 1);
lean_inc(x_16);
lean_inc(x_15);
lean_dec(x_9);
x_17 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_17, 0, x_15);
lean_ctor_set(x_17, 1, x_16);
return x_17;
lean_object* x_13; lean_object* x_14; lean_object* x_15;
x_13 = lean_ctor_get(x_7, 0);
x_14 = lean_ctor_get(x_7, 1);
lean_inc(x_14);
lean_inc(x_13);
lean_dec(x_7);
x_15 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_15, 0, x_13);
lean_ctor_set(x_15, 1, x_14);
return x_15;
}
}
}
@ -6733,7 +6733,7 @@ lean_object* x_7; lean_object* x_8; lean_object* x_9;
lean_dec(x_5);
lean_dec(x_2);
lean_dec(x_1);
x_7 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_7 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_8 = l_unreachable_x21___rarg(x_7);
x_9 = lean_apply_2(x_8, x_3, x_4);
return x_9;
@ -8652,7 +8652,7 @@ else
lean_object* x_12; lean_object* x_13; lean_object* x_14;
lean_dec(x_9);
lean_dec(x_8);
x_12 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_12 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_13 = l_unreachable_x21___rarg(x_12);
x_14 = lean_apply_2(x_13, x_4, x_5);
return x_14;
@ -14241,61 +14241,57 @@ goto _start;
lean_object* l_Lean_Elab_Term_match__syntax_expand(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;
x_4 = lean_ctor_get(x_1, 1);
lean_inc(x_4);
x_5 = l_Lean_stxInh;
x_6 = lean_unsigned_to_nat(1u);
x_7 = lean_array_get(x_5, x_4, x_6);
x_8 = lean_unsigned_to_nat(3u);
x_9 = lean_array_get(x_5, x_4, x_8);
lean_dec(x_4);
x_10 = l_Lean_Syntax_getArgs(x_9);
lean_dec(x_9);
x_11 = lean_unsigned_to_nat(0u);
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;
x_4 = lean_unsigned_to_nat(1u);
x_5 = l_Lean_Syntax_getArg(x_1, x_4);
x_6 = lean_unsigned_to_nat(3u);
x_7 = l_Lean_Syntax_getArg(x_1, x_6);
x_8 = l_Lean_Syntax_getArgs(x_7);
lean_dec(x_7);
x_9 = lean_unsigned_to_nat(0u);
lean_inc(x_2);
lean_inc(x_1);
x_12 = l_Array_umapMAux___main___at_Lean_Elab_Term_match__syntax_expand___spec__1(x_1, x_11, x_10, x_2, x_3);
if (lean_obj_tag(x_12) == 0)
x_10 = l_Array_umapMAux___main___at_Lean_Elab_Term_match__syntax_expand___spec__1(x_1, x_9, x_8, x_2, x_3);
if (lean_obj_tag(x_10) == 0)
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_13 = lean_ctor_get(x_12, 0);
lean_inc(x_13);
x_14 = lean_ctor_get(x_12, 1);
lean_inc(x_14);
lean_dec(x_12);
x_15 = lean_box(0);
x_16 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_16, 0, x_7);
lean_ctor_set(x_16, 1, x_15);
x_17 = l_Array_toList___rarg(x_13);
lean_dec(x_13);
x_18 = l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main(x_1, x_16, x_17, x_2, x_14);
return x_18;
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
x_11 = 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_box(0);
x_14 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_14, 0, x_5);
lean_ctor_set(x_14, 1, x_13);
x_15 = l_Array_toList___rarg(x_11);
lean_dec(x_11);
x_16 = l___private_Init_Lean_Elab_Quotation_9__compileStxMatch___main(x_1, x_14, x_15, x_2, x_12);
return x_16;
}
else
{
uint8_t x_19;
lean_dec(x_7);
uint8_t x_17;
lean_dec(x_5);
lean_dec(x_2);
lean_dec(x_1);
x_19 = !lean_is_exclusive(x_12);
if (x_19 == 0)
x_17 = !lean_is_exclusive(x_10);
if (x_17 == 0)
{
return x_12;
return x_10;
}
else
{
lean_object* x_20; lean_object* x_21; lean_object* x_22;
x_20 = lean_ctor_get(x_12, 0);
x_21 = lean_ctor_get(x_12, 1);
lean_inc(x_21);
lean_inc(x_20);
lean_dec(x_12);
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;
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_18 = lean_ctor_get(x_10, 0);
x_19 = lean_ctor_get(x_10, 1);
lean_inc(x_19);
lean_inc(x_18);
lean_dec(x_10);
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;
}
}
}
@ -16945,7 +16941,7 @@ lean_object* x_610; lean_object* x_611; lean_object* x_612; lean_object* x_613;
x_610 = lean_ctor_get(x_608, 1);
lean_inc(x_610);
lean_dec(x_608);
x_611 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_611 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_612 = l_unreachable_x21___rarg(x_611);
x_613 = lean_apply_2(x_612, x_2, x_610);
return x_613;
@ -17416,7 +17412,7 @@ else
lean_object* x_728; lean_object* x_729; lean_object* x_730;
lean_dec(x_604);
lean_dec(x_1);
x_728 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_728 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_729 = l_unreachable_x21___rarg(x_728);
x_730 = lean_apply_2(x_729, x_2, x_3);
return x_730;
@ -18708,7 +18704,7 @@ lean_object* x_1100; lean_object* x_1101; lean_object* x_1102; lean_object* x_11
x_1100 = lean_ctor_get(x_1098, 1);
lean_inc(x_1100);
lean_dec(x_1098);
x_1101 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_1101 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_1102 = l_unreachable_x21___rarg(x_1101);
x_1103 = lean_apply_2(x_1102, x_2, x_1100);
return x_1103;
@ -19099,7 +19095,7 @@ else
lean_object* x_1177; lean_object* x_1178; lean_object* x_1179;
lean_dec(x_1094);
lean_dec(x_1);
x_1177 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_1177 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_1178 = l_unreachable_x21___rarg(x_1177);
x_1179 = lean_apply_2(x_1178, x_2, x_3);
return x_1179;
@ -20447,7 +20443,7 @@ lean_object* x_1558; lean_object* x_1559; lean_object* x_1560; lean_object* x_15
x_1558 = lean_ctor_get(x_1556, 1);
lean_inc(x_1558);
lean_dec(x_1556);
x_1559 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_1559 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_1560 = l_unreachable_x21___rarg(x_1559);
x_1561 = lean_apply_2(x_1560, x_2, x_1558);
return x_1561;
@ -20838,7 +20834,7 @@ else
lean_object* x_1635; lean_object* x_1636; lean_object* x_1637;
lean_dec(x_1552);
lean_dec(x_1);
x_1635 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_1635 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_1636 = l_unreachable_x21___rarg(x_1635);
x_1637 = lean_apply_2(x_1636, x_2, x_3);
return x_1637;
@ -22219,7 +22215,7 @@ lean_object* x_2022; lean_object* x_2023; lean_object* x_2024; lean_object* x_20
x_2022 = lean_ctor_get(x_2020, 1);
lean_inc(x_2022);
lean_dec(x_2020);
x_2023 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_2023 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_2024 = l_unreachable_x21___rarg(x_2023);
x_2025 = lean_apply_2(x_2024, x_2, x_2022);
return x_2025;
@ -22610,7 +22606,7 @@ else
lean_object* x_2099; lean_object* x_2100; lean_object* x_2101;
lean_dec(x_2016);
lean_dec(x_1);
x_2099 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_2099 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_2100 = l_unreachable_x21___rarg(x_2099);
x_2101 = lean_apply_2(x_2100, x_2, x_3);
return x_2101;
@ -24023,7 +24019,7 @@ lean_object* x_2493; lean_object* x_2494; lean_object* x_2495; lean_object* x_24
x_2493 = lean_ctor_get(x_2491, 1);
lean_inc(x_2493);
lean_dec(x_2491);
x_2494 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_2494 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_2495 = l_unreachable_x21___rarg(x_2494);
x_2496 = lean_apply_2(x_2495, x_2, x_2493);
return x_2496;
@ -24414,7 +24410,7 @@ else
lean_object* x_2570; lean_object* x_2571; lean_object* x_2572;
lean_dec(x_2487);
lean_dec(x_1);
x_2570 = l___private_Init_Lean_Elab_Term_14__synthesizePendingInstMVar___lambda__1___closed__1;
x_2570 = l___private_Init_Lean_Elab_Term_14__resumePostponed___lambda__1___closed__1;
x_2571 = l_unreachable_x21___rarg(x_2570);
x_2572 = lean_apply_2(x_2571, x_2, x_3);
return x_2572;
@ -25017,6 +25013,16 @@ lean_object* _init_l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___ra
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Exception_hasToString___closed__1;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* _init_l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l___private_Init_Lean_Meta_LevelDefEq_10__processPostponedStep___closed__1;
x_2 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_2, 0, x_1);
@ -25102,20 +25108,33 @@ lean_inc(x_31);
lean_dec(x_28);
if (lean_obj_tag(x_31) == 0)
{
lean_object* x_32; lean_object* x_33; lean_object* x_34;
lean_object* x_32;
x_32 = lean_ctor_get(x_31, 0);
lean_inc(x_32);
lean_dec(x_31);
x_33 = l_Lean_Message_toString(x_32);
x_34 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_34, 0, x_33);
return x_34;
if (lean_obj_tag(x_32) == 0)
{
lean_object* x_33; lean_object* x_34; lean_object* x_35;
x_33 = lean_ctor_get(x_32, 0);
lean_inc(x_33);
lean_dec(x_32);
x_34 = l_Lean_Message_toString(x_33);
x_35 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_35, 0, x_34);
return x_35;
}
else
{
lean_object* x_35;
x_35 = l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__4;
return x_35;
lean_object* x_36;
x_36 = l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__4;
return x_36;
}
}
else
{
lean_object* x_37;
x_37 = l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__5;
return x_37;
}
}
}
@ -26012,6 +26031,8 @@ l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__3 = _i
lean_mark_persistent(l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__3);
l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__4 = _init_l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__4();
lean_mark_persistent(l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__4);
l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__5 = _init_l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__5();
lean_mark_persistent(l___private_Init_Lean_Elab_Quotation_15__oldRunTermElabM___rarg___closed__5);
l_Lean_Elab_Term_oldExpandStxQuot___closed__1 = _init_l_Lean_Elab_Term_oldExpandStxQuot___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_oldExpandStxQuot___closed__1);
l_Lean_Elab_Term_oldGetAntiquotVars___closed__1 = _init_l_Lean_Elab_Term_oldGetAntiquotVars___closed__1();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,660 @@
// Lean compiler output
// Module: Init.Lean.HeadIndex
// Imports: Init.Lean.Expr
#include "runtime/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_Expr_toHeadIndex___boxed(lean_object*);
lean_object* l_Lean_Expr_toHeadIndex___main___closed__2;
lean_object* l_Lean_Expr_head___boxed(lean_object*);
lean_object* l_Lean_Expr_toHeadIndex___main___boxed(lean_object*);
lean_object* l_Lean_Expr_toHeadIndex___main___closed__1;
lean_object* l_Lean_HeadIndex_HasBeq___closed__1;
lean_object* l___private_Init_Util_1__mkPanicMessage(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_name_eq(lean_object*, lean_object*);
lean_object* l_Lean_Expr_head___main(lean_object*);
uint8_t l_Lean_HeadIndex_HeadIndex_beq(lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Lean_Expr_head(lean_object*);
lean_object* l_Lean_HeadIndex_Inhabited;
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux___boxed(lean_object*, lean_object*);
lean_object* l_Lean_HeadIndex_HeadIndex_hash___boxed(lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_Expr_toHeadIndex___main___closed__3;
uint8_t l_Lean_Literal_beq(lean_object*, lean_object*);
lean_object* l_Lean_Expr_toHeadIndex___main(lean_object*);
lean_object* l_Lean_HeadIndex_HasBeq;
size_t l_Lean_HeadIndex_HeadIndex_hash(lean_object*);
size_t l_Lean_Name_hash(lean_object*);
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_headNumArgs(lean_object*);
lean_object* l_Lean_Expr_toHeadIndex(lean_object*);
size_t lean_usize_of_nat(lean_object*);
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main(lean_object*, lean_object*);
lean_object* l_Lean_HeadIndex_Hashable;
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux(lean_object*, lean_object*);
lean_object* l_Lean_Expr_head___main___boxed(lean_object*);
lean_object* l_Lean_HeadIndex_Hashable___closed__1;
lean_object* l_Lean_Expr_headNumArgs___boxed(lean_object*);
lean_object* l_Lean_HeadIndex_HeadIndex_beq___boxed(lean_object*, lean_object*);
size_t l_Lean_Literal_hash(lean_object*);
lean_object* lean_panic_fn(lean_object*, lean_object*);
size_t lean_usize_mix_hash(size_t, size_t);
lean_object* _init_l_Lean_HeadIndex_Inhabited() {
_start:
{
lean_object* x_1;
x_1 = lean_box(5);
return x_1;
}
}
size_t l_Lean_HeadIndex_HeadIndex_hash(lean_object* x_1) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 0:
{
lean_object* x_2; size_t x_3; size_t x_4; size_t x_5;
x_2 = lean_ctor_get(x_1, 0);
x_3 = 11;
x_4 = l_Lean_Name_hash(x_2);
x_5 = lean_usize_mix_hash(x_3, x_4);
return x_5;
}
case 1:
{
lean_object* x_6; size_t x_7; size_t x_8; size_t x_9;
x_6 = lean_ctor_get(x_1, 0);
x_7 = 13;
x_8 = l_Lean_Name_hash(x_6);
x_9 = lean_usize_mix_hash(x_7, x_8);
return x_9;
}
case 2:
{
lean_object* x_10; size_t x_11; size_t x_12; size_t x_13;
x_10 = lean_ctor_get(x_1, 0);
x_11 = 17;
x_12 = l_Lean_Name_hash(x_10);
x_13 = lean_usize_mix_hash(x_11, x_12);
return x_13;
}
case 3:
{
lean_object* x_14; lean_object* x_15; size_t x_16; size_t x_17; size_t x_18; size_t x_19; size_t x_20;
x_14 = lean_ctor_get(x_1, 0);
x_15 = lean_ctor_get(x_1, 1);
x_16 = 19;
x_17 = l_Lean_Name_hash(x_14);
x_18 = lean_usize_of_nat(x_15);
x_19 = lean_usize_mix_hash(x_17, x_18);
x_20 = lean_usize_mix_hash(x_16, x_19);
return x_20;
}
case 4:
{
lean_object* x_21; size_t x_22; size_t x_23; size_t x_24;
x_21 = lean_ctor_get(x_1, 0);
x_22 = 23;
x_23 = l_Lean_Literal_hash(x_21);
x_24 = lean_usize_mix_hash(x_22, x_23);
return x_24;
}
case 5:
{
size_t x_25;
x_25 = 29;
return x_25;
}
case 6:
{
size_t x_26;
x_26 = 31;
return x_26;
}
default:
{
size_t x_27;
x_27 = 37;
return x_27;
}
}
}
}
lean_object* l_Lean_HeadIndex_HeadIndex_hash___boxed(lean_object* x_1) {
_start:
{
size_t x_2; lean_object* x_3;
x_2 = l_Lean_HeadIndex_HeadIndex_hash(x_1);
lean_dec(x_1);
x_3 = lean_box_usize(x_2);
return x_3;
}
}
lean_object* _init_l_Lean_HeadIndex_Hashable___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_HeadIndex_HeadIndex_hash___boxed), 1, 0);
return x_1;
}
}
lean_object* _init_l_Lean_HeadIndex_Hashable() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_HeadIndex_Hashable___closed__1;
return x_1;
}
}
uint8_t l_Lean_HeadIndex_HeadIndex_beq(lean_object* x_1, lean_object* x_2) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 0:
{
if (lean_obj_tag(x_2) == 0)
{
lean_object* x_3; lean_object* x_4; uint8_t x_5;
x_3 = lean_ctor_get(x_1, 0);
x_4 = lean_ctor_get(x_2, 0);
x_5 = lean_name_eq(x_3, x_4);
return x_5;
}
else
{
uint8_t x_6;
x_6 = 0;
return x_6;
}
}
case 1:
{
if (lean_obj_tag(x_2) == 1)
{
lean_object* x_7; lean_object* x_8; uint8_t x_9;
x_7 = lean_ctor_get(x_1, 0);
x_8 = lean_ctor_get(x_2, 0);
x_9 = lean_name_eq(x_7, x_8);
return x_9;
}
else
{
uint8_t x_10;
x_10 = 0;
return x_10;
}
}
case 2:
{
if (lean_obj_tag(x_2) == 2)
{
lean_object* x_11; lean_object* x_12; uint8_t x_13;
x_11 = lean_ctor_get(x_1, 0);
x_12 = lean_ctor_get(x_2, 0);
x_13 = lean_name_eq(x_11, x_12);
return x_13;
}
else
{
uint8_t x_14;
x_14 = 0;
return x_14;
}
}
case 3:
{
if (lean_obj_tag(x_2) == 3)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19;
x_15 = lean_ctor_get(x_1, 0);
x_16 = lean_ctor_get(x_1, 1);
x_17 = lean_ctor_get(x_2, 0);
x_18 = lean_ctor_get(x_2, 1);
x_19 = lean_name_eq(x_15, x_17);
if (x_19 == 0)
{
uint8_t x_20;
x_20 = 0;
return x_20;
}
else
{
uint8_t x_21;
x_21 = lean_nat_dec_eq(x_16, x_18);
return x_21;
}
}
else
{
uint8_t x_22;
x_22 = 0;
return x_22;
}
}
case 4:
{
if (lean_obj_tag(x_2) == 4)
{
lean_object* x_23; lean_object* x_24; uint8_t x_25;
x_23 = lean_ctor_get(x_1, 0);
x_24 = lean_ctor_get(x_2, 0);
x_25 = l_Lean_Literal_beq(x_23, x_24);
return x_25;
}
else
{
uint8_t x_26;
x_26 = 0;
return x_26;
}
}
case 5:
{
if (lean_obj_tag(x_2) == 5)
{
uint8_t x_27;
x_27 = 1;
return x_27;
}
else
{
uint8_t x_28;
x_28 = 0;
return x_28;
}
}
case 6:
{
if (lean_obj_tag(x_2) == 6)
{
uint8_t x_29;
x_29 = 1;
return x_29;
}
else
{
uint8_t x_30;
x_30 = 0;
return x_30;
}
}
default:
{
if (lean_obj_tag(x_2) == 7)
{
uint8_t x_31;
x_31 = 1;
return x_31;
}
else
{
uint8_t x_32;
x_32 = 0;
return x_32;
}
}
}
}
}
lean_object* l_Lean_HeadIndex_HeadIndex_beq___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_Lean_HeadIndex_HeadIndex_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_Lean_HeadIndex_HasBeq___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_HeadIndex_HeadIndex_beq___boxed), 2, 0);
return x_1;
}
}
lean_object* _init_l_Lean_HeadIndex_HasBeq() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_HeadIndex_HasBeq___closed__1;
return x_1;
}
}
lean_object* l_Lean_Expr_head___main(lean_object* x_1) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 5:
{
lean_object* x_2;
x_2 = lean_ctor_get(x_1, 0);
x_1 = x_2;
goto _start;
}
case 8:
{
lean_object* x_4;
x_4 = lean_ctor_get(x_1, 3);
x_1 = x_4;
goto _start;
}
case 10:
{
lean_object* x_6;
x_6 = lean_ctor_get(x_1, 1);
x_1 = x_6;
goto _start;
}
default:
{
lean_inc(x_1);
return x_1;
}
}
}
}
lean_object* l_Lean_Expr_head___main___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_head___main(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* l_Lean_Expr_head(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_head___main(x_1);
return x_2;
}
}
lean_object* l_Lean_Expr_head___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_head(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main(lean_object* x_1, lean_object* x_2) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 5:
{
lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_3 = lean_ctor_get(x_1, 0);
x_4 = lean_unsigned_to_nat(1u);
x_5 = lean_nat_add(x_2, x_4);
lean_dec(x_2);
x_1 = x_3;
x_2 = x_5;
goto _start;
}
case 8:
{
lean_object* x_7;
x_7 = lean_ctor_get(x_1, 3);
x_1 = x_7;
goto _start;
}
case 10:
{
lean_object* x_9;
x_9 = lean_ctor_get(x_1, 1);
x_1 = x_9;
goto _start;
}
default:
{
return x_2;
}
}
}
}
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main(x_1, x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main(x_1, x_2);
return x_3;
}
}
lean_object* l___private_Init_Lean_HeadIndex_1__headNumArgsAux___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3;
x_3 = l___private_Init_Lean_HeadIndex_1__headNumArgsAux(x_1, x_2);
lean_dec(x_1);
return x_3;
}
}
lean_object* l_Lean_Expr_headNumArgs(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = lean_unsigned_to_nat(0u);
x_3 = l___private_Init_Lean_HeadIndex_1__headNumArgsAux___main(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_Expr_headNumArgs___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_headNumArgs(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* _init_l_Lean_Expr_toHeadIndex___main___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("Init.Lean.HeadIndex");
return x_1;
}
}
lean_object* _init_l_Lean_Expr_toHeadIndex___main___closed__2() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("unexpected expression kind");
return x_1;
}
}
lean_object* _init_l_Lean_Expr_toHeadIndex___main___closed__3() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_1 = l_Lean_Expr_toHeadIndex___main___closed__1;
x_2 = lean_unsigned_to_nat(81u);
x_3 = lean_unsigned_to_nat(29u);
x_4 = l_Lean_Expr_toHeadIndex___main___closed__2;
x_5 = l___private_Init_Util_1__mkPanicMessage(x_1, x_2, x_3, x_4);
return x_5;
}
}
lean_object* l_Lean_Expr_toHeadIndex___main(lean_object* x_1) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 1:
{
lean_object* x_2; lean_object* x_3;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = lean_alloc_ctor(0, 1, 0);
lean_ctor_set(x_3, 0, x_2);
return x_3;
}
case 2:
{
lean_object* x_4; lean_object* x_5;
x_4 = lean_ctor_get(x_1, 0);
lean_inc(x_4);
x_5 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_5, 0, x_4);
return x_5;
}
case 3:
{
lean_object* x_6;
x_6 = lean_box(5);
return x_6;
}
case 4:
{
lean_object* x_7; lean_object* x_8;
x_7 = lean_ctor_get(x_1, 0);
lean_inc(x_7);
x_8 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_8, 0, x_7);
return x_8;
}
case 5:
{
lean_object* x_9;
x_9 = lean_ctor_get(x_1, 0);
x_1 = x_9;
goto _start;
}
case 6:
{
lean_object* x_11;
x_11 = lean_box(6);
return x_11;
}
case 7:
{
lean_object* x_12;
x_12 = lean_box(7);
return x_12;
}
case 8:
{
lean_object* x_13;
x_13 = lean_ctor_get(x_1, 3);
x_1 = x_13;
goto _start;
}
case 9:
{
lean_object* x_15; lean_object* x_16;
x_15 = lean_ctor_get(x_1, 0);
lean_inc(x_15);
x_16 = lean_alloc_ctor(4, 1, 0);
lean_ctor_set(x_16, 0, x_15);
return x_16;
}
case 10:
{
lean_object* x_17;
x_17 = lean_ctor_get(x_1, 1);
x_1 = x_17;
goto _start;
}
case 11:
{
lean_object* x_19; lean_object* x_20; lean_object* x_21;
x_19 = lean_ctor_get(x_1, 0);
x_20 = lean_ctor_get(x_1, 1);
lean_inc(x_20);
lean_inc(x_19);
x_21 = lean_alloc_ctor(3, 2, 0);
lean_ctor_set(x_21, 0, x_19);
lean_ctor_set(x_21, 1, x_20);
return x_21;
}
default:
{
lean_object* x_22; lean_object* x_23; lean_object* x_24;
x_22 = l_Lean_HeadIndex_Inhabited;
x_23 = l_Lean_Expr_toHeadIndex___main___closed__3;
x_24 = lean_panic_fn(x_22, x_23);
return x_24;
}
}
}
}
lean_object* l_Lean_Expr_toHeadIndex___main___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_toHeadIndex___main(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* l_Lean_Expr_toHeadIndex(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_toHeadIndex___main(x_1);
return x_2;
}
}
lean_object* l_Lean_Expr_toHeadIndex___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Expr_toHeadIndex(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* initialize_Init_Lean_Expr(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_HeadIndex(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init_Lean_Expr(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_HeadIndex_Inhabited = _init_l_Lean_HeadIndex_Inhabited();
lean_mark_persistent(l_Lean_HeadIndex_Inhabited);
l_Lean_HeadIndex_Hashable___closed__1 = _init_l_Lean_HeadIndex_Hashable___closed__1();
lean_mark_persistent(l_Lean_HeadIndex_Hashable___closed__1);
l_Lean_HeadIndex_Hashable = _init_l_Lean_HeadIndex_Hashable();
lean_mark_persistent(l_Lean_HeadIndex_Hashable);
l_Lean_HeadIndex_HasBeq___closed__1 = _init_l_Lean_HeadIndex_HasBeq___closed__1();
lean_mark_persistent(l_Lean_HeadIndex_HasBeq___closed__1);
l_Lean_HeadIndex_HasBeq = _init_l_Lean_HeadIndex_HasBeq();
lean_mark_persistent(l_Lean_HeadIndex_HasBeq);
l_Lean_Expr_toHeadIndex___main___closed__1 = _init_l_Lean_Expr_toHeadIndex___main___closed__1();
lean_mark_persistent(l_Lean_Expr_toHeadIndex___main___closed__1);
l_Lean_Expr_toHeadIndex___main___closed__2 = _init_l_Lean_Expr_toHeadIndex___main___closed__2();
lean_mark_persistent(l_Lean_Expr_toHeadIndex___main___closed__2);
l_Lean_Expr_toHeadIndex___main___closed__3 = _init_l_Lean_Expr_toHeadIndex___main___closed__3();
lean_mark_persistent(l_Lean_Expr_toHeadIndex___main___closed__3);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus
}
#endif

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Linter
// Imports: Init.System.IO Init.Lean.Attributes Init.Lean.Syntax Init.Lean.Util.Message
// Imports: Init.System.IO Init.Lean.Attributes Init.Lean.Syntax Init.Lean.Message
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -76,7 +76,7 @@ return x_12;
lean_object* initialize_Init_System_IO(lean_object*);
lean_object* initialize_Init_Lean_Attributes(lean_object*);
lean_object* initialize_Init_Lean_Syntax(lean_object*);
lean_object* initialize_Init_Lean_Util_Message(lean_object*);
lean_object* initialize_Init_Lean_Message(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Linter(lean_object* w) {
lean_object * res;
@ -91,7 +91,7 @@ lean_dec_ref(res);
res = initialize_Init_Lean_Syntax(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Lean_Util_Message(lean_io_mk_world());
res = initialize_Init_Lean_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = l_Lean_mkLintersRef(lean_io_mk_world());

View file

@ -1,5 +1,5 @@
// Lean compiler output
// Module: Init.Lean.Util.Message
// Module: Init.Lean.Message
// Imports: Init.Data.ToString Init.Lean.Data.Position Init.Lean.Syntax Init.Lean.MetavarContext Init.Lean.Environment
#include "runtime/lean.h"
#if defined(__clang__)
@ -2127,7 +2127,7 @@ lean_object* initialize_Init_Lean_Syntax(lean_object*);
lean_object* initialize_Init_Lean_MetavarContext(lean_object*);
lean_object* initialize_Init_Lean_Environment(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Util_Message(lean_object* w) {
lean_object* initialize_Init_Lean_Message(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Meta
// Imports: Init.Lean.Meta.Basic Init.Lean.Meta.LevelDefEq Init.Lean.Meta.WHNF Init.Lean.Meta.InferType Init.Lean.Meta.FunInfo Init.Lean.Meta.ExprDefEq Init.Lean.Meta.DiscrTree Init.Lean.Meta.Reduce Init.Lean.Meta.Instances Init.Lean.Meta.AbstractMVars Init.Lean.Meta.SynthInstance Init.Lean.Meta.AppBuilder Init.Lean.Meta.Tactic Init.Lean.Meta.Message
// Imports: Init.Lean.Meta.Basic Init.Lean.Meta.LevelDefEq Init.Lean.Meta.WHNF Init.Lean.Meta.InferType Init.Lean.Meta.FunInfo Init.Lean.Meta.ExprDefEq Init.Lean.Meta.DiscrTree Init.Lean.Meta.Reduce Init.Lean.Meta.Instances Init.Lean.Meta.AbstractMVars Init.Lean.Meta.SynthInstance Init.Lean.Meta.AppBuilder Init.Lean.Meta.Tactic Init.Lean.Meta.Message Init.Lean.Meta.KAbstract
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -27,6 +27,7 @@ lean_object* initialize_Init_Lean_Meta_SynthInstance(lean_object*);
lean_object* initialize_Init_Lean_Meta_AppBuilder(lean_object*);
lean_object* initialize_Init_Lean_Meta_Tactic(lean_object*);
lean_object* initialize_Init_Lean_Meta_Message(lean_object*);
lean_object* initialize_Init_Lean_Meta_KAbstract(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Meta(lean_object* w) {
lean_object * res;
@ -74,6 +75,9 @@ lean_dec_ref(res);
res = initialize_Init_Lean_Meta_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Lean_Meta_KAbstract(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

@ -29,6 +29,7 @@ lean_object* l_Lean_Meta_mkEqSymm___closed__1;
lean_object* l_Lean_Meta_mkEqTrans___closed__3;
lean_object* l_Lean_Meta_mkAppM(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongr___closed__2;
extern lean_object* l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
extern lean_object* l_Array_empty___closed__1;
lean_object* l_Lean_Meta_mkCongr(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongrFun(lean_object*, lean_object*, lean_object*, lean_object*);
@ -53,7 +54,6 @@ lean_object* l_Lean_Meta_mkEqSymm___closed__2;
lean_object* l___private_Init_Lean_Meta_AppBuilder_3__mkAppMAux___main___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkEqSymm(lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
lean_object* l___private_Init_Lean_Meta_AppBuilder_1__infer(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkCongrArg___closed__3;
lean_object* l_Lean_Expr_heq_x3f___closed__2;
@ -80,7 +80,7 @@ lean_object* l_Lean_Expr_heq_x3f___closed__1;
lean_object* l_Lean_Expr_heq_x3f___boxed(lean_object*);
lean_object* l_Lean_ConstantInfo_lparams(lean_object*);
lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_synthInstance(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_synthInstance(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_hasAssignableMVar(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_arrow_x3f(lean_object*);
lean_object* l_List_mapM___main___at_Lean_Meta_mkAppM___spec__1(lean_object*, lean_object*, lean_object*);
@ -4334,7 +4334,7 @@ lean_inc(x_9);
x_10 = l_Lean_Meta_getMVarDecl(x_9, x_3, x_4);
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;
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_11 = lean_ctor_get(x_10, 0);
lean_inc(x_11);
x_12 = lean_ctor_get(x_10, 1);
@ -4343,105 +4343,104 @@ lean_dec(x_10);
x_13 = lean_ctor_get(x_11, 2);
lean_inc(x_13);
lean_dec(x_11);
x_14 = lean_unsigned_to_nat(10000u);
lean_inc(x_3);
x_15 = l_Lean_Meta_synthInstance(x_13, x_14, x_3, x_12);
if (lean_obj_tag(x_15) == 0)
x_14 = l_Lean_Meta_synthInstance(x_13, x_3, x_12);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_16 = lean_ctor_get(x_15, 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);
x_17 = lean_ctor_get(x_15, 1);
lean_inc(x_17);
lean_dec(x_15);
x_18 = l_Lean_Meta_assignExprMVar(x_9, x_16, x_3, x_17);
if (lean_obj_tag(x_18) == 0)
lean_dec(x_14);
x_17 = l_Lean_Meta_assignExprMVar(x_9, x_15, x_3, x_16);
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_19; lean_object* x_20; lean_object* x_21;
x_19 = lean_ctor_get(x_18, 1);
lean_inc(x_19);
lean_dec(x_18);
x_20 = lean_unsigned_to_nat(1u);
x_21 = lean_nat_add(x_2, x_20);
lean_object* x_18; lean_object* x_19; lean_object* x_20;
x_18 = lean_ctor_get(x_17, 1);
lean_inc(x_18);
lean_dec(x_17);
x_19 = lean_unsigned_to_nat(1u);
x_20 = lean_nat_add(x_2, x_19);
lean_dec(x_2);
x_2 = x_21;
x_4 = x_19;
x_2 = x_20;
x_4 = x_18;
goto _start;
}
else
{
uint8_t x_23;
uint8_t x_22;
lean_dec(x_3);
lean_dec(x_2);
x_23 = !lean_is_exclusive(x_18);
if (x_23 == 0)
x_22 = !lean_is_exclusive(x_17);
if (x_22 == 0)
{
return x_18;
return x_17;
}
else
{
lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_24 = lean_ctor_get(x_18, 0);
x_25 = lean_ctor_get(x_18, 1);
lean_inc(x_25);
lean_object* x_23; lean_object* x_24; lean_object* x_25;
x_23 = lean_ctor_get(x_17, 0);
x_24 = lean_ctor_get(x_17, 1);
lean_inc(x_24);
lean_dec(x_18);
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;
lean_inc(x_23);
lean_dec(x_17);
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;
}
}
}
else
{
uint8_t x_27;
uint8_t x_26;
lean_dec(x_9);
lean_dec(x_3);
lean_dec(x_2);
x_27 = !lean_is_exclusive(x_15);
if (x_27 == 0)
x_26 = !lean_is_exclusive(x_14);
if (x_26 == 0)
{
return x_15;
return x_14;
}
else
{
lean_object* x_28; lean_object* x_29; lean_object* x_30;
x_28 = lean_ctor_get(x_15, 0);
x_29 = lean_ctor_get(x_15, 1);
lean_inc(x_29);
lean_object* x_27; lean_object* x_28; lean_object* x_29;
x_27 = lean_ctor_get(x_14, 0);
x_28 = lean_ctor_get(x_14, 1);
lean_inc(x_28);
lean_dec(x_15);
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;
lean_inc(x_27);
lean_dec(x_14);
x_29 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_29, 0, x_27);
lean_ctor_set(x_29, 1, x_28);
return x_29;
}
}
}
else
{
uint8_t x_31;
uint8_t x_30;
lean_dec(x_9);
lean_dec(x_3);
lean_dec(x_2);
x_31 = !lean_is_exclusive(x_10);
if (x_31 == 0)
x_30 = !lean_is_exclusive(x_10);
if (x_30 == 0)
{
return x_10;
}
else
{
lean_object* x_32; lean_object* x_33; lean_object* x_34;
x_32 = lean_ctor_get(x_10, 0);
x_33 = lean_ctor_get(x_10, 1);
lean_inc(x_33);
lean_object* x_31; lean_object* x_32; lean_object* x_33;
x_31 = lean_ctor_get(x_10, 0);
x_32 = lean_ctor_get(x_10, 1);
lean_inc(x_32);
lean_inc(x_31);
lean_dec(x_10);
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;
x_33 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_33, 0, x_31);
lean_ctor_set(x_33, 1, x_32);
return x_33;
}
}
}
@ -5251,7 +5250,7 @@ lean_object* _init_l_Lean_Meta_mkAppM___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
x_1 = l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
x_2 = l_Lean_Meta_Exception_toTraceMessageData___closed__68;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;

File diff suppressed because it is too large Load diff

View file

@ -23,6 +23,7 @@ lean_object* l___private_Init_Lean_Meta_Check_4__checkConstant(lean_object*, lea
lean_object* l___private_Init_Lean_Meta_Check_1__ensureType(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Util_Trace_2__addNode___at_Lean_Meta_check___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_EIO_Monad___closed__1;
extern lean_object* l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
lean_object* l___private_Init_Lean_Meta_Check_6__checkAux(lean_object*, lean_object*, lean_object*);
lean_object* lean_environment_find(lean_object*, lean_object*);
lean_object* l_Lean_Meta_isExprDefEqAux(lean_object*, lean_object*, lean_object*, lean_object*);
@ -49,7 +50,6 @@ lean_object* l_Lean_MonadTracerAdapter_addTrace___at_Lean_Meta_isTypeCorrect___s
lean_object* l_Lean_Meta_isTypeCorrect___closed__1;
lean_object* l_Lean_Meta_isTypeCorrect___closed__2;
lean_object* l_Array_forMAux___main___at___private_Init_Lean_Meta_Check_6__checkAux___main___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
lean_object* l_Lean_Expr_fvarId_x21(lean_object*);
lean_object* l_List_lengthAux___main___rarg(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Util_Trace_3__getResetTraces___at_Lean_Meta_check___spec__1(lean_object*);
@ -2676,7 +2676,7 @@ lean_object* _init_l_Lean_Meta_check___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
x_1 = l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
x_2 = l_Lean_Meta_check___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
@ -4255,7 +4255,7 @@ lean_object* _init_l_Lean_Meta_isTypeCorrect___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
x_1 = l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
x_2 = l_Lean_Meta_isTypeCorrect___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Meta.Exception
// Imports: Init.Lean.Environment Init.Lean.MetavarContext Init.Lean.Util.Message
// Imports: Init.Lean.Environment Init.Lean.MetavarContext Init.Lean.Message
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -1821,7 +1821,7 @@ return x_144;
}
lean_object* initialize_Init_Lean_Environment(lean_object*);
lean_object* initialize_Init_Lean_MetavarContext(lean_object*);
lean_object* initialize_Init_Lean_Util_Message(lean_object*);
lean_object* initialize_Init_Lean_Message(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Meta_Exception(lean_object* w) {
lean_object * res;
@ -1833,7 +1833,7 @@ lean_dec_ref(res);
res = initialize_Init_Lean_MetavarContext(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Lean_Util_Message(lean_io_mk_world());
res = initialize_Init_Lean_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Meta_Exception_Inhabited___closed__1 = _init_l_Lean_Meta_Exception_Inhabited___closed__1();

View file

@ -49,6 +49,7 @@ lean_object* l_Lean_Meta_CheckAssignment_checkFVar(lean_object*, lean_object*, l
lean_object* l___private_Init_Lean_Meta_ExprDefEq_8__cache___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_metavar_ctx_get_expr_assignment(lean_object*, lean_object*);
uint8_t l_Array_anyRangeMAux___main___at_Lean_Meta_CheckAssignment_check___main___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkMVar(lean_object*);
lean_object* l_Lean_Meta_isClassQuick___main(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Array_empty___closed__1;
@ -74,6 +75,7 @@ lean_object* l___private_Init_Lean_Meta_ExprDefEq_26__tryHeuristic(lean_object*,
lean_object* l___private_Init_Lean_Meta_ExprDefEq_23__isDefEqLeft(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*);
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_LocalContext_findFVar_x3f(lean_object*, lean_object*);
lean_object* l_AssocList_find___main___at___private_Init_Lean_Meta_ExprDefEq_7__findCached_x3f___spec__2___boxed(lean_object*, lean_object*);
lean_object* l_Lean_WHNF_getStuckMVar___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
@ -198,7 +200,6 @@ uint8_t l_Array_isEmpty___rarg(lean_object*);
lean_object* l___private_Init_Lean_Meta_ExprDefEq_36__isSynthetic(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_isEtaUnassignedMVar(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkLambda(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkFreshId___rarg(lean_object*);
lean_object* l___private_Init_Lean_Meta_ExprDefEq_6__isDefEqBinding(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_try___at___private_Init_Lean_Meta_ExprDefEq_40__isDefEqQuick___main___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
@ -279,6 +280,7 @@ lean_object* l_Lean_Meta_CheckAssignmentQuick_check(uint8_t, uint8_t, lean_objec
lean_object* l___private_Init_Lean_Meta_ExprDefEq_41__isDefEqProofIrrel(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_try___at___private_Init_Lean_Meta_ExprDefEq_40__isDefEqQuick___main___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_ExprDefEq_24__isDefEqRight___closed__2;
extern lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
uint8_t l_Bool_toLBool(uint8_t);
lean_object* l___private_Init_Lean_Meta_ExprDefEq_4__isDefEqArgs___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_synthPending(lean_object*, lean_object*, lean_object*);
@ -318,8 +320,6 @@ lean_object* l_Lean_Meta_instantiateMVars(lean_object*, lean_object*, lean_objec
lean_object* l___private_Init_Lean_Meta_ExprDefEq_17__checkTypesAndAssign___closed__3;
uint8_t l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_ExprDefEq_19__processAssignmentAux___main___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_mk_array(lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_ExprDefEq_8__cache(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkAssignment___closed__1;
lean_object* l_Lean_Meta_CheckAssignment_mkAuxMVar(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -327,7 +327,7 @@ lean_object* l___private_Init_Lean_Meta_ExprDefEq_21__isDeltaCandidate(lean_obje
lean_object* l_Lean_Meta_CheckAssignment_Lean_MonadCache___closed__3;
lean_object* l___private_Init_Lean_Meta_ExprDefEq_32__unfoldReducibeDefEq___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_mkHashMap___at_Lean_Meta_checkAssignment___spec__2(lean_object*);
lean_object* l_Lean_Meta_whnfD(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_ExprDefEq_35__isAssigned(lean_object*, lean_object*, lean_object*);
@ -16196,7 +16196,7 @@ return x_24;
else
{
lean_object* x_25;
x_25 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_5, x_2, x_4, x_6, x_7, x_8, x_3, x_1, x_9, x_10, x_11);
x_25 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_5, x_2, x_4, x_6, x_7, x_8, x_3, x_1, x_9, x_10, x_11);
return x_25;
}
}
@ -20534,7 +20534,7 @@ return x_491;
}
}
}
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, uint8_t x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
_start:
{
lean_object* x_12;
@ -20740,7 +20740,7 @@ return x_22;
}
}
}
lean_object* l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___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) {
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___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;
@ -20761,7 +20761,7 @@ if (x_12 == 0)
lean_object* x_13; uint8_t x_14;
lean_dec(x_10);
lean_dec(x_5);
x_13 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
x_13 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
x_14 = lean_nat_dec_eq(x_13, x_2);
lean_dec(x_2);
if (x_14 == 0)
@ -20828,7 +20828,7 @@ lean_inc(x_26);
x_27 = 1;
x_28 = l_Array_empty___closed__1;
x_29 = lean_unsigned_to_nat(0u);
x_30 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_1, x_2, x_3, x_27, x_5, x_26, x_28, x_29, x_10, x_6, x_11);
x_30 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_1, x_2, x_3, x_27, x_5, x_26, x_28, x_29, x_10, x_6, x_11);
return x_30;
}
}
@ -20846,7 +20846,7 @@ if (x_33 == 0)
lean_object* x_34; uint8_t x_35;
lean_dec(x_31);
lean_dec(x_5);
x_34 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
x_34 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
x_35 = lean_nat_dec_eq(x_34, x_2);
lean_dec(x_2);
if (x_35 == 0)
@ -20915,7 +20915,7 @@ lean_inc(x_48);
x_49 = 1;
x_50 = l_Array_empty___closed__1;
x_51 = lean_unsigned_to_nat(0u);
x_52 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_1, x_2, x_3, x_49, x_5, x_48, x_50, x_51, x_31, x_6, x_32);
x_52 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_1, x_2, x_3, x_49, x_5, x_48, x_50, x_51, x_31, x_6, x_32);
return x_52;
}
}
@ -21020,7 +21020,7 @@ lean_inc(x_24);
lean_dec(x_22);
lean_inc(x_2);
lean_ctor_set(x_9, 0, x_2);
x_25 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__1(x_1, x_2, x_20, x_24, x_9, x_4, x_23);
x_25 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__1(x_1, x_2, x_20, x_24, x_9, x_4, x_23);
return x_25;
}
else
@ -21072,7 +21072,7 @@ lean_dec(x_32);
lean_inc(x_2);
x_35 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_35, 0, x_2);
x_36 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__1(x_1, x_2, x_30, x_34, x_35, x_4, x_33);
x_36 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__1(x_1, x_2, x_30, x_34, x_35, x_4, x_33);
return x_36;
}
else
@ -21179,13 +21179,13 @@ lean_dec(x_2);
return x_10;
}
}
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
_start:
{
uint8_t x_12; lean_object* x_13;
x_12 = lean_unbox(x_4);
lean_dec(x_4);
x_13 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_1, x_2, x_3, x_12, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
x_13 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_ExprDefEq_18__processConstApprox___spec__2(x_1, x_2, x_3, x_12, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
return x_13;
}
}

View file

@ -15,12 +15,14 @@ extern "C" {
#endif
lean_object* l_PersistentHashMap_insertAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__5(lean_object*, size_t, size_t, lean_object*, lean_object*);
size_t l_USize_add(size_t, size_t);
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
size_t l_Lean_Meta_TransparencyMode_hash(uint8_t);
lean_object* lean_nat_div(lean_object*, lean_object*);
lean_object* l_Lean_Meta_isClassExpensive___main(lean_object*, lean_object*, lean_object*);
uint8_t l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_FunInfo_3__collectDepsAux___main___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentHashMap_findAtAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_FunInfo_3__collectDepsAux___main(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
extern size_t l_PersistentHashMap_insertAux___main___rarg___closed__2;
lean_object* l_Array_qsortAux___main___at___private_Init_Lean_Meta_FunInfo_4__collectDeps___spec__1___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_FunInfo_4__collectDeps(lean_object*, lean_object*);
@ -31,7 +33,7 @@ lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_M
lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at___private_Init_Lean_Meta_FunInfo_4__collectDeps___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__7(size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(uint8_t, lean_object*, lean_object*, 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*);
lean_object* l_Lean_Meta_getFunInfo(lean_object*, lean_object*, lean_object*);
@ -40,7 +42,6 @@ size_t l_USize_shiftRight(size_t, size_t);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_FunInfo_4__collectDeps___boxed(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentHashMap_findAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__2___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentHashMap_findAtAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentHashMap_insertAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -66,7 +67,6 @@ size_t l_Lean_Expr_hash(lean_object*);
lean_object* l___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_FunInfo_3__collectDepsAux___main___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentHashMap_findAux___main___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__2(lean_object*, size_t, lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Meta_TransparencyMode_beq(uint8_t, uint8_t);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -92,6 +92,7 @@ lean_object* l___private_Init_Lean_Meta_FunInfo_2__whenHasVar___rarg(lean_object
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__5___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at___private_Init_Lean_Meta_FunInfo_4__collectDeps___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_FunInfo_2__whenHasVar(lean_object*);
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__5___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_umapMAux___main___at___private_Init_Lean_Meta_FunInfo_5__updateHasFwdDeps___spec__1___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_getFunInfoNArgs(lean_object*, lean_object*, lean_object*, lean_object*);
@ -100,7 +101,6 @@ lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentHashMap_getCollisionNodeSize___rarg(lean_object*);
lean_object* l_PersistentHashMap_find_x3f___at___private_Init_Lean_Meta_FunInfo_1__checkFunInfoCache___spec__1(lean_object*, lean_object*);
extern lean_object* l_Lean_Expr_Inhabited;
lean_object* l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
size_t lean_usize_mix_hash(size_t, size_t);
lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__5(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_Meta_resettingSynthInstanceCache___rarg___closed__1;
@ -4846,7 +4846,7 @@ return x_27;
else
{
lean_object* x_28;
x_28 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(x_4, x_5, x_6, x_1, x_2, x_7, x_8, x_9);
x_28 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(x_4, x_5, x_6, x_1, x_2, x_7, x_8, x_9);
return x_28;
}
}
@ -9171,7 +9171,7 @@ return x_494;
}
}
}
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(uint8_t x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(uint8_t 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;
@ -9372,7 +9372,7 @@ return x_20;
}
}
}
lean_object* _init_l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1() {
lean_object* _init_l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2;
@ -9381,7 +9381,7 @@ x_2 = lean_array_get_size(x_1);
return x_2;
}
}
lean_object* l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
@ -9403,7 +9403,7 @@ lean_object* x_9; lean_object* x_10; lean_object* x_11;
lean_dec(x_6);
lean_dec(x_2);
x_9 = l_Array_empty___closed__1;
x_10 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
x_10 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1;
x_11 = l_Nat_foldMAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__1(x_9, x_10, x_10, x_9, x_3, x_7);
if (lean_obj_tag(x_11) == 0)
{
@ -9475,7 +9475,7 @@ lean_inc(x_27);
x_28 = 1;
x_29 = l_Array_empty___closed__1;
x_30 = lean_unsigned_to_nat(0u);
x_31 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(x_28, x_2, x_27, x_29, x_30, x_6, x_3, x_7);
x_31 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(x_28, x_2, x_27, x_29, x_30, x_6, x_3, x_7);
return x_31;
}
}
@ -9559,7 +9559,7 @@ lean_inc(x_21);
lean_dec(x_15);
x_22 = 1;
lean_ctor_set_uint8(x_5, sizeof(void*)*1 + 6, x_22);
x_23 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(x_20, x_2, x_3, x_21);
x_23 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(x_20, x_2, x_3, x_21);
if (lean_obj_tag(x_23) == 0)
{
lean_object* x_24; lean_object* x_25; uint8_t x_26;
@ -9801,7 +9801,7 @@ x_77 = lean_alloc_ctor(0, 3, 0);
lean_ctor_set(x_77, 0, x_5);
lean_ctor_set(x_77, 1, x_6);
lean_ctor_set(x_77, 2, x_7);
x_78 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(x_74, x_2, x_77, x_75);
x_78 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(x_74, x_2, x_77, x_75);
if (lean_obj_tag(x_78) == 0)
{
lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96;
@ -10029,7 +10029,7 @@ if (lean_is_scalar(x_120)) {
lean_ctor_set(x_125, 0, x_124);
lean_ctor_set(x_125, 1, x_6);
lean_ctor_set(x_125, 2, x_7);
x_126 = l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(x_121, x_2, x_125, x_122);
x_126 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2(x_121, x_2, x_125, x_122);
if (lean_obj_tag(x_126) == 0)
{
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; lean_object* x_140; lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144;
@ -10248,13 +10248,13 @@ lean_dec(x_1);
return x_8;
}
}
lean_object* l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
lean_object* l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
uint8_t x_9; lean_object* x_10;
x_9 = lean_unbox(x_1);
lean_dec(x_1);
x_10 = l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(x_9, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
x_10 = l___private_Init_Lean_Meta_Basic_4__forallTelescopeReducingAuxAux___main___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__3(x_9, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
return x_10;
}
}
@ -10290,8 +10290,8 @@ lean_dec_ref(res);
res = initialize_Init_Lean_Meta_InferType(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1 = _init_l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1();
lean_mark_persistent(l___private_Init_Lean_Meta_Basic_6__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1);
l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1 = _init_l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1();
lean_mark_persistent(l___private_Init_Lean_Meta_Basic_5__forallTelescopeReducingAux___at___private_Init_Lean_Meta_FunInfo_6__getFunInfoAux___spec__2___closed__1);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,7 @@ lean_object* l_Lean_Meta_isExprDefEq___closed__2;
lean_object* l___private_Init_Lean_Meta_LevelDefEq_5__solveSelfMax(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_try___at_Lean_Meta_isLevelDefEq___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l___private_Init_Lean_Meta_LevelDefEq_2__strictOccursMaxAux___main(lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
lean_object* l_Lean_Meta_isExprDefEqAux(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_checkTraceOption(lean_object*, lean_object*);
uint8_t lean_name_eq(lean_object*, lean_object*);
@ -64,7 +65,6 @@ lean_object* l_Lean_MonadTracerAdapter_addTrace___at_Lean_Meta_isLevelDefEqAux__
lean_object* l_Lean_Meta_isLevelDefEq___closed__7;
lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_LevelDefEq_10__processPostponedStep___spec__3(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* lean_metavar_ctx_get_level_assignment(lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
lean_object* l_Lean_Meta_isLevelDefEqAux___main(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_LevelDefEq_9__getResetPostponed(lean_object*);
lean_object* l_Lean_mkLevelMax(lean_object*, lean_object*);
@ -1524,7 +1524,7 @@ lean_object* _init_l_Lean_Meta_isLevelDefEqAux___main___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
x_1 = l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
x_2 = l_Lean_Meta_isLevelDefEqAux___main___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
@ -11544,7 +11544,7 @@ lean_object* _init_l_Lean_Meta_isExprDefEq___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
x_1 = l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
x_2 = l_Lean_Meta_isExprDefEq___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;

View file

@ -14,47 +14,50 @@
extern "C" {
#endif
extern lean_object* l___private_Init_Lean_Syntax_10__decodeNatLitVal___closed__1;
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Meta_isExprDefEqAux(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_name_eq(lean_object*, lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__10;
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffset___main(lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffset(lean_object*);
lean_object* l_Lean_Expr_getAppFn___main(lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_3__isOffset(lean_object*);
lean_object* l_Lean_Meta_evalNat(lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_2__getOffset(lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppNumArgsAux___main(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_5__mkOffset(lean_object*, lean_object*);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__11;
lean_object* l___private_Init_Lean_Meta_Offset_4__mkOffset(lean_object*, lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
lean_object* l_Lean_Meta_evalNat___main(lean_object*);
lean_object* l_Lean_Meta_isDefEqOffset(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__12;
lean_object* lean_name_mk_string(lean_object*, lean_object*);
extern lean_object* l_Lean_Literal_type___closed__1;
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux(lean_object*, uint8_t);
lean_object* l_Lean_Meta_evalNat___main___closed__6;
extern lean_object* l_Lean_Literal_type___closed__2;
lean_object* l_Lean_Meta_evalNat___main___closed__13;
lean_object* l___private_Init_Lean_Meta_Offset_4__mkOffset___closed__1;
lean_object* l___private_Init_Lean_Meta_Offset_4__isNatZero___boxed(lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__4;
lean_object* l_Lean_Expr_getRevArg_x21___main(lean_object*, lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__2;
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_5__mkOffset___closed__1;
lean_object* l_Lean_Meta_evalNat___main___closed__9;
uint8_t l_Bool_toLBool(uint8_t);
uint8_t l___private_Init_Lean_Meta_Offset_3__isNatZero(lean_object*);
uint8_t l___private_Init_Lean_Meta_Offset_4__isNatZero(lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__8;
lean_object* lean_nat_mul(lean_object*, lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__7;
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(lean_object*, uint8_t);
lean_object* l_Lean_Meta_evalNat___boxed(lean_object*);
lean_object* l_Lean_Meta_evalNat___main___closed__3;
lean_object* l_Lean_Meta_evalNat___main___closed__5;
lean_object* l_Lean_Meta_evalNat___main___closed__14;
lean_object* l_Lean_Meta_evalNat___main___closed__1;
lean_object* l_Lean_Meta_evalNat___main___boxed(lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_3__isNatZero___boxed(lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux___boxed(lean_object*, lean_object*);
lean_object* l_Lean_mkNatLit(lean_object*);
lean_object* l___private_Init_Lean_Meta_Offset_2__isOffset(lean_object*);
lean_object* l_Lean_mkAppB(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
uint8_t lean_string_dec_eq(lean_object*, lean_object*);
@ -977,296 +980,492 @@ lean_dec(x_1);
return x_2;
}
}
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffset___main(lean_object* x_1) {
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(lean_object* x_1, uint8_t x_2) {
_start:
{
lean_object* x_3;
if (lean_obj_tag(x_1) == 5)
{
lean_object* x_2; lean_object* x_3;
x_2 = lean_ctor_get(x_1, 1);
lean_inc(x_2);
x_3 = l_Lean_Expr_getAppFn___main(x_1);
if (lean_obj_tag(x_3) == 4)
lean_object* x_9; lean_object* x_10;
x_9 = lean_ctor_get(x_1, 1);
lean_inc(x_9);
x_10 = l_Lean_Expr_getAppFn___main(x_1);
if (lean_obj_tag(x_10) == 4)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_34; lean_object* x_60; uint8_t x_61;
x_4 = lean_ctor_get(x_3, 0);
lean_inc(x_4);
lean_dec(x_3);
x_5 = lean_unsigned_to_nat(0u);
x_6 = l_Lean_Expr_getAppNumArgsAux___main(x_1, x_5);
x_60 = l_Lean_Meta_evalNat___main___closed__14;
x_61 = lean_name_eq(x_4, x_60);
if (x_61 == 0)
lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_53; lean_object* x_90; uint8_t x_91;
x_11 = lean_ctor_get(x_10, 0);
lean_inc(x_11);
lean_dec(x_10);
x_12 = lean_unsigned_to_nat(0u);
x_13 = l_Lean_Expr_getAppNumArgsAux___main(x_1, x_12);
x_90 = l_Lean_Meta_evalNat___main___closed__14;
x_91 = lean_name_eq(x_11, x_90);
if (x_91 == 0)
{
lean_object* x_62;
lean_dec(x_2);
x_62 = lean_box(0);
x_34 = x_62;
goto block_59;
lean_object* x_92;
lean_dec(x_9);
x_92 = lean_box(0);
x_53 = x_92;
goto block_89;
}
else
{
lean_object* x_63; uint8_t x_64;
x_63 = lean_unsigned_to_nat(1u);
x_64 = lean_nat_dec_eq(x_6, x_63);
if (x_64 == 0)
lean_object* x_93; uint8_t x_94;
x_93 = lean_unsigned_to_nat(1u);
x_94 = lean_nat_dec_eq(x_13, x_93);
if (x_94 == 0)
{
lean_object* x_65;
lean_dec(x_2);
x_65 = lean_box(0);
x_34 = x_65;
goto block_59;
lean_object* x_95;
lean_dec(x_9);
x_95 = lean_box(0);
x_53 = x_95;
goto block_89;
}
else
{
lean_object* x_66; uint8_t x_67;
lean_dec(x_6);
lean_dec(x_4);
uint8_t x_96; lean_object* x_97;
lean_dec(x_13);
lean_dec(x_11);
lean_dec(x_1);
x_66 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_2);
x_67 = !lean_is_exclusive(x_66);
if (x_67 == 0)
x_96 = 0;
x_97 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_9, x_96);
if (lean_obj_tag(x_97) == 0)
{
lean_object* x_68; lean_object* x_69;
x_68 = lean_ctor_get(x_66, 1);
x_69 = lean_nat_add(x_68, x_63);
lean_dec(x_68);
lean_ctor_set(x_66, 1, x_69);
return x_66;
lean_object* x_98;
x_98 = lean_box(0);
return x_98;
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73;
x_70 = lean_ctor_get(x_66, 0);
x_71 = lean_ctor_get(x_66, 1);
lean_inc(x_71);
lean_inc(x_70);
lean_dec(x_66);
x_72 = lean_nat_add(x_71, x_63);
lean_dec(x_71);
x_73 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_73, 0, x_70);
lean_ctor_set(x_73, 1, x_72);
return x_73;
}
}
}
block_33:
uint8_t x_99;
x_99 = !lean_is_exclusive(x_97);
if (x_99 == 0)
{
lean_object* x_8; uint8_t x_9;
lean_dec(x_7);
x_8 = l_Lean_Meta_evalNat___main___closed__9;
x_9 = lean_name_eq(x_4, x_8);
lean_dec(x_4);
if (x_9 == 0)
lean_object* x_100; uint8_t x_101;
x_100 = lean_ctor_get(x_97, 0);
x_101 = !lean_is_exclusive(x_100);
if (x_101 == 0)
{
lean_object* x_10;
lean_dec(x_6);
x_10 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_10, 0, x_1);
lean_ctor_set(x_10, 1, x_5);
return x_10;
lean_object* x_102; lean_object* x_103;
x_102 = lean_ctor_get(x_100, 1);
x_103 = lean_nat_add(x_102, x_93);
lean_dec(x_102);
lean_ctor_set(x_100, 1, x_103);
return x_97;
}
else
{
lean_object* x_11; uint8_t x_12;
x_11 = lean_unsigned_to_nat(4u);
x_12 = lean_nat_dec_eq(x_6, x_11);
if (x_12 == 0)
{
lean_object* x_13;
lean_dec(x_6);
x_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_1);
lean_ctor_set(x_13, 1, x_5);
return x_13;
lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107;
x_104 = lean_ctor_get(x_100, 0);
x_105 = lean_ctor_get(x_100, 1);
lean_inc(x_105);
lean_inc(x_104);
lean_dec(x_100);
x_106 = lean_nat_add(x_105, x_93);
lean_dec(x_105);
x_107 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_107, 0, x_104);
lean_ctor_set(x_107, 1, x_106);
lean_ctor_set(x_97, 0, x_107);
return x_97;
}
}
else
{
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_14 = lean_unsigned_to_nat(3u);
x_15 = lean_nat_sub(x_6, x_14);
x_16 = lean_unsigned_to_nat(1u);
x_17 = lean_nat_sub(x_15, x_16);
lean_dec(x_15);
x_18 = l_Lean_Expr_getRevArg_x21___main(x_1, x_17);
x_19 = l_Lean_Meta_evalNat___main(x_18);
lean_dec(x_18);
if (lean_obj_tag(x_19) == 0)
lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114;
x_108 = lean_ctor_get(x_97, 0);
lean_inc(x_108);
lean_dec(x_97);
x_109 = lean_ctor_get(x_108, 0);
lean_inc(x_109);
x_110 = lean_ctor_get(x_108, 1);
lean_inc(x_110);
if (lean_is_exclusive(x_108)) {
lean_ctor_release(x_108, 0);
lean_ctor_release(x_108, 1);
x_111 = x_108;
} else {
lean_dec_ref(x_108);
x_111 = lean_box(0);
}
x_112 = lean_nat_add(x_110, x_93);
lean_dec(x_110);
if (lean_is_scalar(x_111)) {
x_113 = lean_alloc_ctor(0, 2, 0);
} else {
x_113 = x_111;
}
lean_ctor_set(x_113, 0, x_109);
lean_ctor_set(x_113, 1, x_112);
x_114 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_114, 0, x_113);
return x_114;
}
}
}
}
block_52:
{
lean_object* x_15; uint8_t x_16;
lean_dec(x_14);
x_15 = l_Lean_Meta_evalNat___main___closed__9;
x_16 = lean_name_eq(x_11, x_15);
lean_dec(x_11);
if (x_16 == 0)
{
lean_object* x_17;
lean_dec(x_13);
x_17 = lean_box(0);
x_3 = x_17;
goto block_8;
}
else
{
lean_object* x_18; uint8_t x_19;
x_18 = lean_unsigned_to_nat(4u);
x_19 = lean_nat_dec_eq(x_13, x_18);
if (x_19 == 0)
{
lean_object* x_20;
lean_dec(x_6);
x_20 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_20, 0, x_1);
lean_ctor_set(x_20, 1, x_5);
return x_20;
lean_dec(x_13);
x_20 = lean_box(0);
x_3 = x_20;
goto block_8;
}
else
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; uint8_t x_26;
x_21 = lean_ctor_get(x_19, 0);
lean_inc(x_21);
lean_dec(x_19);
x_22 = lean_nat_sub(x_6, x_5);
lean_dec(x_6);
x_23 = lean_nat_sub(x_22, x_16);
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_21 = lean_unsigned_to_nat(3u);
x_22 = lean_nat_sub(x_13, x_21);
x_23 = lean_unsigned_to_nat(1u);
x_24 = lean_nat_sub(x_22, x_23);
lean_dec(x_22);
x_24 = l_Lean_Expr_getRevArg_x21___main(x_1, x_23);
lean_dec(x_1);
x_25 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_24);
x_26 = !lean_is_exclusive(x_25);
if (x_26 == 0)
x_25 = l_Lean_Expr_getRevArg_x21___main(x_1, x_24);
x_26 = l_Lean_Meta_evalNat___main(x_25);
lean_dec(x_25);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_27; lean_object* x_28;
x_27 = lean_ctor_get(x_25, 1);
x_28 = lean_nat_add(x_27, x_21);
lean_dec(x_21);
lean_dec(x_27);
lean_ctor_set(x_25, 1, x_28);
return x_25;
lean_object* x_27;
lean_dec(x_13);
lean_dec(x_1);
x_27 = lean_box(0);
return x_27;
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32;
x_29 = lean_ctor_get(x_25, 0);
x_30 = lean_ctor_get(x_25, 1);
lean_inc(x_30);
lean_inc(x_29);
lean_dec(x_25);
x_31 = lean_nat_add(x_30, x_21);
lean_dec(x_21);
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33; lean_object* x_34;
x_28 = lean_ctor_get(x_26, 0);
lean_inc(x_28);
lean_dec(x_26);
x_29 = lean_unsigned_to_nat(2u);
x_30 = lean_nat_sub(x_13, x_29);
lean_dec(x_13);
x_31 = lean_nat_sub(x_30, x_23);
lean_dec(x_30);
x_32 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_32, 0, x_29);
lean_ctor_set(x_32, 1, x_31);
return x_32;
}
}
}
}
}
block_59:
x_32 = l_Lean_Expr_getRevArg_x21___main(x_1, x_31);
lean_dec(x_1);
x_33 = 0;
x_34 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_32, x_33);
if (lean_obj_tag(x_34) == 0)
{
lean_object* x_35; uint8_t x_36;
lean_dec(x_34);
x_35 = l_Lean_Meta_evalNat___main___closed__12;
x_36 = lean_name_eq(x_4, x_35);
lean_object* x_35;
lean_dec(x_28);
x_35 = lean_box(0);
return x_35;
}
else
{
uint8_t x_36;
x_36 = !lean_is_exclusive(x_34);
if (x_36 == 0)
{
lean_object* x_37;
x_37 = lean_box(0);
x_7 = x_37;
goto block_33;
lean_object* x_37; uint8_t x_38;
x_37 = lean_ctor_get(x_34, 0);
x_38 = !lean_is_exclusive(x_37);
if (x_38 == 0)
{
lean_object* x_39; lean_object* x_40;
x_39 = lean_ctor_get(x_37, 1);
x_40 = lean_nat_add(x_39, x_28);
lean_dec(x_28);
lean_dec(x_39);
lean_ctor_set(x_37, 1, x_40);
return x_34;
}
else
{
lean_object* x_38; uint8_t x_39;
x_38 = lean_unsigned_to_nat(2u);
x_39 = lean_nat_dec_eq(x_6, x_38);
if (x_39 == 0)
{
lean_object* x_40;
x_40 = lean_box(0);
x_7 = x_40;
goto block_33;
}
else
{
lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45;
lean_dec(x_4);
x_41 = lean_unsigned_to_nat(1u);
x_42 = lean_nat_sub(x_6, x_41);
x_43 = lean_nat_sub(x_42, x_41);
lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44;
x_41 = lean_ctor_get(x_37, 0);
x_42 = lean_ctor_get(x_37, 1);
lean_inc(x_42);
lean_inc(x_41);
lean_dec(x_37);
x_43 = lean_nat_add(x_42, x_28);
lean_dec(x_28);
lean_dec(x_42);
x_44 = l_Lean_Expr_getRevArg_x21___main(x_1, x_43);
x_45 = l_Lean_Meta_evalNat___main(x_44);
lean_dec(x_44);
if (lean_obj_tag(x_45) == 0)
{
lean_object* x_46;
lean_dec(x_6);
x_46 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_46, 0, x_1);
lean_ctor_set(x_46, 1, x_5);
return x_46;
x_44 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_44, 0, x_41);
lean_ctor_set(x_44, 1, x_43);
lean_ctor_set(x_34, 0, x_44);
return x_34;
}
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; uint8_t x_52;
x_47 = lean_ctor_get(x_45, 0);
lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51;
x_45 = lean_ctor_get(x_34, 0);
lean_inc(x_45);
lean_dec(x_34);
x_46 = lean_ctor_get(x_45, 0);
lean_inc(x_46);
x_47 = lean_ctor_get(x_45, 1);
lean_inc(x_47);
lean_dec(x_45);
x_48 = lean_nat_sub(x_6, x_5);
lean_dec(x_6);
x_49 = lean_nat_sub(x_48, x_41);
lean_dec(x_48);
x_50 = l_Lean_Expr_getRevArg_x21___main(x_1, x_49);
lean_dec(x_1);
x_51 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_50);
x_52 = !lean_is_exclusive(x_51);
if (x_52 == 0)
{
lean_object* x_53; lean_object* x_54;
x_53 = lean_ctor_get(x_51, 1);
x_54 = lean_nat_add(x_53, x_47);
if (lean_is_exclusive(x_45)) {
lean_ctor_release(x_45, 0);
lean_ctor_release(x_45, 1);
x_48 = x_45;
} else {
lean_dec_ref(x_45);
x_48 = lean_box(0);
}
x_49 = lean_nat_add(x_47, x_28);
lean_dec(x_28);
lean_dec(x_47);
lean_dec(x_53);
lean_ctor_set(x_51, 1, x_54);
if (lean_is_scalar(x_48)) {
x_50 = lean_alloc_ctor(0, 2, 0);
} else {
x_50 = x_48;
}
lean_ctor_set(x_50, 0, x_46);
lean_ctor_set(x_50, 1, x_49);
x_51 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_51, 0, x_50);
return x_51;
}
else
}
}
}
}
}
block_89:
{
lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58;
x_55 = lean_ctor_get(x_51, 0);
x_56 = lean_ctor_get(x_51, 1);
lean_inc(x_56);
lean_inc(x_55);
lean_dec(x_51);
x_57 = lean_nat_add(x_56, x_47);
lean_dec(x_47);
lean_dec(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;
}
}
}
}
}
lean_object* x_54; uint8_t x_55;
lean_dec(x_53);
x_54 = l_Lean_Meta_evalNat___main___closed__12;
x_55 = lean_name_eq(x_11, x_54);
if (x_55 == 0)
{
lean_object* x_56;
x_56 = lean_box(0);
x_14 = x_56;
goto block_52;
}
else
{
lean_object* x_74; lean_object* x_75;
lean_dec(x_3);
lean_dec(x_2);
x_74 = lean_unsigned_to_nat(0u);
x_75 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_75, 0, x_1);
lean_ctor_set(x_75, 1, x_74);
return x_75;
}
lean_object* x_57; uint8_t x_58;
x_57 = lean_unsigned_to_nat(2u);
x_58 = lean_nat_dec_eq(x_13, x_57);
if (x_58 == 0)
{
lean_object* x_59;
x_59 = lean_box(0);
x_14 = x_59;
goto block_52;
}
else
{
lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64;
lean_dec(x_11);
x_60 = lean_unsigned_to_nat(1u);
x_61 = lean_nat_sub(x_13, x_60);
x_62 = lean_nat_sub(x_61, x_60);
lean_dec(x_61);
x_63 = l_Lean_Expr_getRevArg_x21___main(x_1, x_62);
x_64 = l_Lean_Meta_evalNat___main(x_63);
lean_dec(x_63);
if (lean_obj_tag(x_64) == 0)
{
lean_object* x_65;
lean_dec(x_13);
lean_dec(x_1);
x_65 = lean_box(0);
return x_65;
}
else
{
lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; uint8_t x_70; lean_object* x_71;
x_66 = lean_ctor_get(x_64, 0);
lean_inc(x_66);
lean_dec(x_64);
x_67 = lean_nat_sub(x_13, x_12);
lean_dec(x_13);
x_68 = lean_nat_sub(x_67, x_60);
lean_dec(x_67);
x_69 = l_Lean_Expr_getRevArg_x21___main(x_1, x_68);
lean_dec(x_1);
x_70 = 0;
x_71 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_69, x_70);
if (lean_obj_tag(x_71) == 0)
{
lean_object* x_72;
lean_dec(x_66);
x_72 = lean_box(0);
return x_72;
}
else
{
uint8_t x_73;
x_73 = !lean_is_exclusive(x_71);
if (x_73 == 0)
{
lean_object* x_74; uint8_t x_75;
x_74 = lean_ctor_get(x_71, 0);
x_75 = !lean_is_exclusive(x_74);
if (x_75 == 0)
{
lean_object* x_76; lean_object* x_77;
x_76 = lean_unsigned_to_nat(0u);
x_77 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_77, 0, x_1);
lean_ctor_set(x_77, 1, x_76);
return x_77;
x_76 = lean_ctor_get(x_74, 1);
x_77 = lean_nat_add(x_76, x_66);
lean_dec(x_66);
lean_dec(x_76);
lean_ctor_set(x_74, 1, x_77);
return x_71;
}
else
{
lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81;
x_78 = lean_ctor_get(x_74, 0);
x_79 = lean_ctor_get(x_74, 1);
lean_inc(x_79);
lean_inc(x_78);
lean_dec(x_74);
x_80 = lean_nat_add(x_79, x_66);
lean_dec(x_66);
lean_dec(x_79);
x_81 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_81, 0, x_78);
lean_ctor_set(x_81, 1, x_80);
lean_ctor_set(x_71, 0, x_81);
return x_71;
}
}
else
{
lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88;
x_82 = lean_ctor_get(x_71, 0);
lean_inc(x_82);
lean_dec(x_71);
x_83 = lean_ctor_get(x_82, 0);
lean_inc(x_83);
x_84 = lean_ctor_get(x_82, 1);
lean_inc(x_84);
if (lean_is_exclusive(x_82)) {
lean_ctor_release(x_82, 0);
lean_ctor_release(x_82, 1);
x_85 = x_82;
} else {
lean_dec_ref(x_82);
x_85 = lean_box(0);
}
x_86 = lean_nat_add(x_84, x_66);
lean_dec(x_66);
lean_dec(x_84);
if (lean_is_scalar(x_85)) {
x_87 = lean_alloc_ctor(0, 2, 0);
} else {
x_87 = x_85;
}
lean_ctor_set(x_87, 0, x_83);
lean_ctor_set(x_87, 1, x_86);
x_88 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_88, 0, x_87);
return x_88;
}
}
}
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffset(lean_object* x_1) {
}
}
}
}
else
{
lean_object* x_115;
lean_dec(x_10);
lean_dec(x_9);
x_115 = lean_box(0);
x_3 = x_115;
goto block_8;
}
}
else
{
lean_object* x_116;
x_116 = lean_box(0);
x_3 = x_116;
goto block_8;
}
block_8:
{
lean_dec(x_3);
if (x_2 == 0)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = lean_unsigned_to_nat(0u);
x_5 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_5, 0, x_1);
lean_ctor_set(x_5, 1, x_4);
x_6 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
else
{
lean_object* x_7;
lean_dec(x_1);
x_7 = lean_box(0);
return x_7;
}
}
}
}
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_2;
x_2 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_1);
return x_2;
uint8_t x_3; lean_object* x_4;
x_3 = lean_unbox(x_2);
lean_dec(x_2);
x_4 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_3);
return x_4;
}
}
lean_object* l___private_Init_Lean_Meta_Offset_2__isOffset(lean_object* x_1) {
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux(lean_object* x_1, uint8_t x_2) {
_start:
{
lean_object* x_3;
x_3 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_2);
return x_3;
}
}
lean_object* l___private_Init_Lean_Meta_Offset_1__getOffsetAux___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = lean_unbox(x_2);
lean_dec(x_2);
x_4 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux(x_1, x_3);
return x_4;
}
}
lean_object* l___private_Init_Lean_Meta_Offset_2__getOffset(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3;
x_2 = 1;
x_3 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_2);
return x_3;
}
}
lean_object* l___private_Init_Lean_Meta_Offset_3__isOffset(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 5)
@ -1307,12 +1506,11 @@ goto block_17;
}
else
{
lean_object* x_25; lean_object* x_26;
uint8_t x_25; lean_object* x_26;
lean_dec(x_5);
lean_dec(x_3);
x_25 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_1);
x_26 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_26, 0, x_25);
x_25 = 1;
x_26 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_25);
return x_26;
}
}
@ -1344,24 +1542,22 @@ goto block_17;
}
else
{
lean_object* x_33; lean_object* x_34;
uint8_t x_33; lean_object* x_34;
lean_dec(x_5);
lean_dec(x_3);
x_33 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_1);
x_34 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_34, 0, x_33);
x_33 = 1;
x_34 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_33);
return x_34;
}
}
}
else
{
lean_object* x_35; lean_object* x_36;
uint8_t x_35; lean_object* x_36;
lean_dec(x_5);
lean_dec(x_3);
x_35 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_1);
x_36 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_36, 0, x_35);
x_35 = 1;
x_36 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_35);
return x_36;
}
}
@ -1383,10 +1579,9 @@ return x_9;
}
else
{
lean_object* x_10; lean_object* x_11;
x_10 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_1);
x_11 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_11, 0, x_10);
uint8_t x_10; lean_object* x_11;
x_10 = 1;
x_11 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_10);
return x_11;
}
}
@ -1405,10 +1600,9 @@ return x_14;
}
else
{
lean_object* x_15; lean_object* x_16;
x_15 = l___private_Init_Lean_Meta_Offset_1__getOffset___main(x_1);
x_16 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_16, 0, x_15);
uint8_t x_15; lean_object* x_16;
x_15 = 1;
x_16 = l___private_Init_Lean_Meta_Offset_1__getOffsetAux___main(x_1, x_15);
return x_16;
}
}
@ -1432,7 +1626,7 @@ return x_38;
}
}
}
uint8_t l___private_Init_Lean_Meta_Offset_3__isNatZero(lean_object* x_1) {
uint8_t l___private_Init_Lean_Meta_Offset_4__isNatZero(lean_object* x_1) {
_start:
{
lean_object* x_2;
@ -1456,17 +1650,17 @@ return x_6;
}
}
}
lean_object* l___private_Init_Lean_Meta_Offset_3__isNatZero___boxed(lean_object* x_1) {
lean_object* l___private_Init_Lean_Meta_Offset_4__isNatZero___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3;
x_2 = l___private_Init_Lean_Meta_Offset_3__isNatZero(x_1);
x_2 = l___private_Init_Lean_Meta_Offset_4__isNatZero(x_1);
lean_dec(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
lean_object* _init_l___private_Init_Lean_Meta_Offset_4__mkOffset___closed__1() {
lean_object* _init_l___private_Init_Lean_Meta_Offset_5__mkOffset___closed__1() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
@ -1476,7 +1670,7 @@ x_3 = l_Lean_mkConst(x_2, x_1);
return x_3;
}
}
lean_object* l___private_Init_Lean_Meta_Offset_4__mkOffset(lean_object* x_1, lean_object* x_2) {
lean_object* l___private_Init_Lean_Meta_Offset_5__mkOffset(lean_object* x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; uint8_t x_4;
@ -1485,12 +1679,12 @@ x_4 = lean_nat_dec_eq(x_2, x_3);
if (x_4 == 0)
{
uint8_t x_5;
x_5 = l___private_Init_Lean_Meta_Offset_3__isNatZero(x_1);
x_5 = l___private_Init_Lean_Meta_Offset_4__isNatZero(x_1);
if (x_5 == 0)
{
lean_object* x_6; lean_object* x_7; lean_object* x_8;
x_6 = l_Lean_mkNatLit(x_2);
x_7 = l___private_Init_Lean_Meta_Offset_4__mkOffset___closed__1;
x_7 = l___private_Init_Lean_Meta_Offset_5__mkOffset___closed__1;
x_8 = l_Lean_mkAppB(x_7, x_1, x_6);
return x_8;
}
@ -1514,7 +1708,7 @@ _start:
{
lean_object* x_5;
lean_inc(x_1);
x_5 = l___private_Init_Lean_Meta_Offset_2__isOffset(x_1);
x_5 = l___private_Init_Lean_Meta_Offset_3__isOffset(x_1);
if (lean_obj_tag(x_5) == 0)
{
lean_object* x_6;
@ -1539,7 +1733,7 @@ x_10 = lean_ctor_get(x_6, 0);
lean_inc(x_10);
lean_dec(x_6);
lean_inc(x_2);
x_11 = l___private_Init_Lean_Meta_Offset_2__isOffset(x_2);
x_11 = l___private_Init_Lean_Meta_Offset_3__isOffset(x_2);
if (lean_obj_tag(x_11) == 0)
{
lean_object* x_12;
@ -1681,7 +1875,7 @@ x_48 = lean_ctor_get(x_46, 1);
lean_inc(x_48);
lean_dec(x_46);
lean_inc(x_2);
x_49 = l___private_Init_Lean_Meta_Offset_2__isOffset(x_2);
x_49 = l___private_Init_Lean_Meta_Offset_3__isOffset(x_2);
if (lean_obj_tag(x_49) == 0)
{
lean_object* x_50;
@ -1810,7 +2004,7 @@ lean_object* x_82; lean_object* x_83; lean_object* x_84;
x_82 = lean_nat_sub(x_48, x_79);
lean_dec(x_79);
lean_dec(x_48);
x_83 = l___private_Init_Lean_Meta_Offset_4__mkOffset(x_47, x_82);
x_83 = l___private_Init_Lean_Meta_Offset_5__mkOffset(x_47, x_82);
x_84 = l_Lean_Meta_isExprDefEqAux(x_83, x_78, x_3, x_4);
if (lean_obj_tag(x_84) == 0)
{
@ -1874,7 +2068,7 @@ lean_object* x_100; lean_object* x_101; lean_object* x_102;
x_100 = lean_nat_sub(x_79, x_48);
lean_dec(x_48);
lean_dec(x_79);
x_101 = l___private_Init_Lean_Meta_Offset_4__mkOffset(x_78, x_100);
x_101 = l___private_Init_Lean_Meta_Offset_5__mkOffset(x_78, x_100);
x_102 = l_Lean_Meta_isExprDefEqAux(x_47, x_101, x_3, x_4);
if (lean_obj_tag(x_102) == 0)
{
@ -2040,8 +2234,8 @@ l_Lean_Meta_evalNat___main___closed__13 = _init_l_Lean_Meta_evalNat___main___clo
lean_mark_persistent(l_Lean_Meta_evalNat___main___closed__13);
l_Lean_Meta_evalNat___main___closed__14 = _init_l_Lean_Meta_evalNat___main___closed__14();
lean_mark_persistent(l_Lean_Meta_evalNat___main___closed__14);
l___private_Init_Lean_Meta_Offset_4__mkOffset___closed__1 = _init_l___private_Init_Lean_Meta_Offset_4__mkOffset___closed__1();
lean_mark_persistent(l___private_Init_Lean_Meta_Offset_4__mkOffset___closed__1);
l___private_Init_Lean_Meta_Offset_5__mkOffset___closed__1 = _init_l___private_Init_Lean_Meta_Offset_5__mkOffset___closed__1();
lean_mark_persistent(l___private_Init_Lean_Meta_Offset_5__mkOffset___closed__1);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

File diff suppressed because it is too large Load diff

View file

@ -14,13 +14,13 @@
extern "C" {
#endif
lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
lean_object* l_Lean_Meta_checkNotAssigned___closed__1;
extern lean_object* l_Lean_formatDataValue___closed__1;
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* l_Lean_Meta_checkNotAssigned___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_metavar_ctx_is_expr_assigned(lean_object*, lean_object*);
lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*);
extern lean_object* l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
lean_object* l___private_Init_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*);
@ -170,7 +170,7 @@ lean_object* _init_l___private_Init_Lean_Meta_Tactic_Util_1__regTraceClasses___c
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Init_Lean_Meta_Basic_11__regTraceClasses___closed__2;
x_1 = l___private_Init_Lean_Meta_Basic_10__regTraceClasses___closed__2;
x_2 = l___private_Init_Lean_Meta_Tactic_Util_1__regTraceClasses___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Parser.Module
// Imports: Init.Lean.Util.Message Init.Lean.Parser.Command
// Imports: Init.Lean.Message Init.Lean.Parser.Command
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -2999,14 +2999,14 @@ lean_dec(x_1);
return x_3;
}
}
lean_object* initialize_Init_Lean_Util_Message(lean_object*);
lean_object* initialize_Init_Lean_Message(lean_object*);
lean_object* initialize_Init_Lean_Parser_Command(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Parser_Module(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init_Lean_Util_Message(lean_io_mk_world());
res = initialize_Init_Lean_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Lean_Parser_Command(lean_io_mk_world());

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Parser.Parser
// Imports: Init.Lean.Data.Trie Init.Lean.Data.Position Init.Lean.Syntax Init.Lean.ToExpr Init.Lean.Environment Init.Lean.Attributes Init.Lean.Util.Message Init.Lean.Parser.Identifier Init.Lean.Compiler.InitAttr
// Imports: Init.Lean.Data.Trie Init.Lean.Data.Position Init.Lean.Syntax Init.Lean.ToExpr Init.Lean.Environment Init.Lean.Attributes Init.Lean.Message Init.Lean.Parser.Identifier Init.Lean.Compiler.InitAttr
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -36143,7 +36143,7 @@ lean_object* initialize_Init_Lean_Syntax(lean_object*);
lean_object* initialize_Init_Lean_ToExpr(lean_object*);
lean_object* initialize_Init_Lean_Environment(lean_object*);
lean_object* initialize_Init_Lean_Attributes(lean_object*);
lean_object* initialize_Init_Lean_Util_Message(lean_object*);
lean_object* initialize_Init_Lean_Message(lean_object*);
lean_object* initialize_Init_Lean_Parser_Identifier(lean_object*);
lean_object* initialize_Init_Lean_Compiler_InitAttr(lean_object*);
static bool _G_initialized = false;
@ -36169,7 +36169,7 @@ lean_dec_ref(res);
res = initialize_Init_Lean_Attributes(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Lean_Util_Message(lean_io_mk_world());
res = initialize_Init_Lean_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Lean_Parser_Identifier(lean_io_mk_world());

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Util.Sorry
// Imports: Init.Lean.Util.Message
// Imports: Init.Lean.Message
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -910,13 +910,13 @@ x_3 = lean_box(x_2);
return x_3;
}
}
lean_object* initialize_Init_Lean_Util_Message(lean_object*);
lean_object* initialize_Init_Lean_Message(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Util_Sorry(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init_Lean_Util_Message(lean_io_mk_world());
res = initialize_Init_Lean_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_Expr_isSorry___closed__1 = _init_l_Lean_Expr_isSorry___closed__1();

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Util.Trace
// Imports: Init.Lean.Util.Message
// Imports: Init.Lean.Message
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -1887,13 +1887,13 @@ x_6 = lean_register_option(x_4, x_5, x_2);
return x_6;
}
}
lean_object* initialize_Init_Lean_Util_Message(lean_object*);
lean_object* initialize_Init_Lean_Message(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Util_Trace(lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_mk_io_result(lean_box(0));
_G_initialized = true;
res = initialize_Init_Lean_Util_Message(lean_io_mk_world());
res = initialize_Init_Lean_Message(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_checkTraceOption___closed__1 = _init_l_Lean_checkTraceOption___closed__1();