hoopl 3.7.4.0 → 3.7.7.0
raw patch · 8 files changed
+61/−19 lines, 8 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Compiler.Hoopl.Dataflow: BwdPass :: DataflowLattice f -> BwdTransfer n f -> BwdRewrite n f -> BwdPass n f
- Compiler.Hoopl.Dataflow: DataflowLattice :: String -> a -> JoinFun a -> Bool -> DataflowLattice a
- Compiler.Hoopl.Dataflow: FwdPass :: DataflowLattice f -> FwdTransfer n f -> FwdRewrite n f -> FwdPass n f
- Compiler.Hoopl.Dataflow: NewFact :: a -> NewFact a
- Compiler.Hoopl.Dataflow: NoChange :: ChangeFlag
- Compiler.Hoopl.Dataflow: OldFact :: a -> OldFact a
- Compiler.Hoopl.Dataflow: SomeChange :: ChangeFlag
- Compiler.Hoopl.Dataflow: analyzeAndRewriteBwd :: (Edges n) => BwdPass n f -> Body n -> FactBase f -> FuelMonad (Body n, FactBase f)
- Compiler.Hoopl.Dataflow: analyzeAndRewriteFwd :: (Edges n) => FwdPass n f -> Body n -> FactBase f -> FuelMonad (Body n, FactBase f)
- Compiler.Hoopl.Dataflow: bp_lattice :: BwdPass n f -> DataflowLattice f
- Compiler.Hoopl.Dataflow: bp_rewrite :: BwdPass n f -> BwdRewrite n f
- Compiler.Hoopl.Dataflow: bp_transfer :: BwdPass n f -> BwdTransfer n f
- Compiler.Hoopl.Dataflow: changeIf :: Bool -> ChangeFlag
- Compiler.Hoopl.Dataflow: data BwdPass n f
- Compiler.Hoopl.Dataflow: data ChangeFlag
- Compiler.Hoopl.Dataflow: data DataflowLattice a
- Compiler.Hoopl.Dataflow: data FwdPass n f
- Compiler.Hoopl.Dataflow: deepBwdRw :: BwdRewrite n f -> BwdRewrite n f
- Compiler.Hoopl.Dataflow: deepFwdRw :: FwdRewrite n f -> FwdRewrite n f
- Compiler.Hoopl.Dataflow: fact_bot :: DataflowLattice a -> a
- Compiler.Hoopl.Dataflow: fact_do_logging :: DataflowLattice a -> Bool
- Compiler.Hoopl.Dataflow: fact_extend :: DataflowLattice a -> JoinFun a
- Compiler.Hoopl.Dataflow: fact_name :: DataflowLattice a -> String
- Compiler.Hoopl.Dataflow: fp_lattice :: FwdPass n f -> DataflowLattice f
- Compiler.Hoopl.Dataflow: fp_rewrite :: FwdPass n f -> FwdRewrite n f
- Compiler.Hoopl.Dataflow: fp_transfer :: FwdPass n f -> FwdTransfer n f
- Compiler.Hoopl.Dataflow: newtype NewFact a
- Compiler.Hoopl.Dataflow: newtype OldFact a
- Compiler.Hoopl.Dataflow: noBwdRewrite :: BwdRewrite n f
- Compiler.Hoopl.Dataflow: noFwdRewrite :: FwdRewrite n f
- Compiler.Hoopl.Dataflow: shallowBwdRw :: SimpleBwdRewrite n f -> BwdRewrite n f
- Compiler.Hoopl.Dataflow: shallowFwdRw :: SimpleFwdRewrite n f -> FwdRewrite n f
- Compiler.Hoopl.Dataflow: thenBwdRw :: BwdRewrite n f -> BwdRewrite n f -> BwdRewrite n f
- Compiler.Hoopl.Dataflow: thenFwdRw :: FwdRewrite n f -> FwdRewrite n f -> FwdRewrite n f
- Compiler.Hoopl.Dataflow: type BwdRewrite n f = forall e x. n e x -> Fact x f -> Maybe (BwdRes n f e x)
- Compiler.Hoopl.Dataflow: type BwdTransfer n f = forall e x. n e x -> Fact x f -> Fact e f
- Compiler.Hoopl.Dataflow: type FwdRewrite n f = forall e x. n e x -> Fact e f -> Maybe (FwdRes n f e x)
- Compiler.Hoopl.Dataflow: type FwdTransfer n f = forall e x. n e x -> Fact e f -> Fact x f
- Compiler.Hoopl.Dataflow: type JoinFun a = OldFact a -> NewFact a -> (ChangeFlag, a)
- Compiler.Hoopl.Dataflow: type SimpleBwdRewrite n f = forall e x. n e x -> Fact x f -> Maybe (AGraph n e x)
- Compiler.Hoopl.Dataflow: type SimpleFwdRewrite n f = forall e x. n e x -> Fact e f -> Maybe (AGraph n e x)
- Compiler.Hoopl.Fuel: data FuelMonad a
- Compiler.Hoopl.Fuel: freshLabel :: FuelMonad Label
- Compiler.Hoopl.Fuel: getFuel :: FuelMonad Fuel
- Compiler.Hoopl.Fuel: instance Monad FuelMonad
- Compiler.Hoopl.Fuel: runWithFuel :: Fuel -> FuelMonad a -> a
- Compiler.Hoopl.Fuel: setFuel :: Fuel -> FuelMonad ()
- Compiler.Hoopl.Fuel: type Fuel = Int
- Compiler.Hoopl.Fuel: withFuel :: Maybe a -> FuelMonad (Maybe a)
- Compiler.Hoopl.Graph: BCat :: Block n e O -> Block n O x -> Block n e x
- Compiler.Hoopl.Graph: BUnit :: n e x -> Block n e x
- Compiler.Hoopl.Graph: BodyCat :: Body n -> Body n -> Body n
- Compiler.Hoopl.Graph: BodyEmpty :: Body n
- Compiler.Hoopl.Graph: BodyUnit :: Block n C C -> Body n
- Compiler.Hoopl.Graph: GMany :: MaybeO e (Block n O C) -> Body n -> MaybeO x (Block n C O) -> Graph n e x
- Compiler.Hoopl.Graph: GNil :: Graph n O O
- Compiler.Hoopl.Graph: GUnit :: Block n O O -> Graph n O O
- Compiler.Hoopl.Graph: JustO :: t -> MaybeO O t
- Compiler.Hoopl.Graph: NothingO :: MaybeO C t
- Compiler.Hoopl.Graph: addBlock :: Block n C C -> Body n -> Body n
- Compiler.Hoopl.Graph: bodyList :: (Edges n) => Body n -> [(Label, Block n C C)]
- Compiler.Hoopl.Graph: class Edges thing
- Compiler.Hoopl.Graph: data Block n e x
- Compiler.Hoopl.Graph: data Body n
- Compiler.Hoopl.Graph: data C
- Compiler.Hoopl.Graph: data Graph n e x
- Compiler.Hoopl.Graph: data MaybeO ex t
- Compiler.Hoopl.Graph: data O
- Compiler.Hoopl.Graph: entryLabel :: (Edges thing) => thing C x -> Label
- Compiler.Hoopl.Graph: instance (Edges n) => Edges (Block n)
- Compiler.Hoopl.Graph: successors :: (Edges thing) => thing e C -> [Label]
- Compiler.Hoopl.Label: allLabels :: [Label]
- Compiler.Hoopl.Label: data Label
- Compiler.Hoopl.Label: delFromFactBase :: FactBase f -> [(Label, a)] -> FactBase f
- Compiler.Hoopl.Label: elemFactBase :: Label -> FactBase f -> Bool
- Compiler.Hoopl.Label: elemLabelSet :: Label -> LabelSet -> Bool
- Compiler.Hoopl.Label: emptyLabelSet :: LabelSet
- Compiler.Hoopl.Label: extendFactBase :: FactBase f -> Label -> f -> FactBase f
- Compiler.Hoopl.Label: extendLabelSet :: LabelSet -> Label -> LabelSet
- Compiler.Hoopl.Label: factBaseLabels :: FactBase f -> [Label]
- Compiler.Hoopl.Label: factBaseList :: FactBase f -> [(Label, f)]
- Compiler.Hoopl.Label: instance Eq Label
- Compiler.Hoopl.Label: instance Ord Label
- Compiler.Hoopl.Label: instance Show Label
- Compiler.Hoopl.Label: interLabelSet :: LabelSet -> LabelSet -> LabelSet
- Compiler.Hoopl.Label: labelSetElems :: LabelSet -> [Label]
- Compiler.Hoopl.Label: lookupFact :: FactBase f -> Label -> Maybe f
- Compiler.Hoopl.Label: minusLabelSet :: LabelSet -> LabelSet -> LabelSet
- Compiler.Hoopl.Label: mkFactBase :: [(Label, f)] -> FactBase f
- Compiler.Hoopl.Label: mkLabelSet :: [Label] -> LabelSet
- Compiler.Hoopl.Label: noFacts :: FactBase f
- Compiler.Hoopl.Label: reduceLabelSet :: LabelSet -> Label -> LabelSet
- Compiler.Hoopl.Label: sizeLabelSet :: LabelSet -> Int
- Compiler.Hoopl.Label: type FactBase a = IntMap a
- Compiler.Hoopl.Label: type LabelMap a = IntMap a
- Compiler.Hoopl.Label: type LabelSet = IntSet
- Compiler.Hoopl.Label: unionFactBase :: FactBase f -> FactBase f -> FactBase f
- Compiler.Hoopl.Label: unionLabelSet :: LabelSet -> LabelSet -> LabelSet
- Compiler.Hoopl.Label: unitFact :: Label -> FactBase f -> FactBase f
- Compiler.Hoopl.MkGraph: (<*>) :: AGraph n e O -> AGraph n O x -> AGraph n e x
- Compiler.Hoopl.MkGraph: addEntrySeq :: AGraph n O C -> AGraph n C x -> AGraph n O x
- Compiler.Hoopl.MkGraph: addExitSeq :: AGraph n e C -> AGraph n C O -> AGraph n e O
- Compiler.Hoopl.MkGraph: catAGraphs :: [AGraph n O O] -> AGraph n O O
- Compiler.Hoopl.MkGraph: class IfThenElseable x
- Compiler.Hoopl.MkGraph: class (Edges n) => Node n
- Compiler.Hoopl.MkGraph: emptyAGraph :: AGraph n O O
- Compiler.Hoopl.MkGraph: instance (Labels l1, Labels l2) => Labels (l1, l2)
- Compiler.Hoopl.MkGraph: instance (Labels l1, Labels l2, Labels l3) => Labels (l1, l2, l3)
- Compiler.Hoopl.MkGraph: instance (Labels l1, Labels l2, Labels l3, Labels l4) => Labels (l1, l2, l3, l4)
- Compiler.Hoopl.MkGraph: instance IfThenElseable C
- Compiler.Hoopl.MkGraph: instance IfThenElseable O
- Compiler.Hoopl.MkGraph: instance Labels Label
- Compiler.Hoopl.MkGraph: mkBranch :: (Node n) => Label -> AGraph n O C
- Compiler.Hoopl.MkGraph: mkBranchNode :: (Node n) => Label -> n O C
- Compiler.Hoopl.MkGraph: mkEntry :: Block n O C -> AGraph n O C
- Compiler.Hoopl.MkGraph: mkFirst :: n C O -> AGraph n C O
- Compiler.Hoopl.MkGraph: mkIfThenElse :: (IfThenElseable x, Node n) => (Label -> Label -> AGraph n O C) -> AGraph n O x -> AGraph n O x -> AGraph n O x
- Compiler.Hoopl.MkGraph: mkLabel :: (Node n) => Label -> AGraph n C O
- Compiler.Hoopl.MkGraph: mkLabelNode :: (Node n) => Label -> n C O
- Compiler.Hoopl.MkGraph: mkLast :: n O C -> AGraph n O C
- Compiler.Hoopl.MkGraph: mkMiddle :: n O O -> AGraph n O O
- Compiler.Hoopl.MkGraph: mkMiddles :: [n O O] -> AGraph n O O
- Compiler.Hoopl.MkGraph: mkWhileDo :: (Node n) => (Label -> Label -> AGraph n O C) -> AGraph n O O -> AGraph n O O
- Compiler.Hoopl.MkGraph: type AGraph n e x = FuelMonad (Graph n e x)
- Compiler.Hoopl.MkGraph: withFreshLabels :: (Labels l) => (l -> AGraph n e x) -> AGraph n e x
+ Compiler.Hoopl: (<*>) :: AGraph n e O -> AGraph n O x -> AGraph n e x
+ Compiler.Hoopl: BCat :: Block n e O -> Block n O x -> Block n e x
+ Compiler.Hoopl: BUnit :: n e x -> Block n e x
+ Compiler.Hoopl: BodyCat :: Body n -> Body n -> Body n
+ Compiler.Hoopl: BodyEmpty :: Body n
+ Compiler.Hoopl: BodyUnit :: Block n C C -> Body n
+ Compiler.Hoopl: BwdPass :: DataflowLattice f -> BwdTransfer n f -> BwdRewrite n f -> BwdPass n f
+ Compiler.Hoopl: DataflowLattice :: String -> a -> JoinFun a -> Bool -> DataflowLattice a
+ Compiler.Hoopl: FwdPass :: DataflowLattice f -> FwdTransfer n f -> FwdRewrite n f -> FwdPass n f
+ Compiler.Hoopl: GMany :: MaybeO e (Block n O C) -> Body n -> MaybeO x (Block n C O) -> Graph n e x
+ Compiler.Hoopl: GNil :: Graph n O O
+ Compiler.Hoopl: GUnit :: Block n O O -> Graph n O O
+ Compiler.Hoopl: JustO :: t -> MaybeO O t
+ Compiler.Hoopl: NewFact :: a -> NewFact a
+ Compiler.Hoopl: NoChange :: ChangeFlag
+ Compiler.Hoopl: NothingO :: MaybeO C t
+ Compiler.Hoopl: OldFact :: a -> OldFact a
+ Compiler.Hoopl: SomeChange :: ChangeFlag
+ Compiler.Hoopl: addBlock :: Block n C C -> Body n -> Body n
+ Compiler.Hoopl: addEntrySeq :: AGraph n O C -> AGraph n C x -> AGraph n O x
+ Compiler.Hoopl: addExitSeq :: AGraph n e C -> AGraph n C O -> AGraph n e O
+ Compiler.Hoopl: allLabels :: [Label]
+ Compiler.Hoopl: analyzeAndRewriteBwd :: (Edges n) => BwdPass n f -> Body n -> FactBase f -> FuelMonad (Body n, FactBase f)
+ Compiler.Hoopl: analyzeAndRewriteFwd :: (Edges n) => FwdPass n f -> Body n -> FactBase f -> FuelMonad (Body n, FactBase f)
+ Compiler.Hoopl: bodyList :: (Edges n) => Body n -> [(Label, Block n C C)]
+ Compiler.Hoopl: bodyMap :: (Edges n) => Body n -> LabelMap (Block n C C)
+ Compiler.Hoopl: bp_lattice :: BwdPass n f -> DataflowLattice f
+ Compiler.Hoopl: bp_rewrite :: BwdPass n f -> BwdRewrite n f
+ Compiler.Hoopl: bp_transfer :: BwdPass n f -> BwdTransfer n f
+ Compiler.Hoopl: catAGraphs :: [AGraph n O O] -> AGraph n O O
+ Compiler.Hoopl: changeIf :: Bool -> ChangeFlag
+ Compiler.Hoopl: class Edges thing
+ Compiler.Hoopl: class IfThenElseable x
+ Compiler.Hoopl: class (Edges n) => Node n
+ Compiler.Hoopl: data Block n e x
+ Compiler.Hoopl: data Body n
+ Compiler.Hoopl: data BwdPass n f
+ Compiler.Hoopl: data C
+ Compiler.Hoopl: data ChangeFlag
+ Compiler.Hoopl: data DataflowLattice a
+ Compiler.Hoopl: data FuelMonad a
+ Compiler.Hoopl: data FwdPass n f
+ Compiler.Hoopl: data Graph n e x
+ Compiler.Hoopl: data Label
+ Compiler.Hoopl: data MaybeO ex t
+ Compiler.Hoopl: data O
+ Compiler.Hoopl: deepBwdRw :: SimpleBwdRewrite n f -> BwdRewrite n f
+ Compiler.Hoopl: deepFwdRw :: SimpleFwdRewrite n f -> FwdRewrite n f
+ Compiler.Hoopl: delFromFactBase :: FactBase f -> [(Label, a)] -> FactBase f
+ Compiler.Hoopl: elemFactBase :: Label -> FactBase f -> Bool
+ Compiler.Hoopl: elemLabelSet :: Label -> LabelSet -> Bool
+ Compiler.Hoopl: emptyAGraph :: AGraph n O O
+ Compiler.Hoopl: emptyClosedAGraph :: AGraph n C C
+ Compiler.Hoopl: emptyLabelSet :: LabelSet
+ Compiler.Hoopl: entryLabel :: (Edges thing) => thing C x -> Label
+ Compiler.Hoopl: extendFactBase :: FactBase f -> Label -> f -> FactBase f
+ Compiler.Hoopl: extendLabelSet :: LabelSet -> Label -> LabelSet
+ Compiler.Hoopl: factBaseLabels :: FactBase f -> [Label]
+ Compiler.Hoopl: factBaseList :: FactBase f -> [(Label, f)]
+ Compiler.Hoopl: fact_bot :: DataflowLattice a -> a
+ Compiler.Hoopl: fact_do_logging :: DataflowLattice a -> Bool
+ Compiler.Hoopl: fact_extend :: DataflowLattice a -> JoinFun a
+ Compiler.Hoopl: fact_name :: DataflowLattice a -> String
+ Compiler.Hoopl: fp_lattice :: FwdPass n f -> DataflowLattice f
+ Compiler.Hoopl: fp_rewrite :: FwdPass n f -> FwdRewrite n f
+ Compiler.Hoopl: fp_transfer :: FwdPass n f -> FwdTransfer n f
+ Compiler.Hoopl: freshLabel :: FuelMonad Label
+ Compiler.Hoopl: gCatClosed :: AGraph n e C -> AGraph n C x -> AGraph n e x
+ Compiler.Hoopl: getFuel :: FuelMonad Fuel
+ Compiler.Hoopl: interLabelSet :: LabelSet -> LabelSet -> LabelSet
+ Compiler.Hoopl: iterBwdRw :: BwdRewrite n f -> BwdRewrite n f
+ Compiler.Hoopl: iterFwdRw :: FwdRewrite n f -> FwdRewrite n f
+ Compiler.Hoopl: labelSetElems :: LabelSet -> [Label]
+ Compiler.Hoopl: lookupFact :: FactBase f -> Label -> Maybe f
+ Compiler.Hoopl: minusLabelSet :: LabelSet -> LabelSet -> LabelSet
+ Compiler.Hoopl: mkBranch :: (Node n) => Label -> AGraph n O C
+ Compiler.Hoopl: mkBranchNode :: (Node n) => Label -> n O C
+ Compiler.Hoopl: mkEntry :: Block n O C -> AGraph n O C
+ Compiler.Hoopl: mkFactBase :: [(Label, f)] -> FactBase f
+ Compiler.Hoopl: mkFirst :: n C O -> AGraph n C O
+ Compiler.Hoopl: mkIfThenElse :: (IfThenElseable x, Node n) => (Label -> Label -> AGraph n O C) -> AGraph n O x -> AGraph n O x -> AGraph n O x
+ Compiler.Hoopl: mkLabel :: (Node n) => Label -> AGraph n C O
+ Compiler.Hoopl: mkLabelNode :: (Node n) => Label -> n C O
+ Compiler.Hoopl: mkLabelSet :: [Label] -> LabelSet
+ Compiler.Hoopl: mkLast :: n O C -> AGraph n O C
+ Compiler.Hoopl: mkMiddle :: n O O -> AGraph n O O
+ Compiler.Hoopl: mkMiddles :: [n O O] -> AGraph n O O
+ Compiler.Hoopl: mkWhileDo :: (Node n) => (Label -> Label -> AGraph n O C) -> AGraph n O O -> AGraph n O O
+ Compiler.Hoopl: newtype NewFact a
+ Compiler.Hoopl: newtype OldFact a
+ Compiler.Hoopl: noBwdRewrite :: BwdRewrite n f
+ Compiler.Hoopl: noFacts :: FactBase f
+ Compiler.Hoopl: noFwdRewrite :: FwdRewrite n f
+ Compiler.Hoopl: reduceLabelSet :: LabelSet -> Label -> LabelSet
+ Compiler.Hoopl: runWithFuel :: Fuel -> FuelMonad a -> a
+ Compiler.Hoopl: setFuel :: Fuel -> FuelMonad ()
+ Compiler.Hoopl: shallowBwdRw :: SimpleBwdRewrite n f -> BwdRewrite n f
+ Compiler.Hoopl: shallowFwdRw :: SimpleFwdRewrite n f -> FwdRewrite n f
+ Compiler.Hoopl: sizeLabelSet :: LabelSet -> Int
+ Compiler.Hoopl: successors :: (Edges thing) => thing e C -> [Label]
+ Compiler.Hoopl: thenBwdRw :: BwdRewrite n f -> BwdRewrite n f -> BwdRewrite n f
+ Compiler.Hoopl: thenFwdRw :: FwdRewrite n f -> FwdRewrite n f -> FwdRewrite n f
+ Compiler.Hoopl: type AGraph n e x = FuelMonad (Graph n e x)
+ Compiler.Hoopl: type BwdRewrite n f = forall e x. n e x -> Fact x f -> Maybe (BwdRes n f e x)
+ Compiler.Hoopl: type BwdTransfer n f = forall e x. n e x -> Fact x f -> Fact e f
+ Compiler.Hoopl: type FactBase a = IntMap a
+ Compiler.Hoopl: type Fuel = Int
+ Compiler.Hoopl: type FwdRewrite n f = forall e x. n e x -> Fact e f -> Maybe (FwdRes n f e x)
+ Compiler.Hoopl: type FwdTransfer n f = forall e x. n e x -> Fact e f -> Fact x f
+ Compiler.Hoopl: type JoinFun a = OldFact a -> NewFact a -> (ChangeFlag, a)
+ Compiler.Hoopl: type LabelMap a = IntMap a
+ Compiler.Hoopl: type LabelSet = IntSet
+ Compiler.Hoopl: type SimpleBwdRewrite n f = forall e x. n e x -> Fact x f -> Maybe (AGraph n e x)
+ Compiler.Hoopl: type SimpleFwdRewrite n f = forall e x. n e x -> Fact e f -> Maybe (AGraph n e x)
+ Compiler.Hoopl: unionFactBase :: FactBase f -> FactBase f -> FactBase f
+ Compiler.Hoopl: unionLabelSet :: LabelSet -> LabelSet -> LabelSet
+ Compiler.Hoopl: unitFact :: Label -> FactBase f -> FactBase f
+ Compiler.Hoopl: withFreshLabels :: (Labels l) => (l -> AGraph n e x) -> AGraph n e x
+ Compiler.Hoopl: withFuel :: Maybe a -> FuelMonad (Maybe a)
Files
- CHANGES +6/−0
- Compiler/Hoopl.hs +1/−1
- Compiler/Hoopl/Dataflow.hs +20/−8
- Compiler/Hoopl/Graph.hs +4/−1
- Compiler/Hoopl/MkGraph.hs +5/−2
- Compiler/Hoopl/Util.hs +14/−0
- hoopl.cabal +11/−7
- hoopl.pdf binary
+ CHANGES view
@@ -0,0 +1,6 @@+3.7.7.0++ - Restrict clients so they see much less, including hiding+ the value constructors for Body.++
Compiler/Hoopl.hs view
@@ -9,6 +9,6 @@ import Compiler.Hoopl.Dataflow import Compiler.Hoopl.Fuel hiding (withFuel, getFuel, setFuel)-import Compiler.Hoopl.Graph+import Compiler.Hoopl.Graph hiding (BodyEmpty, BodyUnit, BodyCat) import Compiler.Hoopl.Label hiding (allLabels) import Compiler.Hoopl.MkGraph
Compiler/Hoopl/Dataflow.hs view
@@ -59,9 +59,9 @@ ( DataflowLattice(..), JoinFun, OldFact(..), NewFact(..) , ChangeFlag(..), changeIf , FwdPass(..), FwdTransfer, FwdRewrite, SimpleFwdRewrite- , noFwdRewrite, thenFwdRw, shallowFwdRw, deepFwdRw+ , noFwdRewrite, thenFwdRw, shallowFwdRw, deepFwdRw, iterFwdRw , BwdPass(..), BwdTransfer, BwdRewrite, SimpleBwdRewrite- , noBwdRewrite, thenBwdRw, shallowBwdRw, deepBwdRw+ , noBwdRewrite, thenBwdRw, shallowBwdRw, deepBwdRw, iterBwdRw , Fact , analyzeAndRewriteFwd, analyzeAndRewriteBwd )@@ -127,16 +127,19 @@ Nothing -> Nothing Just ag -> Just (FwdRes ag noFwdRewrite) +deepFwdRw :: SimpleFwdRewrite n f -> FwdRewrite n f+deepFwdRw r = iterFwdRw (shallowFwdRw r)+ thenFwdRw :: FwdRewrite n f -> FwdRewrite n f -> FwdRewrite n f thenFwdRw rw1 rw2 n f = case rw1 n f of Nothing -> rw2 n f Just (FwdRes ag rw1a) -> Just (FwdRes ag (rw1a `thenFwdRw` rw2)) -deepFwdRw :: FwdRewrite n f -> FwdRewrite n f-deepFwdRw rw =+iterFwdRw :: FwdRewrite n f -> FwdRewrite n f+iterFwdRw rw = \ n f -> case rw n f of- Just (FwdRes g rw2) -> Just $ FwdRes g (rw2 `thenFwdRw` deepFwdRw rw)+ Just (FwdRes g rw2) -> Just $ FwdRes g (rw2 `thenFwdRw` iterFwdRw rw) Nothing -> Nothing analyzeAndRewriteFwd@@ -241,15 +244,21 @@ Nothing -> Nothing Just ag -> Just (BwdRes ag noBwdRewrite) +deepBwdRw :: SimpleBwdRewrite n f -> BwdRewrite n f+deepBwdRw r = iterBwdRw (shallowBwdRw r)++ thenBwdRw :: BwdRewrite n f -> BwdRewrite n f -> BwdRewrite n f thenBwdRw rw1 rw2 n f = case rw1 n f of Nothing -> rw2 n f Just (BwdRes ag rw1a) -> Just (BwdRes ag (rw1a `thenBwdRw` rw2)) -deepBwdRw :: BwdRewrite n f -> BwdRewrite n f-deepBwdRw rw = rw `thenBwdRw` deepBwdRw rw-+iterBwdRw :: BwdRewrite n f -> BwdRewrite n f+iterBwdRw rw =+ \ n f -> case rw n f of+ Just (BwdRes g rw2) -> Just $ BwdRes g (rw2 `thenBwdRw` iterBwdRw rw)+ Nothing -> Nothing ----------------------------------------------------------------------------- -- Backward implementation@@ -439,6 +448,9 @@ -- RG: an internal data type for graphs under construction -- TOTALLY internal to Hoopl -----------------------------------------------------------------------------++-- this type exists because we have not yet found a way to write arfNode+-- to return a Graph; the invariants of Graph seem too strong data RG n f e x where RGNil :: RG n f a a
Compiler/Hoopl/Graph.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE GADTs, EmptyDataDecls #-} module Compiler.Hoopl.Graph - ( O, C, Block(..), Body(..), Graph(..), MaybeO(..)+ ( O, C, Block(..), Body(..), bodyMap, Graph(..), MaybeO(..) , Edges(entryLabel, successors) , addBlock, bodyList )@@ -59,4 +59,7 @@ go BodyEmpty bs = bs go (BodyUnit b) bs = (entryLabel b, b) : bs go (BodyCat b1 b2) bs = go b1 (go b2 bs)++bodyMap :: Edges n => Body n -> LabelMap (Block n C C)+bodyMap = mkFactBase . bodyList
Compiler/Hoopl/MkGraph.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE ScopedTypeVariables #-} module Compiler.Hoopl.MkGraph- ( AGraph, (<*>)- , emptyAGraph, withFreshLabels+ ( AGraph, (<*>), gCatClosed+ , emptyAGraph, emptyClosedAGraph, withFreshLabels , mkFirst, mkMiddle, mkMiddles, mkLast, mkEntry, mkBranch, mkLabel, mkWhileDo , addEntrySeq, addExitSeq, catAGraphs , IfThenElseable(mkIfThenElse)@@ -26,6 +26,9 @@ emptyAGraph :: AGraph n O O emptyAGraph = return GNil++emptyClosedAGraph :: AGraph n C C+emptyClosedAGraph = return $ GMany NothingO BodyEmpty NothingO addEntrySeq :: AGraph n O C -> AGraph n C x -> AGraph n O x addExitSeq :: AGraph n e C -> AGraph n C O -> AGraph n e O
+ Compiler/Hoopl/Util.hs view
@@ -0,0 +1,14 @@+module Compiler.Hoopl.Util+ ( gUnitOO, gUnitOC, gUnitCO, gUnitCC+ )+where++import Compiler.Hoopl.Graph+gUnitOO :: Block n O O -> Graph n O O+gUnitOC :: Block n O C -> Graph n O C+gUnitCO :: Block n C O -> Graph n C O+gUnitCC :: Block n C C -> Graph n C C+gUnitOO b = GUnit b+gUnitOC b = GMany (JustO b) BodyEmpty NothingO+gUnitCO b = GMany NothingO BodyEmpty (JustO b)+gUnitCC b = GMany NothingO (BodyUnit b) NothingO
hoopl.cabal view
@@ -1,5 +1,5 @@ Name: hoopl-Version: 3.7.4.0+Version: 3.7.7.0 Description: Higher-order optimization library License: BSD3 License-file: LICENSE@@ -7,15 +7,19 @@ Maintainer: nr@cs.tufts.edu Build-Type: Simple Cabal-Version: >=1.2+Stability: alpha Synopsis: A library to support dataflow analysis and optimization Category: Compilers/Interpreters-Extra-source-files: README, hoopl.pdf+Extra-source-files: README, hoopl.pdf, CHANGES Library Build-Depends: base >= 3 && < 5, containers- Exposed-modules: Compiler.Hoopl,- Compiler.Hoopl.Dataflow, Compiler.Hoopl.Graph, - Compiler.Hoopl.MkGraph,- Compiler.Hoopl.Fuel, Compiler.Hoopl.Label- Other-modules: Compiler.Hoopl.GraphUtil+ Exposed-modules: Compiler.Hoopl+ Other-modules: Compiler.Hoopl.GraphUtil,+ -- GraphUtil should *never* be seen by clients.+ -- The remaining modules are hidden *provisionally*+ Compiler.Hoopl.Dataflow, Compiler.Hoopl.Graph, + Compiler.Hoopl.MkGraph,+ Compiler.Hoopl.Fuel, Compiler.Hoopl.Label,+ Compiler.Hoopl.Util ghc-options: -Wall -fno-warn-name-shadowing
hoopl.pdf view
binary file changed (255755 → 256322 bytes)