灯下 登录
计算机科学 / SICP / 4.4.1 Deductive Information Retrieval

Exercise 4.57 · 习题

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:

all people who can replace Cy D. Fect;

all people who can replace someone who is being paid more than they are,

together with the two salaries.

练习 4.57:定义一条规则,说明以下情形:如果人员 1 与人员 2 从事相同的工作,或者能做人员 1 工作的人也能做人员 2 的工作,且人员 1 与人员 2 不是同一人,则人员 1 可以替代人员 2。利用你的规则,给出能找出以下信息的查询:

所有能替代 Cy D. Fect 的人员;

所有能替代薪资高于自己的人员的人,以及双方的薪资。