Skip to content

Commit

Permalink
Merge pull request #37 from leanprover-community/bump/nightly-2024-10-17
Browse files Browse the repository at this point in the history
chore: adaptations for nightly-2024-10-17
  • Loading branch information
kim-em authored Oct 18, 2024
2 parents 9b4088c + 6b65715 commit da6193d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ImportGraph/Imports.lean
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ partial
def transitiveFilteredUpstream (node : Name) (graph : NameMap (Array Name))
(filter : Name → Bool) (replacement : Option Name := none):
List Name :=
(graph.find! node).toList.bind fun source =>
(graph.find! node).toList.flatMap fun source =>
( if filter source then
-- Add the transitive edges going through the filtered node `source`.
-- If there is a replacement node, add an additional edge `repl → node`.
Expand All @@ -156,12 +156,12 @@ def filterGraph (graph : NameMap (Array Name)) (filter : Name → Bool)
(replacement : Option Name := none) : NameMap (Array Name) :=
-- Create a list of all files imported by any of the filtered files
-- and remove all imports starting with `Mathlib` to avoid loops.
let replImports := graph.toList.bind
let replImports := graph.toList.flatMap
(fun ⟨n, i⟩ => if filter n then i.toList else [])
|>.eraseDups |>.filter (¬ Name.isPrefixOf `Mathlib ·) |>.toArray
let graph := graph.filterMap (fun node edges => if filter node then none else some <|
-- If the node `node` is not filtered, modify the `edges` going into `node`.
edges.toList.bind (fun source =>
edges.toList.flatMap (fun source =>
if filter source then
transitiveFilteredUpstream source graph filter (replacement := replacement)
else [source]) |>.eraseDups.toArray)
Expand Down
4 changes: 2 additions & 2 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "daf1ed91789811cf6bbb7bf2f4dad6b3bad8fbf4",
"rev": "389fb58a2ff92e1ede0db37b1fedcb9a6162df94",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inputRev": "nightly-testing",
"inherited": false,
"configFile": "lakefile.lean"}],
"name": "importGraph",
Expand Down
2 changes: 1 addition & 1 deletion lakefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rev = "main"
[[require]]
name = "batteries"
scope = "leanprover-community"
rev = "main"
rev = "nightly-testing"

[[lean_lib]]
name = "ImportGraph"
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.13.0-rc1
leanprover/lean4:nightly-2024-10-17

0 comments on commit da6193d

Please sign in to comment.