anchor.diff:    (with-key-stream (in key :start start :end end)
       (get-id-impl in dawg)))
   
  -(defmacro each-common-prefix ((match-id match-end)
  -                              (key dawg &key (start 0) (end `(length ,key)))
  -                              &body body)
  -  (let ((in (gensym)))
  -    `(block nil
  -       (with-key-stream (,in ,key :start ,start :end ,end)
  -         (each-common-prefix-impl 
  -          (lambda (,match-id ,match-end)
  -            (declare (positive-fixnum ,match-id)
  -                     (array-index ,match-end))
  -            ,@body)
  -          ,in ,dawg))
  -       t)))
  -
  -(defmacro each-predictive ((match-id)
  -                           (key dawg &key (start 0) (end `(length ,key)))
  -                           &body body)
  -  (let ((in (gensym)))
  -    `(block nil
  -       (with-key-stream (,in ,key :start ,start :end ,end)
  -         (each-predictive-impl 
  -          (lambda (,match-id)
  -            (declare (positive-fixnum ,match-id))
  -            ,@body)
  -          ,in ,dawg))
  -       t)))
  -
  -
   (package-alias :dawg.octet-stream)
  
positive.code: ;;; declamation
  (declaim (inline check-encoded-children get-node 
                   base chck terminal? sibling-total inc-id 
                   get-id-impl member?-impl
                   each-common-prefix-impl each-predictive-impl)
           (ftype (function #.*args-type* boolean) member?)
           (ftype (function #.*args-type* (or null positive-fixnum)) get-id))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;; auxiliary function(1)
  (defun read-array (index-path &key size element-type offset byte-order)
    (declare ((member uint4 uint8) element-type))
    (with-open-file (in index-path :element-type element-type)
      (file-position in offset)
      (let ((ary (make-array size :element-type element-type)))
  
negative.code: (defun load (index-path &key (byte-order :native))
    (declare ((or string pathname file-stream) index-path)
             ((member :native :little :big) byte-order))
    (let ((char-path (format nil "~a.char" index-path))
          (ext-path (format nil "~a.ext" index-path))
          (node-path (format nil "~a.node" index-path)))
      (make-dawg
       :node (read-array node-path :size (read-count node-path byte-order) 
                                   :element-type 'uint1 :offset 4 :byte-order byte-order)
       :ext (read-array ext-path :size (floor (read-count ext-path byte-order) 4)
                                 :element-type 'uint4 :offset 1 :byte-order byte-order)
       :char-map (read-array char-path :size #x100 :element-type 'uint1 :byte-order byte-order))))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;; auxiliary function(2)
  (declaim (inline %type))
  (defun terminal? (node) (ldb-test (byte 1 19) (the uint5 node)))
  (defun base (node) (ldb (byte 19  0) (the uint5 node)))
  (defun chck (node) (ldb (byte  7 20) (the uint5 node)))
  (defun %type (node)
    (declare (uint5 node))
    (if (ldb-test (byte 1 39) node)
        (+ 2 (ldb (byte 1 38) node))
      0))
  
  (defun sibling-total (da node)
    (case (%type node)
      (0 (ldb (byte  5 34) node))
      (2 (ldb (byte 11 27) node))
      (t (aref (dawg-ext da)
               (ldb (byte 11 27) node)))))
  
  (defun inc-id (id da node)
    (let ((terminal (if (terminal? node) 1 0))
          (sibling-total (sibling-total da node)))
      (the uint4 (+ id terminal sibling-total))))
  
  (defun arc (char dawg)
    (aref (dawg-char-map dawg) char))
  
  (defun check-encoded-children (in node dawg)
    (declare (uint5 node))
    (labels ((enc-chck ()
               (ldb (byte 7 27) node))
             (check (&aux (chck (enc-chck)))
               (or (zerop chck)
                    (and (= chck (arc (stream:read in) dawg))
                         (not (stream:eos? in))))))
      (declare (inline enc-chck check))
      (case (%type node)
        (0 (check))
        (t t))))
  
  (defun get-node (dawg index)
    (declare (dawg dawg)
             (positive-fixnum index))
    (with-slots (node) (the dawg dawg)
      (let ((n 0)
            (i (* index 5)))
        (declare (uint5 n))
        (setf (ldb (byte 8 32) n) (aref node (+ i 0))
              (ldb (byte 8 24) n) (aref node (+ i 1))
              (ldb (byte 8 16) n) (aref node (+ i 2))
              (ldb (byte 8 08) n) (aref node (+ i 3))
              (ldb (byte 8 00) n) (aref node (+ i 4)))
        n)))
  
  ;;;;;;;;;;;;;;;;;;;;;;;;
  ;;; external function(2)
  