%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  File:  grammar2.pl
%
%  Course:  HPSG Grammars in ALE
%
%  Purpose:  1. Introduces the type "list"
%            2. Feature "subj" now takes lists as values
%            3. Lexical entries changed to use lists
%            4. Rules changed also
%
%  Parses:     sandy snored
%              *sandy sandy snored
%              *snored sandy snored .. etc
%
%  No parses:  snored sandy
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%**********************  Type Hierarchy

bot sub [sign,list,cat,head].      % New type "list"

sign sub []
   intro [cat:cat].

cat sub []
   intro [head:head,
          subj:list].

head sub [noun,verb].

noun sub [].
verb sub [].

list sub [e_list,ne_list].         % Specification of list types

ne_list sub []
  intro [hd:sign,
         tl:list].

e_list sub [].

%%%**********************  Lexical Entries

sandy ---> cat:(head:noun,
              subj:[]).            % Now "sandy" cannot have a subject

snored ---> cat:(head:verb,
                 subj:[cat:head:noun]).    % First element is a noun

%%%**********************  Grammmar Rules

subject_head rule
(cat:head:verb)
===>
cat> (cat:head:Head),  
cat> (cat:subj:[cat:head:Head]).   % First "subj" element must match subject
