
(/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 (|t| |f| |s| |j| |i| #0=#:G1830)
    (RETURN
      (SEQ (LETT |t| (SPADCALL "1" (QREFELT $ 13))
                 . #1=(|IBITS;coerce;$Of;3|))
           (LETT |f| (SPADCALL "0" (QREFELT $ 13)) . #1#)
           (LETT |s|
                 (MAKE-FULL-CVEC (SPADCALL |v| (QREFELT $ 10))
                     (SPADCALL (QREFELT $ 14))) . #1#)
           (SEQ (LETT |j| (QREFELT $ 6) . #1#)
                (LETT |i| (SPADCALL |s| (QREFELT $ 15)) . #1#)
                (LETT #0# (SPADCALL |s| (QREFELT $ 16)) . #1#) G190
                (COND ((> |i| #0#) (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) . #1#)) . #1#)
                (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| (#0=#:G1858)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1859)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache| '|IndexedBits|)
                       '|domainEqualList|)
                   . #2=(|IndexedBits|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|IndexedBits;| #0#) (LETT #1# T . #2#))
               (COND
                 ((NOT #1#) (HREM |$ConstructorCache| '|IndexedBits|))))))))))) 

(DEFUN |IndexedBits;| (|#1|)
  (PROG (DV$1 |dv$| $ #0=#:G1855 |pv$| #1=#:G1857 #2=#:G1856)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #3=(|IndexedBits|))
        (LETT |dv$| (LIST '|IndexedBits| DV$1) . #3#)
        (LETT $ (GETREFV 51) . #3#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| (|Boolean|)
                                '(|ConvertibleTo| (|InputForm|)))
                            (|HasCategory| (|Boolean|) '(|OrderedSet|))
                            (|HasCategory| (|Integer|) '(|OrderedSet|))
                            (LETT #0#
                                  (|HasCategory| (|Boolean|)
                                      '(|SetCategory|)) . #3#)
                            (AND #0#
                                 (|HasCategory| (|Boolean|)
                                     '(|Evalable| (|Boolean|)))))) . #3#))
        (|haddProp| |$ConstructorCache| '|IndexedBits| (LIST DV$1)
            (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (AND (LETT #1# (|HasCategory| $ '(|shallowlyMutable|)) . #3#)
             (|augmentPredVector| $ 32))
        (AND #1# (|HasCategory| (|Boolean|) '(|OrderedSet|))
             (|augmentPredVector| $ 64))
        (AND (LETT #2# (|HasCategory| $ '(|finiteAggregate|)) . #3#)
             (|augmentPredVector| $ 128))
        (AND #2# #0# (|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| (|Equation| 17)
             (|List| 40) (|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 |size?| 113 |setelt| 119 |select| 133 |sample|
             139 |reverse!| 143 |reverse| 148 |removeDuplicates| 153
             |remove| 158 |reduce| 170 |qsetelt!| 191 |qelt| 198
             |position| 204 |parts| 223 |or| 228 |not| 234 |nor| 239
             |new| 245 |nand| 251 |more?| 257 |minIndex| 263 |min| 268
             |merge| 274 |members| 287 |member?| 292 |maxIndex| 298
             |max| 303 |map!| 309 |map| 315 |less?| 328 |latex| 334
             |insert| 339 |indices| 353 |index?| 358 |hash| 364 |first|
             369 |find| 374 |fill!| 380 |every?| 386 |eval| 392 |eq?|
             418 |entry?| 424 |entries| 430 |empty?| 435 |empty| 440
             |elt| 444 |delete| 463 |count| 475 |copyInto!| 487 |copy|
             494 |convert| 499 |construct| 504 |concat| 509 |coerce|
             532 |any?| 537 |and| 543 |\\/| 549 |Or| 555 |Not| 561
             |And| 566 >= 572 > 578 = 584 <= 590 < 596 |/\\| 602 |#|
             608)
          'NIL
          (CONS (|makeByteWordVec2| 5
                    '(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&|
                         |Collection&| |IndexedAggregate&|
                         |OrderedSet&| |HomogeneousAggregate&|
                         |SetCategory&| |EltableAggregate&|
                         |Aggregate&| |Logic&| |Evalable&| NIL NIL NIL
                         NIL |BasicType&| NIL |InnerEvalable&| NIL)
                      (CONS '#((|BitAggregate|)
                               (|OneDimensionalArrayAggregate| 17)
                               (|FiniteLinearAggregate| 17)
                               (|LinearAggregate| 17) (|Collection| 17)
                               (|IndexedAggregate| 7 17) (|OrderedSet|)
                               (|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 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 2 8 17 29
                                  0 1 3 8 17 29 0 17 1 3 6 17 0 7 17 1
                                  2 0 17 0 7 1 3 4 7 17 0 7 1 2 4 7 17
                                  0 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 17 0 7 1 3 0 0 0 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 2 5 0 0 41 1 3 5
                                  0 0 17 17 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 3 0 17 0 7 17 1 2 0 17 0 7
                                  18 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 0 0 1 2 0 0
                                  17 0 1 1 0 0 49 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|)) 
