Exercise 4.64: Louis Reasoner mistakenly deletes
the outranked-by rule (4.4.1) from the data base. When he
realizes this, he quickly reinstalls it. Unfortunately, he makes a slight
change in the rule, and types it in as
(rule (outranked-by ?staff-person ?boss)
(or (supervisor ?staff-person ?boss)
(and (outranked-by ?middle-manager
?boss)
(supervisor ?staff-person
?middle-manager))))
Just after Louis types this information into the system, DeWitt Aull comes by
to find out who outranks Ben Bitdiddle. He issues the query
(outranked-by (Bitdiddle Ben) ?who)
After answering, the system goes into an infinite loop. Explain why.
练习 4.64:Louis Reasoner 误将 outranked-by 规则(4.4.1)从数据库中删除。当他意识到这一点后,迅速将其重新添加回去。然而,他对规则做了微小改动,录入了如下版本:
(rule (outranked-by ?staff-person ?boss)
(or (supervisor ?staff-person ?boss)
(and (outranked-by ?middle-manager
?boss)
(supervisor ?staff-person
?middle-manager))))
Louis 刚将此信息录入系统后,DeWitt Aull 前来查询谁的级别高于 Ben Bitdiddle。他发出了查询:
(outranked-by (Bitdiddle Ben) ?who)
给出答案后,系统陷入了无限循环。请解释原因。
(rule (outranked-by ?staff-person ?boss)
(or (supervisor ?staff-person ?boss)
(and (outranked-by ?middle-manager
?boss)
(supervisor ?staff-person
?middle-manager)))) (outranked-by (Bitdiddle Ben) ?who)