Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackOverflowError with infinite terms #124

Open
s-webber opened this issue Sep 2, 2018 · 1 comment
Open

StackOverflowError with infinite terms #124

s-webber opened this issue Sep 2, 2018 · 1 comment
Assignees

Comments

@s-webber
Copy link
Owner

s-webber commented Sep 2, 2018

Infinite terms (also known as "cyclic terms") cause a StackOverflowError.

Example:

X = p(X).
@s-webber s-webber self-assigned this Sep 2, 2018
s-webber added a commit that referenced this issue Sep 2, 2018
Added unit-test to confirm that a StackOverflowError is thrown when
using infinite terms (also known as "cyclic terms").
@s-webber
Copy link
Owner Author

s-webber commented Oct 27, 2018

Note that the unify_with_occurs_check/2 predicate can be used instead of =/2 to guard against the creation of cyclic terms during unification. #157

Examples:

?- unify_with_occurs_check(X, p(Y)).

X = p(Y)
Y = Y

yes

?- unify_with_occurs_check(X, p(X)).

no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant