[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

logbitp vs. logand+ash



I wonder if anyone has seen/can see this problem, that is,
(logbitp p i) != (/= (logand i (ash 1 p)) 0).

I'm running akcl-1-615 (installed for sVr3 w/ gcc-1.40) under sVr4.  The code
that caused the problem and a sample script output are given below.

Thanks.

Wei Jen Yeh

(defun is_visited (graph state visited)
  (let ((state_index (graph-state_index graph))
        (state_array (graph-state_array graph)))
       (format T "is_visited (~A, ~A) ~A, ~A: ~A ~A ~A ~A~%"
               (state_string state)
               visited
               (logbitp (ec_state_index graph state) visited) ; wrong rslt
               (/= (logand visited (ash 1 (ec_state_index graph state)))
                   0)
               (gethash state state_index)
               (ec_state_index graph state)
               (state_string (aref state_array (ec_state_index graph state)))
               (mapcar #'state_string (bvec_to_list graph visited))))
;  (logbitp (ec_state_index graph state) visited)
   (/= (logand visited (ash 1 (ec_state_index graph state)))
       0)
)

==> is_visited (<11.11>, 4398046511104) T, NIL: 66 66 <11.11> (<10.11>)