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 all_possible_subarguments_length (args: list term) :
length (all_possible_subarguments args) = prodl (map (@term_size _ _ _) args).