Commit 0426c9f1 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli Committed by Alfredo Di Napoli

Rewrite buildForest in terms of graphs (and strongly-connected

components)

This commit rewrites the logic behind `buildForest` to build first a
graph, discovering loops in there (via the strongly-connected components
machinery) and finally converting the DAG (freshly-made so) into a
Forest.
parent 4739268a
Pipeline #7945 failed with stages
in 43 minutes and 33 seconds
This diff is collapsed.
...@@ -315,8 +315,8 @@ testLoopBreaker_02 = ...@@ -315,8 +315,8 @@ testLoopBreaker_02 =
let t1 = Map.fromList [ ( "foo", mkMapTerm "foo" & ne_children .~ mSetFromList ["bar"]) let t1 = Map.fromList [ ( "foo", mkMapTerm "foo" & ne_children .~ mSetFromList ["bar"])
, ( "bar", mkMapTerm "bar" & ne_children .~ mSetFromList ["foo"]) , ( "bar", mkMapTerm "bar" & ne_children .~ mSetFromList ["foo"])
] ]
in (buildForestOrBreakLoop t1) `compareForestVisually` [r| in (pruneForest $ buildForestOrBreakLoop t1) `compareForestVisually` [r|
foo bar
| |
`- bar `- foo
|] |]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment