fact: Fixpoint typeOf G e : option type := match e with | Id x => nth_error G x | Const n => Some N | Abs t e' => match typeOf (t::G) e' with | Some t' => Some (Arrow t t') | None => None end | App e1 e2 => match typeOf G e1, typeOf G e2 with | Some (Arrow t1 t2), Some t1' => if t1 = t1'? then Some t2 else None | _, _ => None end end.
imports: mathcomp(ssreflect ssrbool eqtype) Arith List String Lia QuickChick(QuickChick)