[ Type Testing | Reference Manual | Alphabetic Index ]
Succeeds if Term is acyclic (finite)
- Arbitrary term
Used to test whether Term is acyclic (a finite tree).
Fails if Term is cyclic (an infinite, rational tree).
Modes and Determinism
- acyclic_term(?) is semidet
Fails if Term is cyclic
?- X = f(f(a)), acyclic_term(X).
X = f(f(a))
Yes (0.00s cpu)
?- X = f(X), acyclic_term(X).
No (0.00s cpu)
% could be used to simulate occurs check
unify_with_occurs_check(X, X) :- acyclic_term(X).