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

(* Specifications: *)
Lemma normalise_correct : forall (T: Type) env t (tg:T), eval_cnf eval_nformula env (normalise t tg) <-> Zeval_formula env Tauto.isProp t.
Definition xnegate (f:NFormula Z) : list (NFormula Z)  :=
let (e,o) := f in
match o with
| Equal  => (e,Equal) :: nil
| NonEqual => (psub e (Pc 1),NonStrict) :: (psub (Pc (-1)) e, NonStrict) :: nil
| NonStrict => (e,NonStrict)::nil
| Strict    => (psub e (Pc 1),NonStrict)::nil
end.