[Up] [Next]
Go up to Difference Lists and Definite Clause Grammars
Go forward to Difference Lists


This section introduces the DEFINITE CLAUSE GRAMMAR (DCG) format, which is a Prolog notation for context free grammars. The DCG notation is essentially a shorthand for implementing the type of rule discussed in Context Free Grammars And How To Implement Them In Prolog, except that it uses a different and much faster method for concatenating lists. This chapter begins by explaining how the latter works, and then shows how to write rules in the DCG format.


[Up] [Next]