Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cubix.Language.Parametric.Semantics.Cfg
Synopsis
- collapseFProd :: (HFunctor f, f :-<: gs) => f (Term gs :*: t) :-> (Term gs :*: f t)
- collapseFProd' :: (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> (AnnTerm a gs :*: f t)
- fprodFst' :: (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> AnnTerm a gs
- data EnterExitPair fs l
- = EnterExitPair { }
- | SubPairs (Sum fs (EnterExitPair fs) l)
- | EmptyEnterExit
- extractEEPList :: forall fs l. (ListF :-<: fs, Typeable l) => EnterExitPair fs [l] -> [EnterExitPair fs l]
- extractEEPPair :: forall fs a b. PairF :-<: fs => EnterExitPair fs (a, b) -> (EnterExitPair fs a, EnterExitPair fs b)
- extractEEPMaybe :: (All (KExtractF' Maybe) fs, Monad m) => m (EnterExitPair fs (Maybe l)) -> m (Maybe (EnterExitPair fs l))
- identEnterExit :: CfgNode fs -> EnterExitPair fs l
- combineEnterExit :: (HasCurCfg s fs, All HTraversable fs, All HFoldable fs, All HFunctor fs, MonadState s m) => EnterExitPair fs i -> EnterExitPair fs j -> m (EnterExitPair fs k)
- collapseEnterExit :: (HasCurCfg s fs, All HTraversable fs, All HFoldable fs, All HFunctor fs, MonadState s m) => EnterExitPair fs i -> m (EnterExitPair fs j)
- type family ComputationSorts (fs :: [(* -> *) -> * -> *]) :: [*]
- type family SuspendedComputationSorts (fs :: [(* -> *) -> * -> *]) :: [*]
- type family ContainerFunctors (fs :: [(* -> *) -> * -> *]) :: [(* -> *) -> * -> *]
- labeledIsComputationSort :: forall fs l. (IsComputationSort fs, All HFunctor fs) => TermLab fs l -> Bool
- labeledIsSuspendedComputationSort :: (IsSuspendedComputationSort fs, All HFunctor fs) => AnnTerm a fs l -> Bool
- labeledIsContainer :: (IsContainer fs, All HFunctor fs) => AnnTerm a fs l -> Bool
- type PreRAlg f g a = f (HFix g :*: a) :-> a
- class ConstructCfg gs s f where
- constructCfg :: PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs))
- data HState s f l = HState {}
- runSubCfgs :: (f :-<: gs, HTraversable f, CfgComponent gs s) => f (HState s (EnterExitPair gs)) i -> State s (EnterExitPair gs j)
- type CfgComponent gs s = (HasLabelGen s, HasCurCfg s gs, All HTraversable gs, All HFoldable gs, All HFunctor gs)
- constructCfgGeneric :: forall f gs s. (f :-<: gs, HTraversable f, CfgComponent gs s) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs))
- constructCfgDefault :: forall f gs s. (f :-<: gs, HTraversable f, CfgComponent gs s, SortChecks gs) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs))
- type family CfgState (f :: [(* -> *) -> * -> *]) :: *
- class CfgInitState fs where
- cfgInitState :: Proxy fs -> CfgState fs
- class (CfgComponent fs (CfgState fs), ConstructCfg fs (CfgState fs) (Sum fs), CfgInitState fs) => CfgBuilder fs
- makeCfg :: forall fs l. CfgBuilder fs => TermLab fs l -> Cfg fs
- constructCfgReturn :: (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (Maybe (EnterExitPair gs i)) -> m (EnterExitPair gs l)
- constructCfgEmpty :: (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs l)
- constructCfgIfElseIfElse :: (MonadState s m, CfgComponent gs s) => TermLab gs l -> m [(EnterExitPair gs i, EnterExitPair gs j)] -> m (Maybe (EnterExitPair gs k)) -> m (EnterExitPair gs l)
- data LoopStack
- emptyLoopStack :: LoopStack
- class HasLoopStack c where
- loopStack :: Lens' c LoopStack
- break_stack :: Lens' c [Label]
- continue_stack :: Lens' c [Label]
- pushContinueNode :: (MonadState s m, HasLoopStack s) => CfgNode fs -> m ()
- popContinueNode :: (MonadState s m, HasLoopStack s) => m ()
- pushBreakNode :: (MonadState s m, HasLoopStack s) => CfgNode fs -> m ()
- popBreakNode :: (MonadState s m, HasLoopStack s) => m ()
- pushLoopNode :: (MonadState s m, HasLoopStack s) => CfgNode fs -> CfgNode fs -> m ()
- popLoopNode :: (MonadState s m, HasLoopStack s) => m ()
- constructCfgWhile :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) -> m (EnterExitPair gs j) -> m (EnterExitPair gs k)
- constructCfgDoWhile :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) -> m (EnterExitPair gs j) -> m (EnterExitPair gs k)
- constructCfgFor :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (Maybe (EnterExitPair gs h)) -> m (Maybe (EnterExitPair gs i)) -> m (Maybe (EnterExitPair gs j)) -> m (EnterExitPair gs k) -> m (EnterExitPair gs l)
- constructCfgBreak :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i)
- constructCfgContinue :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i)
- data LabelMap
- emptyLabelMap :: LabelMap
- class HasLabelMap c where
- constructCfgGoto :: (MonadState s m, HasLabelMap s, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- constructCfgLabel :: forall gs s m l i. (MonadState s m, HasLabelMap s, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- data ScopedLabelMap
- emptyScopedLabelMap :: ScopedLabelMap
- class HasScopedLabelMap c where
- scopedLabelMap :: Lens' c ScopedLabelMap
- scoped_label_map :: Lens' c (Map String (Map CfgNodeType Label))
- withScopedLabel :: (MonadState s m, HasScopedLabelMap s) => String -> Map CfgNodeType Label -> m a -> m a
- edgeToScopedLabel :: (MonadState s m, HasScopedLabelMap s, CfgComponent fs s) => CfgNode fs -> String -> CfgNodeType -> m ()
- constructCfgScopedLabeledBreak :: (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- constructCfgScopedLabeledContinue :: (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- constructCfgScopedLabel :: (HasScopedLabelMap s, MonadState s m, CfgComponent fs s) => TermLab fs l -> String -> TermLab fs s0 -> m (EnterExitPair fs s0) -> m (EnterExitPair fs i)
- constructCfgShortCircuitingBinOp :: (MonadState s m, CfgComponent fs s) => TermLab fs l -> m (EnterExitPair fs ls) -> m (EnterExitPair fs rs) -> m (EnterExitPair fs es)
- constructCfgCondOp :: (MonadState s m, CfgComponent fs s) => TermLab fs l -> m (EnterExitPair fs ls) -> m (EnterExitPair fs rs) -> m (EnterExitPair fs es) -> m (EnterExitPair fs es)
- data Cfg fs
- data CfgNode fs
- data CfgNodeType
- pattern ExitNode :: CfgNodeType
- pattern LoopEntryNode :: CfgNodeType
- pattern EnterNode :: CfgNodeType
- isEnterNode :: CfgNodeType -> Bool
- evalPointToNodeType :: NodeEvaluationPoint -> CfgNodeType
- nodeTypeToEvalPoint :: CfgNodeType -> NodeEvaluationPoint
- class HasCurCfg c fs | c -> fs where
- cfg_node_prevs :: HasCfgNode c fs => Lens' c (Set Label)
- cfg_node_succs :: HasCfgNode c fs => Lens' c (Set Label)
- cfg_node_lab :: HasCfgNode c fs => Lens' c Label
- cfg_node_type :: HasCfgNode c fs => Lens' c CfgNodeType
- cfg_node_term :: HasCfgNode c fs => Lens' c (E (TermLab fs))
- emptyCfg :: Cfg fs
- cfgNodes :: Cfg fs -> [CfgNode fs]
- addCfgNode :: (HasCurCfg s fs, HasLabelGen s, MonadState s m) => TermLab fs l -> CfgNodeType -> m (CfgNode fs)
- nodeForLab :: (HasCurCfg s fs, MonadState s m) => Label -> m (Maybe (CfgNode fs))
- addEdge :: CfgNode fs -> CfgNode fs -> Cfg fs -> Cfg fs
- addEdgeLab :: forall fs. Proxy fs -> Label -> Label -> Cfg fs -> Cfg fs
- safeLookupCfg :: Cfg fs -> Label -> Maybe (CfgNode fs)
- lookupCfg :: Cfg fs -> Label -> CfgNode fs
- cfgNodeForTerm :: Cfg fs -> CfgNodeType -> TermLab fs l -> Maybe (CfgNode fs)
- contractNode :: Label -> Cfg fs -> Cfg fs
- satisfyingPredBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- satisfyingSuccBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- satisfyingStrictPredBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- satisfyingStrictSuccBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- prettyCfg :: Cfg fs -> String
- debugCfg :: (All ShowHF fs, All HFoldable fs, All HFunctor fs) => TermLab fs l -> Cfg fs -> IO ()
- isStartNode :: Cfg fs -> CfgNode fs -> Bool
- startsBasicBlock :: Cfg fs -> CfgNode fs -> Bool
- renderCfgDot :: forall fs l. CfgBuilder fs => TermLab fs l -> Graph
Documentation
collapseFProd' :: (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> (AnnTerm a gs :*: f t) Source #
data EnterExitPair fs l Source #
Constructors
EnterExitPair | |
SubPairs (Sum fs (EnterExitPair fs) l) | |
EmptyEnterExit |
Instances
(All ShowHF fs, All HFunctor fs) => Show (EnterExitPair fs l) Source # | |
Defined in Cubix.Language.Parametric.Semantics.Cfg.CfgConstruction Methods showsPrec :: Int -> EnterExitPair fs l -> ShowS # show :: EnterExitPair fs l -> String # showList :: [EnterExitPair fs l] -> ShowS # |
extractEEPList :: forall fs l. (ListF :-<: fs, Typeable l) => EnterExitPair fs [l] -> [EnterExitPair fs l] Source #
extractEEPPair :: forall fs a b. PairF :-<: fs => EnterExitPair fs (a, b) -> (EnterExitPair fs a, EnterExitPair fs b) Source #
extractEEPMaybe :: (All (KExtractF' Maybe) fs, Monad m) => m (EnterExitPair fs (Maybe l)) -> m (Maybe (EnterExitPair fs l)) Source #
identEnterExit :: CfgNode fs -> EnterExitPair fs l Source #
combineEnterExit :: (HasCurCfg s fs, All HTraversable fs, All HFoldable fs, All HFunctor fs, MonadState s m) => EnterExitPair fs i -> EnterExitPair fs j -> m (EnterExitPair fs k) Source #
collapseEnterExit :: (HasCurCfg s fs, All HTraversable fs, All HFoldable fs, All HFunctor fs, MonadState s m) => EnterExitPair fs i -> m (EnterExitPair fs j) Source #
type family ComputationSorts (fs :: [(* -> *) -> * -> *]) :: [*] Source #
Instances
type ComputationSorts MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
type ComputationSorts MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg type ComputationSorts MLuaSig = '[StatL, ExpL, PrefixExpL, VarL, TableFieldL, FunCallL, [BlockItemL], AssignL] | |
type ComputationSorts MJSSig Source # | |
type ComputationSorts MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
type ComputationSorts MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg |
type family SuspendedComputationSorts (fs :: [(* -> *) -> * -> *]) :: [*] Source #
Instances
type SuspendedComputationSorts MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
type SuspendedComputationSorts MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
type SuspendedComputationSorts MJSSig Source # | |
type SuspendedComputationSorts MJavaSig Source # | |
type SuspendedComputationSorts MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg |
type family ContainerFunctors (fs :: [(* -> *) -> * -> *]) :: [(* -> *) -> * -> *] Source #
Instances
type ContainerFunctors MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
type ContainerFunctors MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
type ContainerFunctors MJSSig Source # | |
type ContainerFunctors MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
type ContainerFunctors MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg |
labeledIsComputationSort :: forall fs l. (IsComputationSort fs, All HFunctor fs) => TermLab fs l -> Bool Source #
labeledIsSuspendedComputationSort :: (IsSuspendedComputationSort fs, All HFunctor fs) => AnnTerm a fs l -> Bool Source #
type PreRAlg f g a = f (HFix g :*: a) :-> a Source #
PreRAlg's are things that can be modularly composed to form R-algebras. R-algebras are in turn the building block used to define paramorphisms, a recursion scheme where each step can depend on both an entire term and the previous results. Because the map of variables in scope within a term depends both on the entire term and the variables in scope in each subterm, this is a correct recursion scheme to use.
PreRAlg f f a == RAlg f a
In PreRAlg f g a
, f
is the signature functor of
the outer layer, while g
is the recursive signature
functor, and a
is the carrier of the R-algebra.
class ConstructCfg gs s f where Source #
Methods
constructCfg :: PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs)) Source #
Instances
(f :-<: gs, HTraversable f, CfgComponent gs s, SortChecks gs) => ConstructCfg gs s f Source # | |
All (ConstructCfg g s) fs => ConstructCfg g s (Sum fs) Source # | |
runSubCfgs :: (f :-<: gs, HTraversable f, CfgComponent gs s) => f (HState s (EnterExitPair gs)) i -> State s (EnterExitPair gs j) Source #
type CfgComponent gs s = (HasLabelGen s, HasCurCfg s gs, All HTraversable gs, All HFoldable gs, All HFunctor gs) Source #
constructCfgGeneric :: forall f gs s. (f :-<: gs, HTraversable f, CfgComponent gs s) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs)) Source #
constructCfgDefault :: forall f gs s. (f :-<: gs, HTraversable f, CfgComponent gs s, SortChecks gs) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs)) Source #
type family CfgState (f :: [(* -> *) -> * -> *]) :: * Source #
Instances
type CfgState MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
type CfgState MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
type CfgState MJSSig Source # | |
type CfgState MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
type CfgState MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg |
class CfgInitState fs where Source #
Methods
cfgInitState :: Proxy fs -> CfgState fs Source #
Instances
CfgInitState MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg Methods cfgInitState :: Proxy MPythonSig -> CfgState MPythonSig Source # | |
CfgInitState MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
CfgInitState MJSSig Source # | |
CfgInitState MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
CfgInitState MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg |
class (CfgComponent fs (CfgState fs), ConstructCfg fs (CfgState fs) (Sum fs), CfgInitState fs) => CfgBuilder fs Source #
Instances
(CfgComponent fs (CfgState fs), ConstructCfg fs (CfgState fs) (Sum fs), CfgInitState fs) => CfgBuilder fs Source # | |
makeCfg :: forall fs l. CfgBuilder fs => TermLab fs l -> Cfg fs Source #
Constructs a CFG for the given labelled term
constructCfgReturn :: (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (Maybe (EnterExitPair gs i)) -> m (EnterExitPair gs l) Source #
constructCfgEmpty :: (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs l) Source #
constructCfgIfElseIfElse :: (MonadState s m, CfgComponent gs s) => TermLab gs l -> m [(EnterExitPair gs i, EnterExitPair gs j)] -> m (Maybe (EnterExitPair gs k)) -> m (EnterExitPair gs l) Source #
Instances
Eq LoopStack Source # | |
Ord LoopStack Source # | |
Defined in Cubix.Language.Parametric.Semantics.Cfg.CommonNodes | |
Show LoopStack Source # | |
HasLoopStack LoopStack Source # | |
class HasLoopStack c where Source #
Minimal complete definition
Methods
loopStack :: Lens' c LoopStack Source #
break_stack :: Lens' c [Label] Source #
continue_stack :: Lens' c [Label] Source #
Instances
pushContinueNode :: (MonadState s m, HasLoopStack s) => CfgNode fs -> m () Source #
popContinueNode :: (MonadState s m, HasLoopStack s) => m () Source #
pushBreakNode :: (MonadState s m, HasLoopStack s) => CfgNode fs -> m () Source #
popBreakNode :: (MonadState s m, HasLoopStack s) => m () Source #
pushLoopNode :: (MonadState s m, HasLoopStack s) => CfgNode fs -> CfgNode fs -> m () Source #
popLoopNode :: (MonadState s m, HasLoopStack s) => m () Source #
constructCfgWhile :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) -> m (EnterExitPair gs j) -> m (EnterExitPair gs k) Source #
constructCfgDoWhile :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) -> m (EnterExitPair gs j) -> m (EnterExitPair gs k) Source #
constructCfgFor :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (Maybe (EnterExitPair gs h)) -> m (Maybe (EnterExitPair gs i)) -> m (Maybe (EnterExitPair gs j)) -> m (EnterExitPair gs k) -> m (EnterExitPair gs l) Source #
constructCfgBreak :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) Source #
constructCfgContinue :: (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) Source #
class HasLabelMap c where Source #
Minimal complete definition
constructCfgGoto :: (MonadState s m, HasLabelMap s, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
constructCfgLabel :: forall gs s m l i. (MonadState s m, HasLabelMap s, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
data ScopedLabelMap Source #
Use this if labels are lexically scoped and may not be shadowed In accordance with the representable/valid principle, we are not reusing LabelMap for this purpose. LabelMap is for C's goto labels; ScopedLabelMap is for JavaJS labeled breakcontinue
Instances
class HasScopedLabelMap c where Source #
Minimal complete definition
Methods
scopedLabelMap :: Lens' c ScopedLabelMap Source #
scoped_label_map :: Lens' c (Map String (Map CfgNodeType Label)) Source #
Instances
HasScopedLabelMap ScopedLabelMap Source # | |
Defined in Cubix.Language.Parametric.Semantics.Cfg.CommonNodes Methods scopedLabelMap :: Lens' ScopedLabelMap ScopedLabelMap Source # scoped_label_map :: Lens' ScopedLabelMap (Map String (Map CfgNodeType Label)) Source # |
withScopedLabel :: (MonadState s m, HasScopedLabelMap s) => String -> Map CfgNodeType Label -> m a -> m a Source #
edgeToScopedLabel :: (MonadState s m, HasScopedLabelMap s, CfgComponent fs s) => CfgNode fs -> String -> CfgNodeType -> m () Source #
constructCfgScopedLabeledBreak :: (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
constructCfgScopedLabeledContinue :: (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
constructCfgScopedLabel :: (HasScopedLabelMap s, MonadState s m, CfgComponent fs s) => TermLab fs l -> String -> TermLab fs s0 -> m (EnterExitPair fs s0) -> m (EnterExitPair fs i) Source #
constructCfgShortCircuitingBinOp :: (MonadState s m, CfgComponent fs s) => TermLab fs l -> m (EnterExitPair fs ls) -> m (EnterExitPair fs rs) -> m (EnterExitPair fs es) Source #
constructCfgCondOp :: (MonadState s m, CfgComponent fs s) => TermLab fs l -> m (EnterExitPair fs ls) -> m (EnterExitPair fs rs) -> m (EnterExitPair fs es) -> m (EnterExitPair fs es) Source #
Instances
All EqHF fs => Eq (Cfg fs) Source # | |
(All HFunctor fs, All OrdHF fs, All EqHF fs) => Ord (Cfg fs) Source # | |
(All ShowHF fs, All HFunctor fs) => Show (Cfg fs) Source # | |
Generic (Cfg fs) Source # | |
HasCurCfg (Cfg fs) fs Source # | |
type Rep (Cfg fs) Source # | |
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph type Rep (Cfg fs) = D1 ('MetaData "Cfg" "Cubix.Language.Parametric.Semantics.Cfg.Graph" "cubix-0.1.0.0-GE3qzSJT6A0CUj1veI8jGO" 'False) (C1 ('MetaCons "Cfg" 'PrefixI 'True) (S1 ('MetaSel ('Just "_cfg_nodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Label (CfgNode fs))) :*: S1 ('MetaSel ('Just "_cfg_ast_nodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Label (Map CfgNodeType Label))))) |
Instances
data CfgNodeType Source #
Instances
pattern ExitNode :: CfgNodeType Source #
pattern LoopEntryNode :: CfgNodeType Source #
pattern EnterNode :: CfgNodeType Source #
isEnterNode :: CfgNodeType -> Bool Source #
class HasCurCfg c fs | c -> fs where Source #
Minimal complete definition
cfg_node_prevs :: HasCfgNode c fs => Lens' c (Set Label) Source #
cfg_node_succs :: HasCfgNode c fs => Lens' c (Set Label) Source #
cfg_node_lab :: HasCfgNode c fs => Lens' c Label Source #
cfg_node_type :: HasCfgNode c fs => Lens' c CfgNodeType Source #
cfg_node_term :: HasCfgNode c fs => Lens' c (E (TermLab fs)) Source #
addCfgNode :: (HasCurCfg s fs, HasLabelGen s, MonadState s m) => TermLab fs l -> CfgNodeType -> m (CfgNode fs) Source #
nodeForLab :: (HasCurCfg s fs, MonadState s m) => Label -> m (Maybe (CfgNode fs)) Source #
cfgNodeForTerm :: Cfg fs -> CfgNodeType -> TermLab fs l -> Maybe (CfgNode fs) Source #
satisfyingPredBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
satisfyingSuccBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
satisfyingStrictPredBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
satisfyingStrictSuccBoundary :: (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
debugCfg :: (All ShowHF fs, All HFoldable fs, All HFunctor fs) => TermLab fs l -> Cfg fs -> IO () Source #
Prints a large amount of debug information about a CFG, including a node list, an edge list, and a record of which nodes begin basic blocks.
For an actual graph visualization, see Cubix.Language.Parametric.Semantics.CfgDot
renderCfgDot :: forall fs l. CfgBuilder fs => TermLab fs l -> Graph Source #