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

Safe HaskellNone

Language.ArrayForth.Distance

Synopsis

Documentation

countBits :: (Integral n, Bits n) => n -> n -> IntSource

Counts the number of bits that differ between two numbers.

registers :: [State -> F18Word] -> State -> State -> DistanceSource

Return a distance function that counts the different bits between the given registers. You could use it like `compareRegisters [s, t]`.

locations :: [F18Word] -> State -> State -> DistanceSource

Returns a distance function that counts the different bits between the given memory locations.

matching :: Eq a => (State -> a) -> Trace -> Trace -> DistanceSource

Returns a score that counts the number of matching states according to some projection function.