This predicate computes the most specific generalisation of X and Y which can be represented using ic-symbolic's domains and domain variables.
If X and Y are domain variables (or constants) from the same domain, then MSG will be unified with a new domain variable whose domain consists of the union of the domain elements of X and Y.
If X and Y are domain variables or constants with incompatible domains, then the result will be a free (unconstrained) variable.
If X or Y are free (unconstrained) variables, then the result will also be a free (unconstrained) variable.
?- local domain(weekday(mo, tu, we, th, fr, sa, su)).
Yes (0.00s cpu)
?- msg(we, fr, Z).
Z = Z{[we, fr]}
Yes (0.00s cpu)
?- X &:: [sa, su], msg(X, we, Z).
X = X{[sa, su]}
Z = Z{[we, sa, su]}
Yes (0.00s cpu)
?- X &:: [sa, su], Y &:: [mo, tu, we], msg(X, Y, Z).
X = X{[sa, su]}
Y = Y{[mo, tu, we]}
Z = Z{[mo, tu, we, sa, su]}
Yes (0.00s cpu)
?- X &:: [sa, su], msg(X, _, Z).
X = X{[sa, su]}
Z = Z
Yes (0.01s cpu)
% in the following, the result is not precisely representable
?- X &:: [sa, su], msg(X, foo, Z).
X = X{[sa, su]}
Z = Z
Yes (0.01s cpu)