# Unexplained behaviour wrt the well founded semantics - Part 2

**URL:** <https://swi-prolog.discourse.group/t/unexplained-behaviour-wrt-the-well-founded-semantics-part-2/4164>\
**Category:** Help!\
**Created:** [July 14, 2021, 10:12pm UTC](https://swi-prolog.discourse.group/t/unexplained-behaviour-wrt-the-well-founded-semantics-part-2/4164 "2021-07-14T22:12:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christophe\_Rey](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@Christophe\_Rey](https://swi-prolog.discourse.group/u/Christophe_Rey)\
**Post date:** [July 14, 2021, 10:12pm UTC](https://swi-prolog.discourse.group/t/unexplained-behaviour-wrt-the-well-founded-semantics-part-2/4164/1 "2021-07-14T22:12:28Z")

</div>

Hi Jan,

thanks for your reply. If that can help, I’ve found another example of the same kind:

Program:

```prolog

:- table p/1 as incremental.
p(X) :- tnot(qs(X)), tnot(p(X)).
p(X) :- tnot(rs(X)), tnot(p(X)).

:- table qs/1 as incremental.
qs(X) :- q(X).
:- table rs/1 as incremental.
rs(X) :- q(X).

:- dynamic q/1 as incremental.
q(1).

```

and execution:

```prolog

?- p(1).
false.

?- retract(q(1)).
true.

?- p(1).
% WFS residual program
p(1) :-
tnot(p(1)).
p(1).

?- assert(q(1)).
true.

?- p(1).
% WFS residual program
p(1) :-
tnot(p(1)).
p(1).

```

The last answer should be false I think.

By the way, the previous example works fine in XSB, but this new example (above) works the same in XSB as in SWI.

Hope it can help.

Christophe

---

<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:** [July 15, 2021, 10:53am UTC](https://swi-prolog.discourse.group/t/unexplained-behaviour-wrt-the-well-founded-semantics-part-2/4164/2 "2021-07-15T10:53:33Z")

</div>

Thanks. Also fixed. The two problems were independent. I’ll explain to Teri and David what I think is wrong 🙂

Please keep the discussion on the public forum. The “it will take some time” was not relevant to anyone except you. Could you validate the fix and update the status at the public forum?

---

<div class="post-metadata">

**Author:** ![Christophe\_Rey](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@Christophe\_Rey](https://swi-prolog.discourse.group/u/Christophe_Rey)\
**Post date:** [July 15, 2021, 12:51pm UTC](https://swi-prolog.discourse.group/t/unexplained-behaviour-wrt-the-well-founded-semantics-part-2/4164/3 "2021-07-15T12:51:29Z")

</div>

Thank you very very much Jan. Your fixes have solved my problems.  
Cheers !
