If I use the predicates member or the nt1 in SWI-Prolog as follows:
?- member(X, [A]).
X = A.
or
nth1(N, [A], X).
N = 1,
A = X.
The interpreter unifies the variable A as X.
Is their some alternative version of this functions which does not use the unification. Means, if I call something like this:
?- _member(X, [A]).
it would give
false
as long as the call is not
?- member(X, [X]).
which would lead to
true
And in the same way
_nth1(N, [A], X).
would give false
but
_nth1(N, [X], X).
would give
N = 1
Seems like you just need to roll your own using
==/2instead of=/2:See https://swish.swi-prolog.org/p/DqhYGuEf.pl