[ Type Testing | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

acyclic_term(?Term)

Succeeds if Term is acyclic (finite)
Term
Arbitrary term

Description

Used to test whether Term is acyclic (a finite tree). Fails if Term is cyclic (an infinite, rational tree).

Modes and Determinism

Fail Conditions

Fails if Term is cyclic

Examples

    ?- 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).

See Also