Term_factorized/3 error for compound_name_arity zero term

The new predicates work brilliantly.

I benchmarked them on a 1,000-Hydra list (generating a raw graph of 500,501 nodes):

?- N = 1000,
   create_hydra_list(1, N, Xs),
   Wrap =.. [roots | Xs],
   time((
       term_automaton(Wrap, Auto),
       automaton_minimal(Auto, Min, Map)
   )),
   functor(Auto, _, RawSize),
   functor(Min, _, MinSize).
% 3 inferences, 0.111 CPU in 0.163 seconds (68% CPU, 27 Lips)
% N = 1000,
% RawSize = 500501,
% MinSize = 2 .

Compared to our O(N log N) Prolog-level prototype (which took ~13.0s), the C implementation finishes in 0.11s—more than 100x faster—and correctly preserves physical sharing up to 500,000+ nodes before collapsing into 2 states.

The bidirectional API of term_automaton/2 and the Map return in automaton_minimal/3 are exceptionally clean and easy to integrate. Thank you for this outstanding addition!