3.5.2 Extending the DCG

Semantically annotated DCGs.

Let's see how to use this notation in DCGs. We'll deal with the rules first. Actually, there's practically nothing that needs to be said here. If we work with rules in the manner suggested by (our refined version of) Task 3, all we need is the following:

firstLambda.pl: View Download

s(NP@VP)--> np(NP), vp(VP).

np(PN)--> pn(PN).

np(Det@Noun)--> det(Det), noun(Noun).

vp(IV)--> iv(IV).

vp(TV@NP)--> tv(TV), np(NP).

The unary branching rules just percolate up their semantic representation (here coded as Prolog variables NP, VP and so on), while the binary branching rules use @ to build a semantic representation out of their component representations. This is completely transparent: we simply apply function to argument to get the desired result.


Aljoscha Burchardt, Stephan Walter, Alexander Koller, Michael Kohlhase, Patrick Blackburn and Johan Bos
Version 1.2.5 (20030212)