# =\>, is this "forward chaining"

**URL:** <https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593>\
**Category:** Help!\
**Tags:** ssu\
**Created:** [February 11, 2021, 8:14am UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593 "2021-02-11T08:14:53Z")\
**Posts on this page:** 9\
**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 11, 2021, 8:14am UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/1 "2021-02-11T08:14:53Z")

</div>

Hello,

I am still trying to understand the new =\>/2 operator.

Is this essentially, a simple forward chaining mechanism – how does backtracking intended to work with this.

Dan

---

<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 11, 2021, 11:49am UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/3 "2021-02-11T11:49:44Z")

</div>

How would it be forward chaining? It is just a Prolog clause with single sided unification and an implicit commit (cut). The search for rules is the same, only the matching differs. The simplest answer to forward chaining is tabling 🙂

---

<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 11, 2021, 12:10pm UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/4 "2021-02-11T12:10:59Z")

</div>

Thank you.

Yes, no “chaining” here, just some kind of “forward” …

I don’t know why i am blanking on this new construct to graps it.

Perhaps, if you can explain why its called “single sided unification” what is single sided vs. multi-sided about this, and what is multi-sided …

Is side, the side of the operator “=\>” or “:-” …

Dan

---

<div class="post-metadata">

**Author:** ![erikkaplun](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/erikkaplun/32/2659_2.png) [@erikkaplun](https://swi-prolog.discourse.group/u/erikkaplun)\
**Post date:** [October 4, 2021, 3:39pm UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/6 "2021-10-04T15:39:14Z")

</div>

Could you provide at least some explanation of or examples to the statement: _the simplest answer to forward chaining is tabling_?

---

<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:** [October 4, 2021, 4:19pm UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/9 "2021-10-04T16:19:16Z")

</div>

Would still be interesting to know how tabling enables forward chaining – if you have some thoughts on that, that would be great.

---

<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:** [October 4, 2021, 6:37pm UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/11 "2021-10-04T18:37:54Z")

</div>

Tabling could indeed be considered as an answer to forward chaining. Roughly, tabling performs backward chaining while identifying recursive calls that call the same _variant_ goal. Such goals and _delayed_. The subsequent tabling _completion phase_ identifies the delayed goals and performs forward chaining on them until fixed point is reached.

---

<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:** [October 5, 2021, 4:55am UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/12 "2021-10-05T04:55:42Z")

</div>

> [@jan](#):
>
> that call the same _variant_ goal.

Jan, what is a _same_ and a _variant_ goal … could you provide an example … can these calls be traced … to see (and learn) what happens in practice.

Dan

---

<div class="post-metadata">

**Author:** ![Boris](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/boris/32/7486_2.png) [@Boris](https://swi-prolog.discourse.group/u/Boris)\
**Post date:** [October 6, 2021, 4:26am UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/13 "2021-10-06T04:26:36Z")

</div>

Did you read:

[https://www.swi-prolog.org/pldoc/man?section=tabling-subsumptive](https://www.swi-prolog.org/pldoc/man?section=tabling-subsumptive)

[https://www.swi-prolog.org/pldoc/man?predicate=%3D@%3D/2](https://www.swi-prolog.org/pldoc/man?predicate=%3D@%3D/2)

?

---

<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:** [October 6, 2021, 5:42am UTC](https://swi-prolog.discourse.group/t/is-this-forward-chaining/3593/14 "2021-10-06T05:42:10Z")

</div>

Thank you – indeed its there …

Dan
