let e_if c t f = match c with
  | Tconst (ConstBool true-> t
  | Tconst (ConstBool false-> f
  | _ -> if eq_terms t f then t else Tif (c, t, f)