Fixpoint all_possible_subarguments (args: list term) : list (list term) :=
match args with
| [] => [[]]
| (x::xs) => let psa := all_possible_subarguments xs in
let pst := sub_terms x in
flat_map (fun st => map (fun sa => st::sa) psa) pst
end.

Lemma length_sub_terms a : length (sub_terms a) = term_size a.