Exercises

Since there is a lot to read and to digest this week, the number of exercises is reduced.

Mandatory exercises

  • Exercise 0: some food for thought about basic computational arithmetic
  • Exercise 1: implementing emacs’s M-u and M-l
  • Exercise 5: implementing a polymorphic unparser for quadruples
  • Exercise 9: implementing a predicate to determine whether a given non-negative integer is odd
  • Exercise 10: playing with an implementation of the power function

Exercise 10

The accompanying file contains a bug, and your task is to fix this bug.

To this end, load this file a few times in OCaml, as in:

# #use "week-05_power.ml";;
...
#

until the bug becomes apparent (you will recognize it when you see it).

Then figure it out and fix it.

(Hint: redefine the silent flag at the beginning of the file to enable error messages.)

Version

Added Exercise 0 [15 Feb 2020]

Created [14 Feb 2020]

Table Of Contents

Previous topic

Induction and recursion over natural numbers

Next topic

YSC1212 Lecture Notes, Week 06