5.2 DCGs

Now you have seen some examples of CFGs including a grammar for a fragment of English. Before we go about building parsers that use this grammar, let us pause for a moment and see what Prolog's built in Definite Clause Grammar s (DCGs) can do for us. Although DCGs are formally more powerful than CFGs, we can easily use the DCG mechanism to deal with CFGs like the ones we have seen before.

Note that what follows is not intended as a complete introduction (for that, see any decent Prolog textbook). It's simply meant to remind you of some basic aspects of DCG notation, and how DCGs can be used in our context.



Kristina Striegnitz, Patrick Blackburn, Katrin Erk, Stephan Walter, Aljoscha Burchardt and Dimitra Tsovaltzi
Version 1.2.5 (20030212)