camfort-0.802: CamFort - Cambridge Fortran infrastructure

Safe HaskellNone
LanguageHaskell98

Camfort.Specification.Stencils.InferenceFrontend

Contents

Synopsis

Documentation

data InferMode Source #

Instances

Eq InferMode Source # 
Data InferMode Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InferMode -> c InferMode #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InferMode #

toConstr :: InferMode -> Constr #

dataTypeOf :: InferMode -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c InferMode) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InferMode) #

gmapT :: (forall b. Data b => b -> b) -> InferMode -> InferMode #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InferMode -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InferMode -> r #

gmapQ :: (forall d. Data d => d -> u) -> InferMode -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InferMode -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InferMode -> m InferMode #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InferMode -> m InferMode #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InferMode -> m InferMode #

Read InferMode Source # 
Show InferMode Source # 
Default InferMode Source # 

data InferState Source #

Constructors

IS 

Fields

type Inferer = WriterT [LogLine] (ReaderT (Cycles, ProgramUnitName, TypeEnv A) (State InferState)) Source #

type Cycles = [(Name, Name)] Source #

type Params = (?flowsGraph :: FlowsGraph A, ?nameMap :: NameMap) Source #

runInferer :: InductionVarMapByASTBlock -> Cycles -> ProgramUnitName -> TypeEnv A -> Inferer a -> (a, [LogLine]) Source #

stencilInference :: NameMap -> InferMode -> ProgramFile (Analysis A) -> (ProgramFile (Analysis A), [LogLine]) Source #

findVarFlowCycles :: Data a => ProgramFile a -> [(Name, Name)] Source #

Return list of variable names that flow into themselves via a 2-cycle

findVarFlowCycles' :: Data a => ProgramFile (Analysis a) -> [(Name, Name)] Source #

1 . Core inference over blocks

genSpecsAndReport :: Params => InferMode -> SrcSpan -> [Neighbour] -> [Block (Analysis A)] -> Inferer [([Variable], Specification)] Source #

isArraySubscript :: Expression (Analysis A) -> Maybe [Index (Analysis A)] Source #

fromJustMsg :: [Char] -> Maybe t -> t Source #

perBlockInfer :: Params => InferMode -> Block (Analysis A) -> Inferer (Block (Analysis A)) Source #

genSpecifications :: Params => InductionVarMapByASTBlock -> [Neighbour] -> [Block (Analysis A)] -> Writer EvalLog [([Variable], Specification)] Source #

genSubscripts :: Params => Bool -> Block (Analysis A) -> State [Int] (Map Variable [[Index (Analysis A)]]) Source #

genRHSsubscripts :: Block (Analysis A) -> Map Variable [[Index (Analysis A)]] Source #

getInductionVar :: Maybe (DoSpecification (Analysis A)) -> [Variable] Source #

isStencilDo :: Block (Analysis A) -> Bool Source #

2 .Conversion from indexing expressions

padZeros :: [[Int]] -> [[Int]] Source #

indicesToSpec :: InductionVarMapByASTBlock -> Variable -> [Neighbour] -> [[Index (Analysis Annotation)]] -> Writer EvalLog (Maybe Specification) Source #

isNeighbour :: Data a => Index (Analysis a) -> [Variable] -> Bool Source #

neighbourIndex :: InductionVarMapByASTBlock -> [Index (Analysis Annotation)] -> Maybe [Neighbour] Source #

ixToNeighbour :: InductionVarMapByASTBlock -> Index (Analysis Annotation) -> Neighbour Source #

ixToNeighbour' :: Data a => [Variable] -> Index (Analysis a) -> Neighbour Source #

expToNeighbour :: forall a. Data a => [Variable] -> Expression (Analysis a) -> Neighbour Source #

isUnaryOrBinaryExpr :: Expression a -> Bool Source #

isVariableExpr :: Expression a -> Bool Source #

type TypeEnv a = Map TypeScope (Map String IDType) Source #

isArrayType :: TypeEnv A -> ProgramUnitName -> String -> Bool Source #