(*******************************************************************)
(* Decorated nested implications are pairs of a nested implication *)
(* and a counter-model of the premisses.                           *)

Definition decorated_nested_imp := (nimp * kripke_tree)%type.Definition decorated_nested_imps := list decorated_nested_imp.Definition DNI_NIL := nil (A:=decorated_nested_imp).Definition decorated_nested_imp2nimp (x : decorated_nested_imp) :=
  match x with
  | (x0, _) => x0
  end.Definition decorated_nested_imp2k (x : decorated_nested_imp) :=
  match x with
  | (_, k) => k
  end.Definition decorated_nested_imp2form (x : decorated_nested_imp) :=
  nimp2form (decorated_nested_imp2nimp x).Fixpoint rev_app (ds : decorated_nested_imps) :
 nested_imps -> nested_imps :=
  match ds with
  | nil => fun ni : nested_imps => ni
  | (x, k) :: ds => fun ni : nested_imps => rev_app ds (Decorated x k :: ni)
  end.

Lemma in_app_or_ni : forall (x : nested_imp) (ni1 ni2 : nested_imps), In x (ni1 ++ ni2) -> In x ni1 \/ In x ni2.