Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Options = Opt [[Primitive]]
- data Common = Cmn {}
- class WithCommon a => ProgramGeneratorIO a where
- class WithCommon a => ProgramGenerator a where
- mkTrie :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> a
- mkTrieOpt :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> a
- matchingPrograms, matchingProgramsWOAbsents, unifyingPrograms :: Search m => Type -> a -> m AnnExpr
- class WithCommon a where
- extractCommon :: a -> Common
- type Prim = (Int, Int, Type, TyVar, Typed [CoreExpr])
- extractTCL :: WithCommon a => a -> TyConLib
- extractVL :: WithCommon a => a -> VarLib
- extractRTrie :: WithCommon a => a -> RTrie
- reducer :: Common -> CoreExpr -> Dynamic
- mkCommon :: Options -> [Primitive] -> [Primitive] -> [Int] -> Common
- initCommon :: Options -> [Primitive] -> Common
- initCommonExt :: (TyConLib -> [[(String, Dynamic)]]) -> (TyConLib -> [[(String, Dynamic)]]) -> (TyConLib -> [[(String, Dynamic)]]) -> Options -> [Primitive] -> Common
- updateCommon :: [Dynamic] -> [Dynamic] -> [Int] -> Common -> Common
- retsTVar :: (a, b, Type, d, e) -> Bool
- annotateTCEs :: Typed [CoreExpr] -> Prim
- splitPrims :: [Typed [CoreExpr]] -> ([Prim], [Prim])
- splitPrimss :: [[Typed [CoreExpr]]] -> ([[Prim]], [[Prim]])
- mapSum :: (MonadPlus m, Delay m) => (a -> m b) -> [[a]] -> m b
- applyDo :: (Functor m, Monad m) => ([Type] -> Type -> PriorSubsts m a) -> [Type] -> Type -> PriorSubsts m a
- wind :: (a -> a) -> ([Type] -> Type -> a) -> [Type] -> Type -> a
- wind_ :: ([Type] -> Type -> a) -> [Type] -> Type -> a
- fromAssumptions :: (Search m, Expression e) => Common -> Int -> (Type -> PriorSubsts m [e]) -> (Type -> Type -> PriorSubsts m ()) -> Type -> [Type] -> PriorSubsts m [e]
- retMono :: (Search m, Expression e) => Common -> Int -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m ()) -> (Int8, (Int, [Type], Type)) -> PriorSubsts m [e]
- fromAvail :: [Type] -> [(Int8, (Int, [Type], Type))]
- mguAssumptions :: (Functor m, MonadPlus m) => Type -> [Type] -> PriorSubsts m [CoreExpr]
- mguAssumptions' :: forall (m :: Type -> Type). MonadPlus m => [Type] -> Type -> PriorSubsts m [CoreExpr]
- matchAssumptions :: (Functor m, MonadPlus m, Expression e) => Common -> Int -> Type -> [Type] -> PriorSubsts m [e]
- mguAssumptions_ :: (Functor m, MonadPlus m) => Type -> [Type] -> PriorSubsts m ()
- mguAssumptions_' :: forall (m :: Type -> Type). MonadPlus m => [Type] -> Type -> PriorSubsts m ()
- retPrimMono :: (Search m, Expression e) => Common -> Int -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> Type -> PriorSubsts m ()) -> Type -> Prim -> PriorSubsts m [e]
- funApSub :: (Search m, Expression e) => (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> [e] -> PriorSubsts m [e]
- funApSubOp :: (Monad m1, Monad m2) => (r -> a2 -> r) -> (Type -> m1 (m2 a2)) -> (Type -> m1 (m2 a2)) -> (Type -> m1 (m2 a2)) -> Type -> m2 r -> m1 (m2 r)
- fap :: (Foldable t1, Monad m1, Monad m2, Expression r) => (t2 -> m1 (m2 r)) -> t1 t2 -> m2 r -> m1 (m2 r)
- mapAndFoldM :: Monad m => (t1 -> t2 -> t1) -> t1 -> (t3 -> m t2) -> [t3] -> m t1
- retGen :: (Search m, Expression e) => Common -> Int -> (Type -> Type -> [e] -> [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> Prim -> PriorSubsts m [e]
- retGen' :: forall (n :: Type -> Type) e i t b c. (Search n, Expression e, Integral i) => (Type -> t -> PriorSubsts n b) -> Common -> i -> (Type -> Type -> [e] -> t) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> Type -> (Int, Int, c, TyVar, Typed [CoreExpr]) -> PriorSubsts n b
- retGenOrd :: (Search m, Expression e) => Common -> Int -> (Type -> Type -> [e] -> [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> Prim -> PriorSubsts m [e]
- orderedAndUsedArgs :: Type -> Bool
- usedArg :: TyVar -> Type -> Bool
- retGenTV1 :: (Search m, Expression e) => Common -> Int -> (Type -> Type -> [e] -> [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> Prim -> PriorSubsts m [e]
- retGenTV0 :: forall (n :: Type -> Type) e j i b c. (Search n, Expression e, Integral j, Integral i) => Common -> i -> (Type -> Type -> [e] -> b) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> Type -> (j, j, c, TyVar, Typed [CoreExpr]) -> PriorSubsts n b
- filtExprs :: Expression e => Bool -> Type -> Type -> [e] -> [e]
- filterExprs :: Expression e => Type -> Type -> [e] -> [e]
- getArgExprs :: CoreExpr -> [CoreExpr]
- gae :: CoreExpr -> [CoreExpr] -> [CoreExpr]
- constEq :: Type -> [CoreExpr] -> Bool
- ceq :: CoreExpr -> Type -> [CoreExpr] -> Bool
- recHead :: Type -> CoreExpr -> Bool
- retSameVal :: Type -> [CoreExpr] -> Bool
- rsv :: Type -> [CoreExpr] -> Bool
- rsv' :: CoreExpr -> Type -> [CoreExpr] -> Bool
- returnsAtoA :: Type -> Bool
- returnsId :: Type -> CoreExpr -> Bool
- isId :: CoreExpr -> Bool
- isId' :: Int8 -> CoreExpr -> Bool
- isId'' :: Int8 -> Int8 -> CoreExpr -> Bool
- retVal :: Type -> CoreExpr -> CoreExpr
- rv :: Type -> Int8 -> CoreExpr -> CoreExpr
- mapsub :: Int8 -> CoreExpr -> CoreExpr
- isConstrExpr :: CoreExpr -> Bool
- isClosed :: CoreExpr -> Bool
- isClosed' :: Int8 -> CoreExpr -> Bool
- includesStrictArg :: [CoreExpr] -> Bool
- anyRec :: Type -> [CoreExpr] -> Bool
- recursive :: Type -> CoreExpr -> Bool
- constRec :: Int8 -> CoreExpr -> Bool
- belowIsUsed :: Int8 -> CoreExpr -> Bool
- isUsed :: Int8 -> CoreExpr -> Bool
- mkSubsts :: Search m => Int -> TyVar -> Type -> PriorSubsts m Int
- mkSubst :: Search m => Int -> TyVar -> Type -> PriorSubsts m Int
- mkRetty :: Type -> (Type, Type)
- reorganizer_ :: ([Type] -> a) -> [Type] -> a
- hit :: Type -> [Type] -> Bool
- combs :: (Eq t, Num t) => t -> [a] -> [[a]]
- tails :: [a] -> [[a]]
- dynamic :: ExpQ -> ExpQ -> ExpQ
Documentation
class WithCommon a => ProgramGeneratorIO a where Source #
mkTrieIO :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> IO a Source #
|mkTrie| creates the generator with the default parameters.
mkTrieOptIO :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> IO a Source #
matchingProgramsIO :: Type -> a -> RecompT IO AnnExpr Source #
Use memoization requiring IO
unifyingProgramsIO :: Type -> a -> RecompT IO AnnExpr Source #
Use memoization requiring IO
Instances
ProgramGeneratorIO ProgGen Source # | |
Defined in MagicHaskeller.ProgGen mkTrieIO :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> IO ProgGen Source # mkTrieOptIO :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> IO ProgGen Source # matchingProgramsIO :: Type -> ProgGen -> RecompT IO AnnExpr Source # unifyingProgramsIO :: Type -> ProgGen -> RecompT IO AnnExpr Source # | |
ProgramGeneratorIO (PGSFIOR CoreExpr) Source # | |
Defined in MagicHaskeller.ProgGenSFIORef mkTrieIO :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> IO (PGSFIOR CoreExpr) Source # mkTrieOptIO :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> IO (PGSFIOR CoreExpr) Source # matchingProgramsIO :: Type -> PGSFIOR CoreExpr -> RecompT IO AnnExpr Source # unifyingProgramsIO :: Type -> PGSFIOR CoreExpr -> RecompT IO AnnExpr Source # |
class WithCommon a => ProgramGenerator a where Source #
ProgramGenerator is a generalization of the old Memo
type.
mkTrie :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> a Source #
|mkTrie| creates the generator with the default parameters.
mkTrieOpt :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> a Source #
matchingPrograms :: Search m => Type -> a -> m AnnExpr Source #
matchingProgramsWOAbsents :: Search m => Type -> a -> m AnnExpr Source #
unifyingPrograms :: Search m => Type -> a -> m AnnExpr Source #
Instances
ProgramGenerator ProgGen Source # | |
Defined in MagicHaskeller.ProgGen mkTrie :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> ProgGen Source # mkTrieOpt :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> ProgGen Source # matchingPrograms :: Search m => Type -> ProgGen -> m AnnExpr Source # matchingProgramsWOAbsents :: Search m => Type -> ProgGen -> m AnnExpr Source # unifyingPrograms :: Search m => Type -> ProgGen -> m AnnExpr Source # | |
Expression e => ProgramGenerator (PGSF e) Source # | |
Defined in MagicHaskeller.ProgGenSF mkTrie :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> PGSF e Source # mkTrieOpt :: Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> PGSF e Source # matchingPrograms :: Search m => Type -> PGSF e -> m AnnExpr Source # matchingProgramsWOAbsents :: Search m => Type -> PGSF e -> m AnnExpr Source # unifyingPrograms :: Search m => Type -> PGSF e -> m AnnExpr Source # |
class WithCommon a where Source #
extractCommon :: a -> Common Source #
Instances
WithCommon ProgGen Source # | |
Defined in MagicHaskeller.ProgGen extractCommon :: ProgGen -> Common Source # | |
Expression e => WithCommon (PGSF e) Source # | |
Defined in MagicHaskeller.ProgGenSF extractCommon :: PGSF e -> Common Source # | |
Expression e => WithCommon (PGSFIOR e) Source # | |
Defined in MagicHaskeller.ProgGenSFIORef extractCommon :: PGSFIOR e -> Common Source # |
extractTCL :: WithCommon a => a -> TyConLib Source #
extractVL :: WithCommon a => a -> VarLib Source #
extractRTrie :: WithCommon a => a -> RTrie Source #
initCommonExt :: (TyConLib -> [[(String, Dynamic)]]) -> (TyConLib -> [[(String, Dynamic)]]) -> (TyConLib -> [[(String, Dynamic)]]) -> Options -> [Primitive] -> Common Source #
updateCommon :: [Dynamic] -> [Dynamic] -> [Int] -> Common -> Common Source #
updateCommon
can be used for incremetal learning
annotateTCEs :: Typed [CoreExpr] -> Prim Source #
applyDo :: (Functor m, Monad m) => ([Type] -> Type -> PriorSubsts m a) -> [Type] -> Type -> PriorSubsts m a Source #
fromAssumptions :: (Search m, Expression e) => Common -> Int -> (Type -> PriorSubsts m [e]) -> (Type -> Type -> PriorSubsts m ()) -> Type -> [Type] -> PriorSubsts m [e] Source #
retMono :: (Search m, Expression e) => Common -> Int -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m ()) -> (Int8, (Int, [Type], Type)) -> PriorSubsts m [e] Source #
mguAssumptions' :: forall (m :: Type -> Type). MonadPlus m => [Type] -> Type -> PriorSubsts m [CoreExpr] Source #
matchAssumptions :: (Functor m, MonadPlus m, Expression e) => Common -> Int -> Type -> [Type] -> PriorSubsts m [e] Source #
mguAssumptions_ :: (Functor m, MonadPlus m) => Type -> [Type] -> PriorSubsts m () Source #
mguAssumptions_' :: forall (m :: Type -> Type). MonadPlus m => [Type] -> Type -> PriorSubsts m () Source #
retPrimMono :: (Search m, Expression e) => Common -> Int -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> Type -> PriorSubsts m ()) -> Type -> Prim -> PriorSubsts m [e] Source #
funApSub :: (Search m, Expression e) => (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> [e] -> PriorSubsts m [e] Source #
funApSubOp :: (Monad m1, Monad m2) => (r -> a2 -> r) -> (Type -> m1 (m2 a2)) -> (Type -> m1 (m2 a2)) -> (Type -> m1 (m2 a2)) -> Type -> m2 r -> m1 (m2 r) Source #
fap :: (Foldable t1, Monad m1, Monad m2, Expression r) => (t2 -> m1 (m2 r)) -> t1 t2 -> m2 r -> m1 (m2 r) Source #
mapAndFoldM :: Monad m => (t1 -> t2 -> t1) -> t1 -> (t3 -> m t2) -> [t3] -> m t1 Source #
retGen :: (Search m, Expression e) => Common -> Int -> (Type -> Type -> [e] -> [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> Prim -> PriorSubsts m [e] Source #
retGen' :: forall (n :: Type -> Type) e i t b c. (Search n, Expression e, Integral i) => (Type -> t -> PriorSubsts n b) -> Common -> i -> (Type -> Type -> [e] -> t) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> Type -> (Int, Int, c, TyVar, Typed [CoreExpr]) -> PriorSubsts n b Source #
retGenOrd :: (Search m, Expression e) => Common -> Int -> (Type -> Type -> [e] -> [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> Prim -> PriorSubsts m [e] Source #
orderedAndUsedArgs :: Type -> Bool Source #
retGenTV1 :: (Search m, Expression e) => Common -> Int -> (Type -> Type -> [e] -> [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> (Type -> PriorSubsts m [e]) -> Type -> Prim -> PriorSubsts m [e] Source #
retGenTV0 :: forall (n :: Type -> Type) e j i b c. (Search n, Expression e, Integral j, Integral i) => Common -> i -> (Type -> Type -> [e] -> b) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> (Type -> PriorSubsts n [e]) -> Type -> (j, j, c, TyVar, Typed [CoreExpr]) -> PriorSubsts n b Source #
filtExprs :: Expression e => Bool -> Type -> Type -> [e] -> [e] Source #
filterExprs :: Expression e => Type -> Type -> [e] -> [e] Source #
getArgExprs :: CoreExpr -> [CoreExpr] Source #
retSameVal :: Type -> [CoreExpr] -> Bool Source #
returnsAtoA :: Type -> Bool Source #
isConstrExpr :: CoreExpr -> Bool Source #
includesStrictArg :: [CoreExpr] -> Bool Source #
reorganizer_ :: ([Type] -> a) -> [Type] -> a Source #