module Exercise_9 where import Form_9 import Test.QuickCheck import Control.Monad import Data.List as List {- Library -- nicht veraendern! -} data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Eq, Show) -- allow QuickCheck to generate arbitrary values of type Tree instance Arbitrary a => Arbitrary (Tree a) where arbitrary = sized tree where tree 0 = return Empty tree n | n > 0 = oneof [return Empty, liftM3 Node arbitrary (tree (n `div` 2)) (tree (n `div` 2))] {- G9.1 -} -- Modify Form.hs from the lecture {- G9.2 -} {- G9.3 -} showTable :: Form -> String showTable = undefined {- H9.1 -} {- insert proof here -} {- H9.2 -} isDnf :: Form -> Bool isDnf = undefined pushNot :: Form -> Form pushNot = undefined pushAnd :: Form -> Form pushAnd = undefined balance :: Form -> Form balance = undefined toDnf :: Form -> Form toDnf = undefined {- H9.3 -} treeSum :: Tree Int -> Int treeSum = undefined treeMin :: Ord a => a -> Tree a -> a treeMin = undefined evens :: Tree Int -> [Int] evens = undefined {- H9.4 -} {-WETT-} quasiMajorityElems :: Eq a => [a] -> [a] quasiMajorityElems xs = undefined {-TTEW-}