
(/VERSIONCHECK 2) 

(DEFUN |GRAY;firstSubsetGray;PiV;1| (|n| $)
  (PROG (#1=#:G666 |i| |vv|)
    (RETURN
     (SEQ
      (LETT |vv| (SPADCALL 2 #() (QREFELT $ 9))
            . #2=(|GRAY;firstSubsetGray;PiV;1|))
      (SPADCALL |vv| 1 (SPADCALL |n| 0 (QREFELT $ 11)) (QREFELT $ 12))
      (SPADCALL |vv| 2 (SPADCALL (+ |n| 1) 1 (QREFELT $ 11)) (QREFELT $ 12))
      (SEQ (LETT |i| 1 . #2#) (LETT #1# (+ |n| 1) . #2#) G190
           (COND ((QSGREATERP |i| #1#) (GO G191)))
           (SEQ
            (EXIT
             (SPADCALL (SPADCALL |vv| 2 (QREFELT $ 13)) |i| |i|
                       (QREFELT $ 14))))
           (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 $ 13))
            . #1=(|GRAY;nextSubsetGray;VPiV;2|))
      (LETT |lab| (SPADCALL |vv| 2 (QREFELT $ 13)) . #1#)
      (LETT |c| (SPADCALL |lab| 1 (QREFELT $ 17)) . #1#)
      (SPADCALL |lab| 1 1 (QREFELT $ 14))
      (COND
       ((EQL (SPADCALL |subs| |c| (QREFELT $ 17)) 0)
        (SPADCALL |subs| |c| 1 (QREFELT $ 14)))
       ('T (SPADCALL |subs| |c| 0 (QREFELT $ 14))))
      (SPADCALL |lab| |c| (SPADCALL |lab| (+ |c| 1) (QREFELT $ 17))
                (QREFELT $ 14))
      (SPADCALL |lab| (+ |c| 1) (+ |c| 1) (QREFELT $ 14)) (EXIT |vv|))))) 

(DEFUN |GrayCode| #1=()
  (PROG #1#
    (RETURN
     (PROG (#2=#:G671)
       (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 19) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|GrayCode| NIL (CONS 1 $))
      (|stuffDomainSlots| $)
      $)))) 

(MAKEPROP '|GrayCode| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|NonNegativeInteger|) (|Vector| 10)
              (|Vector| 7) (0 . |new|) (|Integer|) (6 . |new|) (12 . |setelt|)
              (19 . |elt|) (25 . |setelt|) (|PositiveInteger|)
              |GRAY;firstSubsetGray;PiV;1| (32 . |elt|)
              |GRAY;nextSubsetGray;VPiV;2|)
           '#(|nextSubsetGray| 38 |firstSubsetGray| 44) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 18
                                                 '(2 8 0 6 7 9 2 7 0 6 10 11 3
                                                   8 7 0 10 7 12 2 8 7 0 10 13
                                                   3 7 10 0 10 10 14 2 7 10 0
                                                   10 17 2 0 8 8 15 18 1 0 8 15
                                                   16)))))
           '|lookupComplete|)) 

(MAKEPROP '|GrayCode| 'NILADIC T) 
