Maxima Function
makeset (expr, x, s)
Returns a set with members generated from the expression expr, where x is a list of variables in expr, and s is a set or list of lists. To generate each set member, expr is evaluated with the variables x bound in parallel to a member of s.
Each member of s must have the same length as x. The list of variables x must be a list of symbols, without subscripts. Even if there is only one symbol, x must be a list of one element, and each member of s must be a list of one element.
Examples:
(%i1) makeset (i/j, [i, j], [[1, a], [2, b], [3, c], [4, d]]); 1 2 3 4 (%o1) {-, -, -, -} a b c d (%i2) S : {x, y, z}$ (%i3) S3 : cartesian_product (S, S, S); (%o3) {[x, x, x], [x, x, y], [x, x, z], [x, y, x], [x, y, y], [x, y, z], [x, z, x], [x, z, y], [x, z, z], [y, x, x], [y, x, y], [y, x, z], [y, y, x], [y, y, y], [y, y, z], [y, z, x], [y, z, y], [y, z, z], [z, x, x], [z, x, y], [z, x, z], [z, y, x], [z, y, y], [z, y, z], [z, z, x], [z, z, y], [z, z, z]} (%i4) makeset (i + j + k, [i, j, k], S3); (%o4) {3 x, 3 y, y + 2 x, 2 y + x, 3 z, z + 2 x, z + y + x, z + 2 y, 2 z + x, 2 z + y} (%i5) makeset (sin(x), [x], {[1], [2], [3]}); (%o5) {sin(1), sin(2), sin(3)}