chore: update stage0

This commit is contained in:
Leonardo de Moura 2022-01-03 09:37:18 -08:00
parent e9c112007b
commit bf17eec439
12 changed files with 1655 additions and 1215 deletions

View file

@ -335,7 +335,7 @@ syntax (name := change) "change " term (location)? : tactic
syntax (name := changeWith) "change " term " with " term (location)? : tactic
syntax rwRule := ("← " <|> "<- ")? term
syntax rwRuleSeq := "[" rwRule,+,? "]"
syntax rwRuleSeq := "[" rwRule,*,? "]"
syntax (name := rewriteSeq) "rewrite " (config)? rwRuleSeq (location)? : tactic

View file

@ -603,22 +603,28 @@ def getDoLetVars (doLet : Syntax) : TermElabM (Array Name) :=
-- leading_parser "let " >> optional "mut " >> letDecl
getLetDeclVars doLet[2]
def getDoHaveVar (doHave : Syntax) : Name :=
/-
`leading_parser "have " >> Term.haveDecl`
where
```
haveDecl := leading_parser optIdent >> termParser >> (haveAssign <|> fromTerm <|> byTactic)
optIdent := optional (try (ident >> " : "))
```
-/
let optIdent := doHave[1][0]
def getHaveIdLhsVar (optIdent : Syntax) : Name :=
if optIdent.isNone then
`this
else
optIdent[0].getId
def getDoHaveVars (doHave : Syntax) : TermElabM (Array Name) :=
-- doHave := leading_parser "have " >> Term.haveDecl
-- haveDecl := leading_parser haveIdDecl <|> letPatDecl <|> haveEqnsDecl
let arg := doHave[1][0]
if arg.getKind == ``Lean.Parser.Term.haveIdDecl then
-- haveIdDecl := leading_parser atomic (haveIdLhs >> " := ") >> termParser
-- haveIdLhs := optional (ident >> many (ppSpace >> (simpleBinderWithoutType <|> bracketedBinder))) >> optType
pure #[getHaveIdLhsVar arg[0]]
else if arg.getKind == ``Lean.Parser.Term.letPatDecl then
getLetPatDeclVars arg
else if arg.getKind == ``Lean.Parser.Term.haveEqnsDecl then
-- haveEqnsDecl := leading_parser haveIdLhs >> matchAlts
pure #[getHaveIdLhsVar arg[0]]
else
throwError "unexpected kind of have declaration"
def getDoLetRecVars (doLetRec : Syntax) : TermElabM (Array Name) := do
-- letRecDecls is an array of `(group (optional attributes >> letDecl))`
let letRecDecls := doLetRec[1][0].getSepArgs
@ -1530,9 +1536,9 @@ mutual
checkNotShadowingMutable vars
mkVarDeclCore vars doElem <$> withNewMutableVars vars (isMutableLet doElem) (doSeqToCode doElems)
else if k == ``Lean.Parser.Term.doHave then
let var := getDoHaveVar doElem
checkNotShadowingMutable #[var]
mkVarDeclCore #[var] doElem <$> (doSeqToCode doElems)
let vars ← getDoHaveVars doElem
checkNotShadowingMutable vars
mkVarDeclCore vars doElem <$> (doSeqToCode doElems)
else if k == ``Lean.Parser.Term.doLetRec then
let vars ← getDoLetRecVars doElem
checkNotShadowingMutable vars

View file

@ -129,16 +129,20 @@ def addNonRec (preDef : PreDefinition) : TermElabM Unit := do
/--
Eliminate recursive application annotations containing syntax. These annotations are used by the well-founded recursion module
to produce better error messages. -/
def eraseRecAppSyntax (e : Expr) : CoreM Expr :=
def eraseRecAppSyntaxExpr (e : Expr) : CoreM Expr :=
Core.transform e (post := fun e => TransformStep.done <| if (getRecAppSyntax? e).isSome then e.mdataExpr! else e)
def addAndCompileUnsafe (preDefs : Array PreDefinition) (safety := DefinitionSafety.unsafe) : TermElabM Unit :=
def eraseRecAppSyntax (preDef : PreDefinition) : CoreM PreDefinition :=
return { preDef with value := (← eraseRecAppSyntaxExpr preDef.value) }
def addAndCompileUnsafe (preDefs : Array PreDefinition) (safety := DefinitionSafety.unsafe) : TermElabM Unit := do
let preDefs ← preDefs.mapM fun d => eraseRecAppSyntax d
withRef preDefs[0].ref do
let decl := Declaration.mutualDefnDecl <| ← preDefs.toList.mapM fun preDef => return {
name := preDef.declName
levelParams := preDef.levelParams
type := preDef.type
value := (← eraseRecAppSyntax preDef.value)
value := preDef.value
safety := safety
hints := ReducibilityHints.opaque
}

View file

@ -81,11 +81,13 @@ def structuralRecursion (preDefs : Array PreDefinition) : TermElabM Unit :=
throwError "structural recursion does not handle mutually recursive functions"
else do
let ((recArgPos, preDefNonRec), state) ← run <| elimRecursion preDefs[0]
let preDefNonRec ← eraseRecAppSyntax preDefNonRec
let preDef ← eraseRecAppSyntax preDefs[0]
state.addMatchers.forM liftM
mapError (addNonRec preDefNonRec) (fun msg => m!"structural recursion failed, produced type incorrect term{indentD msg}")
addAndCompilePartialRec preDefs
addSmartUnfoldingDef preDefs[0] recArgPos
registerEqnsInfo preDefs[0] recArgPos
addAndCompilePartialRec #[preDef]
addSmartUnfoldingDef preDef recArgPos
registerEqnsInfo preDef recArgPos
builtin_initialize
registerTraceClass `Elab.definition.structural

View file

