Simple extensions to the DCG
Load this DCG type listing. You will see that Prolog translated the user friendly --> notation to its internal DCG format.
To find out whether a list words L is a sentence, you have to ask the query s(L,[]). But you can also ask whether it is a noun phrase by asking np(L,[]), or whether it starts with a noun phrase by asking np(L,Rest).
Play with the DCG a bit: ask some queries and maybe do a trace.
Now make some simple extensions to this DCG. For example: