MODULE        M1.

BASE          Day, ListOfDay.

CONSTANT      Nil : ListOfDay;
              Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,
              Sunday : Day.
FUNCTION      Cons : Day * ListOfDay -> ListOfDay.
PREDICATE     Append : ListOfDay * ListOfDay * ListOfDay;
              Append3 : ListOfDay * ListOfDay * ListOfDay * ListOfDay.

Append(Nil,x,x).
Append(Cons(u,x),y,Cons(u,z)) <-
              Append(x,y,z).

Append3(x,y,z,u) <-
              Append(x,y,w) &
              Append(w,z,u).
