I am new to Prolog and the problem I am dealing with is the following: Given a list of variables, I want to assign a value for each element of that list, and then check if a restriction containing some of those variables is true. This is an example of how I thought it should work:
predicate(L1, Restriction) :-
foreach(member(Var,L1), Var = 1),
Restriction.
But when I write in the console:
? - predicate([A,B,C], A==1).
or
? - predicate([A,B,C], B==1).
or
? - predicate([A,B,C], A==B).
they all return false.
Shouldn't A, B, and C be all equivalent to 1 after the foreach loop?