let rec compatible_types = function
    (Base(Channel_ota),Base(Channel))
  | (Base(Channel),Base(Channel_ota))
  | (Base(Channel_dy),Base(Channel))
  | (Base(Channel),Base(Channel_dy))
  | (Set([]),Set(_))
  | (Set([]),Function(_))
  | (_,Base(Message))
  | (Base(Hash_func),Base(_)) -> true
  | (Set([Pair(t1,Pair(t2,t3))]),Function(s1,s2::ls)) ->
      (compatible_types (t1,s2))
      && (compatible_types (Set([Pair(t1,t3)]),Function(s1,ls)))
  | (Set([Pair(t1,t2)]),Function(s1,[s2])) ->
      (compatible_types (t1,s2))
      && (compatible_types (t2,s1))
  | (x,y) -> x=y