I have
assert(user(anna)).
assert(user(tom)).
but when I query
?- user(X).
I only get
X = anna.
Shouldn't I get another line saying X = tom as well?
You need to type a semicolon after the first answer:
?- user(X).
X = anna ;
X = tom.