(************************************************************)
(* disjunctions are stored as pairs of Int's                *)

Definition disj := (Int * Int)%type.Definition disjs := list disj.Definition DNil := nil (A:=disj).Definition disj2form (x : disj) :=
  match x with
  | (i, j) => OrF (Atom i) (Atom j)
  end.Definition disj2nform (x : disj) := match x with
                                    | (i, j) => NDisj i j
                                    end.Definition disjs2forms (ds : disjs) := map disj2form ds.Definition disjs2nforms (ds : disjs) := map disj2nform ds.(*****************************************************************)
(* Nested implications are stored either as a nimp or as a       *)
(* nimp and a counter-model                                      *)

Inductive nested_imp : Set :=
  | Undecorated : nimp -> nested_imp
  | Decorated : nimp -> kripke_tree -> nested_imp.(*****************************************************************)
(* Nested implications are stored either as a nimp or as a       *)
(* nimp and a counter-model                                      *)

Inductive nested_imp : Set :=
  | Undecorated : nimp -> nested_imp
  | Decorated : nimp -> kripke_tree -> nested_imp.(*****************************************************************)
(* Nested implications are stored either as a nimp or as a       *)
(* nimp and a counter-model                                      *)

Inductive nested_imp : Set :=
  | Undecorated : nimp -> nested_imp
  | Decorated : nimp -> kripke_tree -> nested_imp.Definition nested_imp2nimp (ni : nested_imp) :=
  match ni with
  | Undecorated ni => ni
  | Decorated ni _ => ni
  end.Definition nested_imp2form (x : nested_imp) := nimp2form (nested_imp2nimp x).Definition nested_imp2nform (x : nested_imp) := NImp_NF (nested_imp2nimp x).Definition nested_imps := list nested_imp.Definition NNil := nil (A:=nested_imp).Definition nested_imps2forms (ni : nested_imps) := map nested_imp2form ni.Definition nested_imps2nforms (ni : nested_imps) := map nested_imp2nform ni.Definition nested_imps2nimps (ni : nested_imps) := map nested_imp2nimp ni.

Lemma nested_imps2nimps_length : forall ni : nested_imps, length ni = length (nested_imps2nimps ni).