Definite Clause Grammar

A definite clause grammar (DCG) is a way of expressing grammar, either for natural or formal languages, in a logic programming language such as Prolog. It is closely related to the concept of attribute grammars / affix grammars from which Prolog was originally developed. DCGs are usually associated with Prolog, but similar languages such as Mercury also include DCGs. They are called definite clause grammars because they represent a grammar as a set of definite clauses in first-order logic.

The term DCG refers to the specific type of expression in Prolog and other similar languages; not all ways of expressing grammars using definite clauses are considered DCGs. However, all of the capabilities or properties of DCGs will be the same for any grammar that is represented with definite clauses in essentially the same way as in Prolog.

The definite clauses of a DCG can be considered a set of axioms where the validity of a sentence, and the fact that it has a certain parse tree can be considered theorems that follow from these axioms. This has the advantage of making it so that recognition and parsing of expressions in a language becomes a general matter of proving statements, such as statements in a logic programming language.

Read more about Definite Clause Grammar:  History, Extensions, Example, Translation Into Definite Clauses, Non-context-free Grammars, Representing Features, Parsing With DCGs, Other Uses

Famous quotes containing the words definite, clause and/or grammar:

    There are many definite methods, honest and dishonest, which make people rich; the only “instinct” I know of which does it is that instinct which theological Christianity crudely describes as “the sin of avarice.”
    Gilbert Keith Chesterton (1874–1936)

    Long ago I added to the true old adage of “What is everybody’s business is nobody’s business,” another clause which, I think, more than any other principle has served to influence my actions in life. That is, What is nobody’s business is my business.
    Clara Barton (1821–1912)

    All the facts of nature are nouns of the intellect, and make the grammar of the eternal language. Every word has a double, treble or centuple use and meaning.
    Ralph Waldo Emerson (1803–1882)