The Generous Professor

An Example of Syntax Transformations

In a previous example, we studied the attachment of two transformations, NEG and PRON_DIR, to a simple sentence, transforming it (a) to negative form, (b) to a form in which the direct object was replaced by a clitic pronoun.

In this exercise we will begin by introducing further transformations along the same lines:

Then we will consider how to make a random choice of these transformations to be performed on the basic sentence.

The base sentence is essentially the same as the example on the Syntax page, except that the choice of words is mandated, and their actual genders have been have been attached to the children of S, except in the case of "étudiant/e", to which either gender is applicable.

    S = choose Ge3: Genre, No1, No2, No3 : Nombre;
        NP[masc, No1]/"professeur"
                V[No1, prés, p3]/"donner"
                    NP[Ge2, masc]/"livre_1" NPI[Ge3, No3]/"étudiant"
    %

    NPI = inherit No: Nombre, Ge: Genre;
        PREP/"à" NP[Ge, No]
    %

    NP = inherit No: Nombre, Ge: Genre;
        DET[Ge, No] N[Ge, No]
    %

The transformations are:

    PRON_SUBJ = TRANSFORMATION
    {replaces the subject by a pronoun which acquires its gender and
    number from the noun phrase. This must be carried out before
    PRON_INV if both are present.}
    PRIORITY 1
        NP * : PRON[suj, pronper, clit, p3, 1!Genre, 1!Nombre] 2;
    %

    ESTCEQUE = TRANSFORMATION
    {makes the sentence interrogative by prefixing it with "est ce que"}
    PRIORITY 2
        * : PART/"est-ce que" 1;
    %

    AVOIR_PERF = TRANSFORMATION
    {introduces the auxiliary verb "avoir" and changes the original
    to the past participle, thereby converting the verb to its passé
    composé form. The participle is given its masc, sing form but this
    may be altered by PRON_DIR. Since it is the auxiliary verb which
    must receive the object pronouns and negative adverbs, this must be
    carried out before those transformations. Note that the latter
    will locate the first V, that is, the auxiliary verb, if it is
    present.}
    PRIORITY 3
        * V * : 1 V[2!Temps, 2!Nombre, 2!Personne]/"avoir"
                    2[-Temps, -Nombre, -Personne, masc, sing, pastpart] 3;
    %

    NEG = TRANSFORMATION
    {causes sentence to become negative; V is surrounded by "ne" and "pas"}
    PRIORITY 4
        * V * : 1 ADV/"ne" 2 ADV/"pas" 3;
    %

    PRON_INV = TRANSFORMATION
    {makes the sentence interrogative by pronoun inversion. The two
    subrules cover the possibility that the subject of the sentence is a
    noun phrase or a pronoun. PRON_SUBJ, if present, is applied before
    PRON_INV, so the status is known by the time this is carried out.
    NEG must also be applied before PRON_INV, so that "pas" follows the
    inverted pronoun. The morphology for "-" generates "-t-" if
    necessary. The context-free rules must obviously ensure that we do
    not apply both PRON_INV and ESTCEQUE}
    PRIORITY 5
        PRON * V * : 2 3 PONCT/"-" 1 4;
        NP * V * : 1 2 3 PONCT/"-"
                    PRON[suj, pronper, clit, p3, 1!Genre, 1!Nombre] 4;
    %

    PRON_DIR = TRANSFORMATION
    {replaces the direct object by a pronoun. In comparison to the
    example on the Syntax page, this contains an extra subrule, the
    first, which caters for the possibility that the verb is in the
    passé composé. If so, the past participle must be made to agree
    in gender and number with its preceding direct object pronoun.
    The attachment to the participle (node 4) contains two attribute
    forces which put this into effect.}
    PRIORITY 6
        * V * V NP * : 1 PRON[objd, pronper, clit, p3, 5!Genre, 5!Nombre]
                            2 3 4[5!Genre, 5!Nombre] 6;
        * V * NP * : 1 PRON[objd, pronper, clit, p3, 4!Genre, 4!Nombre]
                            2 3 5;
    %

    PRON_INDIR = TRANSFORMATION
    {replaces the indirect object by a pronoun}
    PRIORITY 7
       * V * NPI : 1 PRON[obji, pronper, clit, p3, 4!Genre, 4!Nombre]
                            2 3 5;
    %

Generation is initiated by a ROOT rule such as:

    ROOT = PRON_SUBJ: NEG: AVOIR_PERF: S %

where any combination of these transformations not including both interrogatives may be attached.

There are 96 such combinations (three alternatives for interrogatives, two for the other five features). Choosing Ge3, No1, No2 and No3 offers 16 possibilities for each combination, though not all the resulting sentences are different. (The indirect object pronouns do not vary for gender.)

This exercise would provide the basis for a comprehensive learner test on the proper attachment of negatives and pronouns to French verbs. The number of sentences can be vastly increased by eliminating the mandated lexical choices, by randomly choosing the genders of subject and direct object, and by permitting verbs in the base sentence to take the future, imperfect and conditional tenses as well as the present. Note that the transformations already allow for this.

Random Selection

Suppose we would like to generate sentences based on a random selection of these transformations.

It is tempting, but not correct, to replace the ROOT rule by:

    ROOT = ( | PRON_SUBJ:) ( | ESTCEQUE: | PRON_INV:)
                                       ... ( | AVOIR_PERF:) S %

vinci permits factorization, but only of complete tree nodes, not of attachments.

It would be correct, but very tedious, to write a context-free ROOT rule which enumerated all 96 alternative combinations.

A neater and more instructive approach is expressed in the context-free rules:


    ROOT = (S1 | PRON_SUBJ: S1) %
    S1   = (S2 | ESTCEQUE: S2 | PRON_INV: S2) %
    S2   = (S3 | NEG: S3) %
    S3   = (S4 | PRON_DIR: S4) %
    S4   = (S5 | PRON_INDIR: S5) %
    S5   = (S  | AVOIR_PERF: S) %

These generate trees such as:

                   ROOT
                     |
                    S1
                     |
          PRON_INV: S2
                     |
               NEG: S3
                     |
                    S4
                     |
                    S5
                     |
         AVOIR_PERF: S

where each node may or may not be accompanied by a transformation call, and S continues as before to generate the base sentence.

As before, we need all the transformations calls to be attached to S before any of them are applied. We accomplish this by having them move themselves down the tree. Take, for example, the transformation NEG. We simply insert a default subrule with right-hand side NEG: 1; thus:

    NEG = TRANSFORMATION
    {causes sentence to become negative; V is surrounded by "ne" and "pas"}
    PRIORITY 4
        * V * : 1 ADV/"ne" 2 ADV/"pas" 3;
          *   : NEG: 1;
    %

NEG starts on node S3. On this node, the children do not match * V *, but the single child S4 does match the default guard. The right-hand side therefore attaches NEG to S4. S4's children still do not match * V *, so NEG is attached to the only child, S5, and so on. The other transformations are given analogous defaults.

vinci starts applying transformations at the top of the tree. If it finds one on S1, the transformation will place a call to itself on S2. If vinci finds transformations on S2, these will attach calls to S3, and so on, until all of them are present on S. At this point, the "proper" subrules take over to carry out their tasks.