Skip to content

Commit

Permalink
🧩 [doc] : Note on fwdSliceDeMorgan, graph bwd.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolyp committed Sep 26, 2023
1 parent 4a3e4fc commit 3b0ae2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EvalGraph.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Control.Monad.Error.Class (class MonadError)
import Data.Array (range, singleton) as A
import Data.Either (Either(..))
import Data.Exists (runExists)
import Data.List (List(..), (:), length, snoc, unzip, zip)
import Data.List (List(..), length, snoc, unzip, zip, (:))
import Data.Set (Set, empty, insert, intersection, singleton, union)
import Data.Set as S
import Data.Traversable (sequence, traverse)
Expand Down Expand Up @@ -201,6 +201,6 @@ graphGC gconfig@{ g, n, γα } e = do
(g' × _) × eα × vα <- evalWithConfig { g, n, γα } e
let
fwd αs = G.vertices (fwdSlice αs g') `intersection` vertices vα
-- TODO: (vertices eα `union` vertices γα) rather than sinks g'
-- TODO: want (vertices eα `union` foldMap vertices γα) rather than sinks g' here?
bwd αs = G.vertices (bwdSlice αs g') `intersection` sinks g'
pure { gconfig, eα, g: g', vα, fwd, bwd }
1 change: 1 addition & 0 deletions src/Graph/Slice.purs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ bwdSlice αs0 g0 = fst $ runWithGraph $ tailRecM go (empty × L.fromFoldable αs
extend α βs
pure $ Loop ((visited # insert α) × (L.fromFoldable βs <> αs))

-- Doesn't do the final negation.
fwdSliceDeMorgan :: forall g. Graph g => Set Vertex -> g -> g
fwdSliceDeMorgan αs_0 g_0 =
bwdSlice (sinks g_0 `difference` αs_0) (op g_0)
Expand Down

0 comments on commit 3b0ae2a

Please sign in to comment.