See your previous thread here, hydra/2
and hydrax/2
create 2^N leafs aka Hydra heads through sharing. But use
only N Prolog compounds to construct the Hydra body:
You can test hydra/2
from the other thread and the new
hydrax/2
, that I posted in this thread. Your new cft_compare/3
is better in hydra/2
, but still not that good in hydrax/2
.
The problem is the Product Automata Construction that you did with
shift/1 and reset/3, doesn’t detect sharing. The name Hydra is
from Greek Mythology, a multi-headed, serpent-like water monster.