MagicHaskeller-0.9.6.7: Automatic inductive functional programmer by systematic search

Safe HaskellNone
LanguageHaskell98

MagicHaskeller.RunAnalytical

Contents

Synopsis

Documentation

This module provides analytically-generate-and-test synthesis, i.e. synthesis by filtration of analytically generated (many) expressions. Actions whose name ends with F use random testing filter (like filterThenF) in order to reduce the number of expressions.

ATTENTION: This module is supposed to be used under GHCi environment. Currently it is known not to work when executed as an a.out. Also, this module is tested only on Linux, and does not work with Windows. Another point is that currently functions in this module only work with known types appearing in defaultPrimitives.

Re-exported modules

All in one actions

quickStart Source #

Arguments

:: Typeable a 
=> Q [Dec]

target I/O pairs

-> Q [Dec]

I/O pairs for background knowledge functions

-> (a -> Bool)

test function

-> IO () 

Example of quickStart

>>> quickStart [d| f [] = 0; f [a] = 1 |] noBKQ (\f -> f "12345" == 5)
> \a -> let fa (b@([])) = 0
>           fa (b@(c : d)) = succ (fa d)
>       in fa a :: forall t2 . [t2] -> Int
> ^CInterrupted.

quickStartF Source #

Arguments

:: (Filtrable a, Typeable a) 
=> Q [Dec]

target I/O pairs

-> Q [Dec]

I/O pairs for background knowledge functions

-> (a -> Bool)

test function

-> IO () 

filterGet1 and its friends can be used to synthesize one expression satisfying the given condition. For example,

filterGetOne_ :: Typeable * a => HscEnv -> Q [Dec] -> (a -> Bool) -> IO () Source #

filterGetOne Source #

Arguments

:: Typeable a 
=> HscEnv

session in which synthesized expressions are run

-> Q [Dec]

target I/O pairs

-> (a -> Bool)

test function

-> IO (Every a) 

filterGetOneBK Source #

Arguments

:: Typeable a 
=> HscEnv

session in which synthesized expressions are run

-> Q [Dec]

target I/O pairs

-> Q [Dec]

I/O pairs for background knowledge functions

-> (a -> Bool)

test function

-> IO (Every a) 

Unlike filterGetOne and its friends, the following three functions do not print anything but only return results silently.

synthFilt Source #

Arguments

:: Typeable a 
=> HscEnv

session in which synthesized expressions are run

-> Q [Dec]

target I/O pairs

-> Q [Dec]

I/O pairs for background knowledge functions

-> (a -> Bool)

test function

-> IO (Every a) 

synthFiltF Source #

Arguments

:: (Filtrable a, Typeable a) 
=> HscEnv

session in which synthesized expressions are run

-> Q [Dec]

target I/O pairs

-> Q [Dec]

I/O pairs for background knowledge functions

-> (a -> Bool)

test function

-> IO (Every a) 

synthAll Source #

Arguments

:: Typeable a 
=> HscEnv

session in which synthesized expressions are run

-> Q [Dec]

target I/O pairs

-> Q [Dec]

I/O pairs for background knowledge functions

-> IO (Every a) 

noBKQ can be used as the background knowledge for showing that no background knowledge functions are used.