Skip to content

Commit

Permalink
Reverse operators in get-operators-by-effect.
Browse files Browse the repository at this point in the history
Work-around for Bug #1954.
  • Loading branch information
bvds committed Mar 10, 2012
1 parent 55a1d0e commit 4cbfbaa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Knowledge/Operators.cl
Expand Up @@ -343,17 +343,21 @@
(gethash Opname *Operators-By-Name*))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; get-operators-by-effect (public)
;; get the specified operators that have effects of the specified predicate type.
;;
;; Arguments: Predicate: The predicate e.g. 'Variable' that we are seaching for.
;; Returns: A list of operators who have at least one effect of the specified type
;; ornil if noe exist.
;; Returns: A list of operators who have at least one effect of the
;; specified type or nil if none exist.

(defun get-operators-by-effect (Predicate)
"Obtain a list of operators that have an effect of the specified predicate type or nil if none exist."
(gethash Predicate *Operators-By-Effect*))
;; In principle, the order of the operators on
;; this list should not matter. However,
;; problems LMOM6 KT11B ELEC7 DR20 fail to solve
;; if order is reversed. Bug #1954
(reverse (gethash Predicate *Operators-By-Effect*)))

;; Following utility mainly for kb debugging. takes either atom or form
(defun list-ops (Predicate-or-Form)
Expand Down

0 comments on commit 4cbfbaa

Please sign in to comment.