我目前正在通過SICP的邏輯編程部分工作,但我陷入了關於邏輯推理的例子,尤其是附加到表單的規則。他們如何工作?我不太明白的是第二條規則是如何降低第一份名單的。例如,給定:附加到表單如何工作? (SICP關於邏輯編程的部分)
(規則(追加到形式()Y Y)?)
(規則(追加到形式(U,V,)Y(U???? ?Z)) (追加到v型ŸZ))
一)我們如何到達的:???
;;; Query input:
(append-to-form (a b) (c d) ?z)
to
;;; Query results:
(append-to-form (a b) (c d) (a b c d))
二)什麼布特這樣一條:
;;; Query input:
(append-to-form (a b) ?y (a b c d))
to
;;; Query results:
(append-to-form (a b) (c d) (a b c d))
C)和最後:
;;; Query input:
(append-to-form ?x ?y (a b c d))
to
;;; Query results:
(append-to-form() (a b c d) (a b c d))
(append-to-form (a) (b c d) (a b c d))
(append-to-form (a b) (c d) (a b c d))
(append-to-form (a b c) (d) (a b c d))
(append-to-form (a b c d)() (a b c d))
我是否有興趣進行規則匹配所需的特定心理的步驟。
預先感謝您。
謝謝你的迴應,牛肉。實際上,我爲此感到困惑,因爲評估者的功能在本章後面解釋。我應該事先閱讀這些例子之後的部分。 – motxilo 2011-01-05 14:47:28