
(/VERSIONCHECK 2) 

(DEFUN |GRAY;firstSubsetGray;PiV;1| (|n| $)
  (PROG (#1=#:G1802 |i| |vv|)
    (RETURN
     (SEQ (LETT |vv| (MAKEARR1 2 #()) . #2=(|GRAY;firstSubsetGray;PiV;1|))
          (SPADCALL |vv| 1 (MAKEARR1 |n| 0) (QREFELT $ 9))
          (SPADCALL |vv| 2 (MAKEARR1 (+ |n| 1) 1) (QREFELT $ 9))
          (SEQ (LETT |i| 1 . #2#) (LETT #1# (+ |n| 1) . #2#) G190
               (COND ((QSGREATERP |i| #1#) (GO G191)))
               (SEQ
                (EXIT
                 (SPADCALL (SPADCALL |vv| 2 (QREFELT $ 10)) |i| |i|
                           (QREFELT $ 11))))
               (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |vv|))))) 

(DEFUN |GRAY;nextSubsetGray;VPiV;2| (|vv| |n| $)
  (PROG (|c| |lab| |subs|)
    (RETURN
     (SEQ
      (LETT |subs| (SPADCALL |vv| 1 (QREFELT $ 10))
            . #1=(|GRAY;nextSubsetGray;VPiV;2|))
      (LETT |lab| (SPADCALL |vv| 2 (QREFELT $ 10)) . #1#)
      (LETT |c| (SPADCALL |lab| 1 (QREFELT $ 14)) . #1#)
      (SPADCALL |lab| 1 1 (QREFELT $ 11))
      (COND
       ((EQL (SPADCALL |subs| |c| (QREFELT $ 14)) 0)
        (SPADCALL |subs| |c| 1 (QREFELT $ 11)))
       ('T (SPADCALL |subs| |c| 0 (QREFELT $ 11))))
      (SPADCALL |lab| |c| (SPADCALL |lab| (+ |c| 1) (QREFELT $ 14))
                (QREFELT $ 11))
      (SPADCALL |lab| (+ |c| 1) (+ |c| 1) (QREFELT $ 11)) (EXIT |vv|))))) 

(DEFUN |GrayCode| #1=()
  (PROG #1#
    (RETURN
     (PROG (#2=#:G1807)
       (RETURN
        (COND
         ((LETT #2# (HGET |$ConstructorCache| '|GrayCode|) . #3=(|GrayCode|))
          (|CDRwithIncrement| (CDAR #2#)))
         ('T
          (UNWIND-PROTECT
              (PROG1
                  (CDDAR
                   (HPUT |$ConstructorCache| '|GrayCode|
                         (LIST (CONS NIL (CONS 1 (|GrayCode;|))))))
                (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|GrayCode|))))))))))) 

(DEFUN |GrayCode;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
     (PROGN
      (LETT |dv$| '(|GrayCode|) . #1=(|GrayCode|))
      (LETT $ (GETREFV 16) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|GrayCode| NIL (CONS 1 $))
      (|stuffDomainSlots| $)
      (SETF |pv$| (QREFELT $ 3))
      $)))) 

(MAKEPROP '|GrayCode| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|Vector| 7) (|Integer|) (|Vector| 6)
              (0 . |setelt|) (7 . |elt|) (13 . |setelt|) (|PositiveInteger|)
              |GRAY;firstSubsetGray;PiV;1| (20 . |elt|)
              |GRAY;nextSubsetGray;VPiV;2|)
           '#(|nextSubsetGray| 26 |firstSubsetGray| 32) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 15
                                                 '(3 8 6 0 7 6 9 2 8 6 0 7 10 3
                                                   6 7 0 7 7 11 2 6 7 0 7 14 2
                                                   0 8 8 12 15 1 0 8 12 13)))))
           '|lookupComplete|)) 

(MAKEPROP '|GrayCode| 'NILADIC T) 
