[ library(ic_symbolic) | Reference Manual | Alphabetic Index ]

?X &= ?Y

X is the same domain value as Y
X
variable or domain value
Y
variable or domain value

Description

Constrains X and Y to be the same. This is almost the same as unifying X and Y, except that &=/2 raises errors when X and Y are domain-less (where unification succeeds) or when the domains of X and Y are incompatible (where unification fails).

Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

Examples

    ?- [X, Y] &:: weekday, X &= Y.
    X = X{[mo, tu, we, th, fr, sa, su]}
    Y = X{[mo, tu, we, th, fr, sa, su]}
    Yes (0.01s cpu)

    ?- th &= th.
    Yes (0.00s cpu)

    ?- X &= th.
    X = th
    Yes (0.00s cpu)

    ?- fr &= th.
    No (0.00s cpu)

    ?- X &= Y.
    Arguments have no domains in X &= Y in module eclipse
    Abort

    ?- X &:: weekday, X &= red.
    Arguments have different domains (weekday,colour) in X &= red ...
    Abort
    

See Also

&= / 3, &< / 2, &> / 2, &=< / 2, &>= / 2, &\= / 2, shift / 3, rotate / 3