4.56 Exercise 4.56

The names of all people who are supervised by Ben Bitdiddle, together with their addresses

(and (supervisor ?person (Bitdiddle Ben))
     (address ?person ?address))

All people whose salary is less than Ben Bitdiddle’s, together with their salary and Ben Bitdiddle’s salary

(and (salary (Bitdiddle Ben) ?bitdiddle-salary)
     (salary ?person ?person-salary)
     (lisp-value > ?bitdiddle-salary ?person-salary))

All people who are supervised by someone who is not in the computer division, together with the supervisor’s name and job

I’m going to interpret the division as not being a part of the name of the job (i.e., the job for (computer programmer) is (programmer)).

(and (supervisor ?subordinate ?supervisor)
     (not (job ?supervisor (computer . ?supervisor-job))))