Foundations of CS

Welcome to our course page for Foundations of Computer Science in Michaelmas 2014. Read through the following information (submission guidance and getting started) and the general guidelines for all students before the first lecture of the course.

Submission Guidance

The supervision signup page on otter:

Please submit you work as a single .sml file, a Standard ML source file. If you have difficulties then please submit your work as a .txt file. It does not matter if some of your code will not compile but please use comments to explain your approach and detail any difficulties you have faced.

Before writing each function, write a comment to detail the purpose of the function and its type, what are the function’s arguments and what you expect the function to return. Explicitly state the assumptions you are making about any arguments e.g. we assume that the integer is positive or we assume that the list is non-empty.

If both iterative and recursive functions are provided, add an i to the end of the iterative function name to differentiate between them.
Where possible write a few test cases alongside either function or give an example call trace.

Here is an example of how a student might document a function called last:

1
2
3
4
5
6
7
(* last takes a list and returns the last item in the list. This function doesn't handle empty lists *)
(* val last = fn: 'a list -> 'a *)
fun last [x] = x
| last (x::xs) = last xs
 
(* last [3] returns 3 *)
(* last [3,5,7,9] returns 3 *)

Getting Started

I understand that you will be busy over the weekend with freshers but I highly suggest that you both get ML set up on your personal machine (directions are on the course webpage) and get hold of the course textbook. The book will be in your college library as well as the departmental library, you can locate it using cambridge library search (formally known as newton).

Let me know if you have any issues: I may be able to help with setup (linux/mac not windows) or locate a copy of the book for you.

Leave a Reply