hw7Solutions - Homework 7 Solutions Problem 1) and = foldr...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 7 Solutions Problem 1) and = foldr ( ) True {and} Problem 2) Theorem {and 1 }. and([x] ++ ([False] ++ ys)) = False proof: and([x] ++ ([False] ++ ys)) = and((x: [ ]) ++ ([False] ++ ys)) (:) = and(x: ([ ] ++ ([False] ++ ys))) ++.: = foldr ( ) True (x: ([ ] ++ ([False] ++ ys))) and = x (foldr ( ) True ([ ] ++ ([False] ++ ys))) foldr.: = x (foldr ( ) True ([False] ++ ys)) ++.[ ] = x (foldr ( ) True ((False: [ ]) ++ ys)) (:) = x (False (foldr ( ) True ([ ] ++ ys))) foldr.: = x ((foldr ( ) True ([ ] ++ ys)) False) commutes = (x (foldr ( ) True ([ ] ++ ys)) False associative = F a l s e null Problem 3) Theorem {and T }. and[True, True, … True] = True P(0) (and[ ] = True) P(1) (and[True] = True) P(2) (and[True, True] = True) P(n) (and[True, True, … True] = True) where [True, True, … True] has n elements Base Case: P(0) and [ ] = foldr (∧) True [ ] and = True foldr.[ ] Inductive Case: P(n+1)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This homework help was uploaded on 04/08/2008 for the course CS 2603 taught by Professor Rexpage during the Spring '08 term at The University of Oklahoma.

Page1 / 2

hw7Solutions - Homework 7 Solutions Problem 1) and = foldr...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online