let norm_Uplet_cmp purifie (sub : t_subst) (lst : term list) : term list * t_subst =
let rec norm_Uc = function
| (Uplet l)::fin -> norm_Uc (l@fin) (* For <<..>..> = <....> *)
| tt::fin ->
( let (l,ss) = norm_Uc fin in
match purifie ss tt with
| (Var n as t,s) ->
( match valeur n s with
| Uplet(ll) -> (ll@l,s)
| Atm(0)
| Xor(_) -> (t::l,s)
| t -> (t::l,s) )
| (Uplet ll,s) -> (ll@l,s)
| (Atm(0) as t, s)
| (Xor(_) as t, s) ->
let (nv, ns) = add_newvalue s t
in (nv::l, ns)
| (t,s) -> (t::l,s) )
| [] -> ([],sub)
in
norm_Uc lst