CSCI 587 - Assignment 4 Generative Grammars in Prolog


Date: Feb 20, 1997
Date Due: Feb 27, 1997
  1. #10 page 78
  2. Write a "half-sister" rule in prolog. A half sister is: (1) female, (2) has a common parent, but does not have both parents the same.
    halfSister(X,H) :- parent(X,P), parent(H,P), 
            parent(X,PX), not(PX = P),
            parent(H,PH), not(PH = P).
    
  3. Run nlp2 and see what sentences can be generated. Run script and then load nlp2. Run it with the Goal S(X). Repeat ";" to run through alternatives.
  4. Extend NLP2 to handle simple "art adj noun" noun phrases also.
    np(X, Y):- art(X, Z), noun(Z, Y).
    np(X, Y):- art(X, Z), adj(Z, W), noun(W, Y).
    
  5. Extend NLP2 to handle simple "art ADJL noun" phrases also.
    np(X, Y):- art(X, Z), noun(Z, Y).
    np(X, Y):- art(X, Z), adjList(Z, W), noun(W, Y).
    
    adjList(X, Y) :- adj(X,Y).
    adjList(X, Y) :- adj(X,Z), adjList(Z,Y).