Skip to content

Commit 63bd0b5

Browse files
authored
refactor: introduce Match.altInfos (#11256)
This PR replaces `MatcherInfo.numAltParams` with a more detailed data structure that allows us, in particular, to distinguish between an alternative for a constructor with a `Unit` field and the alternative for a nullary constructor, where an artificial `Unit` argument is introduced.
1 parent 7534296 commit 63bd0b5

File tree

9 files changed

+71
-58
lines changed

9 files changed

+71
-58
lines changed

src/Lean/Compiler/LCNF/ToDecl.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ partial def inlineMatchers (e : Expr) : CoreM Expr :=
4949
return .visit (← Meta.mkLambdaFVars xs (mkAppN e xs))
5050
else
5151
let mut args := e.getAppArgs
52-
let numAlts := info.numAlts
5352
let altNumParams := info.altNumParams
5453
let rec inlineMatcher (i : Nat) (args : Array Expr) (letFVars : Array Expr) : MetaM Expr := do
55-
if h : i < numAlts then
54+
if h : i < altNumParams.size then
5655
let altIdx := i + info.getFirstAltPos
5756
let numParams := altNumParams[i]
5857
let alt ← normalizeAlt args[altIdx]! numParams

src/Lean/Elab/PreDefinition/Structural/BRecOn.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ private partial def replaceRecApps (recArgInfos : Array RecArgInfo) (positions :
187187
trace[Elab.definition.structural] "below before matcherApp.addArg: {below} : {← inferType below}"
188188
if let some matcherApp ← matcherApp.addArg? below then
189189
let altsNew ← matcherApp.alts.zipWithM (bs := matcherApp.altNumParams) fun alt numParams =>
190-
lambdaBoundedTelescope alt numParams fun xs altBody => do
190+
lambdaBoundedTelescope alt (numParams + 1) fun xs altBody => do
191191
trace[Elab.definition.structural] "altNumParams: {numParams}, xs: {xs}"
192-
unless xs.size = numParams do
192+
unless xs.size = numParams + 1 do
193193
throwError "unexpected matcher application alternative{indentExpr alt}\nat application{indentExpr e}"
194-
let belowForAlt := xs[numParams - 1]!
194+
let belowForAlt := xs[numParams]!
195195
mkLambdaFVars xs (← loop belowForAlt altBody)
196196
pure { matcherApp with alts := altsNew }.toExpr
197197
else

src/Lean/Elab/PreDefinition/WF/Fix.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ where
101101
| some matcherApp =>
102102
if let some matcherApp ← matcherApp.addArg? F then
103103
let altsNew ← matcherApp.alts.zipWithM (bs := matcherApp.altNumParams) fun alt numParams =>
104-
lambdaBoundedTelescope alt numParams fun xs altBody => do
105-
unless xs.size = numParams do
104+
lambdaBoundedTelescope alt (numParams + 1) fun xs altBody => do
105+
unless xs.size = (numParams + 1) do
106106
throwError "unexpected matcher application alternative{indentExpr alt}\nat application{indentExpr e}"
107-
let FAlt := xs[numParams - 1]!
107+
let FAlt := xs[numParams]!
108108
let altBody' ← loop FAlt altBody
109109
mkLambdaFVars xs altBody'
110110
return { matcherApp with alts := altsNew, discrs := (← matcherApp.discrs.mapM (loop F)) }.toExpr

src/Lean/Meta/Constructions/CasesOnSameCtor.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public def mkCasesOnSameCtor (declName : Name) (indName : Name) : MetaM Unit :=
153153
let motiveType ← mkForallFVars (is ++ #[x1,x2,heq]) (mkSort v)
154154
withLocalDecl `motive .implicit motiveType fun motive => do
155155

156-
let altTypes info.ctors.toArray.mapIdxM fun i ctorName => do
156+
let (altTypes, altInfos) ← Array.unzip <$> info.ctors.toArray.mapIdxM fun i ctorName => do
157157
let ctor := mkAppN (mkConst ctorName us) params
158158
withSharedCtorIndices ctor fun zs12 is fields1 fields2 => do
159159
let ctorApp1 := mkAppN ctor fields1
@@ -164,7 +164,8 @@ public def mkCasesOnSameCtor (declName : Name) (indName : Name) : MetaM Unit :=
164164
let name := match ctorName with
165165
| Name.str _ s => Name.mkSimple s
166166
| _ => Name.mkSimple s!"alt{i+1}"
167-
return (name, e)
167+
let altInfo := { numFields := zs12.size, numOverlaps := 0, hasUnitThunk := zs12.isEmpty : Match.AltParamInfo}
168+
return ((name, e), altInfo)
168169
withLocalDeclsDND altTypes fun alts => do
169170
forallBoundedTelescope t0 (some (info.numIndices + 1)) fun ism1' _ =>
170171
forallBoundedTelescope t0 (some (info.numIndices + 1)) fun ism2' _ => do
@@ -210,7 +211,7 @@ public def mkCasesOnSameCtor (declName : Name) (indName : Name) : MetaM Unit :=
210211
let matcherInfo : MatcherInfo := {
211212
numParams := info.numParams
212213
numDiscrs := info.numIndices + 3
213-
altNumParams := altTypes.map (·.2.getNumHeadForalls)
214+
altInfos
214215
uElimPos? := some 0
215216
discrInfos := #[{}, {}, {}]}
216217

src/Lean/Meta/Match/Match.lean

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ where
9191
k hs
9292

9393
/-- Given a list of `AltLHS`, create a minor premise for each one, convert them into `Alt`, and then execute `k` -/
94-
private def withAlts {α} (motive : Expr) (discrs : Array Expr) (discrInfos : Array DiscrInfo) (lhss : List AltLHS) (k : List Alt → Array (Expr × Nat) → MetaM α) : MetaM α :=
95-
loop lhss [] #[]
94+
private def withAlts {α} (motive : Expr) (discrs : Array Expr) (discrInfos : Array DiscrInfo)
95+
(lhss : List AltLHS) (k : List Alt → Array Expr → Array AltParamInfo → MetaM α) : MetaM α :=
96+
loop lhss [] #[] #[]
9697
where
9798
mkMinorType (xs : Array Expr) (lhs : AltLHS) : MetaM Expr :=
9899
withExistingLocalDecls lhs.fvarDecls do
@@ -101,23 +102,24 @@ where
101102
withEqs discrs args discrInfos fun eqs => do
102103
mkForallFVars (xs ++ eqs) minorType
103104

104-
loop (lhss : List AltLHS) (alts : List Alt) (minors : Array (Expr × Nat)) : MetaM α := do
105+
loop (lhss : List AltLHS) (alts : List Alt) (minors : Array Expr) (altInfos : Array AltParamInfo) : MetaM α := do
105106
match lhss with
106-
| [] => k alts.reverse minors
107+
| [] => k alts.reverse minors altInfos
107108
| lhs::lhss =>
108109
let xs := lhs.fvarDecls.toArray.map LocalDecl.toExpr
109110
let minorType ← mkMinorType xs lhs
110111
let hasParams := !xs.isEmpty || discrInfos.any fun info => info.hName?.isSome
111-
let (minorType, minorNumParams) := if hasParams then (minorType, xs.size) else (mkSimpleThunkType minorType, 1)
112+
let minorType := if hasParams then minorType else mkSimpleThunkType minorType
112113
let idx := alts.length
113114
let minorName := (`h).appendIndexAfter (idx+1)
114115
trace[Meta.Match.debug] "minor premise {minorName} : {minorType}"
115116
withLocalDeclD minorName minorType fun minor => do
116117
let rhs := if hasParams then mkAppN minor xs else mkApp minor (mkConst `Unit.unit)
117-
let minors := minors.push (minor, minorNumParams)
118+
let minors := minors.push minor
119+
let altInfos := altInfos.push { numFields := xs.size, numOverlaps := 0, hasUnitThunk := !hasParams }
118120
let fvarDecls ← lhs.fvarDecls.mapM instantiateLocalDeclMVars
119121
let alts := { ref := lhs.ref, idx := idx, rhs := rhs, fvarDecls := fvarDecls, patterns := lhs.patterns, cnstrs := [] } :: alts
120-
loop lhss alts minors
122+
loop lhss alts minors altInfos
121123

122124
structure State where
123125
/-- Used alternatives -/
@@ -1094,7 +1096,6 @@ where `v` is a universe parameter or 0 if `B[a_1, ..., a_n]` is a proposition.
10941096
def mkMatcher (input : MkMatcherInput) : MetaM MatcherResult := withCleanLCtxFor input do
10951097
let ⟨matcherName, matchType, discrInfos, lhss⟩ := input
10961098
let numDiscrs := discrInfos.size
1097-
let numEqs := getNumEqsFromDiscrInfos discrInfos
10981099
checkNumPatterns numDiscrs lhss
10991100
forallBoundedTelescope matchType numDiscrs fun discrs matchTypeBody => do
11001101
/- We generate an matcher that can eliminate using different motives with different universe levels.
@@ -1103,9 +1104,8 @@ def mkMatcher (input : MkMatcherInput) : MetaM MatcherResult := withCleanLCtxFor
11031104
This is useful for implementing `MatcherApp.addArg` because it may have to change the universe level. -/
11041105
let uElim ← getLevel matchTypeBody
11051106
let uElimGen ← if uElim == levelZero then pure levelZero else mkFreshLevelMVar
1106-
let mkMatcher (type val : Expr) (minors : Array (Expr × Nat)) (s : State) : MetaM MatcherResult := do
1107+
let mkMatcher (type val : Expr) (altInfos : Array AltParamInfo) (s : State) : MetaM MatcherResult := do
11071108
trace[Meta.Match.debug] "matcher value: {val}\ntype: {type}"
1108-
trace[Meta.Match.debug] "minors num params: {minors.map (·.2)}"
11091109
/- The option `bootstrap.gen_matcher_code` is a helper hack. It is useful, for example,
11101110
for compiling `src/Init/Data/Int`. It is needed because the compiler uses `Int.decLt`
11111111
for generating code for `Int.casesOn` applications, but `Int.casesOn` is used to
@@ -1125,7 +1125,7 @@ def mkMatcher (input : MkMatcherInput) : MetaM MatcherResult := withCleanLCtxFor
11251125
match addMatcher with
11261126
| some addMatcher => addMatcher <|
11271127
{ numParams := matcher.getAppNumArgs
1128-
altNumParams := minors.map fun minor => minor.2 + numEqs
1128+
altInfos
11291129
discrInfos
11301130
numDiscrs
11311131
uElimPos?
@@ -1153,7 +1153,7 @@ def mkMatcher (input : MkMatcherInput) : MetaM MatcherResult := withCleanLCtxFor
11531153
let isEqMask ← eqs.mapM fun eq => return (← inferType eq).isEq
11541154
return (mvarType, isEqMask)
11551155
trace[Meta.Match.debug] "target: {mvarType}"
1156-
withAlts motive discrs discrInfos lhss fun alts minors => do
1156+
withAlts motive discrs discrInfos lhss fun alts minors altInfos => do
11571157
let mvar ← mkFreshExprMVar mvarType
11581158
trace[Meta.Match.debug] "goal\n{mvar.mvarId!}"
11591159
let examples := discrs'.toList.map fun discr => Example.var discr.fvarId!
@@ -1170,21 +1170,21 @@ def mkMatcher (input : MkMatcherInput) : MetaM MatcherResult := withCleanLCtxFor
11701170
rfls := rfls.push (← mkHEqRefl discr)
11711171
isEqMaskIdx := isEqMaskIdx + 1
11721172
let val := mkAppN (mkAppN val discrs) rfls
1173-
let args := #[motive] ++ discrs ++ minors.map Prod.fst
1173+
let args := #[motive] ++ discrs ++ minors
11741174
let val ← mkLambdaFVars args val
11751175
let type ← mkForallFVars args (mkAppN motive discrs)
1176-
mkMatcher type val minors s
1176+
mkMatcher type val altInfos s
11771177
else
11781178
let mvarType := mkAppN motive discrs
11791179
trace[Meta.Match.debug] "target: {mvarType}"
1180-
withAlts motive discrs discrInfos lhss fun alts minors => do
1180+
withAlts motive discrs discrInfos lhss fun alts minors altInfos => do
11811181
let mvar ← mkFreshExprMVar mvarType
11821182
let examples := discrs.toList.map fun discr => Example.var discr.fvarId!
11831183
let (_, s) ← (process { mvarId := mvar.mvarId!, vars := discrs.toList, alts := alts, examples := examples }).run {}
1184-
let args := #[motive] ++ discrs ++ minors.map Prod.fst
1184+
let args := #[motive] ++ discrs ++ minors
11851185
let type ← mkForallFVars args mvarType
11861186
let val ← mkLambdaFVars args mvar
1187-
mkMatcher type val minors s
1187+
mkMatcher type val altInfos s
11881188

11891189
def getMkMatcherInputInContext (matcherApp : MatcherApp) : MetaM MkMatcherInput := do
11901190
let matcherName := matcherApp.matcherName

src/Lean/Meta/Match/MatcherApp/Basic.lean

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ public section
1212

1313
namespace Lean.Meta
1414

15-
structure MatcherApp where
15+
structure MatcherApp extends Match.MatcherInfo where
1616
matcherName : Name
1717
matcherLevels : Array Level
18-
uElimPos? : Option Nat
19-
discrInfos : Array Match.DiscrInfo
2018
params : Array Expr
2119
motive : Expr
2220
discrs : Array Expr
23-
altNumParams : Array Nat
2421
alts : Array Expr
2522
remaining : Array Expr
2623

@@ -39,14 +36,12 @@ def matchMatcherApp? [Monad m] [MonadEnv m] [MonadError m] (e : Expr) (alsoCases
3936
if args.size < info.arity then
4037
return none
4138
return some {
39+
info with
4240
matcherName := declName
4341
matcherLevels := declLevels.toArray
44-
uElimPos? := info.uElimPos?
45-
discrInfos := info.discrInfos
4642
params := args.extract 0 info.numParams
4743
motive := args[info.getMotivePos]!
4844
discrs := args[(info.numParams + 1)...(info.numParams + 1 + info.numDiscrs)]
49-
altNumParams := info.altNumParams
5045
alts := args[(info.numParams + 1 + info.numDiscrs)...(info.numParams + 1 + info.numDiscrs + info.numAlts)]
5146
remaining := args[(info.numParams + 1 + info.numDiscrs + info.numAlts)...args.size]
5247
}
@@ -63,24 +58,20 @@ def matchMatcherApp? [Monad m] [MonadEnv m] [MonadError m] (e : Expr) (alsoCases
6358
let alts := args[(info.numParams + 1 + info.numIndices + 1)...(info.numParams + 1 + info.numIndices + 1 + info.numCtors)]
6459
let remaining := args[(info.numParams + 1 + info.numIndices + 1 + info.numCtors)...*]
6560
let uElimPos? := if info.levelParams.length == declLevels.length then none else some 0
66-
let mut altNumParams := #[]
67-
for ctor in info.ctors do
68-
let .ctorInfo ctorInfo ← getConstInfo ctor | unreachable!
69-
altNumParams := altNumParams.push ctorInfo.numFields
61+
let altInfos ← info.ctors.toArray.mapM fun ctor => do
62+
let .ctorInfo ctorInfo ← getConstInfo ctor | panic! "expected constructor"
63+
return { numFields := ctorInfo.numFields, numOverlaps := 0, hasUnitThunk := false : Match.AltParamInfo}
7064
return some {
65+
numParams := params.size
66+
numDiscrs := discrs.size
7167
matcherName := declName
7268
matcherLevels := declLevels.toArray
73-
uElimPos?, discrInfos, params, motive, discrs, alts, remaining, altNumParams
69+
uElimPos?, discrInfos, params, motive, discrs, alts, remaining, altInfos
7470
}
7571

7672
return none
7773

78-
def MatcherApp.toMatcherInfo (matcherApp : MatcherApp) : MatcherInfo where
79-
uElimPos? := matcherApp.uElimPos?
80-
discrInfos := matcherApp.discrInfos
81-
numParams := matcherApp.params.size
82-
numDiscrs := matcherApp.discrs.size
83-
altNumParams := matcherApp.altNumParams
74+
def MatcherApp.altNumParams (matcherApp : MatcherApp) := matcherApp.toMatcherInfo.altNumParams
8475

8576
def MatcherApp.toExpr (matcherApp : MatcherApp) : Expr :=
8677
let result := mkAppN (mkConst matcherApp.matcherName matcherApp.matcherLevels.toList) matcherApp.params

src/Lean/Meta/Match/MatcherApp/Transform.lean

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public section
1515
namespace Lean.Meta.MatcherApp
1616

1717
/-- Auxiliary function for MatcherApp.addArg -/
18-
private partial def updateAlts (unrefinedArgType : Expr) (typeNew : Expr) (altNumParams : Array Nat) (alts : Array Expr) (refined : Bool) (i : Nat) : MetaM (Array Nat × Array Expr) := do
18+
private partial def updateAlts (unrefinedArgType : Expr) (typeNew : Expr) (altNumParams : Array Nat) (alts : Array Expr) (refined : Bool) (i : Nat) : MetaM (Array Expr) := do
1919
if h : i < alts.size then
2020
let alt := alts[i]
2121
let numParams := altNumParams[i]!
@@ -33,11 +33,11 @@ private partial def updateAlts (unrefinedArgType : Expr) (typeNew : Expr) (altNu
3333
else
3434
pure <| !(← isDefEq unrefinedArgType (← inferType x[0]!))
3535
return (← mkLambdaFVars xs alt, refined)
36-
updateAlts unrefinedArgType (b.instantiate1 alt) (altNumParams.set! i (numParams+1)) (alts.set i alt) refined (i+1)
36+
updateAlts unrefinedArgType (b.instantiate1 alt) altNumParams (alts.set i alt) refined (i+1)
3737
| _ => throwError "unexpected type at MatcherApp.addArg"
3838
else
3939
if refined then
40-
return (altNumParams, alts)
40+
return alts
4141
else
4242
throwError "failed to add argument to matcher application, argument type was not refined by `casesOn`"
4343

@@ -91,12 +91,11 @@ def addArg (matcherApp : MatcherApp) (e : Expr) : MetaM MatcherApp :=
9191
unless (← isTypeCorrect aux) do
9292
throwError "failed to add argument to matcher application, type error when constructing the new motive"
9393
let auxType ← inferType aux
94-
let (altNumParams, alts) ← updateAlts eType auxType matcherApp.altNumParams matcherApp.alts false 0
94+
let alts ← updateAlts eType auxType matcherApp.altNumParams matcherApp.alts false 0
9595
return { matcherApp with
9696
matcherLevels := matcherLevels,
9797
motive := motive,
9898
alts := alts,
99-
altNumParams := altNumParams,
10099
remaining := #[e] ++ matcherApp.remaining
101100
}
102101

@@ -245,26 +244,30 @@ def transform
245244
let params' ← matcherApp.params.mapM onParams
246245
let discrs' ← matcherApp.discrs.mapM onParams
247246

248-
let (motive', uElim, addHEqualities) ← lambdaTelescope matcherApp.motive fun motiveArgs motiveBody => do
247+
let (motive', uElim, addHEqualities, discrInfos') ← lambdaTelescope matcherApp.motive fun motiveArgs motiveBody => do
249248
unless motiveArgs.size == matcherApp.discrs.size do
250249
throwError "unexpected matcher application, motive must be lambda expression with #{matcherApp.discrs.size} arguments"
251250
let mut motiveBody' ← onMotive motiveArgs motiveBody
252251

253252
-- Prepend `(x = e) →` or `(x ≍ e) → ` to the motive when an equality is requested
254253
-- and not already present, and remember whether we added an Eq or a HEq
255254
let mut addHEqualities : Array (Option Bool) := #[]
255+
let mut discrInfos' := #[]
256256
for arg in motiveArgs, discr in discrs', di in matcherApp.discrInfos do
257257
if addEqualities && di.hName?.isNone then
258258
if ← isProof arg then
259259
addHEqualities := addHEqualities.push none
260+
discrInfos' := discrInfos'.push di
260261
else
261262
let heq ← mkEqHEq discr arg
262263
motiveBody' ← liftMetaM <| mkArrow heq motiveBody'
263264
addHEqualities := addHEqualities.push heq.isHEq
265+
discrInfos' := discrInfos'.push { hName? := some .anonymous }
264266
else
265267
addHEqualities := addHEqualities.push none
268+
discrInfos' := discrInfos'.push di
266269

267-
return (← mkLambdaFVars motiveArgs motiveBody', ← getLevel motiveBody', addHEqualities)
270+
return (← mkLambdaFVars motiveArgs motiveBody', ← getLevel motiveBody', addHEqualities, discrInfos')
268271

269272
let matcherLevels ← match matcherApp.uElimPos? with
270273
| none => pure matcherApp.matcherLevels
@@ -342,7 +345,7 @@ def transform
342345
params := params'
343346
motive := motive'
344347
discrs := discrs'
345-
altNumParams := matchEqns.splitterAltNumParams.map (· + extraEqualities)
348+
discrInfos := discrInfos'
346349
alts := alts'
347350
remaining := remaining'
348351
}
@@ -377,7 +380,7 @@ def transform
377380
params := params'
378381
motive := motive'
379382
discrs := discrs'
380-
altNumParams := matcherApp.altNumParams.map (· + extraEqualities)
383+
discrInfos := discrInfos'
381384
alts := alts'
382385
remaining := remaining'
383386
}

src/Lean/Meta/Match/MatcherInfo.lean

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,24 @@ def Overlaps.overlapping (o : Overlaps) (overlapped : Nat) : Array Nat :=
3030
| some s => s.toArray
3131
| none => #[]
3232

33+
/--
34+
Informatino about the parameter structure for the alternative of a matcher or splitter.
35+
-/
36+
structure AltParamInfo where
37+
/-- Actual fields (not incuding discr eqns) -/
38+
numFields : Nat
39+
/-- Overlap assumption (for splitters only) -/
40+
numOverlaps : Nat
41+
/-- Whether this alternatie has an artifcial `Unit` parameter -/
42+
hasUnitThunk : Bool
43+
deriving Inhabited
44+
3345
/--
3446
A "matcher" auxiliary declaration has the following structure:
3547
- `numParams` parameters
3648
- motive
3749
- `numDiscrs` discriminators (aka major premises)
38-
- `altNumParams.size` alternatives (aka minor premises) where alternative `i` has `altNumParams[i]` parameters
50+
- `altInfos.size` alternatives (aka minor premises) with parameter structure information
3951
- `uElimPos?` is `some pos` when the matcher can eliminate in different universe levels, and
4052
`pos` is the position of the universe level parameter that specifies the elimination universe.
4153
It is `none` if the matcher only eliminates into `Prop`.
@@ -44,7 +56,7 @@ A "matcher" auxiliary declaration has the following structure:
4456
structure MatcherInfo where
4557
numParams : Nat
4658
numDiscrs : Nat
47-
altNumParams : Array Nat
59+
altInfos : Array AltParamInfo
4860
uElimPos? : Option Nat
4961
/--
5062
`discrInfos[i] = { hName? := some h }` if the i-th discriminant was annotated with `h :`.
@@ -53,7 +65,7 @@ structure MatcherInfo where
5365
overlaps : Overlaps := {}
5466

5567
@[expose] def MatcherInfo.numAlts (info : MatcherInfo) : Nat :=
56-
info.altNumParams.size
68+
info.altInfos.size
5769

5870
def MatcherInfo.arity (info : MatcherInfo) : Nat :=
5971
info.numParams + 1 + info.numDiscrs + info.numAlts
@@ -83,6 +95,11 @@ def getNumEqsFromDiscrInfos (infos : Array DiscrInfo) : Nat := Id.run do
8395
def MatcherInfo.getNumDiscrEqs (info : MatcherInfo) : Nat :=
8496
getNumEqsFromDiscrInfos info.discrInfos
8597

98+
def MatcherInfo.altNumParams (info : MatcherInfo) : Array Nat :=
99+
info.altInfos.map fun {numFields, numOverlaps, hasUnitThunk} =>
100+
numFields + numOverlaps + (if hasUnitThunk then 1 else 0) + info.getNumDiscrEqs
101+
102+
86103
namespace Extension
87104

88105
structure Entry where

stage0/src/stdlib_flags.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "util/options.h"
22

3+
// please update this
4+
35
namespace lean {
46
options get_default_options() {
57
options opts;

0 commit comments

Comments
 (0)