Skip to content

TRALE: Gaps

This tutorial introduces how to handle movement and the passive voice in TRALE, a programming language for constructing type-feature structure rules. We will focus on the implementation of gap structures to model the passive voice and manage NP movement. To do so, we’ll define gap features, empty categories, and specific rules for active and passive sentences.

Table of Contents

Open Table of Contents

Example Grammar: The Passive Voice

We begin with a basic grammar that handles nouns, verbs, and sentence structures:

bot sub [cat, sem, vform].
    cat sub [has_sem, det, aux, p, pp].
        has_sem sub [nominal, verbal] intro [sem:sem].
            nominal sub [n, np] intro [sem:n_sem].
            verbal sub [v, vp, s] intro [sem:v_sem, subcat:list, vform:vform].

    sem sub [v_sem, n_sem].
        v_sem sub [tickle] intro [subj:sem, obj:sem].
        n_sem sub [llama, dog].

    vform sub [active, passive].

    list sub [e_list, ne_list].
        ne_list intro [hd:bot, tl:list].

the ---> det.
llama ---> (n, sem:llama).
dog ---> (n, sem:dog).

tickled ---> (v, vform:active, sem:(tickle, subj:Subj, obj:Obj), subcat:[(np, sem:Obj), (np, sem:Subj)]).

np rule
(np, sem:Sem) ===>
cat> det,
cat> (n, sem:Sem).

vp rule
(vp, sem:Sem, subcat:Rest) ===>
cat> (v, sem:Sem, subcat:[NP|Rest]),
cat> (np, NP).

s rule
(s, sem:Sem, subcat:(Rest, [])) ===>
cat> (np, NP),
cat> (vp, sem:Sem, subcat:[NP|Rest]).

Implementing the Passive Voice

In English, the passive voice is typically expressed with the auxiliary verb be and involves NP movement. For instance, “The llama tickled the dog” becomes “The dog was tickled.” To implement this transformation in TRALE, we use gaps to store moved NPs.

Step 1: Defining Gap Structures

We introduce a gap_struc feature for NPs and VPs to store a moved NP, or to indicate there is no gap (none).

has_sem sub [nominal, verbal] intro [sem:sem, gap:gap_struc].
gap_struc sub [np, none].

Step 2: Handling Empty Categories

To accommodate sentences where the object NP has moved (e.g., passive sentences), we introduce empty categories. These empty categories are evaluated as NPs and share the same features as the NP they “replace.”

empty (np, sem:Sem, gap:(sem:Sem, gap:none)).

This rule allows parsing of empty strings as NPs while preserving the NP’s semantic information.

Step 3: Adjusting Lexical Entries

We update the lexical entries for nouns to specify that they cannot act as gaps. Additionally, we define the auxiliary verb was for use in passive constructions:

was ---> aux.
llama ---> (n, sem:llama, gap:none).
dog ---> (n, sem:dog, gap:none).

Step 4: Propagating Gap Structures

Next, we modify the rules so that gap information is carried through each level of the structure. If an NP is a gap, its parent VP and S should inherit this gap information.

np rule
(np, sem:Sem, gap:Gap) ===>
cat> det,
cat> (n, sem:Sem, gap:Gap).

aux rule
(v, vform:passive, sem:Sem, subcat:SubCat, gap:Gap) ===>
cat> aux,
cat> (v, vform:active, sem:Sem, subcat:SubCat, gap:Gap).

vp rule
(vp, sem:Sem, subcat:Rest, gap:Gap) ===>
cat> (v, sem:Sem, subcat:[NP|Rest]),
cat> (np, NP, gap:Gap).

Step 5: Sentence Rules for Active and Passive Voice

We now define two distinct sentence rules: one for active sentences and one for passive sentences.

Active Voice Rule

In active sentences, there are no gaps, so we enforce that the gap feature must be none.

s_active rule
(s, sem:Sem, vform:VForm, subcat:(Rest, []), gap:(none, None)) ===>
cat> (np, NP),
cat> (vp, sem:Sem, vform:VForm, subcat:[NP|Rest], gap:None).

Passive Voice Rule

In passive sentences, the verb must be in the passive form, and the subject NP should be the one found in the VP’s gap. This ensures that the NP has moved from its original position in the VP to the subject position in the sentence.

s_passive rule
(s, sem:Sem, vform:(passive, VForm), subcat:SubCat, gap:none) ===>
cat> (np, NP),
cat> (vp, vform:(passive, VForm), sem:Sem, subcat:(SubCat, [_]), gap:NP).

Step 6: Testing the Grammar

Now, when parsing passive sentences such as The dog was tickled, the system will correctly handle the movement of NPs using gaps. You should get one valid parse that reflects the fact that “dog” is now the subject, while still representing the original object of the action.

Final Grammar

Below is the final version of the grammar that supports both active and passive constructions with gap structures:

bot sub [cat, agr, vform, sem].
    cat sub [has_sem, det, aux, p, pp].
        has_sem sub [nominal, verbal] intro [sem:sem, gap:gap_struc].
            nominal sub [n, np] intro [sem:n_sem].
            verbal sub [v, vp, s] intro [sem:v_sem, subcat:list, vform:vform].

    sem sub [v_sem, n_sem].
        v_sem sub [tickle] intro [subj:sem, obj:sem].
        n_sem sub [llama, dog].

    vform sub [active, passive].

    gap_struc sub [np, none].

    list sub [e_list, ne_list].
        ne_list intro [hd:bot, tl:list].

the ---> det.
was ---> aux.
llama ---> (n, sem:llama, gap:none).
dog ---> (n, sem:dog, gap:none).

tickled ---> (v, vform:active, sem:(tickle, subj:Subj, obj:Obj), subcat:[(np, sem:Obj), (np, sem:Subj)]).

np rule
(np, sem:Sem, gap:Gap) ===>
cat> det,
cat> (n, sem:Sem, gap:Gap).

aux rule
(v, vform:passive, sem:Sem, subcat:SubCat, gap:Gap) ===>
cat> aux,
cat> (v, vform:active, sem:Sem, subcat:SubCat, gap:Gap).

vp rule
(vp, sem:Sem, subcat:Rest, gap:Gap) ===>
cat> (v, sem:Sem, subcat:[NP|Rest]),
cat> (np, NP, gap:Gap).

s_active rule
(s, sem:Sem, vform:VForm, subcat:(Rest, []), gap:(none, None)) ===>
cat> (np, NP),
cat> (vp, sem:Sem, vform:VForm, subcat:[NP|Rest], gap:None).

s_passive rule
(s, sem:Sem, vform:(passive, VForm), subcat:SubCat, gap:none) ===>
cat> (np, NP),
cat> (vp, vform:(passive, VForm), sem:Sem, subcat:(SubCat, [_]), gap:NP).

empty (np, sem:Sem, gap:(sem:Sem, gap:none)).

Conclusion

This grammar now correctly handles both active and passive voice using gap structures and empty categories. The grammar captures NP movement and enforces proper passive construction with the auxiliary verb was and the past participle form of the verb.