I have predicate
superclass('Horde', 'Blood Elf').
superclass('Horde', 'Orc').
element('Blood Elf', ['Paladin', 'Priest','Mage','Warlock','Death Knight','Rogue']).
element('Orc', ['Warrior', 'Shaman','Warlock','Death Knight','Hunter','Rogue']).
find(A):-
( element(_,B),member(A,B)
-> forall(
( element(_,B), member(A,B) ),
( element(C,B), superclass(D,C), format('~w -> ~w -> ~w\n',[D,C,A])))
; superclass(A, _)
-> format('~w\n',A), forall(superclass(A,B),format('\t~w\n',B))
).
and two of results for find('Rogue').
. After all, the predicate prints only 1 of them. However, when i copypaste forall(..)
to console, it gives me all 2 results. Why?
forall/2?
– false