Definition cbv_cache_entry (proof_tree : cbv) := (proj_left proof_tree, proj_right proof_tree).

Theorem size_bound_gen : forall i s p' c1 t c2 v, let p := cbv_update i s p' c1 t c2 v in let A := length (activations p) in let S := max_active_size p in wf p -> size p <= (A * activation_bound prog S + A + 1 + (max_arity * A * (1 + activation_bound prog S))) * (activation_bound prog S + S + cache_size c1 + (1 + max S (maxl (map (fun tv : term * value => value_size (snd tv)) c1))) * (1 + (A * activation_bound prog S + A) + max_arity * (A * activation_bound prog S + A))) + cache_size c1.