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

vs_random(+VS, -X)

Retrieve a random variable from a varset
VS
A varset
X
Tentative variable (output)

Description

Retrieve a random variable from a varset.

Modes and Determinism

Examples

    ?- Vars=[A,B,C], tent_set(Vars, [a,b,c]), vs_create(Vars, VS),
       vs_random(VS, Var).
    Vars = [Var{a -> 0}, B{b -> 0}, C{c -> 0}]
    VS = ...
    Var = Var{a -> 0}	% A, B or C, the result is random!
    Yes (0.00s cpu)
    

See Also

vs_create / 2, vs_element / 3, vs_random_index / 2