§13.12. Relations which express conditions

One last way to create a new relation and, in many ways, the easiest of all. If we write:

Contact relates a thing (called X) to a thing (called Y) when X is part of Y or Y is part of X. The verb to be joined to means the contact relation.

then we would be able to talk about a handle being joined to a door, and a door being joined to a handle, and so on. We are not allowed to declare:

The hook is joined to the line.

because the question of whether they are joined is not for us to decide: that will be for the condition to determine, whenever we test it. Similarly, we cannot meaningfully write

now the hook is joined to the line;

(and Inform will not let us) because this relation is not something we can force either way: we can make it come true by other means, maybe, but we cannot simply make it true by saying so. Lastly, this kind of relation is restricted in that we are not allowed to find paths or calculate numbers of steps through it.

So this way to define relations is, on the face of it, just a sort of verbal trick to write conditions in a more attractive way. The more flexible, changeable relations in previous sections have much greater expressive power. All the same, it is nice to be able to write -

Nearness relates a room (called A) to a room (called B) when the number of moves from B to A is less than 3. The verb to be near means the nearness relation.

and then to be able to write rules like:

Instead of listening when the location is near the Sundial: say "You hear a splashing of water."

As with other relations, there's no reason why we have to use objects. For example:

Material is a kind of value. The materials are wood and metal. A thing has a material.

Materiality relates a thing (called X) to a material (called Y) when Y is the material of X. The verb to be made of means the materiality relation.

which enables us to write:

if the cube is made of wood, ...
say "The carpenter looks at [the list of things which are made of wood].";

And here is a mathematical one:

Divisibility relates a number (called N) to a number (called M) when the remainder after dividing M by N is 0. The verb to divide means the divisibility relation. The verb to be a factor of means the divisibility relation.

We now find that "2 divides 12", "5 is not a factor of 12" and "12 is divisible by 3" are all true. Again, we are only really gaining a nice form of words, but improving the clarity of the source text is never a bad thing.


arrow-up.pngStart of Chapter 13: Relations
arrow-left.pngBack to §13.11. Indirect relations
arrow-right.pngOnward to §13.13. Relations involving values

*ExampleWainwright Acts
A technical note about checking the location of door objects when characters other than the player are interacting with them.

First we define the relationships we choose to acknowledge:

paste.png "A Humble Wayside Flower"

Marriage relates one person to another (called the spouse). The verb to be married to means the marriage relation.

Fatherhood relates one person (called father) to various people. The verb to engender means the fatherhood relation.

For brevity, we will ignore the existence of mothers. It is a sad world.

Siblinghood relates a person (called A) to a person (called B) when a person who engenders A engenders B. The verb to be sibling to means the siblinghood relation.

Family relates a person (called A) to a person (called B) when A is married to B or A engenders B or B engenders A or A is sibling to B. The verb to be related to means the family relation.

A person can be known or unknown. After printing the name of an unknown person (called the alien):
    if a known person (called the contact) is related to the alien:
        say " ([relation between alien and contact] of [the contact])";
        now the alien is known;
        rule succeeds.

To say relation between (first party - a person) and (second party - a person):
    if the first party is married to the second party:
        if the first party is female, say "wife";
        otherwise say "husband";
        rule succeeds;
    if the first party is sibling to the second party:
        if the first party is female, say "sister";
        otherwise say "brother";
        rule succeeds;
    if the first party engenders the second party:
        say "father";
        rule succeeds;
    if the second party is the father of the first party:
        if the first party is female, say "daughter";
        otherwise say "son";
        rule succeeds.

Pere Blanchard's Hut is a room. Percival Blakeney is a known man in the Hut. Marguerite is a woman in the Hut. Percival is married to Marguerite. Outside from the Hut is the Garden. Louise is a woman in the Garden. The Road to Paris is west of the Garden. Armand St Just is a man in the Road. Louise is married to Armand. Monsieur St Just is a man. He engenders Armand and Marguerite.

Test me with "out / west / east / west".

