§14.9. Verbs as values

Each verb known to Inform is actually a value of the kind "verb". To refer to a verb as a value, we have to put the word "verb" in front, as in these examples:

the verb contain, the verb might, the verb provoke

all of which appear in the Standard Rules.

Two adjectives are provided for use with verbs: "modal" (or "non-modal") to pick out verbs like might, could, should, and so on; and "meaningful" (or "meaningless") to pick out verbs which have a defined meaning as an Inform relation. For example, in the Standard Rules, the verb contain is meaningful, the verb might is modal, and the verb provoke is meaningless.

If V has a meaning as a relation of objects, then "meaning of V" produces that relation. For example,

showme the meaning of the verb contain;
showme the meaning of the verb provoke;

produces:

"meaning of the verb contain" = relation of objects: containment relation
"meaning of the verb provoke" = relation of objects: equality relation

As this demonstrates, if a verb has no meaning, or its meaning doesn't relate to objects, we get just the equality relation.

In fact, Inform even defines a verb "to mean": it's meaningful, and its meaning is the meaning relation. Thus:

if the verb mean means the meaning relation...

is true. More usefully, we can search our vocabulary like this:

the list of verbs meaning the containment relation

which, unless any non-Standard Rules definitions have been added, produces:

list of verbs: {verb contain}

Note that the meaning relation can't be changed at run-time: it is not clear what it would even mean to do something like -

now the verb contain means the wearing relation;

with the story already started, so this will produce a problem message.

say "[adapt (verb)]"

Adapts the given verb to the current story tense and story viewpoint. For example, "you [adapt the verb provoke]" might produce "you provoke".

say "[adapt (verb) from (narrative viewpoint)]"

Adapts the given verb to the current story tense but the given viewpoint. For example, "he [adapt the verb provoke from the third person singular]" might produce "he provokes".

say "[adapt (verb) in (grammatical tense)]"

Adapts the given verb to the given tense but the current story viewpoint. For example, "you [adapt the verb provoke in the past tense]" might produce "you provoked".

say "[adapt (verb) in (grammatical tense) from (narrative viewpoint)]"

Adapts the given verb to the given tense and viewpoint. For example, "we [adapt the verb provoke in the future tense from the first person plural]" might produce "we will provoke".

say "[negate (verb)]"

Adapts the given verb to the current story tense and story viewpoint, giving it a negative sense. For example, "you [negate the verb provoke]" might produce "you do not provoke".

say "[negate (verb) from (narrative viewpoint)]"

Adapts the given verb to the current story tense but the given viewpoint, giving it a negative sense. For example, "he [negate the verb provoke from the third person singular]" might produce "he does not provoke".

say "[negate (verb) in (grammatical tense)]"

Adapts the given verb to the given tense but the current story viewpoint, giving it a negative sense. For example, "you [negate the verb provoke in the past tense]" might produce "you did not provoke".

say "[negate (verb) in (grammatical tense) from (narrative viewpoint)]"

Adapts the given verb to the given tense and viewpoint, giving it a negative sense. For example, "we [negate the verb provoke in the future tense from the first person plural]" might produce "we will not provoke".

Note that the verb doesn't have to be named explicitly for use by the adapt or negate phrases, so for example:

To decide which text is the rendering of (V - verb) (this is my rendering):
    decide on "[negate V in the past perfect tense]".

When play begins:
    showme my rendering applied to the list of meaningful verbs.

produces:

"my rendering applied to the list of meaningful verbs" = list of texts: {"had not had", "had not related", "had not meant", "had not provided", "had not contained", "had not supported", "had not incorporated", "had not enclosed", "had not carried", "had not held", "had not worn", "had not been able to see", "had not been able to touch", "had not concealed", "had not unlocked"}

Lastly, we can get at three other useful parts of a verb, too. These aren't adaptive, of course: a verb only has one infinitive form.

say "[infinitive of (verb)]"

Produces the infinitive of the given verb. Note that this is without a "to": for example, "[infinitive of the verb carry]" is "carry", not "to carry".

say "[past participle of (verb)]"

Produces the past participle of the given verb. For example, "[past participle of the verb carry]" is "carried". Warning: because modal verbs like "should" or "might" are defective in English, this will produce odd results on them - "shoulded" and "mighted", for example.

say "[present participle of (verb)]"

Produces the present participle of the given verb. For example, "[present participle of the verb carry]" is "carrying". Warning: because modal verbs like "should" or "might" are defective in English, this will produce odd results on them - "shoulding" and "mighting", for example.


arrow-up.pngStart of Chapter 14: Adaptive Text and Responses
arrow-left.pngBack to §14.8. Adapting contractions
arrow-right.pngOnward to §14.10. Responses

The examples Variety and Narrative Register show how verbs can be associated with particular actions. Here, we use the same principle so that we can report to the player what was last done to a particular object, either by the player or by someone else.