@ -56,6 +56,7 @@ def wfRecursion (preDefs : Array PreDefinition) (wfStx? : Option Syntax) (decrTa
let preDefNonRec ← withoutModifyingEnv do
addAsAxiom unaryPreDef
mkFix unaryPreDef wfRel decrTactic?
let preDefNonRec ← eraseRecAppSyntax preDefNonRec
trace[Elab.definition.wf] ">> {preDefNonRec.declName}"
addNonRec preDefNonRec
addNonRecPreDefs preDefs preDefNonRec

View file

@ -35037,7 +35037,7 @@ x_1 = l_Lean_Parser_Tactic_rwRule;
x_2 = l___aux__Init__Notation______macroRules__stx___x3c_x7c_x3e____1___closed__7;
x_3 = l_term_x5b___x5d___closed__6;
x_4 = 1;
x_5 = lean_alloc_ctor(11, 3, 1);
x_5 = lean_alloc_ctor(10, 3, 1);
lean_ctor_set(x_5, 0, x_1);
lean_ctor_set(x_5, 1, x_2);
lean_ctor_set(x_5, 2, x_3);

View file

@ -4301,11 +4301,11 @@ x_3 = lean_ctor_get(x_1, 0);
x_4 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_5 = lean_ctor_get(x_2, 0);
x_6 = lean_ctor_get_uint32(x_2, sizeof(void*)*1);
x_7 = lean_uint32_dec_lt(x_4, x_6);
x_7 = lean_int_dec_lt(x_3, x_5);
if (x_7 == 0)
{
uint8_t x_8;
x_8 = lean_uint32_dec_eq(x_4, x_6);
x_8 = lean_int_dec_eq(x_3, x_5);
if (x_8 == 0)
{
uint8_t x_9;
@ -4315,11 +4315,11 @@ return x_9;
else
{
uint8_t x_10;
x_10 = lean_int_dec_lt(x_3, x_5);
x_10 = lean_uint32_dec_lt(x_4, x_6);
if (x_10 == 0)
{
uint8_t x_11;
x_11 = lean_int_dec_eq(x_3, x_5);
x_11 = lean_uint32_dec_eq(x_4, x_6);
if (x_11 == 0)
{
uint8_t x_12;

View file

@ -145,6 +145,7 @@ static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_liftMethodForbidd
static lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__29;
lean_object* l_Lean_SourceInfo_fromRef(lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__5;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_Kind_noConfusion___rarg___lambda__1(lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__8___boxed(lean_object**);
@ -231,6 +232,7 @@ static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__2
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getPatternsVarsEx(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_getPatternVarsEx___spec__1___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_mkNestedKind___closed__2;
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__3;
LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at___aux__Init__Notation______macroRules__precMax__1___spec__1(lean_object*, lean_object*);
LEAN_EXPORT uint8_t l_Lean_Elab_Term_Do_hasBreakContinue___lambda__1(lean_object*);
@ -313,6 +315,7 @@ lean_object* l_Lean_Elab_Term_getMainModule___rarg(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Term_Do_concat___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkUnit___closed__6;
uint8_t lean_usize_dec_lt(size_t, size_t);
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__6;
static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__27;
LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_expandDoIf_x3f___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__35;
@ -513,6 +516,7 @@ static lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__4___closed
static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__22;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_instInhabitedAlt___rarg(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_addFreshJP___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__2;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_mkIte___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkPureUnit___closed__2;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -539,6 +543,7 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_actionTerminalToTerm___closed__16
static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doReassignArrowToCode___lambda__1___closed__3;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_homogenize(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__29;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_hasExitPoint(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_hasReturn(lean_object*);
@ -548,6 +553,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Term_Do_ToCodeBlo
lean_object* l_Lean_replaceRef(lean_object*, lean_object*);
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_matchNestedTermResult___closed__10;
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__1;
LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Term_Do_attachJPs___spec__1(lean_object*, size_t, size_t, lean_object*);
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkUnit___closed__9;
static lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___spec__2___closed__5;
@ -616,6 +622,7 @@ static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkUnit___close
static lean_object* l_Lean_Elab_Term_Do_ToTerm_declToTerm___closed__4;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__12(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_Lean_Elab_Term_Do_ToCodeBlock_tryCatchPred___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__4;
static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doForToCode___lambda__1___closed__30;
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__20;
static lean_object* l_Lean_Elab_Term_Do_concat___closed__1;
@ -651,6 +658,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Term_Do_mkJmp___s
lean_object* l_Lean_Macro_throwErrorAt___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Environment_contains(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_toDoElem___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_Do_pullExitPointsAux___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_ToCodeBlock_doMatchToCode___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_expandOptType(lean_object*, lean_object*);
@ -690,6 +698,7 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_mkNestedKind___closed__1;
LEAN_EXPORT lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_seqToTerm___closed__10;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_checkLetArrowRHS(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar(lean_object*);
static lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__8___closed__14;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_ToTerm_mkUVarTuple___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getLetEqnsDeclVar___boxed(lean_object*);
@ -702,7 +711,6 @@ uint8_t l_Array_isEmpty___rarg(lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_seqToTerm___closed__5;
LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___boxed(lean_object*);
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkMonadAlias___closed__1;
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__3;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkSingletonDoSeq(lean_object*);
@ -712,7 +720,6 @@ extern lean_object* l_Lean_instInhabitedSyntax;
static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doForToCode___lambda__1___closed__11;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkReassignCore___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__23;
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___closed__1;
LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Term_Do_concat___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Std_RBNode_erase___at_Lean_Elab_Term_Do_eraseVars___spec__2___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__3(uint8_t, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -843,7 +850,7 @@ LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__L
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_pullExitPointsAux___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__8___closed__10;
static lean_object* l_Lean_Elab_Term_Do_ToTerm_breakToTerm___closed__15;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28011_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28082_(lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___lambda__1___closed__1;
static lean_object* l_Lean_Elab_Term_Do_pullExitPointsAux___lambda__1___closed__9;
static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___closed__3;
@ -1089,7 +1096,6 @@ lean_object* lean_panic_fn(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__39;
static lean_object* l_Lean_Elab_Term_Do_ToTerm_reassignToTerm___closed__5;
static lean_object* l___regBuiltin_Lean_Elab_Term_expandTermTry_declRange___closed__7;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar(lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getLetDeclVars___closed__2;
LEAN_EXPORT uint8_t l_Lean_Elab_Term_Do_hasExitPoint___lambda__1(lean_object*);
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -1198,6 +1204,7 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_reassignToTerm___closed__4;
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__2(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_simp_macro_scopes(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_hasTerminalAction___lambda__1___boxed(lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2;
static lean_object* l_Lean_Elab_Term_Do_ToTerm_actionTerminalToTerm___closed__17;
static lean_object* l_Lean_Elab_Term_Do_instInhabitedCode___closed__1;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_expandTermUnless(lean_object*, lean_object*, lean_object*);
@ -1212,6 +1219,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_mkNestedKind(uint8_t, uint8_
static lean_object* l___regBuiltin_Lean_Elab_Term_expandTermFor_declRange___closed__5;
static lean_object* l_Lean_Elab_Term_Do_ToTerm_reassignToTerm___closed__2;
static lean_object* l_Lean_Elab_Term_Do_ToTerm_matchNestedTermResult___closed__23;
static lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1;
uint8_t l_List_isEmpty___rarg(lean_object*);
static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_Do_ToCodeBlock_checkReassignable___spec__2___closed__1;
static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__7;
@ -1234,6 +1242,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoLetArrowVars(lean_object*, lea
static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__19;
static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_Do_ToCodeBlock_checkReassignable___spec__2___closed__2;
static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doForToCode___closed__3;
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___boxed(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__10(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__2;
static lean_object* l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__2;
@ -1253,7 +1262,6 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__27;
static lean_object* l___regBuiltin_Lean_Elab_Term_Do_elabDo_declRange___closed__4;
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__3___closed__10;
lean_object* l_Lean_MonadRef_mkInfoFromRefPos___rarg(lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___closed__2;
static lean_object* l_Lean_Elab_Term_Do_ToTerm_mkIte___closed__4;
LEAN_EXPORT uint8_t l___private_Lean_Elab_Do_0__Lean_Elab_Term_liftMethodDelimiter(lean_object*);
static lean_object* l_Lean_Elab_Term_Do_getDoReassignVars___closed__1;
@ -11847,7 +11855,7 @@ lean_dec(x_1);
return x_9;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__1() {
static lean_object* _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1() {
_start:
{
lean_object* x_1;
@ -11855,53 +11863,199 @@ x_1 = lean_mk_string("this");
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__2() {
static lean_object* _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = lean_box(0);
x_2 = l_Lean_Elab_Term_Do_getDoHaveVar___closed__1;
x_2 = l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6;
x_2 = lean_unsigned_to_nat(1u);
x_3 = l_Lean_Syntax_getArg(x_1, x_2);
x_4 = lean_unsigned_to_nat(0u);
x_5 = l_Lean_Syntax_getArg(x_3, x_4);
lean_dec(x_3);
x_6 = l_Lean_Syntax_isNone(x_5);
if (x_6 == 0)
uint8_t x_2;
x_2 = l_Lean_Syntax_isNone(x_1);
if (x_2 == 0)
{
lean_object* x_7; lean_object* x_8;
x_7 = l_Lean_Syntax_getArg(x_5, x_4);
lean_dec(x_5);
x_8 = l_Lean_Syntax_getId(x_7);
lean_dec(x_7);
return x_8;
lean_object* x_3; lean_object* x_4; lean_object* x_5;
x_3 = lean_unsigned_to_nat(0u);
x_4 = l_Lean_Syntax_getArg(x_1, x_3);
x_5 = l_Lean_Syntax_getId(x_4);
lean_dec(x_4);
return x_5;
}
else
{
lean_object* x_9;
lean_dec(x_5);
x_9 = l_Lean_Elab_Term_Do_getDoHaveVar___closed__2;
return x_9;
lean_object* x_6;
x_6 = l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2;
return x_6;
}
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___boxed(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Elab_Term_Do_getDoHaveVar(x_1);
x_2 = l_Lean_Elab_Term_Do_getHaveIdLhsVar(x_1);
lean_dec(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("haveIdDecl");
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__2() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__6;
x_2 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__1;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("haveEqnsDecl");
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__4() {
_start:
{
lean_object* x_1; lean_object* x_2; lean_object* x_3;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__6;
x_2 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__3;
x_3 = lean_name_mk_string(x_1, x_2);
return x_3;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__5() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("unexpected kind of have declaration");
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__6() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__5;
x_2 = l_Lean_stringToMessageData(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15;
x_9 = lean_unsigned_to_nat(1u);
x_10 = l_Lean_Syntax_getArg(x_1, x_9);
x_11 = lean_unsigned_to_nat(0u);
x_12 = l_Lean_Syntax_getArg(x_10, x_11);
lean_dec(x_10);
lean_inc(x_12);
x_13 = l_Lean_Syntax_getKind(x_12);
x_14 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__2;
x_15 = lean_name_eq(x_13, x_14);
if (x_15 == 0)
{
lean_object* x_16; uint8_t x_17;
x_16 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_letDeclArgHasBinders___closed__2;
x_17 = lean_name_eq(x_13, x_16);
if (x_17 == 0)
{
lean_object* x_18; uint8_t x_19;
x_18 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__4;
x_19 = lean_name_eq(x_13, x_18);
lean_dec(x_13);
if (x_19 == 0)
{
lean_object* x_20; lean_object* x_21;
lean_dec(x_12);
x_20 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__6;
x_21 = l_Lean_throwError___at_Lean_Elab_Term_Do_getLetDeclVars___spec__1(x_20, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
return x_21;
}
else
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_22 = l_Lean_Syntax_getArg(x_12, x_11);
lean_dec(x_12);
x_23 = l_Lean_Elab_Term_Do_getHaveIdLhsVar(x_22);
lean_dec(x_22);
x_24 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_extractBind___lambda__1___closed__3;
x_25 = lean_array_push(x_24, x_23);
x_26 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_26, 0, x_25);
lean_ctor_set(x_26, 1, x_8);
return x_26;
}
}
else
{
lean_object* x_27;
lean_dec(x_13);
x_27 = l_Lean_Elab_Term_Do_getLetPatDeclVars(x_12, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
lean_dec(x_12);
return x_27;
}
}
else
{
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32;
lean_dec(x_13);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_28 = l_Lean_Syntax_getArg(x_12, x_11);
lean_dec(x_12);
x_29 = l_Lean_Elab_Term_Do_getHaveIdLhsVar(x_28);
lean_dec(x_28);
x_30 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_extractBind___lambda__1___closed__3;
x_31 = lean_array_push(x_30, x_29);
x_32 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_32, 0, x_31);
lean_ctor_set(x_32, 1, x_8);
return x_32;
}
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9;
x_9 = l_Lean_Elab_Term_Do_getDoHaveVars(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
lean_dec(x_1);
return x_9;
}
}
LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_getDoLetRecVars___spec__1(size_t x_1, size_t x_2, lean_object* x_3) {
_start:
{
@ -15312,7 +15466,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__2;
x_3 = lean_unsigned_to_nat(760u);
x_3 = lean_unsigned_to_nat(766u);
x_4 = lean_unsigned_to_nat(13u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -16697,7 +16851,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__21;
x_3 = lean_unsigned_to_nat(879u);
x_3 = lean_unsigned_to_nat(885u);
x_4 = lean_unsigned_to_nat(28u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -17749,7 +17903,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__1;
x_3 = lean_unsigned_to_nat(888u);
x_3 = lean_unsigned_to_nat(894u);
x_4 = lean_unsigned_to_nat(28u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -18001,7 +18155,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__1;
x_3 = lean_unsigned_to_nat(892u);
x_3 = lean_unsigned_to_nat(898u);
x_4 = lean_unsigned_to_nat(28u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -18734,7 +18888,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_breakToTerm___closed__1;
x_3 = lean_unsigned_to_nat(900u);
x_3 = lean_unsigned_to_nat(906u);
x_4 = lean_unsigned_to_nat(28u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -18820,7 +18974,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_breakToTerm___closed__1;
x_3 = lean_unsigned_to_nat(904u);
x_3 = lean_unsigned_to_nat(910u);
x_4 = lean_unsigned_to_nat(28u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -19702,7 +19856,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_actionTerminalToTerm___closed__15;
x_3 = lean_unsigned_to_nat(915u);
x_3 = lean_unsigned_to_nat(921u);
x_4 = lean_unsigned_to_nat(28u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -23666,7 +23820,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_mkNestedKind___closed__1;
x_3 = lean_unsigned_to_nat(1062u);
x_3 = lean_unsigned_to_nat(1068u);
x_4 = lean_unsigned_to_nat(27u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -23872,7 +24026,7 @@ _start:
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1;
x_2 = l_Lean_Elab_Term_Do_ToTerm_matchNestedTermResult___closed__1;
x_3 = lean_unsigned_to_nat(1118u);
x_3 = lean_unsigned_to_nat(1124u);
x_4 = lean_unsigned_to_nat(27u);
x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3;
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
@ -32062,12 +32216,24 @@ return x_195;
}
else
{
lean_object* x_196; lean_object* x_197; lean_object* x_198; lean_object* x_199;
lean_object* x_196;
lean_dec(x_46);
x_196 = l_Lean_Elab_Term_Do_getDoHaveVar(x_39);
x_197 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_extractBind___lambda__1___closed__3;
x_198 = lean_array_push(x_197, x_196);
x_199 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_198, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_37);
lean_inc(x_11);
lean_inc(x_23);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
x_196 = l_Lean_Elab_Term_Do_getDoHaveVars(x_39, x_6, x_7, x_8, x_9, x_23, x_11, x_37);
if (lean_obj_tag(x_196) == 0)
{
lean_object* x_197; lean_object* x_198; lean_object* x_199;
x_197 = lean_ctor_get(x_196, 0);
lean_inc(x_197);
x_198 = lean_ctor_get(x_196, 1);
lean_inc(x_198);
lean_dec(x_196);
x_199 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_197, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_198);
if (lean_obj_tag(x_199) == 0)
{
lean_object* x_200; lean_object* x_201;
@ -32083,7 +32249,7 @@ lean_inc(x_202);
x_203 = lean_ctor_get(x_201, 1);
lean_inc(x_203);
lean_dec(x_201);
x_204 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_198, x_39, x_202);
x_204 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_197, x_39, x_202);
x_205 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_205, 0, x_204);
lean_ctor_set(x_205, 1, x_203);
@ -32092,7 +32258,7 @@ return x_205;
else
{
lean_object* x_206; lean_object* x_207; lean_object* x_208;
lean_dec(x_198);
lean_dec(x_197);
lean_dec(x_39);
x_206 = lean_ctor_get(x_201, 0);
lean_inc(x_206);
@ -32108,7 +32274,7 @@ return x_208;
else
{
lean_object* x_209; lean_object* x_210; lean_object* x_211;
lean_dec(x_198);
lean_dec(x_197);
lean_dec(x_39);
lean_dec(x_23);
lean_dec(x_11);
@ -32129,73 +32295,9 @@ lean_ctor_set(x_211, 1, x_210);
return x_211;
}
}
}
else
{
lean_object* x_212;
lean_dec(x_46);
lean_inc(x_11);
lean_inc(x_23);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
x_212 = l_Lean_Elab_Term_Do_getDoLetVars(x_39, x_6, x_7, x_8, x_9, x_23, x_11, x_37);
if (lean_obj_tag(x_212) == 0)
{
lean_object* x_213; lean_object* x_214; lean_object* x_215;
x_213 = lean_ctor_get(x_212, 0);
lean_inc(x_213);
x_214 = lean_ctor_get(x_212, 1);
lean_inc(x_214);
lean_dec(x_212);
x_215 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_213, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_214);
if (lean_obj_tag(x_215) == 0)
{
lean_object* x_216; uint8_t x_217; lean_object* x_218; lean_object* x_219;
x_216 = lean_ctor_get(x_215, 1);
lean_inc(x_216);
lean_dec(x_215);
lean_inc(x_39);
x_217 = l_Lean_Elab_Term_Do_isMutableLet(x_39);
x_218 = lean_alloc_closure((void*)(l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode), 9, 1);
lean_closure_set(x_218, 0, x_3);
lean_inc(x_213);
x_219 = l_Lean_Elab_Term_Do_ToCodeBlock_withNewMutableVars___rarg(x_213, x_217, x_218, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_216);
if (lean_obj_tag(x_219) == 0)
{
lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223;
x_220 = lean_ctor_get(x_219, 0);
lean_inc(x_220);
x_221 = lean_ctor_get(x_219, 1);
lean_inc(x_221);
lean_dec(x_219);
x_222 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_213, x_39, x_220);
x_223 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_223, 0, x_222);
lean_ctor_set(x_223, 1, x_221);
return x_223;
}
else
{
lean_object* x_224; lean_object* x_225; lean_object* x_226;
lean_dec(x_213);
lean_dec(x_39);
x_224 = lean_ctor_get(x_219, 0);
lean_inc(x_224);
x_225 = lean_ctor_get(x_219, 1);
lean_inc(x_225);
lean_dec(x_219);
x_226 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_226, 0, x_224);
lean_ctor_set(x_226, 1, x_225);
return x_226;
}
}
else
{
lean_object* x_227; lean_object* x_228; lean_object* x_229;
lean_dec(x_213);
lean_object* x_212; lean_object* x_213; lean_object* x_214;
lean_dec(x_39);
lean_dec(x_23);
lean_dec(x_11);
@ -32205,11 +32307,74 @@ lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
x_227 = lean_ctor_get(x_215, 0);
lean_inc(x_227);
x_228 = lean_ctor_get(x_215, 1);
lean_inc(x_228);
x_212 = lean_ctor_get(x_196, 0);
lean_inc(x_212);
x_213 = lean_ctor_get(x_196, 1);
lean_inc(x_213);
lean_dec(x_196);
x_214 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_214, 0, x_212);
lean_ctor_set(x_214, 1, x_213);
return x_214;
}
}
}
else
{
lean_object* x_215;
lean_dec(x_46);
lean_inc(x_11);
lean_inc(x_23);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
x_215 = l_Lean_Elab_Term_Do_getDoLetVars(x_39, x_6, x_7, x_8, x_9, x_23, x_11, x_37);
if (lean_obj_tag(x_215) == 0)
{
lean_object* x_216; lean_object* x_217; lean_object* x_218;
x_216 = lean_ctor_get(x_215, 0);
lean_inc(x_216);
x_217 = lean_ctor_get(x_215, 1);
lean_inc(x_217);
lean_dec(x_215);
x_218 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_216, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_217);
if (lean_obj_tag(x_218) == 0)
{
lean_object* x_219; uint8_t x_220; lean_object* x_221; lean_object* x_222;
x_219 = lean_ctor_get(x_218, 1);
lean_inc(x_219);
lean_dec(x_218);
lean_inc(x_39);
x_220 = l_Lean_Elab_Term_Do_isMutableLet(x_39);
x_221 = lean_alloc_closure((void*)(l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode), 9, 1);
lean_closure_set(x_221, 0, x_3);
lean_inc(x_216);
x_222 = l_Lean_Elab_Term_Do_ToCodeBlock_withNewMutableVars___rarg(x_216, x_220, x_221, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_219);
if (lean_obj_tag(x_222) == 0)
{
lean_object* x_223; lean_object* x_224; lean_object* x_225; lean_object* x_226;
x_223 = lean_ctor_get(x_222, 0);
lean_inc(x_223);
x_224 = lean_ctor_get(x_222, 1);
lean_inc(x_224);
lean_dec(x_222);
x_225 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_216, x_39, x_223);
x_226 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_226, 0, x_225);
lean_ctor_set(x_226, 1, x_224);
return x_226;
}
else
{
lean_object* x_227; lean_object* x_228; lean_object* x_229;
lean_dec(x_216);
lean_dec(x_39);
x_227 = lean_ctor_get(x_222, 0);
lean_inc(x_227);
x_228 = lean_ctor_get(x_222, 1);
lean_inc(x_228);
lean_dec(x_222);
x_229 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_229, 0, x_227);
lean_ctor_set(x_229, 1, x_228);
@ -32219,6 +32384,7 @@ return x_229;
else
{
lean_object* x_230; lean_object* x_231; lean_object* x_232;
lean_dec(x_216);
lean_dec(x_39);
lean_dec(x_23);
lean_dec(x_11);
@ -32228,22 +32394,21 @@ lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
x_230 = lean_ctor_get(x_212, 0);
x_230 = lean_ctor_get(x_218, 0);
lean_inc(x_230);
x_231 = lean_ctor_get(x_212, 1);
x_231 = lean_ctor_get(x_218, 1);
lean_inc(x_231);
lean_dec(x_212);
lean_dec(x_218);
x_232 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_232, 0, x_230);
lean_ctor_set(x_232, 1, x_231);
return x_232;
}
}
}
}
else
{
lean_object* x_233; lean_object* x_234; lean_object* x_235;
lean_dec(x_39);
lean_dec(x_23);
lean_dec(x_11);
lean_dec(x_9);
@ -32252,37 +32417,22 @@ lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
x_233 = lean_ctor_get(x_35, 0);
x_233 = lean_ctor_get(x_215, 0);
lean_inc(x_233);
x_234 = lean_ctor_get(x_35, 1);
x_234 = lean_ctor_get(x_215, 1);
lean_inc(x_234);
lean_dec(x_35);
lean_dec(x_215);
x_235 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_235, 0, x_233);
lean_ctor_set(x_235, 1, x_234);
return x_235;
}
}
else
{
lean_object* x_236; lean_object* x_237; lean_object* x_238; lean_object* x_239;
lean_dec(x_2);
x_236 = lean_ctor_get(x_32, 1);
lean_inc(x_236);
lean_dec(x_32);
x_237 = lean_ctor_get(x_33, 0);
lean_inc(x_237);
lean_dec(x_33);
x_238 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_238, 0, x_237);
lean_ctor_set(x_238, 1, x_3);
x_239 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_238, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_236);
return x_239;
}
}
else
{
lean_object* x_240; lean_object* x_241; lean_object* x_242;
lean_object* x_236; lean_object* x_237; lean_object* x_238;
lean_dec(x_23);
lean_dec(x_11);
lean_dec(x_9);
@ -32291,38 +32441,37 @@ lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
x_236 = lean_ctor_get(x_35, 0);
lean_inc(x_236);
x_237 = lean_ctor_get(x_35, 1);
lean_inc(x_237);
lean_dec(x_35);
x_238 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_238, 0, x_236);
lean_ctor_set(x_238, 1, x_237);
return x_238;
}
}
else
{
lean_object* x_239; lean_object* x_240; lean_object* x_241; lean_object* x_242;
lean_dec(x_2);
x_240 = lean_ctor_get(x_32, 0);
lean_inc(x_240);
x_241 = lean_ctor_get(x_32, 1);
lean_inc(x_241);
x_239 = lean_ctor_get(x_32, 1);
lean_inc(x_239);
lean_dec(x_32);
x_242 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_242, 0, x_240);
lean_ctor_set(x_242, 1, x_241);
x_240 = lean_ctor_get(x_33, 0);
lean_inc(x_240);
lean_dec(x_33);
x_241 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_241, 0, x_240);
lean_ctor_set(x_241, 1, x_3);
x_242 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_241, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_239);
return x_242;
}
}
else
{
lean_object* x_243; lean_object* x_244; lean_object* x_245; lean_object* x_246;
lean_dec(x_2);
x_243 = lean_ctor_get(x_28, 1);
lean_inc(x_243);
lean_dec(x_28);
x_244 = lean_ctor_get(x_29, 0);
lean_inc(x_244);
lean_dec(x_29);
x_245 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_245, 0, x_244);
lean_ctor_set(x_245, 1, x_3);
x_246 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_245, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_243);
return x_246;
}
}
else
{
lean_object* x_247; lean_object* x_248; lean_object* x_249;
lean_object* x_243; lean_object* x_244; lean_object* x_245;
lean_dec(x_23);
lean_dec(x_11);
lean_dec(x_9);
@ -32332,14 +32481,31 @@ lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
x_247 = lean_ctor_get(x_28, 0);
lean_inc(x_247);
x_248 = lean_ctor_get(x_28, 1);
lean_inc(x_248);
x_243 = lean_ctor_get(x_32, 0);
lean_inc(x_243);
x_244 = lean_ctor_get(x_32, 1);
lean_inc(x_244);
lean_dec(x_32);
x_245 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_245, 0, x_243);
lean_ctor_set(x_245, 1, x_244);
return x_245;
}
}
else
{
lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249;
lean_dec(x_2);
x_246 = lean_ctor_get(x_28, 1);
lean_inc(x_246);
lean_dec(x_28);
x_249 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_249, 0, x_247);
lean_ctor_set(x_249, 1, x_248);
x_247 = lean_ctor_get(x_29, 0);
lean_inc(x_247);
lean_dec(x_29);
x_248 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_248, 0, x_247);
lean_ctor_set(x_248, 1, x_3);
x_249 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_248, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_246);
return x_249;
}
}
@ -32355,17 +32521,40 @@ lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
x_250 = lean_ctor_get(x_25, 0);
x_250 = lean_ctor_get(x_28, 0);
lean_inc(x_250);
x_251 = lean_ctor_get(x_25, 1);
x_251 = lean_ctor_get(x_28, 1);
lean_inc(x_251);
lean_dec(x_25);
lean_dec(x_28);
x_252 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_252, 0, x_250);
lean_ctor_set(x_252, 1, x_251);
return x_252;
}
}
else
{
lean_object* x_253; lean_object* x_254; lean_object* x_255;
lean_dec(x_23);
lean_dec(x_11);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_3);
lean_dec(x_2);
x_253 = lean_ctor_get(x_25, 0);
lean_inc(x_253);
x_254 = lean_ctor_get(x_25, 1);
lean_inc(x_254);
lean_dec(x_25);
x_255 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_255, 0, x_253);
lean_ctor_set(x_255, 1, x_254);
return x_255;
}
}
}
static lean_object* _init_l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___closed__1() {
_start:
@ -40487,7 +40676,7 @@ x_4 = l_Lean_addBuiltinDeclarationRanges(x_2, x_3, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28011_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28082_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
@ -41628,10 +41817,22 @@ l_Lean_Elab_Term_Do_getLetDeclVars___closed__1 = _init_l_Lean_Elab_Term_Do_getLe
lean_mark_persistent(l_Lean_Elab_Term_Do_getLetDeclVars___closed__1);
l_Lean_Elab_Term_Do_getLetDeclVars___closed__2 = _init_l_Lean_Elab_Term_Do_getLetDeclVars___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_Do_getLetDeclVars___closed__2);
l_Lean_Elab_Term_Do_getDoHaveVar___closed__1 = _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVar___closed__1);
l_Lean_Elab_Term_Do_getDoHaveVar___closed__2 = _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVar___closed__2);
l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1 = _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1);
l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2 = _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2);
l_Lean_Elab_Term_Do_getDoHaveVars___closed__1 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__1);
l_Lean_Elab_Term_Do_getDoHaveVars___closed__2 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__2();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__2);
l_Lean_Elab_Term_Do_getDoHaveVars___closed__3 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__3();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__3);
l_Lean_Elab_Term_Do_getDoHaveVars___closed__4 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__4();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__4);
l_Lean_Elab_Term_Do_getDoHaveVars___closed__5 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__5();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__5);
l_Lean_Elab_Term_Do_getDoHaveVars___closed__6 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__6();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__6);
l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__1 = _init_l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__1();
lean_mark_persistent(l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__1);
l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__2 = _init_l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__2();
@ -42478,7 +42679,7 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_Do_elabDo_declRange___closed_
res = l___regBuiltin_Lean_Elab_Term_Do_elabDo_declRange(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28011_(lean_io_mk_world());
res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28082_(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l___regBuiltin_Lean_Elab_Term_expandTermFor___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_expandTermFor___closed__1();

File diff suppressed because it is too large Load diff

View file

@ -4593,7 +4593,6 @@ lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_3);
lean_inc(x_2);
lean_inc(x_1);
x_20 = l_Lean_Elab_Structural_structuralRecursion(x_1, x_2, x_3, x_5, x_6, x_7, x_8, x_18);
if (lean_obj_tag(x_20) == 0)
{

View file

@ -28,7 +28,7 @@ lean_object* lean_array_uget(lean_object*, size_t);
LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Structural_structuralRecursion___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__6___closed__3;
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1045_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1079_(lean_object*);
static lean_object* l_Lean_Elab_Structural_structuralRecursion___lambda__1___closed__1;
lean_object* lean_st_ref_get(lean_object*, lean_object*);
lean_object* l_Lean_Elab_Structural_mkIndPredBRecOn(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -36,9 +36,11 @@ lean_object* l_Lean_Elab_Structural_findRecArg___rarg(lean_object*, lean_object*
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__1;
uint8_t l_Lean_Expr_isAppOf(lean_object*, lean_object*);
lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*);
lean_object* lean_array_push(lean_object*, lean_object*);
lean_object* lean_array_get_size(lean_object*);
lean_object* l_Lean_MessageData_ofList(lean_object*);
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__8;
lean_object* l_Lean_Elab_eraseRecAppSyntax(lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__4;
uint8_t lean_usize_dec_lt(size_t, size_t);
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__2;
@ -92,6 +94,7 @@ LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_PreDe
lean_object* l_Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*);
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
static lean_object* l_Lean_Elab_Structural_structuralRecursion___closed__5;
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__5___closed__2;
static lean_object* l_Lean_Elab_Structural_structuralRecursion___closed__4;
lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*);
@ -115,6 +118,7 @@ LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__2___closed__3;
static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__6___closed__1;
LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_PreDefinition_Structural_IndPred_0__Lean_Elab_Structural_replaceIndPredRecApps_loop___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
@ -2426,6 +2430,15 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_structuralRecursion___la
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_Structural_structuralRecursion___closed__5() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = lean_unsigned_to_nat(1u);
x_2 = lean_mk_empty_array_with_capacity(x_1);
return x_2;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion(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:
{
@ -2437,7 +2450,6 @@ lean_dec(x_9);
if (x_11 == 0)
{
lean_object* x_12; lean_object* x_13;
lean_dec(x_1);
x_12 = l_Lean_Elab_Structural_structuralRecursion___closed__2;
x_13 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1(x_12, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
lean_dec(x_7);
@ -2464,7 +2476,7 @@ lean_inc(x_4);
x_19 = l_Lean_Elab_Structural_run___rarg(x_17, x_18, x_4, x_5, x_6, x_7, x_8);
if (lean_obj_tag(x_19) == 0)
{
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27; lean_object* x_28;
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_20 = lean_ctor_get(x_19, 0);
lean_inc(x_20);
x_21 = lean_ctor_get(x_20, 0);
@ -2480,215 +2492,176 @@ lean_inc(x_24);
x_25 = lean_ctor_get(x_21, 1);
lean_inc(x_25);
lean_dec(x_21);
x_26 = lean_array_get_size(x_23);
x_27 = lean_nat_dec_lt(x_15, x_26);
if (x_27 == 0)
lean_inc(x_7);
lean_inc(x_6);
x_26 = l_Lean_Elab_eraseRecAppSyntax(x_25, x_6, x_7, x_22);
if (lean_obj_tag(x_26) == 0)
{
lean_object* x_27; lean_object* x_28; lean_object* x_29;
x_27 = lean_ctor_get(x_26, 0);
lean_inc(x_27);
x_28 = lean_ctor_get(x_26, 1);
lean_inc(x_28);
lean_dec(x_26);
lean_inc(x_7);
lean_inc(x_6);
x_29 = l_Lean_Elab_eraseRecAppSyntax(x_16, x_6, x_7, x_28);
if (lean_obj_tag(x_29) == 0)
{
lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33; lean_object* x_34;
x_30 = lean_ctor_get(x_29, 0);
lean_inc(x_30);
x_31 = lean_ctor_get(x_29, 1);
lean_inc(x_31);
lean_dec(x_29);
x_32 = lean_array_get_size(x_23);
x_33 = lean_nat_dec_lt(x_15, x_32);
if (x_33 == 0)
{
lean_dec(x_32);
lean_dec(x_23);
x_28 = x_22;
goto block_50;
x_34 = x_31;
goto block_58;
}
else
{
uint8_t x_51;
x_51 = lean_nat_dec_le(x_26, x_26);
if (x_51 == 0)
uint8_t x_59;
x_59 = lean_nat_dec_le(x_32, x_32);
if (x_59 == 0)
{
lean_dec(x_26);
lean_dec(x_32);
lean_dec(x_23);
x_28 = x_22;
goto block_50;
x_34 = x_31;
goto block_58;
}
else
{
size_t x_52; size_t x_53; lean_object* x_54; lean_object* x_55;
x_52 = 0;
x_53 = lean_usize_of_nat(x_26);
lean_dec(x_26);
x_54 = lean_box(0);
size_t x_60; size_t x_61; lean_object* x_62; lean_object* x_63;
x_60 = 0;
x_61 = lean_usize_of_nat(x_32);
lean_dec(x_32);
x_62 = lean_box(0);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_55 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Structural_structuralRecursion___spec__1(x_23, x_52, x_53, x_54, x_2, x_3, x_4, x_5, x_6, x_7, x_22);
x_63 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Structural_structuralRecursion___spec__1(x_23, x_60, x_61, x_62, x_2, x_3, x_4, x_5, x_6, x_7, x_31);
lean_dec(x_23);
if (lean_obj_tag(x_55) == 0)
if (lean_obj_tag(x_63) == 0)
{
lean_object* x_56;
x_56 = lean_ctor_get(x_55, 1);
lean_inc(x_56);
lean_dec(x_55);
x_28 = x_56;
goto block_50;
lean_object* x_64;
x_64 = lean_ctor_get(x_63, 1);
lean_inc(x_64);
lean_dec(x_63);
x_34 = x_64;
goto block_58;
}
else
{
uint8_t x_57;
lean_dec(x_25);
uint8_t x_65;
lean_dec(x_30);
lean_dec(x_27);
lean_dec(x_24);
lean_dec(x_16);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_57 = !lean_is_exclusive(x_55);
if (x_57 == 0)
x_65 = !lean_is_exclusive(x_63);
if (x_65 == 0)
{
return x_55;
return x_63;
}
else
{
lean_object* x_58; lean_object* x_59; lean_object* x_60;
x_58 = lean_ctor_get(x_55, 0);
x_59 = lean_ctor_get(x_55, 1);
lean_inc(x_59);
lean_inc(x_58);
lean_dec(x_55);
x_60 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_60, 0, x_58);
lean_ctor_set(x_60, 1, x_59);
return x_60;
lean_object* x_66; lean_object* x_67; lean_object* x_68;
x_66 = lean_ctor_get(x_63, 0);
x_67 = lean_ctor_get(x_63, 1);
lean_inc(x_67);
lean_inc(x_66);
lean_dec(x_63);
x_68 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_68, 0, x_66);
lean_ctor_set(x_68, 1, x_67);
return x_68;
}
}
}
}
block_50:
block_58:
{
lean_object* x_29; lean_object* x_30; lean_object* x_31;
lean_object* x_35; lean_object* x_36; lean_object* x_37;
lean_inc(x_3);
lean_inc(x_2);
x_29 = lean_alloc_closure((void*)(l_Lean_Elab_addNonRec), 8, 3);
lean_closure_set(x_29, 0, x_25);
lean_closure_set(x_29, 1, x_2);
lean_closure_set(x_29, 2, x_3);
x_30 = l_Lean_Elab_Structural_structuralRecursion___closed__4;
x_35 = lean_alloc_closure((void*)(l_Lean_Elab_addNonRec), 8, 3);
lean_closure_set(x_35, 0, x_27);
lean_closure_set(x_35, 1, x_2);
lean_closure_set(x_35, 2, x_3);
x_36 = l_Lean_Elab_Structural_structuralRecursion___closed__4;
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_31 = l_Lean_Meta_mapErrorImp___rarg(x_29, x_30, x_4, x_5, x_6, x_7, x_28);
if (lean_obj_tag(x_31) == 0)
x_37 = l_Lean_Meta_mapErrorImp___rarg(x_35, x_36, x_4, x_5, x_6, x_7, x_34);
if (lean_obj_tag(x_37) == 0)
{
lean_object* x_32; lean_object* x_33;
x_32 = lean_ctor_get(x_31, 1);
lean_inc(x_32);
lean_dec(x_31);
lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41;
x_38 = lean_ctor_get(x_37, 1);
lean_inc(x_38);
lean_dec(x_37);
x_39 = l_Lean_Elab_Structural_structuralRecursion___closed__5;
lean_inc(x_30);
x_40 = lean_array_push(x_39, x_30);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
lean_inc(x_3);
lean_inc(x_2);
x_33 = l_Lean_Elab_addAndCompilePartialRec(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_32);
if (lean_obj_tag(x_33) == 0)
x_41 = l_Lean_Elab_addAndCompilePartialRec(x_40, x_2, x_3, x_4, x_5, x_6, x_7, x_38);
if (lean_obj_tag(x_41) == 0)
{
lean_object* x_34; lean_object* x_35;
x_34 = lean_ctor_get(x_33, 1);
lean_inc(x_34);
lean_dec(x_33);
lean_object* x_42; lean_object* x_43;
x_42 = lean_ctor_get(x_41, 1);
lean_inc(x_42);
lean_dec(x_41);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_24);
lean_inc(x_16);
x_35 = l_Lean_Elab_Structural_addSmartUnfoldingDef(x_16, x_24, x_2, x_3, x_4, x_5, x_6, x_7, x_34);
if (lean_obj_tag(x_35) == 0)
lean_inc(x_30);
x_43 = l_Lean_Elab_Structural_addSmartUnfoldingDef(x_30, x_24, x_2, x_3, x_4, x_5, x_6, x_7, x_42);
if (lean_obj_tag(x_43) == 0)
{
lean_object* x_36; lean_object* x_37;
x_36 = lean_ctor_get(x_35, 1);
lean_inc(x_36);
lean_dec(x_35);
x_37 = l_Lean_Elab_Structural_registerEqnsInfo(x_16, x_24, x_6, x_7, x_36);
lean_dec(x_7);
lean_dec(x_6);
return x_37;
}
else
{
uint8_t x_38;
lean_dec(x_24);
lean_dec(x_16);
lean_dec(x_7);
lean_dec(x_6);
x_38 = !lean_is_exclusive(x_35);
if (x_38 == 0)
{
return x_35;
}
else
{
lean_object* x_39; lean_object* x_40; lean_object* x_41;
x_39 = lean_ctor_get(x_35, 0);
x_40 = lean_ctor_get(x_35, 1);
lean_inc(x_40);
lean_inc(x_39);
lean_dec(x_35);
x_41 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_41, 0, x_39);
lean_ctor_set(x_41, 1, x_40);
return x_41;
}
}
}
else
{
uint8_t x_42;
lean_dec(x_24);
lean_dec(x_16);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_42 = !lean_is_exclusive(x_33);
if (x_42 == 0)
{
return x_33;
}
else
{
lean_object* x_43; lean_object* x_44; lean_object* x_45;
x_43 = lean_ctor_get(x_33, 0);
x_44 = lean_ctor_get(x_33, 1);
lean_object* x_44; lean_object* x_45;
x_44 = lean_ctor_get(x_43, 1);
lean_inc(x_44);
lean_inc(x_43);
lean_dec(x_33);
x_45 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_45, 0, x_43);
lean_ctor_set(x_45, 1, x_44);
lean_dec(x_43);
x_45 = l_Lean_Elab_Structural_registerEqnsInfo(x_30, x_24, x_6, x_7, x_44);
lean_dec(x_7);
lean_dec(x_6);
return x_45;
}
}
}
else
{
uint8_t x_46;
lean_dec(x_30);
lean_dec(x_24);
lean_dec(x_16);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_46 = !lean_is_exclusive(x_31);
x_46 = !lean_is_exclusive(x_43);
if (x_46 == 0)
{
return x_31;
return x_43;
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49;
x_47 = lean_ctor_get(x_31, 0);
x_48 = lean_ctor_get(x_31, 1);
x_47 = lean_ctor_get(x_43, 0);
x_48 = lean_ctor_get(x_43, 1);
lean_inc(x_48);
lean_inc(x_47);
lean_dec(x_31);
lean_dec(x_43);
x_49 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_49, 0, x_47);
lean_ctor_set(x_49, 1, x_48);
@ -2696,10 +2669,106 @@ return x_49;
}
}
}
else
{
uint8_t x_50;
lean_dec(x_30);
lean_dec(x_24);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_50 = !lean_is_exclusive(x_41);
if (x_50 == 0)
{
return x_41;
}
else
{
uint8_t x_61;
lean_object* x_51; lean_object* x_52; lean_object* x_53;
x_51 = lean_ctor_get(x_41, 0);
x_52 = lean_ctor_get(x_41, 1);
lean_inc(x_52);
lean_inc(x_51);
lean_dec(x_41);
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_54;
lean_dec(x_30);
lean_dec(x_24);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_54 = !lean_is_exclusive(x_37);
if (x_54 == 0)
{
return x_37;
}
else
{
lean_object* x_55; lean_object* x_56; lean_object* x_57;
x_55 = lean_ctor_get(x_37, 0);
x_56 = lean_ctor_get(x_37, 1);
lean_inc(x_56);
lean_inc(x_55);
lean_dec(x_37);
x_57 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_57, 0, x_55);
lean_ctor_set(x_57, 1, x_56);
return x_57;
}
}
}
}
else
{
uint8_t x_69;
lean_dec(x_27);
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_69 = !lean_is_exclusive(x_29);
if (x_69 == 0)
{
return x_29;
}
else
{
lean_object* x_70; lean_object* x_71; lean_object* x_72;
x_70 = lean_ctor_get(x_29, 0);
x_71 = lean_ctor_get(x_29, 1);
lean_inc(x_71);
lean_inc(x_70);
lean_dec(x_29);
x_72 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_72, 0, x_70);
lean_ctor_set(x_72, 1, x_71);
return x_72;
}
}
}
else
{
uint8_t x_73;
lean_dec(x_24);
lean_dec(x_23);
lean_dec(x_16);
lean_dec(x_7);
lean_dec(x_6);
@ -2707,24 +2776,53 @@ lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_61 = !lean_is_exclusive(x_19);
if (x_61 == 0)
x_73 = !lean_is_exclusive(x_26);
if (x_73 == 0)
{
return x_26;
}
else
{
lean_object* x_74; lean_object* x_75; lean_object* x_76;
x_74 = lean_ctor_get(x_26, 0);
x_75 = lean_ctor_get(x_26, 1);
lean_inc(x_75);
lean_inc(x_74);
lean_dec(x_26);
x_76 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_76, 0, x_74);
lean_ctor_set(x_76, 1, x_75);
return x_76;
}
}
}
else
{
uint8_t x_77;
lean_dec(x_16);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
x_77 = !lean_is_exclusive(x_19);
if (x_77 == 0)
{
return x_19;
}
else
{
lean_object* x_62; lean_object* x_63; lean_object* x_64;
x_62 = lean_ctor_get(x_19, 0);
x_63 = lean_ctor_get(x_19, 1);
lean_inc(x_63);
lean_inc(x_62);
lean_object* x_78; lean_object* x_79; lean_object* x_80;
x_78 = lean_ctor_get(x_19, 0);
x_79 = lean_ctor_get(x_19, 1);
lean_inc(x_79);
lean_inc(x_78);
lean_dec(x_19);
x_64 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_64, 0, x_62);
lean_ctor_set(x_64, 1, x_63);
return x_64;
x_80 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_80, 0, x_78);
lean_ctor_set(x_80, 1, x_79);
return x_80;
}
}
}
@ -2745,7 +2843,16 @@ lean_dec(x_1);
return x_14;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1045_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) {
_start:
{
lean_object* x_9;
x_9 = l_Lean_Elab_Structural_structuralRecursion(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8);
lean_dec(x_1);
return x_9;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1079_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
@ -2845,7 +2952,9 @@ l_Lean_Elab_Structural_structuralRecursion___closed__3 = _init_l_Lean_Elab_Struc
lean_mark_persistent(l_Lean_Elab_Structural_structuralRecursion___closed__3);
l_Lean_Elab_Structural_structuralRecursion___closed__4 = _init_l_Lean_Elab_Structural_structuralRecursion___closed__4();
lean_mark_persistent(l_Lean_Elab_Structural_structuralRecursion___closed__4);
res = l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1045_(lean_io_mk_world());
l_Lean_Elab_Structural_structuralRecursion___closed__5 = _init_l_Lean_Elab_Structural_structuralRecursion___closed__5();
lean_mark_persistent(l_Lean_Elab_Structural_structuralRecursion___closed__5);
res = l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1079_(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_io_result_mk_ok(lean_box(0));

View file

@ -34,6 +34,7 @@ static lean_object* l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinitio
lean_object* lean_array_get_size(lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* l_Lean_Elab_WF_packMutual(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_eraseRecAppSyntax(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_Term_instInhabitedTermElabM(lean_object*);
uint8_t lean_usize_dec_lt(size_t, size_t);
LEAN_EXPORT lean_object* l_Lean_Elab_wfRecursion___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -55,7 +56,7 @@ lean_object* l_Lean_Elab_WF_mkUnaryArg_go___boxed(lean_object*, lean_object*, le
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Meta_mkLambdaFVars(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs_mkSum___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_881_(lean_object*);
LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_895_(lean_object*);
static lean_object* l_Lean_Expr_withAppAux___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs_mkSum___spec__1___closed__10;
extern lean_object* l_Lean_Elab_instInhabitedPreDefinition;
lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -1795,7 +1796,7 @@ lean_inc(x_4);
x_38 = l_Lean_Elab_WF_mkFix(x_25, x_30, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_37);
if (lean_obj_tag(x_38) == 0)
{
lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; uint8_t x_44; lean_object* x_45; lean_object* x_58; lean_object* x_59; lean_object* x_60; uint8_t x_61;
lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43;
x_39 = lean_ctor_get(x_38, 0);
lean_inc(x_39);
x_40 = lean_ctor_get(x_38, 1);
@ -1805,113 +1806,115 @@ x_41 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6,
x_42 = lean_ctor_get(x_41, 1);
lean_inc(x_42);
lean_dec(x_41);
x_43 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__6;
x_58 = lean_st_ref_get(x_9, x_42);
x_59 = lean_ctor_get(x_58, 0);
lean_inc(x_59);
x_60 = lean_ctor_get(x_59, 3);
lean_inc(x_60);
lean_dec(x_59);
x_61 = lean_ctor_get_uint8(x_60, sizeof(void*)*1);
lean_dec(x_60);
if (x_61 == 0)
lean_inc(x_9);
lean_inc(x_8);
x_43 = l_Lean_Elab_eraseRecAppSyntax(x_39, x_8, x_9, x_42);
if (lean_obj_tag(x_43) == 0)
{
lean_object* x_62; uint8_t x_63;
x_62 = lean_ctor_get(x_58, 1);
lean_object* x_44; lean_object* x_45; lean_object* x_46; uint8_t x_47; lean_object* x_48; lean_object* x_61; lean_object* x_62; lean_object* x_63; uint8_t x_64;
x_44 = lean_ctor_get(x_43, 0);
lean_inc(x_44);
x_45 = lean_ctor_get(x_43, 1);
lean_inc(x_45);
lean_dec(x_43);
x_46 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__6;
x_61 = lean_st_ref_get(x_9, x_45);
x_62 = lean_ctor_get(x_61, 0);
lean_inc(x_62);
lean_dec(x_58);
x_63 = 0;
x_44 = x_63;
x_45 = x_62;
goto block_57;
x_63 = lean_ctor_get(x_62, 3);
lean_inc(x_63);
lean_dec(x_62);
x_64 = lean_ctor_get_uint8(x_63, sizeof(void*)*1);
lean_dec(x_63);
if (x_64 == 0)
{
lean_object* x_65; uint8_t x_66;
x_65 = lean_ctor_get(x_61, 1);
lean_inc(x_65);
lean_dec(x_61);
x_66 = 0;
x_47 = x_66;
x_48 = x_65;
goto block_60;
}
else
{
lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; uint8_t x_68;
x_64 = lean_ctor_get(x_58, 1);
lean_inc(x_64);
lean_dec(x_58);
x_65 = l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(x_43, x_4, x_5, x_6, x_7, x_8, x_9, x_64);
x_66 = lean_ctor_get(x_65, 0);
lean_inc(x_66);
x_67 = lean_ctor_get(x_65, 1);
lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; uint8_t x_71;
x_67 = lean_ctor_get(x_61, 1);
lean_inc(x_67);
lean_dec(x_65);
x_68 = lean_unbox(x_66);
lean_dec(x_66);
x_44 = x_68;
x_45 = x_67;
goto block_57;
}
block_57:
{
if (x_44 == 0)
{
lean_object* x_46;
x_46 = l_Lean_Elab_wfRecursion___lambda__1(x_39, x_1, x_18, x_4, x_5, x_6, x_7, x_8, x_9, x_45);
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; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56;
x_47 = lean_ctor_get(x_39, 3);
lean_inc(x_47);
x_48 = lean_alloc_ctor(4, 1, 0);
lean_ctor_set(x_48, 0, x_47);
x_49 = l_Lean_Elab_wfRecursion___closed__2;
x_50 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_50, 0, x_49);
lean_ctor_set(x_50, 1, x_48);
x_51 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__8;
x_52 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_52, 0, x_50);
lean_ctor_set(x_52, 1, x_51);
x_53 = l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(x_43, x_52, x_4, x_5, x_6, x_7, x_8, x_9, x_45);
x_54 = lean_ctor_get(x_53, 0);
lean_inc(x_54);
x_55 = lean_ctor_get(x_53, 1);
lean_inc(x_55);
lean_dec(x_53);
x_56 = l_Lean_Elab_wfRecursion___lambda__1(x_39, x_1, x_54, x_4, x_5, x_6, x_7, x_8, x_9, x_55);
lean_dec(x_54);
return x_56;
}
}
}
else
{
lean_object* x_69; lean_object* x_70; lean_object* x_71; uint8_t x_72;
lean_dec(x_1);
x_69 = lean_ctor_get(x_38, 0);
lean_dec(x_61);
x_68 = l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(x_46, x_4, x_5, x_6, x_7, x_8, x_9, x_67);
x_69 = lean_ctor_get(x_68, 0);
lean_inc(x_69);
x_70 = lean_ctor_get(x_38, 1);
x_70 = lean_ctor_get(x_68, 1);
lean_inc(x_70);
lean_dec(x_38);
x_71 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_70);
lean_dec(x_68);
x_71 = lean_unbox(x_69);
lean_dec(x_69);
x_47 = x_71;
x_48 = x_70;
goto block_60;
}
block_60:
{
if (x_47 == 0)
{
lean_object* x_49;
x_49 = l_Lean_Elab_wfRecursion___lambda__1(x_44, x_1, x_18, x_4, x_5, x_6, x_7, x_8, x_9, x_48);
return x_49;
}
else
{
lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59;
x_50 = lean_ctor_get(x_44, 3);
lean_inc(x_50);
x_51 = lean_alloc_ctor(4, 1, 0);
lean_ctor_set(x_51, 0, x_50);
x_52 = l_Lean_Elab_wfRecursion___closed__2;
x_53 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_53, 0, x_52);
lean_ctor_set(x_53, 1, x_51);
x_54 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__8;
x_55 = lean_alloc_ctor(10, 2, 0);
lean_ctor_set(x_55, 0, x_53);
lean_ctor_set(x_55, 1, x_54);
x_56 = l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(x_46, x_55, x_4, x_5, x_6, x_7, x_8, x_9, x_48);
x_57 = lean_ctor_get(x_56, 0);
lean_inc(x_57);
x_58 = lean_ctor_get(x_56, 1);
lean_inc(x_58);
lean_dec(x_56);
x_59 = l_Lean_Elab_wfRecursion___lambda__1(x_44, x_1, x_57, x_4, x_5, x_6, x_7, x_8, x_9, x_58);
lean_dec(x_57);
return x_59;
}
}
}
else
{
uint8_t x_72;
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_72 = !lean_is_exclusive(x_71);
lean_dec(x_1);
x_72 = !lean_is_exclusive(x_43);
if (x_72 == 0)
{
lean_object* x_73;
x_73 = lean_ctor_get(x_71, 0);
lean_dec(x_73);
lean_ctor_set_tag(x_71, 1);
lean_ctor_set(x_71, 0, x_69);
return x_71;
return x_43;
}
else
{
lean_object* x_74; lean_object* x_75;
x_74 = lean_ctor_get(x_71, 1);
lean_object* x_73; lean_object* x_74; lean_object* x_75;
x_73 = lean_ctor_get(x_43, 0);
x_74 = lean_ctor_get(x_43, 1);
lean_inc(x_74);
lean_dec(x_71);
lean_inc(x_73);
lean_dec(x_43);
x_75 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_75, 0, x_69);
lean_ctor_set(x_75, 0, x_73);
lean_ctor_set(x_75, 1, x_74);
return x_75;
}
@ -1920,15 +1923,12 @@ return x_75;
else
{
lean_object* x_76; lean_object* x_77; lean_object* x_78; uint8_t x_79;
lean_dec(x_30);
lean_dec(x_25);
lean_dec(x_3);
lean_dec(x_1);
x_76 = lean_ctor_get(x_36, 0);
x_76 = lean_ctor_get(x_38, 0);
lean_inc(x_76);
x_77 = lean_ctor_get(x_36, 1);
x_77 = lean_ctor_get(x_38, 1);
lean_inc(x_77);
lean_dec(x_36);
lean_dec(x_38);
x_78 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_77);
lean_dec(x_9);
lean_dec(x_8);
@ -1961,7 +1961,49 @@ return x_82;
}
else
{
uint8_t x_83;
lean_object* x_83; lean_object* x_84; lean_object* x_85; uint8_t x_86;
lean_dec(x_30);
lean_dec(x_25);
lean_dec(x_3);
lean_dec(x_1);
x_83 = lean_ctor_get(x_36, 0);
lean_inc(x_83);
x_84 = lean_ctor_get(x_36, 1);
lean_inc(x_84);
lean_dec(x_36);
x_85 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_84);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_86 = !lean_is_exclusive(x_85);
if (x_86 == 0)
{
lean_object* x_87;
x_87 = lean_ctor_get(x_85, 0);
lean_dec(x_87);
lean_ctor_set_tag(x_85, 1);
lean_ctor_set(x_85, 0, x_83);
return x_85;
}
else
{
lean_object* x_88; lean_object* x_89;
x_88 = lean_ctor_get(x_85, 1);
lean_inc(x_88);
lean_dec(x_85);
x_89 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_89, 0, x_83);
lean_ctor_set(x_89, 1, x_88);
return x_89;
}
}
}
else
{
uint8_t x_90;
lean_dec(x_25);
lean_dec(x_9);
lean_dec(x_8);
@ -1971,62 +2013,21 @@ lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_1);
x_83 = !lean_is_exclusive(x_29);
if (x_83 == 0)
x_90 = !lean_is_exclusive(x_29);
if (x_90 == 0)
{
return x_29;
}
else
{
lean_object* x_84; lean_object* x_85; lean_object* x_86;
x_84 = lean_ctor_get(x_29, 0);
x_85 = lean_ctor_get(x_29, 1);
lean_inc(x_85);
lean_inc(x_84);
lean_dec(x_29);
x_86 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_86, 0, x_84);
lean_ctor_set(x_86, 1, x_85);
return x_86;
}
}
}
else
{
lean_object* x_87; lean_object* x_88; lean_object* x_89; uint8_t x_90;
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_87 = lean_ctor_get(x_24, 0);
lean_inc(x_87);
x_88 = lean_ctor_get(x_24, 1);
lean_inc(x_88);
lean_dec(x_24);
x_89 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_88);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_90 = !lean_is_exclusive(x_89);
if (x_90 == 0)
{
lean_object* x_91;
x_91 = lean_ctor_get(x_89, 0);
lean_dec(x_91);
lean_ctor_set_tag(x_89, 1);
lean_ctor_set(x_89, 0, x_87);
return x_89;
}
else
{
lean_object* x_92; lean_object* x_93;
x_92 = lean_ctor_get(x_89, 1);
lean_object* x_91; lean_object* x_92; lean_object* x_93;
x_91 = lean_ctor_get(x_29, 0);
x_92 = lean_ctor_get(x_29, 1);
lean_inc(x_92);
lean_dec(x_89);
lean_inc(x_91);
lean_dec(x_29);
x_93 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_93, 0, x_87);
lean_ctor_set(x_93, 0, x_91);
lean_ctor_set(x_93, 1, x_92);
return x_93;
}
@ -2038,11 +2039,11 @@ lean_object* x_94; lean_object* x_95; lean_object* x_96; uint8_t x_97;
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_94 = lean_ctor_get(x_21, 0);
x_94 = lean_ctor_get(x_24, 0);
lean_inc(x_94);
x_95 = lean_ctor_get(x_21, 1);
x_95 = lean_ctor_get(x_24, 1);
lean_inc(x_95);
lean_dec(x_21);
lean_dec(x_24);
x_96 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_95);
lean_dec(x_9);
lean_dec(x_8);
@ -2079,11 +2080,11 @@ lean_object* x_101; lean_object* x_102; lean_object* x_103; uint8_t x_104;
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_101 = lean_ctor_get(x_19, 0);
x_101 = lean_ctor_get(x_21, 0);
lean_inc(x_101);
x_102 = lean_ctor_get(x_19, 1);
x_102 = lean_ctor_get(x_21, 1);
lean_inc(x_102);
lean_dec(x_19);
lean_dec(x_21);
x_103 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_102);
lean_dec(x_9);
lean_dec(x_8);
@ -2114,6 +2115,47 @@ return x_107;
}
}
}
else
{
lean_object* x_108; lean_object* x_109; lean_object* x_110; uint8_t x_111;
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_108 = lean_ctor_get(x_19, 0);
lean_inc(x_108);
x_109 = lean_ctor_get(x_19, 1);
lean_inc(x_109);
lean_dec(x_19);
x_110 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_109);
lean_dec(x_9);
lean_dec(x_8);
lean_dec(x_7);
lean_dec(x_6);
lean_dec(x_5);
lean_dec(x_4);
x_111 = !lean_is_exclusive(x_110);
if (x_111 == 0)
{
lean_object* x_112;
x_112 = lean_ctor_get(x_110, 0);
lean_dec(x_112);
lean_ctor_set_tag(x_110, 1);
lean_ctor_set(x_110, 0, x_108);
return x_110;
}
else
{
lean_object* x_113; lean_object* x_114;
x_113 = lean_ctor_get(x_110, 1);
lean_inc(x_113);
lean_dec(x_110);
x_114 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_114, 0, x_108);
lean_ctor_set(x_114, 1, x_113);
return x_114;
}
}
}
}
LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_wfRecursion___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
_start:
@ -2142,7 +2184,7 @@ lean_dec(x_3);
return x_11;
}
}
LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_881_(lean_object* x_1) {
LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_895_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
@ -2246,7 +2288,7 @@ l_Lean_Elab_wfRecursion___closed__1 = _init_l_Lean_Elab_wfRecursion___closed__1(
lean_mark_persistent(l_Lean_Elab_wfRecursion___closed__1);
l_Lean_Elab_wfRecursion___closed__2 = _init_l_Lean_Elab_wfRecursion___closed__2();
lean_mark_persistent(l_Lean_Elab_wfRecursion___closed__2);
res = l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_881_(lean_io_mk_world());
res = l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_895_(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
return lean_io_result_mk_ok(lean_box(0));