Chapter 4, Metalinguistic Abstraction

Exercise 4.58


There are two cases: (i) Supervisor does not exist (ii) Supervisor exists but does not work in same div.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
;;; Query input:
(assert! (rule (big-shot ?person ?div)
			   (and (job ?person (?div . ?sub))
					(or (not (supervisor ?person ?sup))
						(and (supervisor ?person ?sup)
							 (not (job ?sup (?div . ?sup-subdiv))))))))

Assertion added to data base.

;;; Query input:
(big-shot ?p ?d)

;;; Query results:
(big-shot (warbucks oliver) administration)
(big-shot (scrooge eben) accounting)
(big-shot (bitdiddle ben) computer)