[ library(tentative) | Reference Manual | Alphabetic Index ]

tent_set(?X, +TV)

Set X's tentative value to TV
X
Any term, typically a variable
TV
A (nonvar) term

Description

Give a variable (or several variables within a term) a tentative value. A tentative value cannot be itself a variable.

Modes and Determinism

Fail Conditions

TV is not an instance of X

Exceptions

(4)
TV is not sufficiently instantiated

Examples

    ?- tent_set(X, 27).
    X = X{27 -> 0}
    Yes (0.00s cpu)

    ?- tent_set(X, 27), tent_set(X, 99).
    X = X{99 -> 0}
    Yes (0.00s cpu)

    ?- tent_set(foo(X), foo(27)).
    X = X{27 -> 0}
    Yes (0.00s cpu)

    ?- tent_set(X, Y).
    instantiation fault in X tent_set Y
    Abort
    

See Also

tent_get / 2, has_tent_value / 1, tent_fix / 1