Complete up to exercise 4.56
This commit is contained in:
parent
911dc3512d
commit
3978de8110
|
@ -0,0 +1,30 @@
|
|||
#lang sicp
|
||||
|
||||
;; Exercise 4.55
|
||||
|
||||
;; Everyone supervised by Ben
|
||||
(supervisor ?x (Bitdiddle Ben))
|
||||
|
||||
;; Everyone in the accounting division
|
||||
(job ?x (accounting . ?y))
|
||||
|
||||
;; Everyone who lives in Slumerville
|
||||
(address ?x (Slumerville . ?y))
|
||||
|
||||
;; Exercise 4.56
|
||||
|
||||
;; Names and addresses of everyone supervised by Ben Bitdiddle
|
||||
(and (address ?person ?address)
|
||||
(supervisor ?person (Bitdiddle Ben)))
|
||||
|
||||
;; All people whose salaray is less than Ben Bitdiddle's together with
|
||||
;; their salary and Ben's salary
|
||||
(and (salary ?person ?amount)
|
||||
(and (salary (Bitdiddle Ben) ?ben-salary)
|
||||
(lisp-value < ?amount ?ben-salary)))
|
||||
|
||||
;; All people who are supervised by someone who is not in the computer
|
||||
;; division, together with the supervisor's name and job.
|
||||
(and (supervisor ?person ?supervisor)
|
||||
(job ?supervisor ?supervisor-job)
|
||||
(not (job ?supervisor (computer . ?x))))
|
Loading…
Reference in New Issue