
(/VERSIONCHECK 2) 

(DEFUN |IBITS;minIndex;$I;1| (|u| $) (QREFELT $ 6)) 

(DEFUN |IBITS;range| (|v| |i| $)
  (SEQ
   (COND
    ((NULL (< |i| 0))
     (COND ((< |i| (SPADCALL |v| (QREFELT $ 10))) (EXIT |i|)))))
   (EXIT (|error| "Index out of range")))) 

(DEFUN |IBITS;coerce;$Of;3| (|v| $)
  (PROG (#1=#:G676 |i| |j| |s| |f| |t|)
    (RETURN
     (SEQ (LETT |t| (SPADCALL "1" (QREFELT $ 13)) . #2=(|IBITS;coerce;$Of;3|))
          (LETT |f| (SPADCALL "0" (QREFELT $ 13)) . #2#)
          (LETT |s|
                (MAKE-FULL-CVEC (SPADCALL |v| (QREFELT $ 10))
                                (SPADCALL (QREFELT $ 14)))
                . #2#)
          (SEQ (LETT |j| (QREFELT $ 6) . #2#)
               (LETT |i| (SPADCALL |s| (QREFELT $ 15)) . #2#)
               (LETT #1# (SPADCALL |s| (QREFELT $ 16)) . #2#) G190
               (COND ((> |i| #1#) (GO G191)))
               (SEQ
                (EXIT
                 (SPADCALL |s| |i|
                           (COND ((SPADCALL |v| |j| (QREFELT $ 18)) |t|)
                                 ('T |f|))
                           (QREFELT $ 19))))
               (LETT |i| (PROG1 (+ |i| 1) (LETT |j| (+ |j| 1) . #2#)) . #2#)
               (GO G190) G191 (EXIT NIL))
          (EXIT (SPADCALL |s| (QREFELT $ 21))))))) 

(DEFUN |IBITS;new;NniB$;4| (|n| |b| $) (BVEC-MAKE-FULL |n| (TRUTH-TO-BIT |b|))) 

(PUT '|IBITS;empty;$;5| '|SPADreplace| '(XLAM NIL (BVEC-MAKE-FULL 0 0))) 

(DEFUN |IBITS;empty;$;5| ($) (BVEC-MAKE-FULL 0 0)) 

(PUT '|IBITS;copy;2$;6| '|SPADreplace| 'BVEC-COPY) 

(DEFUN |IBITS;copy;2$;6| (|v| $) (BVEC-COPY |v|)) 

(PUT '|IBITS;#;$Nni;7| '|SPADreplace| 'BVEC-SIZE) 

(DEFUN |IBITS;#;$Nni;7| (|v| $) (BVEC-SIZE |v|)) 

(PUT '|IBITS;=;2$B;8| '|SPADreplace| 'BVEC-EQUAL) 

(DEFUN |IBITS;=;2$B;8| (|v| |u| $) (BVEC-EQUAL |v| |u|)) 

(PUT '|IBITS;<;2$B;9| '|SPADreplace| '(XLAM (|v| |u|) (BVEC-GREATER |u| |v|))) 

(DEFUN |IBITS;<;2$B;9| (|v| |u| $) (BVEC-GREATER |u| |v|)) 

(DEFUN |IBITS;and;3$;10| (|u| |v| $)
  (COND
   ((EQL (SPADCALL |v| (QREFELT $ 10)) (SPADCALL |u| (QREFELT $ 10)))
    (BVEC-AND |v| |u|))
   ('T (SPADCALL (ELT $ 28) |v| |u| (QREFELT $ 30))))) 

(DEFUN |IBITS;or;3$;11| (|u| |v| $)
  (COND
   ((EQL (SPADCALL |v| (QREFELT $ 10)) (SPADCALL |u| (QREFELT $ 10)))
    (BVEC-OR |v| |u|))
   ('T (SPADCALL (ELT $ 32) |v| |u| (QREFELT $ 30))))) 

(DEFUN |IBITS;xor;3$;12| (|v| |u| $)
  (COND
   ((EQL (SPADCALL |v| (QREFELT $ 10)) (SPADCALL |u| (QREFELT $ 10)))
    (BVEC-XOR |v| |u|))
   ('T (SPADCALL (ELT $ 34) |v| |u| (QREFELT $ 30))))) 

(DEFUN |IBITS;setelt;$I2B;13| (|v| |i| |f| $)
  (BVEC-SETELT |v| (|IBITS;range| |v| (- |i| (QREFELT $ 6)) $)
               (TRUTH-TO-BIT |f|))) 

(DEFUN |IBITS;elt;$IB;14| (|v| |i| $)
  (BIT-TO-TRUTH (BVEC-ELT |v| (|IBITS;range| |v| (- |i| (QREFELT $ 6)) $)))) 

(PUT '|IBITS;Not;2$;15| '|SPADreplace| 'BVEC-NOT) 

(DEFUN |IBITS;Not;2$;15| (|v| $) (BVEC-NOT |v|)) 

(DEFUN |IBITS;And;3$;16| (|u| |v| $)
  (COND
   ((EQL (SPADCALL |v| (QREFELT $ 10)) (SPADCALL |u| (QREFELT $ 10)))
    (BVEC-AND |v| |u|))
   ('T (SPADCALL (ELT $ 28) |v| |u| (QREFELT $ 30))))) 

(DEFUN |IBITS;Or;3$;17| (|u| |v| $)
  (COND
   ((EQL (SPADCALL |v| (QREFELT $ 10)) (SPADCALL |u| (QREFELT $ 10)))
    (BVEC-OR |v| |u|))
   ('T (SPADCALL (ELT $ 32) |v| |u| (QREFELT $ 30))))) 

(DEFUN |IndexedBits| (#1=#:G704)
  (PROG ()
    (RETURN
     (PROG (#2=#:G705)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|IndexedBits|)
                                           '|domainEqualList|)
                . #3=(|IndexedBits|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT (PROG1 (|IndexedBits;| #1#) (LETT #2# T . #3#))
            (COND ((NOT #2#) (HREM |$ConstructorCache| '|IndexedBits|))))))))))) 

(DEFUN |IndexedBits;| (|#1|)
  (PROG (#1=#:G702 #2=#:G703 |pv$| #3=#:G701 $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #4=(|IndexedBits|))
      (LETT |dv$| (LIST '|IndexedBits| DV$1) . #4#)
      (LETT $ (GETREFV 51) . #4#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| (|Boolean|)
                                                         '(|ConvertibleTo|
                                                           (|InputForm|)))
                                          (|HasCategory| (|Boolean|)
                                                         '(|OrderedSet|))
                                          (|HasCategory| (|Integer|)
                                                         '(|OrderedSet|))
                                          (LETT #3#
                                                (|HasCategory| (|Boolean|)
                                                               '(|SetCategory|))
                                                . #4#)
                                          (AND #3#
                                               (|HasCategory| (|Boolean|)
                                                              '(|Evalable|
                                                                (|Boolean|))))))
                      . #4#))
      (|haddProp| |$ConstructorCache| '|IndexedBits| (LIST DV$1) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (AND (LETT #2# (|HasCategory| $ '(|shallowlyMutable|)) . #4#)
           (|augmentPredVector| $ 32))
      (AND #2# (|HasCategory| (|Boolean|) '(|OrderedSet|))
           (|augmentPredVector| $ 64))
      (AND (LETT #1# (|HasCategory| $ '(|finiteAggregate|)) . #4#)
           (|augmentPredVector| $ 128))
      (AND #1# #3# (|augmentPredVector| $ 256))
      $)))) 

(MAKEPROP '|IndexedBits| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|Integer|)
              |IBITS;minIndex;$I;1| (|NonNegativeInteger|) |IBITS;#;$Nni;7|
              (|String|) (|Character|) (0 . |char|) (5 . |space|)
              (9 . |minIndex|) (14 . |maxIndex|) (|Boolean|) |IBITS;elt;$IB;14|
              (19 . |setelt|) (|OutputForm|) (26 . |coerce|)
              |IBITS;coerce;$Of;3| |IBITS;new;NniB$;4| |IBITS;empty;$;5|
              |IBITS;copy;2$;6| |IBITS;=;2$B;8| |IBITS;<;2$B;9| (31 . |and|)
              (|Mapping| 17 17 17) (37 . |map|) |IBITS;and;3$;10| (44 . |or|)
              |IBITS;or;3$;11| (50 . |xor|) |IBITS;xor;3$;12|
              |IBITS;setelt;$I2B;13| |IBITS;Not;2$;15| |IBITS;And;3$;16|
              |IBITS;Or;3$;17| (|List| 41) (|Equation| 17) (|List| 17)
              (|InputForm|) (|Mapping| 17 17) (|Void|) (|UniversalSegment| 7)
              (|List| 7) (|Union| 17 '"failed") (|List| $) (|SingleInteger|))
           '#(~= 56 ~ 62 |xor| 67 |swap!| 73 |sorted?| 80 |sort!| 91 |sort| 102
              |smaller?| 113 |size?| 119 |setelt| 125 |select| 139 |sample| 145
              |reverse!| 149 |reverse| 154 |removeDuplicates| 159 |remove| 164
              |reduce| 176 |qsetelt!| 197 |qelt| 204 |position| 210 |parts| 229
              |or| 234 |not| 240 |nor| 245 |new| 251 |nand| 257 |more?| 263
              |minIndex| 269 |min| 274 |merge| 280 |members| 293 |member?| 298
              |maxIndex| 304 |max| 309 |map!| 315 |map| 321 |less?| 334 |latex|
              340 |insert| 345 |indices| 359 |index?| 364 |hash| 370 |first|
              375 |find| 380 |fill!| 386 |every?| 392 |eval| 398 |eq?| 424
              |entry?| 430 |entries| 436 |empty?| 441 |empty| 446 |elt| 450
              |delete| 469 |count| 481 |copyInto!| 493 |copy| 500 |convert| 505
              |construct| 510 |concat| 515 |coerce| 538 |any?| 543 |and| 549
              |\\/| 555 |Or| 561 |Not| 567 |And| 572 >= 578 > 584 = 590 <= 596
              < 602 |/\\| 608 |#| 614)
           'NIL
           (CONS
            (|makeByteWordVec2| 5
                                '(0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 5 1))
            (CONS
             '#(|BitAggregate&| |OneDimensionalArrayAggregate&|
                |FiniteLinearAggregate&| |LinearAggregate&| |OrderedSet&|
                |Collection&| |IndexedAggregate&| NIL |HomogeneousAggregate&|
                |SetCategory&| |EltableAggregate&| |Aggregate&| |Logic&|
                |Evalable&| NIL NIL NIL NIL |BasicType&| NIL |InnerEvalable&|
                NIL)
             (CONS
              '#((|BitAggregate|) (|OneDimensionalArrayAggregate| 17)
                 (|FiniteLinearAggregate| 17) (|LinearAggregate| 17)
                 (|OrderedSet|) (|Collection| 17) (|IndexedAggregate| 7 17)
                 (|Comparable|) (|HomogeneousAggregate| 17) (|SetCategory|)
                 (|EltableAggregate| 7 17) (|Aggregate|) (|Logic|)
                 (|Evalable| 17) (|shallowlyMutable|) (|finiteAggregate|)
                 (|Eltable| 7 17) (|Type|) (|BasicType|) (|CoercibleTo| 20)
                 (|InnerEvalable| 17 17) (|ConvertibleTo| 43))
              (|makeByteWordVec2| 50
                                  '(1 12 0 11 13 0 12 0 14 1 11 7 0 15 1 11 7 0
                                    16 3 11 12 0 7 12 19 1 11 20 0 21 2 17 0 0
                                    0 28 3 0 0 29 0 0 30 2 17 0 0 0 32 2 17 0 0
                                    0 34 2 0 17 0 0 1 1 0 0 0 1 2 0 0 0 0 35 3
                                    6 45 0 7 7 1 1 2 17 0 1 2 0 17 29 0 1 1 7 0
                                    0 1 2 6 0 29 0 1 1 2 0 0 1 2 0 0 29 0 1 2 0
                                    17 0 0 1 2 0 17 0 9 1 3 6 17 0 7 17 36 3 6
                                    17 0 46 17 1 2 8 0 44 0 1 0 0 0 1 1 6 0 0 1
                                    1 0 0 0 1 1 9 0 0 1 2 9 0 17 0 1 2 8 0 44 0
                                    1 4 9 17 29 0 17 17 1 3 8 17 29 0 17 1 2 8
                                    17 29 0 1 3 6 17 0 7 17 1 2 0 17 0 7 1 2 4
                                    7 17 0 1 3 4 7 17 0 7 1 2 0 7 44 0 1 1 8 42
                                    0 1 2 0 0 0 0 33 1 0 0 0 1 2 0 0 0 0 1 2 0
                                    0 9 17 23 2 0 0 0 0 1 2 0 17 0 9 1 1 3 7 0
                                    8 2 0 0 0 0 1 2 2 0 0 0 1 3 0 0 29 0 0 1 1
                                    8 42 0 1 2 9 17 17 0 1 1 3 7 0 1 2 0 0 0 0
                                    1 2 6 0 44 0 1 2 0 0 44 0 1 3 0 0 29 0 0 30
                                    2 0 17 0 9 1 1 0 11 0 1 3 0 0 0 0 7 1 3 0 0
                                    17 0 7 1 1 0 47 0 1 2 0 17 7 0 1 1 0 50 0 1
                                    1 3 17 0 1 2 0 48 44 0 1 2 6 0 0 17 1 2 8
                                    17 44 0 1 2 5 0 0 40 1 3 5 0 0 17 17 1 2 5
                                    0 0 41 1 3 5 0 0 42 42 1 2 0 17 0 0 1 2 9
                                    17 17 0 1 1 0 42 0 1 1 0 17 0 1 0 0 0 24 2
                                    0 17 0 7 18 3 0 17 0 7 17 1 2 0 0 0 46 1 2
                                    0 0 0 7 1 2 0 0 0 46 1 2 9 9 17 0 1 2 8 9
                                    44 0 1 3 6 0 0 0 7 1 1 0 0 0 25 1 1 43 0 1
                                    1 0 0 42 1 2 0 0 0 17 1 2 0 0 17 0 1 1 0 0
                                    49 1 2 0 0 0 0 1 1 0 20 0 22 2 8 17 44 0 1
                                    2 0 0 0 0 31 2 0 0 0 0 1 2 0 0 0 0 39 1 0 0
                                    0 37 2 0 0 0 0 38 2 0 17 0 0 1 2 0 17 0 0 1
                                    2 0 17 0 0 26 2 0 17 0 0 1 2 0 17 0 0 27 2
                                    0 0 0 0 1 1 8 9 0 10)))))
           '|lookupComplete|)) 
