MagicHaskeller-0.9.7.1: Automatic inductive functional programmer by systematic search
Safe HaskellNone
LanguageHaskell2010

MagicHaskeller.ProgramGenerator

Synopsis

Documentation

type Options = Opt [[Primitive]] Source #

options for limiting the hypothesis space.

data Common Source #

Constructors

Cmn 

Fields

class WithCommon a => ProgramGeneratorIO a where Source #

Minimal complete definition

unifyingProgramsIO

Methods

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

Instances details
ProgramGeneratorIO ProgGen Source # 
Instance details

Defined in MagicHaskeller.ProgGen

Methods

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 # 
Instance details

Defined in MagicHaskeller.ProgGenSFIORef

class WithCommon a => ProgramGenerator a where Source #

ProgramGenerator is a generalization of the old Memo type.

Minimal complete definition

unifyingPrograms

Methods

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

Instances details
ProgramGenerator ProgGen Source # 
Instance details

Defined in MagicHaskeller.ProgGen

Methods

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 # 
Instance details

Defined in MagicHaskeller.ProgGenSF

Methods

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 #

Methods

extractCommon :: a -> Common Source #

Instances

Instances details
WithCommon ProgGen Source # 
Instance details

Defined in MagicHaskeller.ProgGen

Expression e => WithCommon (PGSF e) Source # 
Instance details

Defined in MagicHaskeller.ProgGenSF

Expression e => WithCommon (PGSFIOR e) Source # 
Instance details

Defined in MagicHaskeller.ProgGenSFIORef

type Prim = (Int, Int, Type, TyVar, Typed [CoreExpr]) Source #

annotated 'Typed [CoreExpr]'

extractTCL :: WithCommon a => a -> TyConLib Source #

reducer :: Common -> CoreExpr -> Dynamic 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

retsTVar :: (a, b, Type, d, e) -> Bool Source #

splitPrims :: [Typed [CoreExpr]] -> ([Prim], [Prim]) Source #

splitPrimss :: [[Typed [CoreExpr]]] -> ([[Prim]], [[Prim]]) Source #

mapSum :: (MonadPlus m, Delay m) => (a -> m b) -> [[a]] -> m b Source #

applyDo :: (Functor m, Monad m) => ([Type] -> Type -> PriorSubsts m a) -> [Type] -> Type -> PriorSubsts m a Source #

wind :: (a -> a) -> ([Type] -> Type -> a) -> [Type] -> Type -> a Source #

wind_ :: ([Type] -> Type -> a) -> [Type] -> Type -> 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 #

fromAvail :: [Type] -> [(Int8, (Int, [Type], Type))] Source #

mguAssumptions :: (Functor m, MonadPlus m) => Type -> [Type] -> PriorSubsts m [CoreExpr] 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 #

usedArg :: TyVar -> 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 #

constEq :: Type -> [CoreExpr] -> Bool Source #

ceq :: CoreExpr -> Type -> [CoreExpr] -> Bool Source #

recHead :: Type -> CoreExpr -> Bool Source #

retSameVal :: Type -> [CoreExpr] -> Bool Source #

rsv :: Type -> [CoreExpr] -> Bool Source #

rsv' :: CoreExpr -> Type -> [CoreExpr] -> Bool Source #

rv :: Type -> Int8 -> CoreExpr -> CoreExpr Source #

anyRec :: Type -> [CoreExpr] -> Bool Source #

mkSubsts :: Search m => Int -> TyVar -> Type -> PriorSubsts m Int Source #

mkSubst :: Search m => Int -> TyVar -> Type -> PriorSubsts m Int Source #

mkRetty :: Type -> (Type, Type) Source #

reorganizer_ :: ([Type] -> a) -> [Type] -> a Source #

hit :: Type -> [Type] -> Bool Source #

combs :: (Eq t, Num t) => t -> [a] -> [[a]] Source #

tails :: [a] -> [[a]] Source #