From Undecidability.L Require Import Computability.Decidability Datatypes.LNat L.
(* ** Decidabiity of closedness, boundedness and procness *)
Fixpoint boundb (k : nat) (t : term) : bool :=
match t with
| var n => negb (k <=? n)
| app s t => andb (boundb k s) (boundb k t)
| lam s => boundb (S k) s
end.
Instance term_boundb : computableTime' boundb (fun _ _ => (5,fun s _ => (size s * 31+9,tt))).
Definition closedb := boundb 0.
unfold closedb.
destruct (boundb_spec 0 s);constructor; rewrite closed_dcl;auto.
Qed.
Instance termT_closedb : computableTime' closedb (fun s _ => (size s * 31+15,tt)).

Lemma ldec_closed : ldec closed.