Fixpoint activations (proof_tree : cbv) : list cbv :=
  match proof_tree with
  | cbv_constr lp _ _ => flat_map activations lp
  | cbv_split lp p _ _ => activations p ++ flat_map activations lp
  | cbv_function _ _ p _ _ as p' => p' :: activations p
  end.

(* Specifications: *)
Lemma activation_is_function : forall proof_tree p, In p (activations proof_tree) -> exists i s p' t v, p = cbv_function i s p' t v.
Lemma cbv_function_in_activations_InCBV proof_tree sub_proof_tree i s p t v: sub_proof_tree = cbv_function i s p t v -> InCBV sub_proof_tree proof_tree -> In sub_proof_tree (activations proof_tree).
Lemma activations_wf : forall proof_tree p, wf proof_tree -> In p (activations proof_tree) -> wf p.
Lemma le_max_active_size proof_tree p : In p (activations proof_tree) -> term_size (proj_left p) + value_size (proj_right p) <= max_active_size proof_tree.
Lemma activation_bound_spec : forall proof_tree, wf proof_tree -> forall p, In p (activations proof_tree) -> let (i, s) := rule_subst_of_cbv_function p in term_size (subst s (rhs_of_rule (nth i prog rule_default))) <= activation_bound prog (term_size (proj_left p)).