[ library(tentative) | Reference Manual | Alphabetic Index ]
tent_set_random(?Vars, ++Values)
Set the tentative value of each variable within Vars to a random value from the given Range
- Vars
- A term
- Values
- Specification of possible values
Description
Assign to each variable in Vars a random value from the given
specification of possible values. The Values specification can be
- Min..Max
- A range of integers from Min to Max
- List
- A list of possible values
- Array
- An array of possible values
Modes and Determinism
- tent_set_random(?, ++) is det
Examples
?- length(L, 5), tent_set_random(L, 1 .. 9).
L = [Xi{2 -> 0}, Xi{3 -> 0}, Xi{7 -> 0}, Xi{5 -> 0}, Xi{3 -> 0}]
Yes (0.00s cpu)
?- length(L, 5), tent_set_random(L, [a, e, i, o, u]).
L = [Xi{o -> 0}, Xi{e -> 0}, Xi{o -> 0}, Xi{e -> 0}, Xi{e -> 0}]
Yes (0.00s cpu)
?- length(L, 5), tent_set_random(L, [](a, e, i, o, u)).
L = [Xi{u -> 0}, Xi{i -> 0}, Xi{a -> 0}, Xi{o -> 0}, Xi{a -> 0}]
Yes (0.00s cpu)
See Also
tent_set / 2, tent_set_all / 2