Always struggled to find an application of this construct.
Seems that SQL outer joins are easily implemented using *->, at least with manual binding of NULL variables, like done in this SO answer.

Did you know ... | Search Documentation: |

Predicate *->/2 |

Availability:built-in

`call(Condition)`

,
`\+`

`call(Condition)`

and
The construct `A` `*->`

`B`, i.e.,
without an `Else` branch, the semantics is the same as (`call(A)`

, `B`).

This construct is rarely used. An example use case is the implementation of optional in sparql. The optional construct should preserve all solutions if the argument succeeds as least once but still succeed otherwise. This is implemented as below.

optional(Goal) :- ( Goal *-> true ; true ).

Now calling e.g., `optional(member(X, [a,b]))`

has the
solutions
`X=a` and `X=b`, while `optional(member(X,[]))`

succeeds without binding `X`.

Tag confusing pages with **doc-needs-help**|Tags are associated to your profile if you are logged in

Tags:

Always struggled to find an application of this construct.
Seems that SQL outer joins are easily implemented using *->, at least with manual binding of NULL variables, like done in this SO answer.