Skip to content

Commit

Permalink
merge nightly-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Dec 2, 2024
2 parents c9ca9ab + a75e35f commit da3e5c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ImportGraph/RequiredModules.lean
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ partial def Environment.transitivelyRequiredModules' (env : Environment) (module
if verbose then
IO.println s!"Processing module {m}"
let mut r : BitVec N := 0
for n in env.header.moduleData[(env.header.moduleNames.getIdx? m).getD 0]!.constNames do
for n in env.header.moduleData[((env.header.moduleNames.indexOf? m).map Fin.val).getD 0]!.constNames do
if ! n.isInternal then
-- This is messy: Mathlib is big enough that writing a recursive function causes a stack overflow.
-- So we use an explicit stack instead. We visit each constant twice:
Expand Down Expand Up @@ -162,7 +162,7 @@ partial def Environment.transitivelyRequiredModules' (env : Environment) (module
return result
where
toBitVec {N : Nat} (s : NameSet) : BitVec N :=
s.fold (init := 0) (fun b n => b ||| BitVec.twoPow _ ((env.header.moduleNames.getIdx? n).getD 0))
s.fold (init := 0) (fun b n => b ||| BitVec.twoPow _ (((env.header.moduleNames.indexOf? n).map Fin.val).getD 0))
toNameSet {N : Nat} (b : BitVec N) : NameSet :=
env.header.moduleNames.zipWithIndex.foldl (init := {}) (fun s (n, i) => if b.getLsbD i then s.insert n else s)

Expand Down

0 comments on commit da3e5c6

Please sign in to comment.