(** ** Enumerability *)

(* Specifications: *)
Lemma dec_fresh y A : dec (fresh y A).
Lemma incl_dec X (A B : list X) `{eq_dec X} : dec (A <<= B).
Fixpoint L_ded {b} {s : nd} (A : list (form b)) (n : nat) : list (form b) :=
match n with
| 0 => A
| S n => L_ded A n
++ concat [ [ phi1 --> phi2 | phi2 ∈ L_ded (phi1 :: A) n ] | phi1 ∈ L_T (form b) n]
++ [ phi2 | (phi1,phi2) ∈ (L_ded A n × L_T (form b) n) , (phi1 --> phi2 el L_ded A n) ]
++ [ ∀ x; phi | (phi, x, y) ∈ (L_T (form b) n × L_T var n × L_T var n) ,
fresh y (consts phi ++ consts_l A) /\ subst x (P y) phi el L_ded A n ]
++ [ subst x t phi | (phi, x, t) ∈ (L_T (form b) n × L_T var n × L_T term n),
vars_t t = [] /\ ∀ x; phi el L_ded A n]
++ match b with frag => fun _ => [] | full => fun A =>
match s with
| intu => [ phi | phi ∈ L_T (form full) n, Fal el L_ded A n ]
| class => [ phi | phi ∈ L_T (form full) n, (¬¬ phi) el L_ded A n ]
end end A
end.