To do this, we need to use the idea of stored actions from the Advanced Actions chapter.

paste.png "History Lab"

Section 1 - Procedure

An object has an action called the last action.

Describing relates various verbs to various action names. The verb to describe means the describing relation.

To take is a verb. The verb take describes the taking action.
To drop is a verb. The verb drop describes the dropping action.
To look at is a verb. The verb look at describes the examining action.
To examine is a verb. The verb examine describes the examining action.

After an actor doing something to something:
    if a verb describes the action name part of the current action:
        now the indefinite article of the noun is "the";
        now the last action of the noun is the current action;
    continue the action.

After printing the name of something (called item):
    if the last action of the item is not waiting and the last action of the item is not the current action:
        let chosen action-name be the action name part of the last action of the item;
        let chosen actor be the actor part of the the last action of the item;
        if a verb describes the chosen action-name:
            let the chosen verb be a random verb that describes the chosen action-name;
            say " [if the chosen actor is the player][we][else][chosen actor][end if] [adapt chosen verb in past tense]";

Section 2 - Scenario

Lab is a room. It contains a box. The box contains a newspaper. Clark is a man in the Lab.

A persuasion rule:
    persuasion succeeds.

Test me with "x box / look / x newspaper / look / clark, x newspaper / clark, get box / clark, drop box / look / take box / i / smell box / i".

Notice that smelling the box does not change the box's description because we haven't gotten around to defining a smell or sniff verb.

**ExampleHistory Lab
We create phrases such as "the box we took" and "the newspaper Clark looked at" based on what has already happened in the story.

The examples Variety and Narrative Register show how verbs can be associated with particular actions. Here, we use the same principle so that we can report to the player what was last done to a particular object, either by the player or by someone else.

To do this, we need to use the idea of stored actions from the Advanced Actions chapter.

paste.png "History Lab"

Section 1 - Procedure

An object has an action called the last action.

Describing relates various verbs to various action names. The verb to describe means the describing relation.

To take is a verb. The verb take describes the taking action.
To drop is a verb. The verb drop describes the dropping action.
To look at is a verb. The verb look at describes the examining action.
To examine is a verb. The verb examine describes the examining action.

After an actor doing something to something:
    if a verb describes the action name part of the current action:
        now the indefinite article of the noun is "the";
        now the last action of the noun is the current action;
    continue the action.

After printing the name of something (called item):
    if the last action of the item is not waiting and the last action of the item is not the current action:
        let chosen action-name be the action name part of the last action of the item;
        let chosen actor be the actor part of the the last action of the item;
        if a verb describes the chosen action-name:
            let the chosen verb be a random verb that describes the chosen action-name;
            say " [if the chosen actor is the player][we][else][chosen actor][end if] [adapt chosen verb in past tense]";

Section 2 - Scenario

Lab is a room. It contains a box. The box contains a newspaper. Clark is a man in the Lab.

A persuasion rule:
    persuasion succeeds.

Test me with "x box / look / x newspaper / look / clark, x newspaper / clark, get box / clark, drop box / look / take box / i / smell box / i".

Notice that smelling the box does not change the box's description because we haven't gotten around to defining a smell or sniff verb.

The examples Variety and Narrative Register show how verbs can be associated with particular actions. Here, we use the same principle so that we can report to the player what was last done to a particular object, either by the player or by someone else.

To do this, we need to use the idea of stored actions from the Advanced Actions chapter.

paste.png "History Lab"

Section 1 - Procedure

An object has an action called the last action.

Describing relates various verbs to various action names. The verb to describe means the describing relation.

To take is a verb. The verb take describes the taking action.
To drop is a verb. The verb drop describes the dropping action.
To look at is a verb. The verb look at describes the examining action.
To examine is a verb. The verb examine describes the examining action.

After an actor doing something to something:
    if a verb describes the action name part of the current action:
        now the indefinite article of the noun is "the";
        now the last action of the noun is the current action;
    continue the action.

After printing the name of something (called item):
    if the last action of the item is not waiting and the last action of the item is not the current action:
        let chosen action-name be the action name part of the last action of the item;
        let chosen actor be the actor part of the the last action of the item;
        if a verb describes the chosen action-name:
            let the chosen verb be a random verb that describes the chosen action-name;
            say " [if the chosen actor is the player][we][else][chosen actor][end if] [adapt chosen verb in past tense]";

Section 2 - Scenario

Lab is a room. It contains a box. The box contains a newspaper. Clark is a man in the Lab.

A persuasion rule:
    persuasion succeeds.

Test me with "x box / look / x newspaper / look / clark, x newspaper / clark, get box / clark, drop box / look / take box / i / smell box / i".

Notice that smelling the box does not change the box's description because we haven't gotten around to defining a smell or sniff verb.

**ExampleRelevant Relations
An example of how to create room descriptions that acknowledge particular relations using their assigned verbs, rather than by the heavily special-cased code used by the standard library.