Monsieur St Just never appears on the scene in this piece, but if we did put him somewhere the player could find him, he, too, would be properly introduced.

***ExampleA Humble Wayside Flower
Relations track the relationships between one character and another. Whenever the player meets a relative of someone he already knows, he receives a brief introduction.

First we define the relationships we choose to acknowledge:

paste.png "A Humble Wayside Flower"

Marriage relates one person to another (called the spouse). The verb to be married to means the marriage relation.

Fatherhood relates one person (called father) to various people. The verb to engender means the fatherhood relation.

For brevity, we will ignore the existence of mothers. It is a sad world.

Siblinghood relates a person (called A) to a person (called B) when a person who engenders A engenders B. The verb to be sibling to means the siblinghood relation.

Family relates a person (called A) to a person (called B) when A is married to B or A engenders B or B engenders A or A is sibling to B. The verb to be related to means the family relation.

A person can be known or unknown. After printing the name of an unknown person (called the alien):
    if a known person (called the contact) is related to the alien:
        say " ([relation between alien and contact] of [the contact])";
        now the alien is known;
        rule succeeds.

To say relation between (first party - a person) and (second party - a person):
    if the first party is married to the second party:
        if the first party is female, say "wife";
        otherwise say "husband";
        rule succeeds;
    if the first party is sibling to the second party:
        if the first party is female, say "sister";
        otherwise say "brother";
        rule succeeds;
    if the first party engenders the second party:
        say "father";
        rule succeeds;
    if the second party is the father of the first party:
        if the first party is female, say "daughter";
        otherwise say "son";
        rule succeeds.

Pere Blanchard's Hut is a room. Percival Blakeney is a known man in the Hut. Marguerite is a woman in the Hut. Percival is married to Marguerite. Outside from the Hut is the Garden. Louise is a woman in the Garden. The Road to Paris is west of the Garden. Armand St Just is a man in the Road. Louise is married to Armand. Monsieur St Just is a man. He engenders Armand and Marguerite.

Test me with "out / west / east / west".

Monsieur St Just never appears on the scene in this piece, but if we did put him somewhere the player could find him, he, too, would be properly introduced.

First we define the relationships we choose to acknowledge:

paste.png "A Humble Wayside Flower"

Marriage relates one person to another (called the spouse). The verb to be married to means the marriage relation.

Fatherhood relates one person (called father) to various people. The verb to engender means the fatherhood relation.

For brevity, we will ignore the existence of mothers. It is a sad world.

Siblinghood relates a person (called A) to a person (called B) when a person who engenders A engenders B. The verb to be sibling to means the siblinghood relation.

Family relates a person (called A) to a person (called B) when A is married to B or A engenders B or B engenders A or A is sibling to B. The verb to be related to means the family relation.

A person can be known or unknown. After printing the name of an unknown person (called the alien):
    if a known person (called the contact) is related to the alien:
        say " ([relation between alien and contact] of [the contact])";
        now the alien is known;
        rule succeeds.

To say relation between (first party - a person) and (second party - a person):
    if the first party is married to the second party:
        if the first party is female, say "wife";
        otherwise say "husband";
        rule succeeds;
    if the first party is sibling to the second party:
        if the first party is female, say "sister";
        otherwise say "brother";
        rule succeeds;
    if the first party engenders the second party:
        say "father";
        rule succeeds;
    if the second party is the father of the first party:
        if the first party is female, say "daughter";
        otherwise say "son";
        rule succeeds.

Pere Blanchard's Hut is a room. Percival Blakeney is a known man in the Hut. Marguerite is a woman in the Hut. Percival is married to Marguerite. Outside from the Hut is the Garden. Louise is a woman in the Garden. The Road to Paris is west of the Garden. Armand St Just is a man in the Road. Louise is married to Armand. Monsieur St Just is a man. He engenders Armand and Marguerite.

Test me with "out / west / east / west".

Monsieur St Just never appears on the scene in this piece, but if we did put him somewhere the player could find him, he, too, would be properly introduced.