# Dif/2 and tabling - doesn't mix?

**URL:** <https://swi-prolog.discourse.group/t/dif-2-and-tabling-doesnt-mix/3611>\
**Category:** Help!\
**Created:** [February 16, 2021, 6:06pm UTC](https://swi-prolog.discourse.group/t/dif-2-and-tabling-doesnt-mix/3611 "2021-02-16T18:06:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)\
**Post date:** [February 16, 2021, 6:06pm UTC](https://swi-prolog.discourse.group/t/dif-2-and-tabling-doesnt-mix/3611/1 "2021-02-16T18:06:38Z")

</div>

Hello,

I noticed that when I use dif/2 instead of X \= Y, i am getting an error with tabling, such as: " …contains attributed variables"

Is it true that dif/2 (which uses attribute variables) and tabling doesn’t mix …

thanks,

Dan

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [February 16, 2021, 6:46pm UTC](https://swi-prolog.discourse.group/t/dif-2-and-tabling-doesnt-mix/3611/2 "2021-02-16T18:46:27Z")

</div>

I also stumbled into this - kind of - when attempted to phrase\_from\_file a tabled DCG.  
Thinking about it, it’s pretty reasonable…

---

<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:** [February 17, 2021, 7:41am UTC](https://swi-prolog.discourse.group/t/dif-2-and-tabling-doesnt-mix/3611/3 "2021-02-17T07:41:47Z")

</div>

Combining tabling and constraints is possible. XSB does it. Whether it is complete or comes with limitations, I do not know. Tabling involves term copying and constraints and term copying are bad friends. As is though, SWI-Prolog’s _answer tables_ (implemented as _tries_) cannot represent attributes.
