Section FOL_DEF.
Definition ivar : Set :=
nat.
Context {L : language}.
Inductive trm : Set :=
| Var_trm (x : ivar) : trm
| Fun_trm (f : L.(function_symbols)) (ts : trms (L.(function_arity_table) f)) : trm
| Con_trm (c : L.(constant_symbols)) : trm
with trms : forall arity : nat, Set :=
| O_trms : trms O
| S_trms (n : nat) (t : trm) (ts : trms n) : trms (S n).
Inductive frm : Set :=
| Rel_frm (R : L.(relation_symbols)) (ts : trms (L.(relation_arity_table) R)) : frm
| Eqn_frm (t1 : trm) (t2 : trm) : frm
| Neg_frm (p1 : frm) : frm
| Imp_frm (p1 : frm) (p2 : frm) : frm
| All_frm (y : ivar) (p1 : frm) : frm.
Fixpoint trms_to_vec {n : nat} (ts : trms n) : Vector.t trm n :=
match ts with
| O_trms => []
| S_trms n' t ts => t :: trms_to_vec ts
end.
Fixpoint vec_to_trms {n : nat} (ts : Vector.t trm n) : trms n :=
match ts with
| VNil => O_trms
| VCons n t ts => S_trms n t (vec_to_trms ts)
end.

Lemma vec_to_trms_to_vec arity (xs : Vector.t trm arity)
: trms_to_vec (vec_to_trms xs) = xs.