fact: Fixpoint gen_typed (sz : nat) (Γ : env) (t : type) : G term := match sz with | O => gen_base Γ t | S sz' => let app := bindGen (@arbitrarySized type _ 3) (fun t' => bindGen (gen_typed sz' Γ (Arrow t' t)) (fun e1 => bindGen (gen_typed sz' Γ t') (fun e2 => returnGen (App e1 e2)))) in match t with | N => vars Γ t (oneOf_ app [app; liftGen Const arbitrary]) | Arrow t1 t2 => vars Γ t (oneOf_ app [app; liftGen (Abs t1) (gen_typed sz' Γ t2)]) end end.
imports: mathcomp(ssreflect ssrbool eqtype) Arith List String Lia QuickChick(QuickChick)