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 negate_correct : forall T env t (tg:T), eval_cnf eval_nformula env (negate t tg) <-> ~ Zeval_formula env Tauto.isProp t.
Definition cnfZ (Annot: Type) (TX : Tauto.kind -> Type)  (AF : Type) (k: Tauto.kind) (f : TFormula (Formula Z) Annot TX AF k) :=
rxcnf Zunsat Zdeduce normalise negate true f.