This is with reference to this comic, called A Programmer's Life (translated from Portuguese):
Programmer: My wife asked me to go to the market and said: “Bring six eggs. If there are potatoes, bring nine.” There were potatoes. But she got mad when I arrived only with the 9 eggs…
The intended joke is that the programmer has stereotypically interpreted the instructions over‑literally, and has got into trouble with "normal" people who communicate less precisely.
Which is fine (ha ha), but I feel that the actual over-literal interpretation here would be to bring "nine" somehow. The programmer has actually done a bit of correcting-for-ambiguity that is necessary for understanding human speech. Specifically, he has supplied "eggs" to "bring nine", interpreting it as "bring nine eggs". (He should have supplied "potatoes" instead, of course.)
My question is twofold:
Is there a name for this process, in which a missing object (referent?) is inferred?
(Does it have some fancy linguistics name, like "coreference resolution"? Are there some good articles / book sections about it?)
Are there contexts and sentences like "[Verb] n X. If there are Y, [verb] m" (both "[verb]"s stand for the same verb) whose natural interpretation would actually be "[verb] m X", even though both "[verb] m X" and "[verb] m Y" are perfectly meaningful in isolation?
(This would make it clear that the interpretation is not a grammatical issue alone, but very much situation-driven.)