% Simple noun phrase:
% noun_phrase([the,dog],[]). is true
% noun_phrase([dog],S). is false

article(a,[a|S],S).
article(the,[the|S],S).
noun(child,[child|S],S).
noun(dog,[dog|S],S).
noun_phrase(S0,S) :- article(A,S0,S1),noun(N,S1,S).


% Grammar:
%    S -> cAd
%    A -> a | ab

match(Term,[Term|S],S).
    
s_prod(S0,S) :- match(c,S0,S1),a_prod(S1,S2),match(d,S2,S).
a_prod(S0,S) :- match(a,S0,S).
a_prod(S0,S) :- match(a,S0,S1),match(b,S1,S).

    
