Skip to content

Commit

Permalink
Another case issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpgoldman committed Feb 12, 2024
1 parent 061a3f8 commit ab3fc03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions shop3/common/state-utils.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -322,20 +322,20 @@ using MAKE-INITIAL-STATE.")
(setf subtable (make-hash-table :test #'equal))
(setf (gethash (first atom) (state-body st)) subtable))
(if (= (length atom) 1)
(pushnew t (gethash +SINGLETON-TERM+ subtable))
(pushnew t (gethash +singleton-term+ subtable))
(pushnew (rest atom) (gethash (second atom) subtable) :test 'equal))))

(defmethod remove-atom (atom (st doubly-hashed-state))
(let* ((statebody (state-body st))
(subtable (gethash (first atom) statebody)) ; hash-table
(sub-key (if (> (length atom) 1)
(second atom)
+SINGLETON-TERM+))
+singleton-term+))
(subtable-entry (when subtable
(gethash sub-key subtable)))) ; list
(cond ((null subtable) (values)) ;no-op
((null subtable-entry) (values))
((eq sub-key +SINGLETON-TERM+) (remhash sub-key subtable))
((eq sub-key +singleton-term+) (remhash sub-key subtable))
(t
(setf (gethash sub-key subtable)
(delete
Expand All @@ -348,7 +348,7 @@ using MAKE-INITIAL-STATE.")
(acc nil))
(maphash #'(lambda (pred subtable)
(maphash #'(lambda (first-arg lis)
(if (eq first-arg +SINGLETON-TERM+)
(if (eq first-arg +singleton-term+)
(push `(,pred) acc)
(setf acc
(append (mapcar #'(lambda (entry) (cons pred entry)) lis)
Expand Down

0 comments on commit ab3fc03

Please sign in to comment.