% A grammar with left-recursion}
% grambhgrnleftrec.pl

s ---> [np, vp].
vp ---> [v].
vp ---> [v, np].
vp ---> [vp, pp].     %left-recursive
pp ---> [p, np].
np ---> [np, pp].     %left-recursive

np ===> [toby].
np ===> [scotch].
np ===> [drinks].
np ===> [ice].
v ===> [drinks].
p ===> [on].