内容 4.4 Logic Programming · 383
练习 自检推理
Exercise 4.65: Cy D. Fect, looking forward to
the day when he will rise in the organization, gives a query to find all the
wheels (using the wheel rule of 4.4.1):
(wheel ?who)
To his surprise, the system responds
;;; Query results:
(wheel (Warbucks Oliver))
(wheel (Bitdiddle Ben))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
Why is Oliver Warbucks listed four times?
练习 4.65:Cy D. Fect 憧憬着自己在组织中出人头地的那一天,发出查询以找出所有的"核心人物"(使用 4.4.1 中的 wheel 规则):
(wheel ?who)
令他惊讶的是,系统的响应如下:
;;; Query results:
(wheel (Warbucks Oliver))
(wheel (Bitdiddle Ben))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
Oliver Warbucks 为何被列出四次?
SICP source code scheme
(wheel ?who) SICP source code scheme
;;; Query results:
(wheel (Warbucks Oliver))
(wheel (Bitdiddle Ben))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver)) 我的笔记 自动保存