7.6 Other Relations

true()

Always succeeds.
rel true()

false()

Always fails.
rel false()

Term1 = Term2

Succeeds if Term1 and Term2 unify.

Any function calls in each argument term are evaluated first using strict evaluation - expression arguments evaluated first - as with every relation call.
rel =(??term, ??term)

Term1 =@ Term2

Succeeds if Term1 and Term2 unify without instantiating variables in Term2 (one-sided unification).
rel =@(??term, @term)

N1 > N2

Succeeds if N1 is numberically greater than N2.
rel >(!num, !num)

N1 >= N2

Succeeds if N1 is numberically greater than or equal to N2.
rel >=(!num, !num)

N1 < N2

Succeeds if N1 is numberically less than N2.
rel <(!num, !num)

N1 =< N2

Succeeds if N1 is numberically less than or equal to N2.
rel =<(!num, !num)

X in T

Succeeds if X is a term and T is a list, tuple, or set of terms and X is an element of T or if X and T are both strings and X is a single character string occurring in T.

rel ?T in !list(T),
    ??T in !list(??T),
    ?T in !tuple(T),
    ??T in !tuple(??T),
    ?T in !set(T),
    ?string in !string

string2term(S, T)

Succeeds if T is the term obtained by parsing the string S as a QuLog term.
rel string2term(!string, ??term)

This can raise exceptions for the same reasons as read_term. For example

| ?? string2term("f(a)", X).

QuLog exception - exception term: string2term_type_error()

this_thread_name(Name)

Succeeds if Name is the name of this thread
this_thread_name : rel(?atom)


On This Site