At the top right and at the bottom right of the present page, there is a clickable word, “index”, to access the index of the current version of the lecture notes. Click on it and then peruse the index, making sure that its entries make sense to you (otherwise, click on them to check them out).
The lecture notes start with updates (Chapter Lecture Notes for Intro to CS, updates). Make sure to check them out regularly, as they reflect the development of the lecture.
Briefly explain, in your own words, the concept of commuting diagram, as presented in the postlude of Chapter Towards OCaml.
For one more example (which could be connected to Exercise 7.i):
A question about the design of OCaml:
Justify this choice.
Hint: contemplate the APP typing rule.
Richard Feynman: I believe that has some significance for [y]our problem.Mimer: Professor Feynman! Thanks for stopping by!
Consider the following definition:
let length_of_string_self_concatenation s =
String.length (s ^ s) = 2 * String.length s;;
What is the result of applying length_of_string_concatenation to any string?
Justify your answer.
The answer is true, always, because concatenating a string to itself yields a string which is twice as long.
The computation carried out by length_of_string_self_concatenation can be depicted with the following commuting diagram:
Consider the following definition:
let length_of_string_concatenation s1 s2 =
String.length (s1 ^ s2) = String.length s1 + String.length s2;;
What is the result of applying length_of_string_concatenation to any two strings?
Justify your answer.
Déjà vu, anyone?
Strange.
Added the commuting diagram in Exercise 0 [13 Feb 2021]
Fixed a second typo in Exercise 19, again thanks to Ann Chen’s eagle eye [09 Feb 2021]
Fixed a typo in Exercise 19, thanks to Ann Chen’s eagle eye [08 Feb 2021]
Added Exercise 17 and its solution [07 Feb 2021]
Created [06 Feb 2021]