module Exercise_5 where import Data.Maybe {- Library -- nicht verändern! -} type State = Integer type DA = (State, State -> Char -> State, State -> Bool) type ListDA = (State, [((State, Char), State)], [State]) a :: DA a = (0, delta, (==1)) where delta 0 'a' = 1 delta 1 'a' = 1 delta 2 'a' = 1 delta 0 'b' = 2 delta 1 'b' = 2 delta 2 'b' = 2 toDA :: ListDA -> DA toDA (start, delta, final) = (start, deltaFun delta, (`elem` final)) where deltaFun dl = curry (fromMaybe 0 . flip lookup dl) {- H1 -} fixpoint :: (a -> a -> Bool) -> (a -> a) -> a -> a fixpoint = undefined cents :: [Integer] -> [Integer] cents = undefined trancl :: [(Integer, Integer)] -> [(Integer, Integer)] trancl = undefined {- H2 -} advance :: DA -> State -> String -> State advance = undefined prop_advance_empty :: DA -> State -> Bool prop_advance_empty = undefined prop_advance_single :: DA -> State -> Char -> Bool prop_advance_single = undefined prop_advance_concat :: DA -> State -> String -> String -> Bool prop_advance_concat = undefined accept :: DA -> String -> Bool accept = undefined reachableStates :: DA -> State -> [Char] -> [State] reachableStates = undefined {- H3 -} {-WETT-} quasiSubseq :: Eq a => [a] -> [a] -> Bool quasiSubseq xs ys = undefined {-TTEW-}