Safe Haskell | None |
---|---|

Language | Haskell98 |

- type ProgGenSF = PGSF CoreExpr
- data PGSF e = PGSF (MemoDeb e) TypeTrie (ExpTrie e)
- freezePS :: Type -> PriorSubsts Recomp Type -> Matrix (Type, Subst, TyVar)
- funApSub_ :: (Search m, Monoid a) => (Type -> PriorSubsts m ()) -> (Type -> PriorSubsts m a) -> (Type -> PriorSubsts m a) -> Type -> PriorSubsts m a
- funApSub_spec :: (Monoid a, Search m) => (Type -> PriorSubsts m ()) -> (Type -> PriorSubsts m a) -> Type -> PriorSubsts m a
- lookupNormalized :: (Functor m, MonadPlus m) => (Type -> m (e, Subst, TyVar)) -> [Type] -> Type -> PriorSubsts m e
- tokoro10fst :: (Eq k, Ord k) => [(k, s, i)] -> [(k, s, i)]
- mkTrieOptSFIO :: Expression e => Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> IO (PGSF e)

# Documentation

Program generator with synergetic filtration. This program generator employs filtration by random testing, and rarely generate semantically equivalent expressions more than once, while different expressions will eventually appear (for most of the types, represented with Prelude types, whose arguments are instance of Arbitrary and which return instance of Ord). The idea is to apply random numbers to the generated expressions, compute the quotient set of the resulting values at each depth of the search tree, and adopt the complete system of representatives for the depth and push the remaining expressions to one step deeper in the search tree. (Thus, adoption of expressions that may be equivalent to another already-generated-expression will be postponed until their "uniqueness" is proved.) As a result, (unlike ProgGen,) expressions with size N may not appear at depth N but some deeper place.

ProgGenSF is more efficient along with a middle-sized primitive set (like `reallyall`

found in LibTH.hs),
but is slower than ProgGen for a small-sized one.

Also note that ProgGenSF depends on hard use of unsafe* stuff, so if there is a bug, it may segfault....

PGSF (MemoDeb e) TypeTrie (ExpTrie e) |

Expression e => ProgramGenerator (PGSF e) Source # | |

Expression e => WithCommon (PGSF e) Source # | |

funApSub_ :: (Search m, Monoid a) => (Type -> PriorSubsts m ()) -> (Type -> PriorSubsts m a) -> (Type -> PriorSubsts m a) -> Type -> PriorSubsts m a Source #

funApSub_spec :: (Monoid a, Search m) => (Type -> PriorSubsts m ()) -> (Type -> PriorSubsts m a) -> Type -> PriorSubsts m a Source #

lookupNormalized :: (Functor m, MonadPlus m) => (Type -> m (e, Subst, TyVar)) -> [Type] -> Type -> PriorSubsts m e Source #

tokoro10fst :: (Eq k, Ord k) => [(k, s, i)] -> [(k, s, i)] Source #

mkTrieOptSFIO :: Expression e => Common -> [Typed [CoreExpr]] -> [[Typed [CoreExpr]]] -> [[Typed [CoreExpr]]] -> IO (PGSF e) Source #