Definition negate {T : Type} (t:Formula Z) (tg:T) : cnf (NFormula Z) T :=
let f := xnnormalise t in
if Zunsat f then cnf_tt _ _
else cnf_of_list tg (xnegate f).

Lemma xnegate_correct : forall env f,
(make_conj (fun x => eval_nformula env x -> False) (xnegate f)) <-> ~ eval_nformula env f.