diff --git a/ImportGraph/RequiredModules.lean b/ImportGraph/RequiredModules.lean index 5e90a90..b3a91e1 100644 --- a/ImportGraph/RequiredModules.lean +++ b/ImportGraph/RequiredModules.lean @@ -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: @@ -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) diff --git a/lake-manifest.json b/lake-manifest.json index d4ed67a..c15a19f 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -1,24 +1,24 @@ {"version": "1.1.0", "packagesDir": ".lake/packages", "packages": - [{"url": "https://github.com/leanprover/lean4-cli", + [{"url": "https://github.com/leanprover-community/batteries", "type": "git", "subDir": null, - "scope": "leanprover", - "rev": "0c8ea32a15a4f74143e4e1e107ba2c412adb90fd", - "name": "Cli", + "scope": "leanprover-community", + "rev": "58b15585c1480b5e9afcded83a36b8ea0a7d4a24", + "name": "batteries", "manifestFile": "lake-manifest.json", - "inputRev": "main", + "inputRev": "nightly-testing", "inherited": false, "configFile": "lakefile.toml"}, - {"url": "https://github.com/leanprover-community/batteries", + {"url": "https://github.com/leanprover/lean4-cli", "type": "git", "subDir": null, - "scope": "leanprover-community", - "rev": "2ed85f320805f9d3a455ced3b181562ed146bc20", - "name": "batteries", + "scope": "leanprover", + "rev": "0c8ea32a15a4f74143e4e1e107ba2c412adb90fd", + "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "nightly-testing", + "inputRev": "main", "inherited": false, "configFile": "lakefile.toml"}], "name": "importGraph", diff --git a/lean-toolchain b/lean-toolchain index 44435e7..5c0b148 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:nightly-2024-11-14 \ No newline at end of file +leanprover/lean4:nightly-2024-11-20 \ No newline at end of file