
(/VERSIONCHECK 2) 

(DEFUN |GRAY;firstSubsetGray;PiV;1| (|n| $)
  (PROG (|vv| |i| #0=#:G1820)
    (RETURN
      (SEQ (LETT |vv| (SPADCALL 2 #() (QREFELT $ 9))
                 . #1=(|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 . #1#) (LETT #0# (+ |n| 1) . #1#) G190
                (COND ((QSGREATERP |i| #0#) (GO G191)))
                (SEQ (EXIT (SPADCALL (SPADCALL |vv| 2 (QREFELT $ 13))
                               |i| |i| (QREFELT $ 14))))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (EXIT |vv|))))) 

(DEFUN |GRAY;nextSubsetGray;VPiV;2| (|vv| |n| $)
  (PROG (|subs| |lab| |c|)
    (RETURN
      (SEQ (LETT |subs| (SPADCALL |vv| 1 (QREFELT $ 13))
                 . #0=(|GRAY;nextSubsetGray;VPiV;2|))
           (LETT |lab| (SPADCALL |vv| 2 (QREFELT $ 13)) . #0#)
           (LETT |c| (SPADCALL |lab| 1 (QREFELT $ 17)) . #0#)
           (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| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1825)
        (RETURN
          (COND
            ((LETT #0# (HGET |$ConstructorCache| '|GrayCode|)
                   . #1=(|GrayCode|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache| '|GrayCode|
                                   (LIST
                                    (CONS NIL (CONS 1 (|GrayCode;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#) (HREM |$ConstructorCache| '|GrayCode|))))))))))) 

(DEFUN |GrayCode;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|GrayCode|) . #0=(|GrayCode|))
        (LETT $ (GETREFV 19) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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) 
