% Partial execution of a top-down parser over a grammar
% progpextddp.pl

td_parse(np, [toby | Words], Words).
td_parse(np, [scotch | Words], Words).
td_parse(np, [drinks | Words], Words).
td_parse(v, [drinks | Words], Words).

td_parse(s, Input, RemainingInput):- 
       td_parse_dtrs([np, vp] ,Input, RemainingInput).
td_parse(vp, Input, RemainingInput):- 
       td_parse_dtrs([v],Input, RemainingInput).
td_parse(vp, Input, RemainingInput):- 
       td_parse_dtrs([v, np],Input, RemainingInput).
    
  