
  A CSP can be stated by specifying:

  1. A set of variables {V1 V2 ... Vn}

  2. A set of domains {D1 D2 ... Dn}

  3. A set of unary predicates {p1V1,p1V2,..., P1Vn}
  one   for  each    variable,   ranging  over   the
  correspondent domains

  4. A set of binary predicates
      {p2V1V2, P2V1V3,  ..., P2ViVj, ...}

  The generic  CSP  algorithm requires the  user  to
  define the boolean  functions:
 
  ---------------------------------------------------
          (defun P-1 (var value)
              <BODY>)
  this function implements the set of unary 
  predicates {p1V1, p1V2, ... P1Vn}
  Must return T or NIL
  var    must be  expected to be in {V1 V2 ... Vn}, 
  value  must be  expected to be in  {D1 D2 ... Dn}
  ---------------------------------------------------

        (defun P-2 (var1 value1 var2 value2) 
             <BODY>)
  this function implements the set of binary 
  predicates {p2V1V2, P2V1V3, ..
  Must return T or NIL
  var1 and var2 are expected to be in {V1 V2 ... Vn}, 
  value1,value2 are expected to be in {D1 D2 ... Dn}
  --------------------------------------------------

     (defun VARIABLE-DOMAIN (domain-name)
          <BODY>)
  this function must return the contents of the 
  given domain name. It is used to fill initially
  the associated domains.
  Must return a list of values
  --------------------------------------------------

  A network specification must be given to define the 
  network structure:
                    Node Domain |--Neighbors----|
  --------------------------------------------------
  (construct-network '((<V1> <D1>  <Vi> ... <Vj>)
		     (<V2> <D2>  <Vk> ... <Vl>)
		                 ...
		                 ...
		     (<Vn> <Dn>  <Vm> ... <Vp>)))
	
  where i,j,k,l,m,p range over [1..n]
  The argument for construct-network is a list of 
  node descriptors:
  <Vx> are Variable names (lisp identifier)
  <Dx> are Domain names  (lisp identifier)
  Each variable corresponds to a node in the network
  After the domain name you should put the neighbors
  of the current node.
  Let us see now a complete example of input file, 
  for a simple problem of map coloring  (see file
  "color.csp")
 
  *** A COMPLETE EXAMPLE OF INPUT FILE *****
  ========BEGINNING of FILE==================----- 
  (in-package :csp)
  (defun p-1 (var value) t)
  (defun p-2 (var1 v1 var2 v2)(not (equal v1 v2) ))
  (defun variable-domain (domain-name)
   '(red green blue black))
  (construct-network '((r1 D r2 r3 r5 r6)
		       (r2 D r1 r3 r4 r5 r6)
		       (r3 D r1 r2 r4 r6 )
		       (r4 D r2 r3)
		       (r5 D r6 r1 r2)
		       (r6 D r3 r5 r2 r1)))
  ;;optional part:
  (setq *all-distinct-values* nil)
  (setq *stop-at-sol* t)
  ======== END OF FILE =================
 