(** * Zero  - with any arities (n, s) *)
Definition zero_e (n s:nat) : BC :=
comp n s zero nil nil.
Global Opaque succ_e.
(** * Zero predicate  - arities: (1,0) *)
Definition is_zero_e : BC :=
rec (one_e 0 0) (proj 1 1 1) (zero_e 1 1).
Global Opaque is_zero_e.
(** * Predecessor  - arities: (1,0) *)
Definition pred_pos_e : BC :=
rec (zero_e 0 0)
(comp 1 1 (succ true) nil [proj 1 1 1])
(comp 1 1 (succ false) nil [proj 1 1 0]).
Global Opaque pred_pos_e.
Definition pred_e : BC :=
comp 1 0 cond
nil [is_zero_e; pred_pos_e; zero_e 1 0; pred_pos_e].
Global Opaque pred_e.
(** * Division by 2  - arities: (1,0) *)
Notation div2_e := pred.

Lemma div2_correct : forall v,
bs2nat (sem pred nil [v]) = div2 (bs2nat v).