The previous solution was producing wrong answer to the following query:
?- groundterm(foo(bar(_))).
true.
It is important to note that groundterm_in_list should be called in
groundterm with a list that does not consist the functor, otherwise
we would end up in an infinite loop. For example:
The previous solution was producing wrong answer to the following query:
It is important to note that
groundterm_in_list
should be called ingroundterm
with a list that does not consist the functor, otherwise we would end up in an infinite loop. For example: