% Grammar 3
% =========

% signature file
signature(signature).

% load the lexicon

:- [lexicon].


% phrase structure rules
subject_head_rule rule
(phrase, phon:MotherPhon,
         synsem:(category:(
                           subcat:[])),  
 dtr1:Subj, dtr2:Head)
   ===>
cat> (Subj,
      phon:SubjPhon),
cat> (Head,
      phon:HeadPhon),
goal> phon_append(SubjPhon,HeadPhon,MotherPhon).


head_complement_rule rule
(phrase, phon:MotherPhon,
         synsem:(category:(
                           subcat:(ne_list))
                 ),
 dtr1:Comp, dtr2:Head)
   ===>
cat> (Head,
      phon:HeadPhon),
cat> (Comp,
      phon:CompPhon),
goal> phon_append(HeadPhon,CompPhon,MotherPhon).



% Principles

% Semantics Principle
phrase *> (synsem:content:C, 
           dtr2:synsem:content:C).

% Head Feature Principle
phrase *> (synsem:category:head:H, 
           dtr2:synsem:category:head:H).

% Subcategorization Principle (first version)
phrase *> (synsem:category:subcat:PhrSubcat,
           dtr1:synsem:Synsem,
           dtr2:synsem:category:subcat:[Synsem|PhrSubcat]).

%----------------------

phon_append([],[],[]) if !, true.
phon_append([],[H|T1],[H|T2]) if phon_append([],T1,T2).
phon_append([H|T1],L,[H|T2]) if phon_append(T1,L,T2).



