1.5.3 The Lexicon

The real work is done at the lexical level. Nevertheless, the lexical entries for nouns and intransitive verbs practically write themselves:

n(lambda(X, witch(X))) --> [witch], {vars2atoms(X)}.
n(lambda(X, wizard(X))) --> [wizard], {vars2atoms(X)}.
n(lambda(X, broomstick(X))) --> [broomstick], {vars2atoms(X)}.
n(lambda(X, man(X))) --> [man], {vars2atoms(X)}.
n(lambda(X, woman(X))) --> [woman], {vars2atoms(X)}.

iv(lambda(X, fly(X))) --> [flies], {vars2atoms(X)}.

If you do not remember the somewhat difficult representation of transitive verbs, look at Section 1.4.4 again. Here's the lexical rule for our only transitive verb form, ``curses'':

tv(lambda(X, lambda(Y, X@lambda(Z, curse(Y,Z))))) --> [curses], {vars2atoms(X), vars2atoms(Y), vars2atoms(Z)}.
tv(lambda(X, lambda(Y, X@lambda(Z, love(Y,Z))))) --> [loves], {vars2atoms(X), vars2atoms(Y), vars2atoms(Z)}.

Recall that the -expressions for the determiners ``every'' and ``a'' are and . We express these in Prolog as follows:

det(lambda(P, lambda(Q, exists(X, ((P@X) & (Q@X)))))) --> [a], {vars2atoms(P), vars2atoms(Q),vars2atoms(X)}.
det(lambda(P, lambda(Q, forall(X, ((P@X) > (Q@X)))))) --> [every], {vars2atoms(P), vars2atoms(Q),vars2atoms(X)}.

Finally, the ``role-reversing'' (Section 1.4.4) representation for our only proper name:

pn(lambda(P, P@harry)) --> [harry], {vars2atoms(P)}.
pn(lambda(P, P@john)) --> [john], {vars2atoms(P)}.
pn(lambda(P, P@mary)) --> [mary], {vars2atoms(P)}.

Prolog Variables?

Note that we break our convention of representing variables by constants in these lexical rules. All the -bound variables are written as Prolog variables instead of atoms. This is the reason why we have to add the calls to vars2atoms/1 in some of our phrasal rules (included in curly brackets - curly brackets allow us to include further Prolog calls with DCG-rules). Whenever a lexical entry is retrieved, vars2atoms/1 replaces all Prolog variables in it by new atoms. Distinct variables are replaced by distinct atoms. We won't go into how exactly this happens - if you're interested, have a look at the code of the predicate. After this call, the retrieved lexical entry is in accord with our representational conventions again.

This sounds complicated - so why do we do it? If you have read the sidetracks in the previous section (Section 1.4.7 and Section 1.4.8), you've heard about the possibility of accidental binding and the need for -conversion during the semantic construction process. Now by using Prolog variables in lexical entries and replacing them by atoms on retrieval, we make sure that no two meaning representations taken from the lexicon ever contain the same -bound variables. In addition, the atoms substituted by vars2atoms/1 are distinct from the ones that we use for quantified variables. Finally, no other rules in our grammar ever introduce any variables or double any semantic material. In result accidental bindings just cannot happen. So using Prolog variables in the lexicon may be a bit of a hack, but that way we get away without implementing -conversion.


Aljoscha Burchardt, Alexander Koller and Stephan Walter
Version 1.2.5 (20030212)