Constrains a variable, or a list or submatrix of variables, to be in the domain Domain. Domain must be the name of a previously declared domain (see domain/1), or a sub-domain, expressed as a list of values from a single domain. A domain variable can only be instantiated to values within its domain.
Note that, on the left hand side of &::/2, the atom [] is not interpreted as the empty list but as a potential domain element.
?- X &:: weekday. X = X{[mo, tu, we, th, fr, sa, su]} Yes (0.00s cpu) ?- [X,Y,we] &:: weekday. X = X{[mo, tu, we, th, fr, sa, su]} Y = Y{[mo, tu, we, th, fr, sa, su]} Yes (0.00s cpu) ?- dim(M,[3]), M[1..3] &:: weekday. M = [](_306{[mo, tu, we, th, fr, sa, su]}, ...) Yes (0.00s cpu) ?- [X,Y] &:: [we,fr,su]. X = X{[we, fr, su]} Y = Y{[we, fr, su]} ?- X &:: []. No (0.00s cpu)