# Implementing Quine's algorithm

**URL:** <https://swi-prolog.discourse.group/t/implementing-quines-algorithm/2830>\
**Category:** Algorithm\
**Tags:** how-to\
**Created:** [August 26, 2020, 3:54pm UTC](https://swi-prolog.discourse.group/t/implementing-quines-algorithm/2830 "2020-08-26T15:54:21Z")\
**Posts on this page:** 1\
**Showing post:** 156

<div class="post-metadata">

**Author:** ![joseph-vidal-rosset](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/joseph-vidal-rosset/32/2594_2.png) [@joseph-vidal-rosset](https://swi-prolog.discourse.group/u/joseph-vidal-rosset)\
**Post date:** [September 4, 2020, 12:41pm UTC](https://swi-prolog.discourse.group/t/implementing-quines-algorithm/2830/156 "2020-09-04T12:41:52Z")

</div>

> [@anon95304481](#):
>
> Can your program solve this? You need to implement [sat/1](https://www.swi-prolog.org/pldoc/doc_for?object=sat/1) + [labeling/1](https://www.swi-prolog.org/pldoc/doc_for?object=labeling/1), to list the positive answer. Or then realize [sat/1](https://www.swi-prolog.org/pldoc/doc_for?object=sat/1) + [sat\_count/2](https://www.swi-prolog.org/pldoc/doc_for?object=sat_count/2).

I must tell you frankly Jan that even if I am really interested by your question, I am afraid to miss time. Feel free to use the file quine-boole.pl that I just published. I plan to pubish another question here, on another webpage about Wang’s algorithm in Prolog. This work has been done and published [here](https://github.com/benhuds/wangs-algorithm) by Ben Hudson, and the prover seems to me correct, but it can certainly be still improved by good Prolog programmers:  
See now:

> [@Improving Wang's algorithm in Prolog](https://swi-prolog.discourse.group/t/improving-wangs-algorithm-in-prolog/2872/2):
>
> Use format/2,3 instead of write/1. Your way with write/1 help\_01 :- write('-----------------------------------------------------------'),nl, write('\nA Propositional Theorem Prover using Wang\'s Algorithm\n'), write(' \tby Ben Hudson\n\n'), write('-----------------------------------------------------------'),nl, write('To test the validity of your formula with Wang\'s algorithm:\n'), write('- First, write "wang." and press Enter.\n'), write('- Second, with this usua…

---

_[View the full topic](https://swi-prolog.discourse.group/t/implementing-quines-algorithm/2830)._
