Skip to content

Commit

Permalink
Add dom and codom to EvalGraph.EvalGaloisConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
min-nguyen committed Sep 27, 2023
1 parent 74a8d62 commit d911ec1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/EvalGraph.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module EvalGraph
, patternMismatch
) where

import BoolAlg (BoolAlg, powerset)
import Prelude hiding (apply, add)

import Bindings (varAnon)
Expand Down Expand Up @@ -175,7 +176,9 @@ eval_module γ = go D.empty
go (γ' <+> γ'') (Module ds) αs

type EvalGaloisConnection g = GaloisConnection (Set Vertex) (Set Vertex)
( selecte𝔹 :: Set Vertex -> Expr 𝔹
( dom :: BoolAlg (Set Vertex)
, codom :: BoolAlg (Set Vertex)
, selecte𝔹 :: Set Vertex -> Expr 𝔹
, selectv𝔹 :: Set Vertex -> Val 𝔹
, runδv :: (Val 𝔹 -> Val 𝔹) -> Set Vertex
, g :: g
Expand All @@ -195,10 +198,12 @@ graphGC { g, n, γα } e = do
<- eval γα eα S.empty
pure (eα × vα)
let
dom = powerset (sinks g')
codom = powerset (vertices vα)
selecte𝔹 αs = select𝔹s eα αs
selectv𝔹 αs = select𝔹s vα αs
runδv δv = selectαs (δv (botOf vα)) vα
fwd αs = G.vertices (fwdSlice αs g') `intersection` vertices vα
-- TODO: want (vertices eα `union` foldMap vertices γα) rather than sinks g' here?
bwd αs = G.vertices (bwdSlice αs g') `intersection` sinks g'
pure { selecte𝔹, selectv𝔹, runδv, g: g', fwd, bwd }
pure { dom, codom, selecte𝔹, selectv𝔹, runδv, g: g', fwd, bwd }

0 comments on commit d911ec1

Please sign in to comment.