# \#determinism

**URL:** https://swi-prolog.discourse.group/tag/determinism/177.md

[Latest](https://swi-prolog.discourse.group/latest.md) · [Categories](https://swi-prolog.discourse.group/categories.md) · [Tags](https://swi-prolog.discourse.group/tags.md)

---

## [Goal determinism when less than 2 solutions](https://swi-prolog.discourse.group/t/goal-determinism-when-less-than-2-solutions/7252)

<div class="topic-metadata">

**Author:** [@brebs](https://swi-prolog.discourse.group/u/brebs)\
**Replies:** 2\
**Last updated:** [February 19, 2024, 9:30pm UTC](https://swi-prolog.discourse.group/t/goal-determinism-when-less-than-2-solutions/7252 "2024-02-19T21:30:07Z")

</div>

It seems common to have a predicate that produces one solution, leaving behind some choicepoints to check which then never result in a second solution, thus producing an unwanted “there may be more solutions… oh there is…

---

## [Det-if?](https://swi-prolog.discourse.group/t/det-if/7175)

<div class="topic-metadata">

**Author:** [@jan](https://swi-prolog.discourse.group/u/jan)\
**Replies:** 11\
**Last updated:** [January 24, 2024, 8:14am UTC](https://swi-prolog.discourse.group/t/det-if/7175 "2024-01-24T08:14:11Z")

</div>

Some Prolog predicates are deterministic under certain (mode) conditions. One way to program this is e.g. p(X) :- ( ground(X) -\> q(X), ! ; q(X) ). This is a bit cumbersome to write though. …
