You have some typos.
ask(A,V):-
write(A:V),%ask user
write('?:'),
read(Y),%get the answer
asserta(known(Y,A,V)), %remember it ***missing ')'
Y==yes.%succeed or fail
and here
solve:-
retractall(known(_,_,_)), % *** missing _
top_goal(X),
write('The animal is '),write(X),nl.
Then some codes are missing: color/1, haemoglobin/1, heart/1,
nerve_cord/1, skeleton/1, top_goal/1, type/1, vertebral_column/1.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…