# ISO Prolog Part 3 (Definite clause grammar rules)

**URL:** https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348
**Category:** General
**Created:** [August 30, 2021, 1:32pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348 "2021-08-30T13:32:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bagnara](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/bagnara/32/28_2.png) [@bagnara](https://swi-prolog.discourse.group/u/bagnara)
#### Post date: [August 30, 2021, 1:32pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/1 "2021-08-30T13:32:16Z")

</div>

Hi there.

I am interested to know what readers of this list think about

> ISO/IEC NP TS 13211-3 NPOSA UNI/CT 524 2021-11-07  
> Information technology  
> Programming languages  
> Part 3: Definite clause grammar rules

Please see attached draft.  
Kind regards,

```
Roberto

```

(Attachment dcgsdraft-2021-08-16.pdf is missing)

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)
#### Post date: [August 30, 2021, 1:44pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/2 "2021-08-30T13:44:47Z")

</div>

> [@bagnara](#):
>
> (Attachment dcgsdraft-2021-08-16.pdf is missing)

The reason the PDF was not uploaded was because the site setting for authorized extensions that can be uploaded does not include `pdf`. Last I recall it was decided not to allow PDFs to be uploaded.

* * *

Here is a link for those interested:

> **[dcgsdraft-2021-08-16.pdf](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dcgs/dcgsdraft-2021-08-16.pdf)**
>
> 166.51 KB

* * *

For more historical information see the full directory from which the document comes.

[Index of /ulrich/iso-prolog/dcgs](https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dcgs/)

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [August 30, 2021, 2:29pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/4 "2021-08-30T14:29:26Z")

</div>

> [@bagnara](#):
>
> I am interested to know what readers of this list think about

A quick read suggests it formalizes current practice. It is not easy to assess whether SWI-Prolog fully complies to all this. Would be nice if there are test cases that allow making this assessment. Overall, I’m in favor of complying unless there is a good reason not to.

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)
#### Post date: [August 30, 2021, 2:37pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/5 "2021-08-30T14:37:29Z")

</div>

> [@jan](#):
>
> Would be nice if there are test cases that allow making this assessment.

Writing the test cases for conformance seems easy enough (use code examples in the document) but I have little idea of how to test for nonconformance, any suggestions.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [August 30, 2021, 3:00pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/6 "2021-08-30T15:00:26Z")

</div>

Having the examples as unit tests is nice to have. Note that [swipl-devel/test\_dcg.pl at 8c3b93b998d7e5fd318dd10c8b1cb7922f3c054c · SWI-Prolog/swipl-devel · GitHub](https://github.com/SWI-Prolog/swipl-devel/blob/8c3b93b998d7e5fd318dd10c8b1cb7922f3c054c/src/Tests/core/test_dcg.pl) is already written by Ulrich based on an older draft. Hopefully (and likely) not much changed.

---

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)
#### Post date: [August 30, 2021, 6:47pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/9 "2021-08-30T18:47:36Z")

</div>

> [@jan](#):
>
> Having the examples as unit tests is nice to have. Note that [swipl-devel/test\_dcg.pl at 8c3b93b998d7e5fd318dd10c8b1cb7922f3c054c · SWI-Prolog/swipl-devel · GitHub](https://github.com/SWI-Prolog/swipl-devel/blob/8c3b93b998d7e5fd318dd10c8b1cb7922f3c054c/src/Tests/core/test_dcg.pl) is already written by Ulrich based on an older draft.

Talked to Ulrich via e-mail and he noted about the document

> It is the first draft towards a TS.

So I don’t plan to do test cases for a draft but if it does reach a final document will take a look again. 😐

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [August 30, 2021, 7:36pm UTC](https://swi-prolog.discourse.group/t/iso-prolog-part-3-definite-clause-grammar-rules/4348/11 "2021-08-30T19:36:54Z")

</div>

> [@EricGT](#):
>
> It is the first draft towards a TS.

Then there is no reason to hurry. DCGs have been on the ISO agenda since I joined the discussions, probably 20 years ago 🙂 We’ve seen various different approaches, none of which succeeded. I have the impression there is a fair compatibility among the current implementations. I might be wrong as I surely do no know all of them.
