# Clpfd: "not in" constraint

**URL:** <https://swi-prolog.discourse.group/t/clpfd-not-in-constraint/3260>\
**Category:** Predicate\
**Tags:** how-to, clpfd\
**Created:** [November 14, 2020, 4:44pm UTC](https://swi-prolog.discourse.group/t/clpfd-not-in-constraint/3260 "2020-11-14T16:44:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![softmonaut](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@softmonaut](https://swi-prolog.discourse.group/u/softmonaut)\
**Post date:** [November 14, 2020, 4:44pm UTC](https://swi-prolog.discourse.group/t/clpfd-not-in-constraint/3260/1 "2020-11-14T16:44:42Z")

</div>

Hi,

this is obviously a beginner question:  
How to write a “not in” constraint to restrict a variable possible values by supplying a list of integers to exclude from the variable’s domain?

Thx  
J

---

<div class="post-metadata">

**Author:** ![softmonaut](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@softmonaut](https://swi-prolog.discourse.group/u/softmonaut)\
**Post date:** [November 18, 2020, 3:24pm UTC](https://swi-prolog.discourse.group/t/clpfd-not-in-constraint/3260/3 "2020-11-18T15:24:14Z")

</div>

Thanks a lot!
