Exercise 4.57.  Define a rule that says that person 1 can replace person 
2 if either person 1 does the same job as person 2 or someone who does 
person 1's job can also do person 2's job, and if person 1 and person 2 
are not the same person. Using your rule, give queries that find the 
following:

a.  all people who can replace Cy D. Fect;

b.  all people who can replace someone who is being paid more than they 
    are, together with the two salaries.

————————————————————————————————————————————————————————————————————————

(rule (can-replace ?person-1 ?person-2)
  (and (job ?person-1 ?job-1)
       (job ?person-2 ?job-2)
       (not (same person-1 person-2))
       (or (same ?job-1 ?job-2)
           (can-do-job ?job-1 ?job-2))))

(can-replace ?who (Fect Cy D))

(and (can-replace ?a ?b)
     (salary ?a ?s-a)
     (salary ?b ?s-b)
     (lisp-value > ?s-b ?s-a))
