Dcg contextless

Description

A DCG context-free grammar

Source: The Art of Prolog

Download

Program source code: dcg_contextless.pl

Listing

%    Grammar Rules
 
        sentence --> noun_phrase, verb_phrase.
 
        noun_phrase --> determiner, noun_phrase2.
        noun_phrase --> noun_phrase2.
 
        noun_phrase2 --> adjective, noun_phrase2.
        noun_phrase2 --> noun.
 
        verb_phrase --> verb.
        verb_phrase --> verb, noun_phrase.
 
%       Vocabulary
 
        determiner --> [the].    adjective --> [decorated].
        determiner --> [a].
 
        noun --> [pieplate].    verb --> [contains].
        noun --> [surprise].
 
%     Program 19.6:  A DCG context-free grammar

Comments

pl/prolog/pllib/dcg_contextless.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0