SICP 4.4.1 Ex. 4.58

  • 投稿日:
  • カテゴリ:

Ex. 4.58

wheel とか big-shot とか、、、言いたいだけちゃうの。というのは置いといて。

「監督を持たない人」 というのは、「全員」から「監督を持つ人」を引けばよい。"引く"は not でフィルターすればよい。

(rule (big-shot ?x)
      (and (job ?x (?job . ?) )       ;; 部門で働く人
	   (not (and (supervisor ?x ?BOSS)   ;; 監督を持つ人
		     (job ?BOSS (?job . ??)))))) 

;;; Query input:
(big-shot ?)
;;; Query results:
(big-shot (Scrooge Eben))
(big-shot (Warbucks Oliver))
(big-shot (Bitdiddle Ben))

部門というのは (computer programmer) の computer の部分を指すらしい。

答の確認→ http://eli.thegreenplace.net/2008/02/08/sicp-section-441/