anchor.diff:  
   (defun create-state-variables (functions type-objects)
     "Create all state variables from `PREDICATES' applied to `OBJECTS'"
  -  (let ((variable-type (make-hash-table :test #'equal)))
  -    (dolist (f functions)
  -      ;; apply p to all valid arguments
  -      (dolist (args (collect-args (pddl-function-arguments f)
  -                                  type-objects))
  -        (let ((var (cons (pddl-function-name f) args)))
  -          (setf (gethash var variable-type) (pddl-function-type f)))))
  -    variable-type))
  +  (fold (lambda (map f)
  +          (fold (lambda (map args)
  +                  (tree-map-insert map
  +                                   (cons (pddl-function-name f) args)
  +                                   (pddl-function-type f)))
  +                map
  +                (collect-args (pddl-function-arguments f)
  +                              type-objects)))
  +        (make-tree-map #'gsymbol-compare)
  +        functions))
  +
  +
  +
  +  ;; (let ((variable-type (make-hash-table :test #'equal)))
  +  ;;   (dolist (f functions)
  +  ;;     ;; apply p to all valid arguments
  +  ;;     (dolist (args (collect-args (pddl-function-arguments f)
  +  ;;                                 type-objects))
  +  ;;       (let ((var (cons (pddl-function-name f) args)))
  +  ;;         (setf (gethash var variable-type) (pddl-function-type f)))))
  +  ;;   variable-type))
   
   (defun ground-derived-body (derived actual-args type-map)
     (labels ((arg-alist (dummies actuals)
  
positive.code:                                          (pddl-facts-objects facts)))
           (variable-type (create-state-variables (pddl-operators-functions operators)
                                                  type-objects))
           (ground-variables (hash-table-keys variable-type))
           (ground-operators (smt-ground-actions (pddl-operators-actions operators)
                                                 type-objects))
           (initial-true (pddl-facts-init facts))
  
negative.code:      for s in (ground-domain-variables domain)
       for v = (format-state-variable s i)
       collect (multiple-value-bind (type contains)
                   (tree-map-find types s)
                 (assert contains)
                 (smt-declare-fun v () type))))
  
  