next up previous contents
Next: Which manager works Up: Examples with the Previous: Who earns more

Who works for what?


Again, the paraphrase clarifies the reading that has been given to the question.

Squirrel makes use of domain information to find out whether a word refers to an animate or inanimate object. ``Who'' gives rise to a free-variable that can range over animate objects (fva1), and ``what'' gives rise to one that can range over inanimate objects (fvi1). The domain information then rules-out the interpretation where ``works for'' corresponds with the boss-employee relationship.

ENG: who works for what
SYN: (s(np(ipron(who)))(vp(v(works))(pp(prep(for))(np(ipron(what))))))
 PT: `for:fvi1:`work:fva1
FOL: for(fva1,`work,fvi1)
URC: {fva1,fvi1;[fva1,fvi1]:boss}
CHK: Query not meaningful with respect to current database

URC: {fva1,fvi1;[fva1,*,fvi1,*]:emp}
DRC: {fva1:emp![name],fvi1:emp![sal];[fva1,*,fvi1,*]:emp}
OP1: {fva1:emp![name],fvi1:emp![sal];[fva1,*,fvi1,*]:emp}

PAR: which employee earns which salary

TRC: {fva1!name,fvi1!sal;fva1:emp,fvi1:emp;
OP2: {fva1!name,fvi1!sal;fva1:emp,fvi1:emp;
OP3: {fva1!name,fvi1!sal;fva1:emp,fvi1:emp;fva1!sal=fvi1!sal}
SQL: SELECT DISTINCT, fvi1.sal FROM emp fva1, emp fvi1 
      WHERE fva1.sal=fvi1.sal;

|name      |sal                 |
|edna      |            $2000.00|
|georgia   |            $1000.00|
|henry     |            $2000.00|
|malcolm   |            $3000.00|
|mike      |            $1500.00|
|sally     |             $850.00|
|ted       |            $2500.00|
(7 rows)

Chris Fox, September 1995