anchor.diff:  ;;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   ;;;; THE SOFTWARE.
   
  -;;; $Id: species-type.lisp,v 1.28 2008/01/22 16:42:39 amallavarapu Exp $
  +;;; $Id: species-type.lisp,v 1.29 2008/01/24 19:45:18 amallavarapu Exp $
   ;;; $Name:  $
   
   ;;; File: complex-species-type.lisp
  
positive.code:     (symbol (intern (symbol-name x) :keyword))
      (t      x)))
                                                                      
  (defun make-site-info (tags &rest args &key states default connector documentation sublocation index)
    (declare (ignorable args))
    (let* ((tags      (mapcar #'keywordify
                              (if (listp tags) tags (list tags))))
           (name      (first tags))
           (connector (or connector (not (or states default))))
           (states     (or states (and (not connector) (not sublocation))))
           (default    (or default 
                           (and (member-type-p states)
                                (second states)))))
      (cond
  
       ;; attempt to provide both connector and states definitions:
       ((and states connector)
        (error "Ambiguous site definition ~S - state site or a connector site?"))
  
       ;; when it's a not a connector, check default state is valid
       ((not (or connector
                 (typep default states)))
        (error "Default state ~S is not of type ~S in site ~S"
               default states name))
  
      
       (states (make-state-site-info :tags tags :type states :default default :index index
                                     :documentation documentation))
  
       (t      (make-bond-site-info :tags tags
                                    :index index
                                    :type connector
                                    :documentation documentation
                                    :sublocation sublocation)))))
  
  (defun ensure-canonical-complex-graph (x &optional force-pattern)
    (gtools:canonical-graph
  
negative.code: 
  ;; bond sites can connect to other bond sites
  (defstruct-with-fields (bond-site-info (:include site-info))
    bonds sublocation)
  
  ;; state sites have values
  (defstruct-with-fields (state-site-info (:include site-info))
  