% ========================================================================== % $Id: dcg_arguments.pl,v 1.1 2014/02/13 05:47:10 jlang Exp $ % CSI2120 example Code for lecture 9 % ========================================================================== % (C)opyright: % % Jochen Lang % EECS, University of Ottawa % 800 King Edward Ave. % Ottawa, On., K1N 6N5 % Canada. % http://www.eecs.uottawa.ca/~jlang % % Creator: jlang (Jochen Lang) based on Clocksin & Mellish % Email: jlang@eecs.uottawa.ca % ========================================================================== % $Log: dcg_arguments.pl,v $ % Revision 1.1 2014/02/13 05:47:10 jlang % Added grammar examples for lecture 9. % % ========================================================================== sentence --> sentence(_). sentence(X) --> noun_phrase(X), verb_phrase(X). noun_phrase(X) --> determiner(X), noun(X). verb_phrase(X) --> verb(X). verb_phrase(X) --> verb(X), noun_phrase(_). determiner(_) --> [the]. determiner(_) --> [a]. noun(singular) --> [tomato]. noun(plural) --> [tomatos]. noun(singular) --> [bird]. noun(plural) --> [birds]. noun(singular) --> [man]. noun(plural) --> [men]. noun(singular) --> [cat]. noun(plural) --> [cats]. verb(singular) --> [eats]. verb(plural) --> [eat]. verb(singular) --> [sings]. verb(plural) --> [sing]. verb(singular) --> [loves]. verb(plural) --> [love].