view exercises/src/Exercise_4.hs @ 8:8689a0a4b38e

add example key
author Markus Kaiser <markus.kaiser@in.tum.de>
date Wed, 07 Nov 2012 22:17:33 +0100
parents b50c976522fa
children f4d71c6df64c
line wrap: on
line source

module Exercise_4 where
import Test.QuickCheck
import Data.List

{---------------------------------------------------------------------}
{- Aufgabe G4.1 -}

hasFibonacciProperty :: [Integer] -> Bool
hasFibonacciProperty xs = undefined



{---------------------------------------------------------------------}
{- Aufgabe G4.2 -}
key = [('a','x'),('H','e'),('l','P'),('o','M')]

cryptChar :: [(Char,Char)] -> Char -> Char
cryptChar [] c = '_'
cryptChar ((k,v) : ks) c = undefined


crypt :: [(Char,Char)] -> [Char] -> [Char]
crypt key [] = []
crypt key (x : xs) = undefined


isKeyReversible :: [(Char,Char)] -> Bool
isKeyReversible [] = True
isKeyReversible ((k,v) : ks) = undefined

{- QuickCheck Tests -}



{---------------------------------------------------------------------}
{- Aufgabe G4.3 -}

{-
 - Proof me!
 -}



{---------------------------------------------------------------------}
{- Aufgabe G4.4 -}

match :: [Char] -> [Char] -> Bool
match xs ys = undefined



{---------------------------------------------------------------------}
{- Aufgabe H4.1 -}

strictlyDescending :: [Integer] -> Bool
strictlyDescending = undefined



{---------------------------------------------------------------------}
{- Aufgabe H4.2 -}

chunks :: Int -> [a] -> [[a]]
chunks = undefined

irregularChunks :: [Int] -> [a] -> [[a]]
irregularChunks = undefined



{---------------------------------------------------------------------}
{- Aufgabe H4.3 -}

{-WETT-}
upsAndDowns :: Ord a => [a] -> [[a]]
upsAndDowns = undefined
{-TTEW-}



{---------------------------------------------------------------------}
{- Aufgabe H4.4 -}

{-
 - <Hier Induktionsbeweis einfügen>
 -}