You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two other remarks regarding phrase/2:
You write:
To execute a grammar rule, we use Prolog's built-in phrase/2 predicate.
The first argument is a DCG body.
phrase(Body, Ls) is true iff Body describes the list Ls.
BUT that first argument is the HEAD of the/a “top" rule of a DCG, isn’t it?
(It can be the head of a lower rule too of course, if you want to test/find
substructures of a DCG.)
Maybe it’s clearer to replace "iff Body describes” with "iff (sub)DCG describes”?
The text was updated successfully, but these errors were encountered:
Two other remarks regarding phrase/2:
You write:
To execute a grammar rule, we use Prolog's built-in phrase/2 predicate.
The first argument is a DCG body.
phrase(Body, Ls) is true iff Body describes the list Ls.
BUT that first argument is the HEAD of the/a “top" rule of a DCG, isn’t it?
(It can be the head of a lower rule too of course, if you want to test/find
substructures of a DCG.)
Maybe it’s clearer to replace "iff Body describes” with "iff (sub)DCG describes”?
The text was updated successfully, but these errors were encountered: