fixed loop in anti loop detection

master
Rachel Lambda Samuelsson 2022-03-01 18:10:18 +01:00
parent 47411226ac
commit 7fcd27aafd
2 changed files with 6 additions and 2 deletions

View File

@ -85,7 +85,7 @@ detectLoop v g i =
else case M.lookup i g of
Nothing -> pure v -- this has already been removed, meaning this branch is safe
Just is -> if is == S.empty
then pure v -- leaf \/ Set not Traversable
then pure (S.insert i v)
else S.unions <$> detectLoop (S.insert i v) g <~> S.toList is
createGraph :: [TL] -> RefGraph

View File

@ -54,4 +54,8 @@ isEven : Nat → Bool
type bot
absurd : bot -> A := rec[bot]
absurd : bot -> A
:= rec[bot]
id : A -> A
:= λx. x