I'm trying to make a query in prolog where you specify the name of a list, which is already in the knowledge base, and tell me if a certain element is inside that list. To give an example:
?-es(green_day,rock).
true.
This would be the answer I'm looking for. While in the code would have something like:
green_day=[rock,punk].
es(X,Y):- member(Y,X).
This I have already tried, it would give "false" since what it does is to wait for you to pass a list by itself, not a reference to a list already existing within the knowledge base, so it returns false since "green_day" is neither a list nor contains "rock".
So my question would be if there is any way that reference can be made to an existing list since the consultation is done.