(* * Copyright (c) 2009 Robert Dockins and Aquinas Hobor. * *)
Definition unary_primop (f:nat -> nat) : expr :=
Lam (prim (v_Nat oo f) (Var 0)).
Program Definition bin_primop (f:nat -> nat -> nat) : expr :=
Lam (prim (fun n1 => Lam (prim (fun n2 => v_Nat (f n1 n2)) (Var 0))) (Var 0)).
Next Obligation.
compute; split; auto.
Qed.

(* Specifications: *)
Lemma unary_primop_typ : forall f,
Typ nil (unary_primop f) (ty_lam ty_nat ty_nat).
Lemma binary_primop_typ : forall (f:nat -> nat -> nat),
Typ nil (bin_primop f) (ty_lam ty_nat (ty_lam ty_nat ty_nat)).