Session 4: Lists, the sequel

Exercise 1: basic list-predicates

Define predicates for:

Exercise 2: sorting a list

In this exercise we will gradually write a program for sorting a list.

Exercise 3: nested lists
Exercise 4: sets
Lists are often used as a representation for sets. In this exercise we want to make a data abstraction for a set, using a list as internal representation. Remark that in a list an element could occur more than once, in a normal set this is not the case.