Semantic Augmentation

Definition: semantic attachment — specifications on how to compute the meaning representation of a construction from the meanings of its constiuents. [JM]

Abstractly, a grammar rule has the form

A -> α1 ... αn { f(αj.sem, ..., αk.sem) }

Or, in a more mathematically precise formulation:

A -> α1 ... αn { f(αi1.sem, ..., αik.sem) }
This is interpreted that the semantic meaning of the nonterminal A (denoted A.sem) is derived from a function f of the semantic meanings of a subset of the RHS elements.

Note that although this resembles a Prolog action grammar, the mechanisms differ.

Example:

ProperNoun -> AyCaramba        {AyCaramba}

MassNoun -> meat               {Meat}

These two rules specify that the meanings associated with the subtrees generated by these rules consist of the constants "AyCaramba" and "Meat".[JM]
Note that there are an immense number of "feature attachments" (aka world knowledge in AI) associated with these "constants".

NP -> ProperNoun               {ProperNoun.sem}

NP -> MassNoun                 {MassNoun.sem}

.. the subtrees corresponding to these rules do not directly contribute these FOPC constants to the final meaning representation. In keeping with the principle of compositionality, ... the upper NPs obtain their meaning representation from the meanings of their children. [Is this synthesis or inheritance of attributes?]
This model distinguishes between a semantic attachment of a rule and the semantic value associated with a tree generated by a rule. A semantic attachment is a set of instructions on how to ascribe a meaning representation; a semantic value is the result of following these instructions — viz., a meaning representation.

We should see similarities to our Prolog DCG's. The code in curly braces {} is the interpretative actions we take when applying a production (aka rule). The meaning representation is the meaning we synthesized from the constituent elements of the rule and sub-rules. In our case, to keep things manageable, we usually simply asserted fact(_,_, ..., _).

At this point in the process, we're still passing attributes up the parse tree (synthesis), and have not decided on a composite meaning of the sentence, and so don't need to remember any facts.

properNoun(Sem) --> ['AyCaramba'], {Sem = 'AyCaramba'}.

massNoun(Sem) --> [meat], {Sem = 'Meat'}.

np(Sem) --> properNoun(ProperNounSem), {Sem = ProperNounSem}.

np(Sem) --> massNoun(MassNounSem), {Sem = MassNounSem}.