let rec rename s p =
    match s with
      | [] -> p
      | (x,x')::s -> subst x (F.var x') (rename s p)