13.13. Relations involving values

| Chapter 13: Relations |

| 13.13. Relations involving values

Although most of the examples in this chapter have involved objects, relations can connect almost any values together. We can create relations in groups, one to various relations, various to one relations, one to one relations, and various to various relations for any combination of kinds. For example:

> Partnership relates various texts to various texts.

> The verb to belong with (he belongs with, they belong with) implies the
> partnership relation.

> "cheese" belongs with "crackers".
> "clam" belongs with "chowder".

How might we make use of this? Clearly it would be impractical to keep trying:

> if "caviar" belongs with "aardvarks", ...
> if "caviar" belongs with "abacuses", ...
> ...

to find out what "caviar" belongs with. It's still harder to find out if it belongs with anything at all -- in theory we would have to try every possibility, which of course is impossible. Instead we have these phrases:

if (value) relates to (name of kind) by (relation of values to values):

This condition is true if the value V is such that V relates to something by the given relation. Example: suppose partnership relates various texts to various texts. Then we can test if "chalk" relates to a text by the partnership relation, ...

if (name of kind) relates to (value) by (relation of values to values):

This condition is true if the value V is such that something relates to V by the given relation. Example: suppose partnership relates various texts to various texts. Then we can test if a text relates to "cheese" by the partnership relation, ...

If a partner does exist, then we can find it with:

(name of kind) to which/whom (value) relates by (relation of values to values) ... value
or: (name of kind) that/which/whom (value) relates to by (relation of values to values) ... value

This phrase produces an Y such that the given value V relates to Y by the given relation. Example: suppose partnership relates various texts to various texts. Then we can obtain the text to which "chalk" relates by the partnership relation which might be, say, "cheese". It's a run-time problem to use this if no such Y exists.

(name of kind) that/which/who relates to (value) by (relation of values to values) ... value

This phrase produces an X such that X relates to the given value V by the given relation. Example: suppose partnership relates various texts to various texts. Then we can obtain the text which relates to "cheese" by the partnership relation which might be, say, "chalk". It's a run-time problem to use this if no such X exists.

Of course, there might be many answers to this question, so perhaps these are neater:

list of (name of kind) that/which/who relate to (value) by (relation of values to values) ... value

This phrase produces a list of all the X such that X relates to the given value V by the given relation. Example: suppose partnership relates various texts to various texts. Then we can obtain list of texts which relate to "cheese" relates by the partnership relation which might be, say, { "chalk", "grapes", "macaroni" }. The answer might be the empty set, but that's not a problem.

list of (name of kind) to which/whom (value) relates by (relation of values to values) ... value
or: list of (name of kind) that/which/whom (value) relates to by (relation of values to values) ... value

This phrase produces a list of all Y such that the given value V relates to Y by the given relation. Example: suppose partnership relates various texts to various texts. Then we can obtain list of texts to which "chalk" relates by the partnership relation which might be, say, { "cheese", "blackboard", "cliffs" }. The answer might be the empty set, but that's not a problem.

Finally, it's sometimes useful to get at the list of all values which can appear on the left or right hand side of a relation. We need tongue-twister like wording to do it, but:

list of (name of kind) that/which/whom (relation of values to values) relates ... value

This phrase produces a list of all X which relate to anything under the given relation. Example: suppose partnership relates various texts to various texts. Then we can obtain list of texts which the partnership relation relates

list of (name of kind) to which/whom (relation of values to values) relates ... value
or: list of (name of kind) that/which/whom (relation of values to values) relates to ... value

This phrase produces a list of all Y which anything relates to under the given relation. Example: suppose partnership relates various texts to various texts. Then we can obtain list of texts which the partnership relation relates to

For efficiency reasons, there are no guarantees about what order these lists have - but they can of course always be sorted when found.

238
| Example Meet Market A case in which relations give characters multiple values of the same kind. |
RB

We have already seen that we can give things value properties -- a lamp has a brightness, for instance. Relations give us additional flexibility: since we may relate various things to various values, it is possible to describe a thing as having more than one value at the same time. To demonstrate: "Meet Market" by "K M and Eric Rossing" Feature is a kind of value. The features are snub-nosed, gangly, comely, bright-eyed, and sulky. Appearance relates various persons to various features. The verb to appear (she appears, they appear) implies the appearance relation. Meet Market is a room. Bob, Carol, Ted, and Alice are people in the Meet Market. Bob appears snub-nosed and gangly. Ted appears sulky and snub-nosed. Carol appears comely and bright-eyed. Alice appears bright-eyed and comely. Yourself appears sulky and gangly. Instead of looking: say "The snub-nosed ones: [list of people who appear snub-nosed][line break]"; say "The gangly ones: [list of people who appear gangly][line break]"; say "The comely ones: [list of people who appear comely][line break]"; say "The bright-eyed ones: [list of people who appear bright-eyed][line break]"; say "The sulky ones: [list of people who appear sulky][paragraph break]". Test me with "look". The same logic might be used to provide characters who have complex mood states: a person might be angry and sad, not merely one or the other -- feelings being what they are.

239
| Example For Demonstration Purposes A character who learns new actions by watching the player performing them. |
RB

Previous | Contents | Next