sentence(Tokens, Rest) :-
    nounphrase(Tokens, More),
    verbphrase(More, Rest).

nounphrase(Tokens, Rest) :-
    determiner(Tokens, More),
    noun(More, Rest).

nounphrase(Tokens, Rest) :-
    propernoun(Tokens, Rest).

verbphrase(Tokens, Rest) :-
    verb(Tokens, Rest).

verbphrase(Tokens, Rest) :-
    verb(Tokens, More),
    nounphrase(More, Rest).

verbphrase(Tokens, Rest) :-
    verb(Tokens, More),
    nounphrase(More, More2),
    nounphrase(More2, Rest).

determiner([the | Rest], Rest).

determiner([a | Rest], Rest).

noun([man | Rest], Rest). 

noun([apple | Rest], Rest).

noun([snake | Rest], Rest).

verb([eats | Rest], Rest). 

verb([sings | Rest], Rest).

verb([gives | Rest], Rest).

propernoun([eve | Rest], Rest). 

propernoun([adam | Rest], Rest). 
