Prolog脚本的意外输出

Prolog脚本的意外输出,prolog,Prolog,我希望inHands.返回如下内容: leftHand(empty). rightHand(empty). inHands :- write("Left hand:"), nl, leftHand(X), tab(2), write(X), nl, nl, write("Right hand:"), rightHand(Y), tab(2), write(Y), nl. 24 ?- inHand

我希望
inHands.
返回如下内容:

leftHand(empty).
rightHand(empty).

inHands :-
    write("Left hand:"),
    nl,
    leftHand(X),
    tab(2),
    write(X),
    nl,
    nl,
    write("Right hand:"),
    rightHand(Y),
    tab(2),
    write(Y),
    nl.
 24 ?- inHands.
[76, 101, 102, 116, 32, 104, 97, 110, 100, 58]
  empty

[82, 105, 103, 104, 116, 32, 104, 97, 110, 100, 58]  empty
true.
然而,我看到的是:

Left hand:
  empty

Right hand:
  empty

我做错了什么?

结果我不得不用这样的单引号:

leftHand(empty).
rightHand(empty).

inHands :-
    write("Left hand:"),
    nl,
    leftHand(X),
    tab(2),
    write(X),
    nl,
    nl,
    write("Right hand:"),
    rightHand(Y),
    tab(2),
    write(Y),
    nl.
 24 ?- inHands.
[76, 101, 102, 116, 32, 104, 97, 110, 100, 58]
  empty

[82, 105, 103, 104, 116, 32, 104, 97, 110, 100, 58]  empty
true.