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.

Lemma closedb_spec s : Bool.reflect (closed s) (closedb s).