# Term\_factorized/3 error for compound\_name\_arity zero term

**URL:** <https://swi-prolog.discourse.group/t/term-factorized-3-error-for-compound-name-arity-zero-term/9815>\
**Category:** General\
**Created:** [September 7, 2026, 3:13pm UTC](https://swi-prolog.discourse.group/t/term-factorized-3-error-for-compound-name-arity-zero-term/9815 "2026-09-07T15:13:59Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![kuniaki.mukai](https://avatars.discourse-cdn.com/v4/letter/k/c67d28/32.png) [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Post date:** [September 10, 2026, 6:07pm UTC](https://swi-prolog.discourse.group/t/term-factorized-3-error-for-compound-name-arity-zero-term/9815/21 "2026-09-10T18:07:29Z")

</div>

The new predicates work brilliantly.

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

```prolog
?- 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!

[Previous page](https://swi-prolog.discourse.group/t/term-factorized-3-error-for-compound-name-arity-zero-term/9815.md?page=1)
