From 379b6353396ca2401241d714733d570629835ffe Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 6 Feb 2015 08:39:37 +0100 Subject: added practicum files, updated gitignore --- files/practicum/BewijsSubsEnMap.icl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 files/practicum/BewijsSubsEnMap.icl (limited to 'files/practicum/BewijsSubsEnMap.icl') diff --git a/files/practicum/BewijsSubsEnMap.icl b/files/practicum/BewijsSubsEnMap.icl new file mode 100644 index 0000000..43329e3 --- /dev/null +++ b/files/practicum/BewijsSubsEnMap.icl @@ -0,0 +1,33 @@ +Zij gegeven de volgende functie-definities: + +subs :: [a] -> [[a]] +subs [] = [[]] (1.) +subs [x:xs] = subs xs ++ map (cons x) (subs xs) (2.) + +map :: (a -> b) [a] -> [b] +map f [] = [] (3.) +map f [x:xs] = [f x : map f xs] (4.) + +(++) :: [a] [a] -> [a] +(++) [] ys = ys (5.) +(++) [x:xs] ys = [x : xs ++ ys] (6.) + +cons :: a [a] -> [a] +cons x xs = [x : xs] (7.) + + +Bewijs de volgende stelling voor alle functies f en eindige lijsten xs: + + subs (map f xs) = map (map f) (subs xs). + +Je kunt gebruik maken van de volgende hulpstellingen (lemma's) die gelden voor alle +functies f, g en eindige lijsten xs en ys: + +map f (xs ++ ys) = map f xs ++ map f ys (8.) +map g (map f xs) = map (g o f) xs (9.) +(cons (f a)) o (map f) = (map f) o (cons a) (10.) +(g o f) x = g (f x) (11.) + + +Bewijs: +------- -- cgit v1.2.3