2.4.4 Semantic Macros for Lambda-Calculus

We saw in the last chapter that using functional application and -conversion more or less reduces the process of combining semantic representations to an elegant triviality, while it shifts most of the semantic load to the lexical component. We've got the framework for constructing functional applications and for calling the lexicon. But the only semantic information that our lexicon/4-facts supply are the relevant constant and relation symbols. So where do the s come from? The semantic macros are where the real work will be done. Basically, they will specify the templates for the abstraction patterns associated with different lexical categories. Let's now implement the semantic macros needed for -calculus. Here are some examples:

Nouns and proper names

nounSem(Sym,lambda(X,Formula)):-  
   compose(Formula,Sym,[X]).

The first macro, nounSem/2, builds a semantic representation for a noun given its predicate symbol Sym, by turning this symbol into a formula -abstracted with respect to a single variable. For example, given the predicate symbol man, it will return the -abstraction lambda(X,man(X)). The scope of the abstraction is built using compose/3 to incorporate the given predicate symbol into a well-formed open formula. The semantic macro for proper names (pnSem/2) is still simpler: It constructs the kind of -expression discussed above and doesn't even need to call compose/3 for this purpose.

Verbs

Let's have a look at the macros for verbs next. The one for intransitive verbs is very straightforward:

ivSem(Sym,lambda(X,Formula)):-  
   compose(Formula,Sym,[X]).

On a closer look, the macro does exactly the same as nounSem/2. This is not surprising at all - after all the -expressions we saw for intransitive verbs are also exactly like the ones for nouns.

Finding the right abstraction pattern for transitive verbs turned out to be a little more involved. Nevertheless now we've got it, even this pattern translates into a semantic macro without a glimpse:

tvSem(Sym,lambda(K,lambda(Y,K @ lambda(X,Formula)))):-  
   compose(Formula,Sym,[Y,X]).

This macro is again similar to that for nouns, except that it handles two variables rather than just one. Additionally, it resembles the macro for proper names in the way it incorporates our well known role-reversing trick.

Special words

As we've already mentioned, our grammar also deals with some ``special'' words, words that do not have a value for a predicate or constant symbol specified in the lexicon. Determiners are such words - and here are the macros for the indefinite and the universal one. They're basically just the old-style ``lexical entries'' we used in Chapter 1:

detSem(uni,lambda(P,lambda(Q,forall(X,(P@X)>(Q@X))))).

detSem(indef,lambda(P,lambda(Q,exists(X,(P@X)&(Q@X))))).

These macros are self-contained in that they provide a complete semantic representation starting from no input. The first argument is only a tag that helps Prolog select the right clause. It does not occur in the output representation.

All semantic macros can be found in lambda.pl: View Download

For a complete listing of the macros we have been discussing, see the file lambda.pl. We shall introduce another semantic construction method in the next chapter - no problem for our new architecture. From now on, we will always use the lexicon and the rules listed above. The primary locus of change will be the semantic macros and the implementation of combine/2.


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