fact: Fixpoint type_of (Gamma : string -> option ty) (t : tm) : option ty := match t with | tm_var s => Gamma s | tm_abs x T e => bindop (type_of (t_update Gamma x T) e) (fun T' => Some <{T -> T'}>) | tm_app f e => bindop (type_of Gamma f) (fun T21 => match T21 with | <{T2 -> T1}> => bindop (type_of Gamma e) (fun T2' => if type_eqb T2 T2' then Some T1 else None ) | _ => None end ) | tm_true | tm_false => Some Ty_Bool | tm_if b t f => bindop (type_of Gamma b) (fun Tb => bindop (type_of Gamma t) (fun Tt => bindop (type_of Gamma f) (fun Tf => if andb (type_eqb Tb Ty_Bool) (type_eqb Tt Tf) then Some Tt else None ))) end.
imports: QuickChick(QuickChick) Coq(Nat) Coq(Arith.Arith) Coq(Logic.FunctionalExtensionality)