(** A library of Bellantoni-Cook functions on bitstrings without numerical interpretation *)
(** * Swapping of two arguments  - arities: (2, 0) *)
Definition inv_e (e : BC) : BC :=
comp 2 0 e (proj 2 0 1 :: proj 2 0 0 :: nil) nil.
(** * Conversion from arities (1, 1) to (2, 0) *)
Definition from_11_to_20 (e : BC) : BC :=
comp 2 0 e (proj 2 0 0 :: nil) (proj 2 0 1 :: nil).
(** * Concatenation of bitstrings  - arities: (1, 1) *)
Definition app_e : BC :=
rec (proj 0 1 0)
(comp 1 2 (succ false) nil ((proj 1 2 1) :: nil))
(comp 1 2 (succ true) nil ((proj 1 2 1) :: nil)).

Lemma app_correct v1 v2 :
sem app_e [v1] [v2] = v1 ++ v2.