| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cubix.Language.Parametric.Semantics.Cfg
Synopsis
- class (CfgComponent fs (CfgState fs), ConstructCfg fs (CfgState fs) (Sum fs), CfgInitState fs) => CfgBuilder (fs :: Signature)
- makeCfg :: forall (fs :: Signature) l. CfgBuilder fs => TermLab fs l -> Cfg fs
- collapseFProd :: forall (f :: (Type -> Type) -> Type -> Type) (gs :: Signature) (t :: Type -> Type). (HFunctor f, f :-<: gs) => f (Term gs :*: t) :-> (Term gs :*: f t)
- collapseFProd' :: forall (f :: (Type -> Type) -> Type -> Type) (gs :: Signature) a (t :: Type -> Type). (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> (AnnTerm a gs :*: f t)
- fprodFst' :: forall (f :: (Type -> Type) -> Type -> Type) (gs :: Signature) a (t :: Type -> Type). (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> AnnTerm a gs
- data EnterExitPair (fs :: Signature) l
- = EnterExitPair { }
- | SubPairs (Sum fs (EnterExitPair fs) l)
- | EmptyEnterExit
- extractEEPList :: forall (fs :: Signature) l. (ListF :-<: fs, Typeable l) => EnterExitPair fs [l] -> [EnterExitPair fs l]
- extractEEPPair :: forall (fs :: Signature) a b. PairF :-<: fs => EnterExitPair fs (a, b) -> (EnterExitPair fs a, EnterExitPair fs b)
- extractEEPMaybe :: forall (fs :: [(Type -> Type) -> Type -> Type]) m l. (All (KExtractF' Maybe) fs, Monad m) => m (EnterExitPair fs (Maybe l)) -> m (Maybe (EnterExitPair fs l))
- identEnterExit :: forall (fs :: Signature) l. CfgNode fs -> EnterExitPair fs l
- combineEnterExit :: forall s (fs :: Signature) m i j k. (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 :: forall s (fs :: Signature) m i j. (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 :: Signature) :: [Type]
- type family SuspendedComputationSorts (fs :: Signature) :: [Type]
- type family ContainerFunctors (fs :: Signature) :: [Node]
- labeledIsComputationSort :: forall (fs :: Signature) l. (IsComputationSort fs, All HFunctor fs) => TermLab fs l -> Bool
- labeledIsSuspendedComputationSort :: forall (fs :: Signature) a l. (IsSuspendedComputationSort fs, All HFunctor fs) => AnnTerm a fs l -> Bool
- labeledIsContainer :: forall (fs :: Signature) a l. (IsContainer fs, All HFunctor fs) => AnnTerm a fs l -> Bool
- type PreRAlg (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type) (a :: Type -> Type) = f (HFix g :*: a) :-> a
- class ConstructCfg (gs :: Signature) s (f :: Node) where
- constructCfg :: PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs))
- data HState s (f :: Type -> Type) l = HState {}
- runSubCfgs :: forall f (gs :: Signature) s i j. (f :-<: gs, HTraversable f, CfgComponent gs s) => f (HState s (EnterExitPair gs)) i -> State s (EnterExitPair gs j)
- type CfgComponent (gs :: Signature) s = (HasLabelGen s, HasCurCfg s gs, All HTraversable gs, All HFoldable gs, All HFunctor gs)
- constructCfgGeneric :: forall (f :: Fragment) (gs :: Signature) s. (f :-<: gs, HTraversable f, CfgComponent gs s) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs))
- constructCfgDefault :: forall (f :: Fragment) (gs :: Signature) s. (f :-<: gs, HTraversable f, CfgComponent gs s, SortChecks gs) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs))
- type family CfgState (fs :: Signature)
- class CfgInitState (fs :: Signature) where
- cfgInitState :: Proxy fs -> CfgState fs
- constructCfgReturn :: forall s m (gs :: Signature) l i. (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (Maybe (EnterExitPair gs i)) -> m (EnterExitPair gs l)
- constructCfgEmpty :: forall s m (gs :: Signature) l. (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs l)
- constructCfgIfElseIfElse :: forall s m (gs :: Signature) l i j k. (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 :: forall s m (fs :: Signature). (MonadState s m, HasLoopStack s) => CfgNode fs -> m ()
- popContinueNode :: (MonadState s m, HasLoopStack s) => m ()
- pushBreakNode :: forall s m (fs :: Signature). (MonadState s m, HasLoopStack s) => CfgNode fs -> m ()
- popBreakNode :: (MonadState s m, HasLoopStack s) => m ()
- pushLoopNode :: forall s m (fs :: Signature). (MonadState s m, HasLoopStack s) => CfgNode fs -> CfgNode fs -> m ()
- popLoopNode :: (MonadState s m, HasLoopStack s) => m ()
- constructCfgWhile :: forall s m (gs :: Signature) l i j k. (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) -> m (EnterExitPair gs j) -> m (EnterExitPair gs k)
- constructCfgDoWhile :: forall s m (gs :: Signature) l i j k. (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) -> m (EnterExitPair gs j) -> m (EnterExitPair gs k)
- constructCfgFor :: forall s m (gs :: Signature) l h i j k. (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 :: forall s m (gs :: Signature) l i. (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i)
- constructCfgContinue :: forall s m (gs :: Signature) l i. (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i)
- data LabelMap
- emptyLabelMap :: LabelMap
- class HasLabelMap c where
- constructCfgGoto :: forall s m (gs :: Signature) l i. (MonadState s m, HasLabelMap s, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- constructCfgLabel :: forall (gs :: Signature) 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 :: forall s m (fs :: Signature). (MonadState s m, HasScopedLabelMap s, CfgComponent fs s) => CfgNode fs -> String -> CfgNodeType -> m ()
- constructCfgScopedLabeledBreak :: forall s m (gs :: Signature) l i. (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- constructCfgScopedLabeledContinue :: forall s m (gs :: Signature) l i. (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i)
- constructCfgScopedLabel :: forall s m (fs :: Signature) l s0 i. (HasScopedLabelMap s, MonadState s m, CfgComponent fs s) => TermLab fs l -> String -> TermLab fs s0 -> m (EnterExitPair fs s0) -> m (EnterExitPair fs i)
- constructCfgShortCircuitingBinOp :: forall s m (fs :: Signature) l ls rs es. (MonadState s m, CfgComponent fs s) => TermLab fs l -> m (EnterExitPair fs ls) -> m (EnterExitPair fs rs) -> m (EnterExitPair fs es)
- constructCfgCondOp :: forall s m (fs :: Signature) l ls rs es. (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 :: Signature)
- data CfgNode (fs :: Signature)
- safeLookupCfg :: forall (fs :: Signature). Cfg fs -> Label -> Maybe (CfgNode fs)
- lookupCfg :: forall (fs :: Signature). Cfg fs -> Label -> CfgNode fs
- cfgNodeForTerm :: forall (fs :: Signature) l. Cfg fs -> CfgNodeType -> TermLab fs l -> Maybe (CfgNode fs)
- data CfgNodeType
- pattern EnterNode :: CfgNodeType
- pattern LoopEntryNode :: CfgNodeType
- pattern ExitNode :: CfgNodeType
- isEnterNode :: CfgNodeType -> Bool
- evalPointToNodeType :: NodeEvaluationPoint -> CfgNodeType
- nodeTypeToEvalPoint :: CfgNodeType -> NodeEvaluationPoint
- class HasCurCfg c (fs :: Signature) | 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 :: forall (fs :: Signature). Cfg fs
- cfgNodes :: forall (fs :: Signature). Cfg fs -> [CfgNode fs]
- addCfgNode :: forall s (fs :: Signature) m l. (HasCurCfg s fs, HasLabelGen s, MonadState s m) => TermLab fs l -> CfgNodeType -> m (CfgNode fs)
- nodeForLab :: forall s (fs :: Signature) m. (HasCurCfg s fs, MonadState s m) => Label -> m (Maybe (CfgNode fs))
- addEdge :: forall (fs :: Signature). CfgNode fs -> CfgNode fs -> Cfg fs -> Cfg fs
- addEdgeLab :: forall (fs :: Signature). Label -> Label -> Cfg fs -> Cfg fs
- contractNode :: forall (fs :: Signature). Label -> Cfg fs -> Cfg fs
- satisfyingPredBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- satisfyingSuccBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- satisfyingStrictPredBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- satisfyingStrictSuccBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs]
- prettyCfg :: forall (fs :: Signature). Cfg fs -> String
- debugCfg :: forall (fs :: [(Type -> Type) -> Type -> Type]) l. (All ShowHF fs, All HFoldable fs, All HFunctor fs) => TermLab fs l -> Cfg fs -> IO ()
- isStartNode :: forall (fs :: Signature). Cfg fs -> CfgNode fs -> Bool
- startsBasicBlock :: forall (fs :: Signature). Cfg fs -> CfgNode fs -> Bool
- renderCfgDot :: forall (fs :: Signature) l. CfgBuilder fs => TermLab fs l -> Graph
Documentation
class (CfgComponent fs (CfgState fs), ConstructCfg fs (CfgState fs) (Sum fs), CfgInitState fs) => CfgBuilder (fs :: Signature) Source #
Instances
| (CfgComponent fs (CfgState fs), ConstructCfg fs (CfgState fs) (Sum fs), CfgInitState fs) => CfgBuilder fs Source # | |
makeCfg :: forall (fs :: Signature) l. CfgBuilder fs => TermLab fs l -> Cfg fs Source #
Constructs a CFG for the given labelled term
collapseFProd :: forall (f :: (Type -> Type) -> Type -> Type) (gs :: Signature) (t :: Type -> Type). (HFunctor f, f :-<: gs) => f (Term gs :*: t) :-> (Term gs :*: f t) Source #
collapseFProd' :: forall (f :: (Type -> Type) -> Type -> Type) (gs :: Signature) a (t :: Type -> Type). (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> (AnnTerm a gs :*: f t) Source #
fprodFst' :: forall (f :: (Type -> Type) -> Type -> Type) (gs :: Signature) a (t :: Type -> Type). (HFunctor f, f :-<: gs) => (f :&: a) (AnnTerm a gs :*: t) :-> AnnTerm a gs Source #
data EnterExitPair (fs :: Signature) 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 :: Signature) l. (ListF :-<: fs, Typeable l) => EnterExitPair fs [l] -> [EnterExitPair fs l] Source #
extractEEPPair :: forall (fs :: Signature) a b. PairF :-<: fs => EnterExitPair fs (a, b) -> (EnterExitPair fs a, EnterExitPair fs b) Source #
extractEEPMaybe :: forall (fs :: [(Type -> Type) -> Type -> Type]) m l. (All (KExtractF' Maybe) fs, Monad m) => m (EnterExitPair fs (Maybe l)) -> m (Maybe (EnterExitPair fs l)) Source #
identEnterExit :: forall (fs :: Signature) l. CfgNode fs -> EnterExitPair fs l Source #
combineEnterExit :: forall s (fs :: Signature) m i j k. (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 :: forall s (fs :: Signature) m i j. (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 :: Signature) :: [Type] Source #
Instances
| type ComputationSorts MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg | |
| type ComputationSorts MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
| type ComputationSorts MJSSig Source # | |
| 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 MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
type family SuspendedComputationSorts (fs :: Signature) :: [Type] Source #
Instances
| type SuspendedComputationSorts MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg | |
| type SuspendedComputationSorts MJavaSig Source # | |
| type SuspendedComputationSorts MJSSig Source # | |
| type SuspendedComputationSorts MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
| type SuspendedComputationSorts MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
type family ContainerFunctors (fs :: Signature) :: [Node] Source #
Instances
| type ContainerFunctors MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg | |
| type ContainerFunctors MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
| type ContainerFunctors MJSSig Source # | |
| type ContainerFunctors MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
| type ContainerFunctors MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
labeledIsComputationSort :: forall (fs :: Signature) l. (IsComputationSort fs, All HFunctor fs) => TermLab fs l -> Bool Source #
labeledIsSuspendedComputationSort :: forall (fs :: Signature) a l. (IsSuspendedComputationSort fs, All HFunctor fs) => AnnTerm a fs l -> Bool Source #
labeledIsContainer :: forall (fs :: Signature) a l. (IsContainer fs, All HFunctor fs) => AnnTerm a fs l -> Bool Source #
type PreRAlg (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type) (a :: Type -> Type) = 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 :: Signature) s (f :: Node) 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 :: forall f (gs :: Signature) s i j. (f :-<: gs, HTraversable f, CfgComponent gs s) => f (HState s (EnterExitPair gs)) i -> State s (EnterExitPair gs j) Source #
type CfgComponent (gs :: Signature) s = (HasLabelGen s, HasCurCfg s gs, All HTraversable gs, All HFoldable gs, All HFunctor gs) Source #
constructCfgGeneric :: forall (f :: Fragment) (gs :: Signature) s. (f :-<: gs, HTraversable f, CfgComponent gs s) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs)) Source #
constructCfgDefault :: forall (f :: Fragment) (gs :: Signature) s. (f :-<: gs, HTraversable f, CfgComponent gs s, SortChecks gs) => PreRAlg (f :&: Label) (Sum gs :&: Label) (HState s (EnterExitPair gs)) Source #
type family CfgState (fs :: Signature) Source #
Instances
| type CfgState MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg | |
| type CfgState MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
| type CfgState MJSSig Source # | |
| type CfgState MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
| type CfgState MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg | |
class CfgInitState (fs :: Signature) where Source #
Methods
cfgInitState :: Proxy fs -> CfgState fs Source #
Instances
| CfgInitState MCSig Source # | |
Defined in Cubix.Language.C.Parametric.Common.Cfg | |
| CfgInitState MJavaSig Source # | |
Defined in Cubix.Language.Java.Parametric.Common.Cfg | |
| CfgInitState MJSSig Source # | |
| CfgInitState MLuaSig Source # | |
Defined in Cubix.Language.Lua.Parametric.Common.Cfg | |
| CfgInitState MPythonSig Source # | |
Defined in Cubix.Language.Python.Parametric.Common.Cfg Methods cfgInitState :: Proxy MPythonSig -> CfgState MPythonSig Source # | |
constructCfgReturn :: forall s m (gs :: Signature) l i. (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (Maybe (EnterExitPair gs i)) -> m (EnterExitPair gs l) Source #
constructCfgEmpty :: forall s m (gs :: Signature) l. (MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs l) Source #
constructCfgIfElseIfElse :: forall s m (gs :: Signature) l i j k. (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
| Show LoopStack Source # | |
| HasLoopStack LoopStack Source # | |
| Eq LoopStack Source # | |
| Ord LoopStack Source # | |
Defined in Cubix.Language.Parametric.Semantics.Cfg.CommonNodes | |
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 :: forall s m (fs :: Signature). (MonadState s m, HasLoopStack s) => CfgNode fs -> m () Source #
popContinueNode :: (MonadState s m, HasLoopStack s) => m () Source #
pushBreakNode :: forall s m (fs :: Signature). (MonadState s m, HasLoopStack s) => CfgNode fs -> m () Source #
popBreakNode :: (MonadState s m, HasLoopStack s) => m () Source #
pushLoopNode :: forall s m (fs :: Signature). (MonadState s m, HasLoopStack s) => CfgNode fs -> CfgNode fs -> m () Source #
popLoopNode :: (MonadState s m, HasLoopStack s) => m () Source #
constructCfgWhile :: forall s m (gs :: Signature) l i j k. (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 :: forall s m (gs :: Signature) l i j k. (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 :: forall s m (gs :: Signature) l h i j k. (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 :: forall s m (gs :: Signature) l i. (HasLoopStack s, MonadState s m, CfgComponent gs s) => TermLab gs l -> m (EnterExitPair gs i) Source #
constructCfgContinue :: forall s m (gs :: Signature) l i. (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 :: forall s m (gs :: Signature) l i. (MonadState s m, HasLabelMap s, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
constructCfgLabel :: forall (gs :: Signature) 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 :: forall s m (fs :: Signature). (MonadState s m, HasScopedLabelMap s, CfgComponent fs s) => CfgNode fs -> String -> CfgNodeType -> m () Source #
constructCfgScopedLabeledBreak :: forall s m (gs :: Signature) l i. (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
constructCfgScopedLabeledContinue :: forall s m (gs :: Signature) l i. (HasScopedLabelMap s, MonadState s m, CfgComponent gs s) => TermLab gs l -> String -> m (EnterExitPair gs i) Source #
constructCfgScopedLabel :: forall s m (fs :: Signature) l s0 i. (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 :: forall s m (fs :: Signature) l ls rs es. (MonadState s m, CfgComponent fs s) => TermLab fs l -> m (EnterExitPair fs ls) -> m (EnterExitPair fs rs) -> m (EnterExitPair fs es) Source #
constructCfgCondOp :: forall s m (fs :: Signature) l ls rs es. (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 #
data Cfg (fs :: Signature) Source #
Instances
data CfgNode (fs :: Signature) Source #
Instances
| Generic (CfgNode fs) Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph Associated Types
| |||||
| (All ShowHF fs, All HFunctor fs) => Show (CfgNode fs) Source # | |||||
| All EqHF fs => Eq (CfgNode fs) Source # | |||||
| (All HFunctor fs, All OrdHF fs, All EqHF fs) => Ord (CfgNode fs) Source # | |||||
| type Rep (CfgNode fs) Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph type Rep (CfgNode fs) = D1 ('MetaData "CfgNode" "Cubix.Language.Parametric.Semantics.Cfg.Graph" "cubix-0.7.0.15-inplace" 'False) (C1 ('MetaCons "CfgNode" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_cfg_node_prevs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Label)) :*: S1 ('MetaSel ('Just "_cfg_node_succs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Label))) :*: (S1 ('MetaSel ('Just "_cfg_node_lab") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Label) :*: (S1 ('MetaSel ('Just "_cfg_node_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CfgNodeType) :*: S1 ('MetaSel ('Just "_cfg_node_term") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (E (TermLab fs))))))) | |||||
cfgNodeForTerm :: forall (fs :: Signature) l. Cfg fs -> CfgNodeType -> TermLab fs l -> Maybe (CfgNode fs) Source #
data CfgNodeType Source #
Instances
| Generic CfgNodeType Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph Associated Types
| |||||
| Show CfgNodeType Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph Methods showsPrec :: Int -> CfgNodeType -> ShowS # show :: CfgNodeType -> String # showList :: [CfgNodeType] -> ShowS # | |||||
| NFData CfgNodeType Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph Methods rnf :: CfgNodeType -> () # | |||||
| Eq CfgNodeType Source # | |||||
| Ord CfgNodeType Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph Methods compare :: CfgNodeType -> CfgNodeType -> Ordering # (<) :: CfgNodeType -> CfgNodeType -> Bool # (<=) :: CfgNodeType -> CfgNodeType -> Bool # (>) :: CfgNodeType -> CfgNodeType -> Bool # (>=) :: CfgNodeType -> CfgNodeType -> Bool # max :: CfgNodeType -> CfgNodeType -> CfgNodeType # min :: CfgNodeType -> CfgNodeType -> CfgNodeType # | |||||
| type Rep CfgNodeType Source # | |||||
Defined in Cubix.Language.Parametric.Semantics.Cfg.Graph type Rep CfgNodeType = D1 ('MetaData "CfgNodeType" "Cubix.Language.Parametric.Semantics.Cfg.Graph" "cubix-0.7.0.15-inplace" 'True) (C1 ('MetaCons "CfgNodeType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NodeEvaluationPoint))) | |||||
pattern EnterNode :: CfgNodeType Source #
pattern LoopEntryNode :: CfgNodeType Source #
pattern ExitNode :: CfgNodeType Source #
isEnterNode :: CfgNodeType -> Bool Source #
class HasCurCfg c (fs :: Signature) | 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 :: forall s (fs :: Signature) m l. (HasCurCfg s fs, HasLabelGen s, MonadState s m) => TermLab fs l -> CfgNodeType -> m (CfgNode fs) Source #
nodeForLab :: forall s (fs :: Signature) m. (HasCurCfg s fs, MonadState s m) => Label -> m (Maybe (CfgNode fs)) Source #
satisfyingPredBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
satisfyingSuccBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
satisfyingStrictPredBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
satisfyingStrictSuccBoundary :: forall (fs :: Signature). (CfgNode fs -> Bool) -> Cfg fs -> CfgNode fs -> Maybe [CfgNode fs] Source #
debugCfg :: forall (fs :: [(Type -> Type) -> Type -> Type]) l. (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 :: Signature) l. CfgBuilder fs => TermLab fs l -> Graph Source #