ExercisesExercise 3 - ListsExercise 4 - Lists of closed intervals whose bounds are integersDocumentation and user's manualTable of contentsOCaml programs

Exercise 4 - Lists of closed intervals whose bounds are integers

Consider lists of closed interval whose bounds are integers. To deal with such intervals use the non-built-in type  closed_interval  provided by the  Closed_interval  module. To deal with lists use the functions provided by the  List_1  module.

Use lists of closed interval whose bounds are integers.   For each of the following specifications of functional values write a recursive definition that meets the specification:

 1 
  Name:  map_width . Type:  closed_interval list -> int list . Computes the list of the widths of the elements in a list of intervals.

 2 
  Name:  are_embedded . Type:  closed_interval list -> bool . Tests whether a list of intervals is in increasing order (according to set inclusion).


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

ExercisesExercise 3 - ListsExercise 4 - Lists of closed intervals whose bounds are integersDocumentation and user's manualTable of contentsOCaml programs