%%% affhop2.pl
%%%
%%% Second Affix Hopping Grammar
%%% (Testing for use in CL1 course)
%%%
%%% Tom Cornell
%%% November 15, 1999
%%%
%%% Uses DCG formalism. (See especially the verbal
%%% paradigms.)
%%%
%%% Note that we are only concerned here with
%%% transitive verbs in the 3rd person singular.

%%% Negation:
%%% Have an explicit T category that goes to []
%%% in a positive declarative (and imperative)
%%% S, but expands as do_X in a negative or
%%% interrogative S.
%%%    Won't that yield "John does have gone"?
%%% This really does argue for the existence of
%%% an explicit position, to which some verbal
%%% elements can move and some (most) can't.
%%%
%%% pred_neg --> (have,neg,p_perf ; do,neg,p_base ; ...)



rec( Sentence ):-
        s( Sentence, [] ).


s --> subject, predicate.



subject --> [the,hero].
subject --> [the,villain].



predicate --> 
        p_present.
predicate -->
        p_past.
predicate -->
        modal,
        p_base.
        

p_present -->
        (   have_present,
            p_perf
        ;
            be_present,
            p_prog
        ;
            be_present,
            p_passive
        ;
            verb_present,
            direct_object
        ).


p_past -->
        (   have_past,
            p_perf
        ;
            be_past,
            p_prog
        ;
            be_past,
            p_passive
        ;
            verb_past,
            direct_object
        ).

            
p_base -->
        (   have_base,
            p_perf
        ;
            be_base,
            p_prog
        ;
            be_base,
            p_passive
        ;
            verb_base,
            direct_object
        ).

            
p_perf -->
        (   be_perf,
            p_prog
        ;
            be_perf,
            p_passive
        ;
            verb_perfective,
            direct_object
        ).




p_prog -->
        (   be_prog,
            p_passive
        ;
            verb_progressive,
            direct_object
        ).


p_passive -->
        verb_passive.       






direct_object --> [the,hero].
direct_object --> [the,villain].



%%%===( The Lexicon )============================

%%%---( Modals )

modal --> [will].
modal --> [must].


%%%---( Auxiliary ``have'' )

have_present --> [has].
have_past --> [had].
have_base --> [have].

%%%---( Auxiliary ``be'' )

be_perf --> [been].
be_present --> [is].
be_past --> [was].
be_base --> [be].
be_prog --> [being].

%%%---( Main Verbs )
%%%
%%% Verbal paradigms are given in unit clauses
%%% of the form
%%%
%%%    verb(Base,Pres,Past,PresPart,PastPart).
%%%
%%% Note that these are *morphological*
%%% categories. So, for example, both perfective
%%% aspect and passive voice make use of the same
%%% morphological form of the verb.

verb_passive --> [W], {verb(_,_,_,_,W)}.
verb_progressive --> [W], {verb(_,_,_,W,_)}.
verb_perfective --> [W], {verb(_,_,_,_,W)}.
verb_present --> [W], {verb(_,W,_,_,_)}.
verb_past --> [W], {verb(_,_,W,_,_)}.
verb_base --> [W], {verb(W,_,_,_,_)}.


verb( watch,                    % base
      watches,                  % present
      watched,                  % past
      watching,                 % present participle
      watched ).                % past participle

verb( pursue,
      persues,
      persued,
      persuing,
      persued ).

verb( capture,
      captures,
      captured,
      capturing,
      captured ).

verb( entertain,                
      entertains,             
      entertained,           
      entertaining,          
      entertained ).        





