Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to explain first argument of phrase/2 better #10

Open
Anniepoo opened this issue Oct 3, 2016 · 0 comments
Open

Need to explain first argument of phrase/2 better #10

Anniepoo opened this issue Oct 3, 2016 · 0 comments

Comments

@Anniepoo
Copy link
Owner

Anniepoo commented Oct 3, 2016

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”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant