Questions tagged [occurs-check]

The occurs-check is a part of algorithms for syntactic unification. Prolog implementations usually omit the occurs-check for reasons of efficiency, which can lead to circular data structures and looping. But an implementation specific Prolog flag might enable occurs check and a variety of optimizations can render it feasible for common cases.

16 questions
-1
votes
1 answer

How bootstrap setarg_with_occurs_check/3 in Prolog?

How would one go about and bootstrap setarg_with_occurs_check/3 in Prolog. It seems Prolog has two ways to create cyclic data structures. Not only unification can do that, but also setarg/3: /* SWI-Prolog 8.3.26 */ ?- X = f(X). X = f(X). ?- X =…
user502187
1
2