?- freeze(S, integer(S)), occurrences_of_term(S, f(1,2,a), C). C = 2, freeze(S, integer(S)).
- See also
- occurrences_of_var/3 for an equality (==/2) based variant.
?- freeze(S, integer(S)), occurrences_of_term(S, f(1,2,a), C). C = 2, freeze(S, integer(S)).