let rec unif_uplet_light subs = function
  | (a::l1, b::l2) -> unif_uplet_light (unif_light true a b subs) (l1,l2)
  | ([],[]) -> subs
  | _ -> []
and unif_light (to_purify : bool) (u : term) (v : term) (subs : t_subst list) : t_subst list =
  match (u,v) with
    | (Var(n),t) | (t,Var(n))       -> add unif_light (unif_combi unif_light unif_xor) to_purify n t [] subs
    | (Atm(n1),Atm(n2))             -> if n1=n2 then subs else []
    | (Uplet(l1),Uplet(l2))         -> unif_uplet_light subs (l1,l2)
    | (PCrypt(m1,k1),PCrypt(m2,k2))
    | (SCrypt(m1,k1),SCrypt(m2,k2)) -> unif_light true m1 m2 (unif_light to_purify k1 k2 subs)
    | (PInv(t1),t2) | (t2,PInv(t1)) ->
        ( match (t1,t2) with
          | (_,PInv(t2)) -> unif_light to_purify t1 t2 subs
          | (Var(_), _)  -> unif_light to_purify t1 (PInv t2) subs                  (* since t2 <> PInv(_) *)
          | (PInv(t1),_) -> unif_light to_purify t1 t2 subs
          | (Xor(_), _)  -> unif_combi unif_light unif_xor to_purify t1 (PInv t2) subs    (* t2 <> PInv(_) *)
          | (_, Xor(_))  -> unif_combi unif_light unif_xor to_purify (PInv t1) t2 subs
          | _            -> []  )
    | (Exp(a,l1),Exp(b,l2))         -> unif_exp unif_light a l1 b l2 subs
    | (Xor(_),_) | (_,Xor(_))       ->
        (* TODO: we could first test, if it is really a xor problem,
         * because 0 =? Xor[t1;t2] is not really xor,
         * since it is equivalent to t1 =? t2 *)

        unif_combi unif_light unif_xor to_purify u v subs
    | _                             -> []