array-forth-0.2.1.4: A simple interpreter for arrayForth, the language used on GreenArrays chips.

Safe HaskellNone
LanguageHaskell98

Language.ArrayForth.Synthesis

Synopsis

Documentation

data DefaultScore Source

A score type that contains a correctness value and a performance value.

Constructors

DefaultScore Double Double 

trace :: Monoid score => Program -> [State] -> (Trace -> Trace -> score) -> Program -> score Source

Creates an evaluation function from a spec, a set of inputs and a function for comparing program traces.

withPerformance :: Score s => (Trace -> Trace -> s) -> Trace -> Trace -> DefaultScore Source

Using a given correctness measure, produce a score also containing performance.

evaluate :: Program -> [State] -> (State -> State -> Distance) -> Program -> DefaultScore Source

Given a specification program and some inputs, evaluate a program against the specification for both performance and correctness. Normalize the score based on the number of test cases.

defaultOps :: Distr Instruction Source

The default distribution of instructions. For now, we do not support any sort of jumps. All the other possible instructions along with constant numbers and unused slots are equally likely. The numeric value of constants is currently a uniform distribution over 18-bit words.

defaultMutations :: Mutation Program Source

The default mutations to try. For now, this will either change an instruction or swap two instructions in the program, with equal probability.