# \#set

**URL:** https://swi-prolog.discourse.group/tag/set/85.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)

---

## [Intersection\_chk/2](https://swi-prolog.discourse.group/t/intersection-chk-2/4081)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 3\
**Last updated:** [June 16, 2021, 1:09pm UTC](https://swi-prolog.discourse.group/t/intersection-chk-2/4081 "2021-06-16T13:09:51Z")

</div>

As Jan W. notes below, one should use ordered sets and then use ord\_intersect/2 instead of the following code. :dizzy\_face: intersection\_chk(A,B) :- member(Item,A), memberchk(Item,B), !. Many Prolog programmer…
