lib(sd)


    Overview
    
    This is a simple library implementing variables and constraints over
    atomic values.  Its main purpose is for first experiments with constraint
    solving.  Moreover, those interested in writing their own constraint
    solvers can use the source code of this library as a starting point.
    Domains
    Domains are declared by giving a list of possible values for a variable,
    e.g.
    
    	?- X &:: [red, green, blue].
	X = X{[blue, green, red]}
	Yes (0.00s cpu)
    
    A variable that has been given a domain can only be instantiated to
    values from this domain. Any attempt to instantiate the variable to
    a non-domain value will cause failure:
    
    	?- X &:: [red, green, blue], X = red.
	X = red
	Yes (0.00s cpu)
    	?- X &:: [red, green, blue], X = yellow.
	No (0.00s cpu)
    
    Basic Constraints
    There are only two basic constraints, equality and disequality:
    
    X &= YX is the same as Y
    X &\= YX is different from Y
    
    Both constraints exist in a reified form:
    
    &=(X,Y,Bool)Bool is the truth value (0/1) of X &= Y
    &\=(X,Y,Bool)Bool is the truth value (0/1) of X &\= Y
    
    
    Global Constraints
    One derived, global constraint is implemented:
    
    alldifferent(List)All list elements are different
    
    Search
    Domain variables can be instantiated to their domain values using
    
    indomain(X)enumerate values of X
    labeling(Xs)enumerate values of all elements of list Xs
    
    

