Notation u := 0.Notation v := 1.Definition prep (x : string bool) (t : term) : term := fold_right t_f t x.Definition iprep domain eta {I : interp domain eta} (x : list bool) (y : domain) := fold_right i_f y x.Definition enc s := (prep s t_e).Definition F1 := map (fun '(x,y) => Pr (enc x) (enc y)) R.

(* Specifications: *)
Lemma prep_subst y t1 x t : subst_t y t1 (prep x t) = prep x (subst_t y t1 t).
Lemma prep_vars x t : vars_t (prep x t) = vars_t t.
Lemma iprep_eval domain eta (I : interp domain eta) rho x s : eval rho (prep x s) = iprep x (eval rho s).
Lemma iprep_app domain eta (I : interp domain eta) x y d : iprep (x ++ y) d = iprep x (iprep y d).
Lemma IB_prep rho s t : eval rho (prep s t) = s ++ eval rho t.
Lemma IB_enc rho s : eval rho (enc s) = s.
Theorem BPCP_valid : BPCP R <-> valid F.