Exercise 4.67: Devise a way to install a loop
detector in the query system so as to avoid the kinds of simple loops
illustrated in the text and in Exercise 4.64. The general idea is that
the system should maintain some sort of history of its current chain of
deductions and should not begin processing a query that it is already working
on. Describe what kind of information (patterns and frames) is included in
this history, and how the check should be made. (After you study the details
of the query-system implementation in 4.4.4, you may want to
modify the system to include your loop detector.)
练习 4.67:设计一种方法,在查询系统中安装一个循环检测器,以避免文中和练习 4.64 所示的简单循环。基本思路是:系统应维护某种形式的当前推导链历史记录,不应开始处理一个已在处理中的查询。描述历史记录中包含哪些信息(模式和框架),以及应如何进行检查。(在你研究完 4.4.4 中查询系统实现的细节后,可能希望修改系统以加入你的循环检测器。)