Querying and tracing a DCG
You can download the DCG that we saw in the lecture here.
Load it and 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
Play with the DCG a bit: ask some queries and maybe do a trace.