Type-inference by yourselfPart 3 - Induction and recursionTutorial (draft)ExercisesDocumentation and user's manualTable of contentsOCaml programs

Exercises

Each time an expression f with tuple of formal parameters p intended to have a functional value is written, consider each sub-expression g(e) in f (that is, each application) and do the following:
  • To avoid run-time errors: Look at the specification of g and check whether g can be applied to the tuple e of arguments in g(e).
  • To avoid infinite looping: If g is f (recursive call of f) then check whether the tuple e of arguments in f(e) is closer to the basis than the tuple p of formal parameters of f.

  • Exercise 1 - Natural numbers again
  • Exercise 2 - Natural numbers once more
  • Exercise 3 - Lists
  • Exercise 4 - Lists of closed intervals whose bounds are integers

  • Latest update : October 5, 2006
    This document was translated from LaTeX by Hyperlatex 2.5, which is not the latest version of Hyperlatex.

    Type-inference by yourselfPart 3 - Induction and recursionTutorial (draft)ExercisesDocumentation and user's manualTable of contentsOCaml programs