
(/VERSIONCHECK 2) 

(DEFUN |FSAGG-;<;2AB;1| (|s| |t| $)
  (COND
    ((< (SPADCALL |s| (QREFELT $ 9)) (SPADCALL |t| (QREFELT $ 9)))
     (SPADCALL |s| (SPADCALL |s| |t| (QREFELT $ 10)) (QREFELT $ 12)))
    ('T 'NIL))) 

(DEFUN |FSAGG-;=;2AB;2| (|s| |t| $)
  (COND
    ((EQL (SPADCALL |s| (QREFELT $ 9)) (SPADCALL |t| (QREFELT $ 9)))
     (SPADCALL (SPADCALL |s| |t| (QREFELT $ 14)) (QREFELT $ 15)))
    ('T 'NIL))) 

(DEFUN |FSAGG-;brace;LA;3| (|l| $) (SPADCALL |l| (QREFELT $ 18))) 

(DEFUN |FSAGG-;set;LA;4| (|l| $) (SPADCALL |l| (QREFELT $ 18))) 

(DEFUN |FSAGG-;cardinality;ANni;5| (|s| $)
  (SPADCALL |s| (QREFELT $ 9))) 

(DEFUN |FSAGG-;construct;LA;6| (|l| $)
  (PROG (|s| |x| #0=#:G1835)
    (RETURN
      (SEQ (LETT |s| (SPADCALL (QREFELT $ 22))
                 . #1=(|FSAGG-;construct;LA;6|))
           (SEQ (LETT |x| NIL . #1#) (LETT #0# |l| . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (SPADCALL |x| |s| (QREFELT $ 23))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |s|))))) 

(DEFUN |FSAGG-;count;SANni;7| (|x| |s| $)
  (COND ((SPADCALL |x| |s| (QREFELT $ 25)) 1) ('T 0))) 

(DEFUN |FSAGG-,subset?;mem?| (|x| $)
  (SPADCALL |x| |t| (QREFELT $ 25))) 

(DEFUN |FSAGG-;subset?;SB;9| (|s| |t| $)
  (COND
    ((NULL (< (SPADCALL |s| (QREFELT $ 9))
              (SPADCALL |t| (QREFELT $ 9))))
     'NIL)
    ('T
     (SPADCALL (CONS (|function| |FSAGG-;mem?|) $)
         (SPADCALL |s| (QREFELT $ 27)) (QREFELT $ 29))))) 

(DEFUN |FSAGG-;coerce;AOf;10| (|s| $)
  (PROG (#0=#:G1845 |x| #1=#:G1846)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #2=(|FSAGG-;coerce;AOf;10|))
                 (SEQ (LETT |x| NIL . #2#)
                      (LETT #1# (SPADCALL |s| (QREFELT $ 27)) . #2#)
                      G190
                      (COND
                        ((OR (ATOM #1#)
                             (PROGN (LETT |x| (CAR #1#) . #2#) NIL))
                         (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (SPADCALL |x| (QREFELT $ 32))
                                        #0#) . #2#)))
                      (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 34)))))) 

(DEFUN |FSAGG-;intersect;3A;11| (|s| |t| $)
  (PROG (|i| |x| #0=#:G1850)
    (RETURN
      (SEQ (LETT |i| (SPADCALL NIL (QREFELT $ 36))
                 . #1=(|FSAGG-;intersect;3A;11|))
           (SEQ (LETT |x| NIL . #1#)
                (LETT #0# (SPADCALL |s| (QREFELT $ 27)) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (COND
                             ((SPADCALL |x| |t| (QREFELT $ 25))
                              (SPADCALL |x| |i| (QREFELT $ 23))))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |i|))))) 

(DEFUN |FSAGG-;difference;3A;12| (|s| |t| $)
  (PROG (|m| |x| #0=#:G1854)
    (RETURN
      (SEQ (LETT |m| (SPADCALL |s| (QREFELT $ 38))
                 . #1=(|FSAGG-;difference;3A;12|))
           (SEQ (LETT |x| NIL . #1#)
                (LETT #0# (SPADCALL |t| (QREFELT $ 27)) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (SPADCALL |x| |m| (QREFELT $ 39))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |m|))))) 

(DEFUN |FSAGG-;symmetricDifference;3A;13| (|s| |t| $)
  (PROG (|d| |x| #0=#:G1859)
    (RETURN
      (SEQ (LETT |d| (SPADCALL |s| (QREFELT $ 38))
                 . #1=(|FSAGG-;symmetricDifference;3A;13|))
           (SEQ (LETT |x| NIL . #1#)
                (LETT #0# (SPADCALL |t| (QREFELT $ 27)) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (COND
                             ((SPADCALL |x| |s| (QREFELT $ 25))
                              (SPADCALL |x| |d| (QREFELT $ 39)))
                             ('T (SPADCALL |x| |d| (QREFELT $ 23))))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |d|))))) 

(DEFUN |FSAGG-;union;3A;14| (|s| |t| $)
  (PROG (|u| |x| #0=#:G1863)
    (RETURN
      (SEQ (LETT |u| (SPADCALL |s| (QREFELT $ 38))
                 . #1=(|FSAGG-;union;3A;14|))
           (SEQ (LETT |x| NIL . #1#)
                (LETT #0# (SPADCALL |t| (QREFELT $ 27)) . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (SPADCALL |x| |u| (QREFELT $ 23))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |u|))))) 

(DEFUN |FSAGG-;universe;A;15| ($)
  (PROG (#0=#:G1867 |i| #1=#:G1868 #2=#:G1864)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #3=(|FSAGG-;universe;A;15|))
                 (SEQ (LETT |i| 1 . #3#)
                      (LETT #1# (SPADCALL (QREFELT $ 43)) . #3#) G190
                      (COND ((QSGREATERP |i| #1#) (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (SPADCALL
                                         (PROG1 (LETT #2# |i| . #3#)
                                           (|check-subtype| (> #2# 0)
                                            '(|PositiveInteger|) #2#))
                                         (QREFELT $ 45))
                                        #0#) . #3#)))
                      (LETT |i| (QSADD1 |i|) . #3#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 36)))))) 

(DEFUN |FSAGG-;complement;2A;16| (|s| $)
  (SPADCALL (SPADCALL (QREFELT $ 47)) |s| (QREFELT $ 14))) 

(DEFUN |FSAGG-;size;Nni;17| ($) (EXPT 2 (SPADCALL (QREFELT $ 43)))) 

(DEFUN |FSAGG-;index;PiA;18| (|i| $)
  (PROG (#0=#:G1874 |j| #1=#:G1875 #2=#:G1871)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #3=(|FSAGG-;index;PiA;18|))
                 (SEQ (LETT |j| 1 . #3#)
                      (LETT #1# (SPADCALL (QREFELT $ 43)) . #3#) G190
                      (COND ((QSGREATERP |j| #1#) (GO G191)))
                      (SEQ (EXIT (COND
                                   ((SPADCALL (- |i| 1) (- |j| 1)
                                     (QREFELT $ 51))
                                    (LETT #0#
                                     (CONS
                                      (SPADCALL
                                       (PROG1 (LETT #2# |j| . #3#)
                                         (|check-subtype| (> #2# 0)
                                          '(|PositiveInteger|) #2#))
                                       (QREFELT $ 45))
                                      #0#) . #3#)))))
                      (LETT |j| (QSADD1 |j|) . #3#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 36)))))) 

(DEFUN |FSAGG-;random;A;19| ($)
  (PROG (#0=#:G1876)
    (RETURN
      (SPADCALL
          (PROG1 (LETT #0# (+ (RANDOM (SPADCALL (QREFELT $ 57))) 1)
                       |FSAGG-;random;A;19|)
            (|check-subtype| (> #0# 0) '(|PositiveInteger|) #0#))
          (QREFELT $ 58))))) 

(DEFUN |FSAGG-;lookup;APi;20| (|s| $)
  (PROG (|x| #0=#:G1883 #1=#:G1879 |n|)
    (RETURN
      (SEQ (LETT |n| 1 . #2=(|FSAGG-;lookup;APi;20|))
           (SEQ (LETT |x| NIL . #2#)
                (LETT #0# (SPADCALL |s| (QREFELT $ 27)) . #2#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #2#) NIL))
                   (GO G191)))
                (SEQ (EXIT (LETT |n|
                                 (+ |n|
                                    (EXPT 2
                                     (PROG1
                                      (LETT #1#
                                       (- (SPADCALL |x| (QREFELT $ 60))
                                        1) . #2#)
                                       (|check-subtype| (>= #1# 0)
                                        '(|NonNegativeInteger|) #1#)))) . #2#)))
                (LETT #0# (CDR #0#) . #2#) (GO G190) G191 (EXIT NIL))
           (EXIT |n|))))) 

(DEFUN |FSAGG-;max;AS;21| (|s| $)
  (PROG (|l|)
    (RETURN
      (COND
        ((NULL (LETT |l| (SPADCALL |s| (QREFELT $ 27))
                     |FSAGG-;max;AS;21|))
         (|error| "Empty set"))
        ('T (SPADCALL (ELT $ 62) |l| (QREFELT $ 64))))))) 

(DEFUN |FSAGG-;min;AS;22| (|s| $)
  (PROG (|l|)
    (RETURN
      (COND
        ((NULL (LETT |l| (SPADCALL |s| (QREFELT $ 27))
                     |FSAGG-;min;AS;22|))
         (|error| "Empty set"))
        ('T (SPADCALL (ELT $ 66) |l| (QREFELT $ 64))))))) 

(DEFUN |FiniteSetAggregate&| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|FiniteSetAggregate&|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$| (LIST '|FiniteSetAggregate&| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 68) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3
            (LETT |pv$|
                  (|buildPredVector| 0 0
                      (LIST (|HasCategory| |#2| '(|OrderedSet|))
                            (|HasCategory| |#2| '(|Finite|)))) . #0#))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (COND
          ((|testBitVector| |pv$| 2)
           (PROGN
             (QSETREFV $ 46
                 (CONS (|dispatchFunction| |FSAGG-;universe;A;15|) $))
             (QSETREFV $ 48
                 (CONS (|dispatchFunction| |FSAGG-;complement;2A;16|)
                       $))
             (QSETREFV $ 49
                 (CONS (|dispatchFunction| |FSAGG-;size;Nni;17|) $))
             (QSETREFV $ 52
                 (CONS (|dispatchFunction| |FSAGG-;index;PiA;18|) $))
             (QSETREFV $ 59
                 (CONS (|dispatchFunction| |FSAGG-;random;A;19|) $))
             (QSETREFV $ 61
                 (CONS (|dispatchFunction| |FSAGG-;lookup;APi;20|) $)))))
        (COND
          ((|testBitVector| |pv$| 1)
           (PROGN
             (QSETREFV $ 65
                 (CONS (|dispatchFunction| |FSAGG-;max;AS;21|) $))
             (QSETREFV $ 67
                 (CONS (|dispatchFunction| |FSAGG-;min;AS;22|) $)))))
        $)))) 

(MAKEPROP '|FiniteSetAggregate&| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|NonNegativeInteger|) (0 . |#|) (5 . |intersect|)
             (|Boolean|) (11 . =) |FSAGG-;<;2AB;1| (17 . |difference|)
             (23 . |empty?|) |FSAGG-;=;2AB;2| (|List| 7)
             (28 . |construct|) |FSAGG-;brace;LA;3| |FSAGG-;set;LA;4|
             |FSAGG-;cardinality;ANni;5| (33 . |set|) (37 . |insert!|)
             |FSAGG-;construct;LA;6| (43 . |member?|)
             |FSAGG-;count;SANni;7| (49 . |parts|) (|Mapping| 11 7)
             (54 . |every?|) (60 . |subset?|) (|OutputForm|)
             (66 . |coerce|) (|List| $) (71 . |brace|)
             |FSAGG-;coerce;AOf;10| (76 . |brace|)
             |FSAGG-;intersect;3A;11| (81 . |copy|) (86 . |remove!|)
             |FSAGG-;difference;3A;12|
             |FSAGG-;symmetricDifference;3A;13| |FSAGG-;union;3A;14|
             (92 . |size|) (|PositiveInteger|) (96 . |index|)
             (101 . |universe|) (105 . |universe|) (109 . |complement|)
             (114 . |size|) (|Integer|) (118 . |bit?|) (124 . |index|)
             (129 . |random|) (133 . |random|) (137 . |random|)
             (141 . |random|) (145 . |size|) (149 . |index|)
             (154 . |random|) (158 . |lookup|) (163 . |lookup|)
             (168 . |max|) (|Mapping| 7 7 7) (174 . |reduce|)
             (180 . |max|) (185 . |min|) (191 . |min|))
          '#(|universe| 196 |union| 200 |symmetricDifference| 206
             |subset?| 212 |size| 218 |set| 222 |random| 227 |min| 231
             |max| 236 |lookup| 241 |intersect| 246 |index| 252
             |difference| 257 |count| 263 |construct| 269 |complement|
             274 |coerce| 279 |cardinality| 284 |brace| 289 = 294 <
             300)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 67
                                '(1 6 8 0 9 2 6 0 0 0 10 2 6 11 0 0 12
                                  2 6 0 0 0 14 1 6 11 0 15 1 6 0 17 18
                                  0 6 0 22 2 6 0 7 0 23 2 6 11 7 0 25 1
                                  6 17 0 27 2 17 11 28 0 29 2 0 11 0 0
                                  30 1 7 31 0 32 1 31 0 33 34 1 6 0 17
                                  36 1 6 0 0 38 2 6 0 7 0 39 0 7 8 43 1
                                  7 0 44 45 0 0 0 46 0 6 0 47 1 0 0 0
                                  48 0 0 8 49 2 50 11 0 0 51 1 0 0 44
                                  52 0 6 0 53 0 0 6 54 0 11 0 55 0 7 0
                                  56 0 6 8 57 1 6 0 44 58 0 0 0 59 1 7
                                  44 0 60 1 0 44 0 61 2 7 0 0 0 62 2 17
                                  7 63 0 64 1 0 7 0 65 2 7 0 0 0 66 1 0
                                  7 0 67 0 0 0 46 2 0 0 0 0 42 2 0 0 0
                                  0 41 2 0 11 0 0 30 0 0 8 49 1 0 0 17
                                  20 0 0 0 59 1 0 7 0 67 1 0 7 0 65 1 0
                                  44 0 61 2 0 0 0 0 37 1 0 0 44 52 2 0
                                  0 0 0 40 2 0 8 7 0 26 1 0 0 17 24 1 0
                                  0 0 48 1 0 31 0 35 1 0 8 0 21 1 0 0
                                  17 19 2 0 11 0 0 16 2 0 11 0 0 13)))))
          '|lookupComplete|)) 
