fix findLoops

This commit is contained in:
Jon Eugster
2023-07-20 15:56:01 +02:00
parent 77ba1cd85e
commit 4e12c749e0
2 changed files with 106 additions and 46 deletions
+18
View File
@@ -0,0 +1,18 @@
import GameServer.Commands
open Lean
-- E → A → B → C → A and
-- F → G → F
open HashMap in
def testArrows : HashMap Name (HashSet Name) :=
ofList [("a", (HashSet.empty.insert "b": HashSet Name).insert "d"),
("b", (HashSet.empty.insert "c": HashSet Name)),
("c", (HashSet.empty.insert "a": HashSet Name)),
("d", {}),
("f", (HashSet.empty.insert "g": HashSet Name)),
("g", (HashSet.empty.insert "f": HashSet Name)),
("e", (HashSet.empty.insert "a": HashSet Name).insert "f")]
-- some permutation of ``[`c, `a, `b]`` or ``[`f, `g]``
#eval findLoops testArrows