let rec reverse_assoc lst = match lst with
    (x,y)::rest -> (y,x)::(reverse_assoc rest)
  | [] -> []