Proper way to Declare and Search List in Prolog?
<p>I'm new to Prolog. Is it possible to "declare" a list as a fact in Prolog, and then access it easily? I'm working on a family-tree type problem. To start, I would like to declare a bunch of males as belonging to a list of males. I then would like to be able to query if a particular person is a male. Here is the code I've written so far:</p>

<pre><code>% ------------------------------------------------------------------------- %
% Facts:

males([john, joseph, aaron, peter, paul, mark, ben, adam, daniel]).


% ------------------------------------------------------------------------- %
% Rules:

% Member of a List
member(X, [X|_]).
member(X, [_|T]) :- member(X, T).

male(X) :- member(X, males).
</code></pre>

<p>However, my output is not as expected:</p>

<pre><code>21 ?- male(john).
</code></pre>

<p>false.</p>

<p>I know my member() rules are working, since I can produce the following result:</p>

<pre><code>23 ?- member(john, [peter, paul, john]).
</code></pre>

<p>true</p>

<p>Can anyone point me in the right direction? Thank you in advance.</p>