%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  File:  grammar1.pl
%
%  Course:  HPSG Grammars in ALE
%
%  Purpose:  Introducing features and using types and variables.  
%            This grammar needs some editing to be sensible.
%
%  Parses:    sandy snored
%             *snored sandy ... etc
%
%  No parses: snored snored
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Type Hierarchy

bot sub [sign,cat,head].      %  Three basic types

sign sub []                   %  The type "sign" introduces the
   intro [cat:cat].           %  feature "cat"

cat sub []
   intro [head:head,          % "cat" introduces two features
          subj:head].

head sub [noun,verb].

noun sub [].

verb sub [].

% Lexical Entries

sandy ---> cat:head:noun.

snored ---> cat:(head:verb,
                 subj:noun).

% Grammmar Rules

subject_head rule
(cat:head:verb)
===>
cat> (cat:head:Head),        %  The subject's "head" feature must
cat> (cat:subj:Head).        %  match the head's "subj" feature
