[ library(tentative) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

# vs_random(+VS, -Var)

Retrieve a random variable from a varset

VS
  A varset
Var
  Tentative variable (output)

## Description

Retrieve a random variable from a varset.

### Modes and Determinism

- vs_random(+, -) is semidet

## 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