Assignment 8, Fall 2002, CS314 1. Louden #6.22 2.In Algol68 we are given the following four user-defined modes: mode vector [1:10] int; mode matrix [1:10] vector; mode mm [1:10,1:10] int; mode zz [1:10] vector; mm c,d; zz a,b; vector v1,v2; matrix m1, m2; (Note: the first statement defines 'vector' as a type which is a 10 word array of integer values, a 'row int' type in Algol68 parlance.) a. If we use structural equivalence for comparing types, which of these variables are of the same type? b. If we use name equivalence, which of these variables are of the same type? 3. Recall the function reduce in Scheme: (define ( reduce op ys id) (if (null? ys) id (op (car ys) (reduce op (cdr ys) id ))) Using reduce, define a Scheme function that calculates the maximum value contained in a list 4. Recall the map function in Scheme: (define (map f ys) (if (null? ys) '() cons (f (car ys)) (map f (cdr ys)))) What will be the result of this function call? (map (lambda (x) (if (< x 0) (* 2 x) x)) '(-1 2 3 -4 -5))