


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Progrmg Languages & Compilers; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Summer 2009;
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



1.2 Fixed Problem 10 grader bug introduced in 1.1. 1.1 Extra Credit Problem 10 has been further disambiguated, mp2grader script for Problem 10 has been fixed to conform to the problem description, and its point value has been increased from 8 to 10. 1.0 Initial release.
The purpose of this MP is to help the student master:
Collaboration is NOT allowed in this assignment.
The problems below have sample executions that suggest how to write answers. Students have to use the same function name, but the name of the parameters that follow the function name need not be duplicated. That is, the students are free to choose different names for the arguments to the functions from the ones given in the example execution. We will sometimes use let rec to begin the definition of a function that is allowed to use rec. You are not required to start your code with let rec, and you may use let rec when we do not.
For all these problems, you are allowed to write your own auxiliary functions, either internally to the function being defined or externally as separate functions. In fact, you will find it helpful to do so on several problems. In this assignment, you may not use any library functions (except @, which is also pervasive).
Some functions in this assignment have polymorphic types. These functions can be tested on non-integer inputs as well. Please be careful about your function types.
5.1 Pattern Matching
Note: input can be a non-integer pair. Your function should be polymorphic.
val tuple_to_list : ’a (^) * ’a (^) * ’a -> ’a list =
val mean_max : int (^) * int -> int (^) * int =
val sort_first_two : ’a list -> ’a list =
5.2 Recursion
val concat_even : string list -> string =
val largest_of : int list -> int (^) * int =
val simple_poker : (int (^) * int) list -> int (^) * int =