
(/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 (#1=#:G8147 |x| |s|)
    (RETURN
     (SEQ (LETT |s| (SPADCALL (QREFELT $ 22)) . #2=(|FSAGG-;construct;LA;6|))
          (SEQ (LETT |x| NIL . #2#) (LETT #1# |l| . #2#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |x| (CAR #1#) . #2#) NIL))
                 (GO G191)))
               (SEQ (EXIT (SPADCALL |x| |s| (QREFELT $ 23))))
               (LETT #1# (CDR #1#) . #2#) (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?;2AB;8| (|s| |t| $)
  (PROG ()
    (RETURN
     (COND
      ((< (SPADCALL |s| (QREFELT $ 9)) (SPADCALL |t| (QREFELT $ 9)))
       (SPADCALL (CONS #'|FSAGG-;subset?;2AB;8!0| (VECTOR $ |t|))
                 (SPADCALL |s| (QREFELT $ 27)) (QREFELT $ 29)))
      ('T 'NIL))))) 

(DEFUN |FSAGG-;subset?;2AB;8!0| (|x| $$)
  (PROG (|t| $)
    (LETT |t| (QREFELT $$ 1) . #1=(|FSAGG-;subset?;2AB;8|))
    (LETT $ (QREFELT $$ 0) . #1#)
    (RETURN (PROGN (SPADCALL |x| |t| (QREFELT $ 25)))))) 

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

(DEFUN |FSAGG-;intersect;3A;10| (|s| |t| $)
  (PROG (#1=#:G8161 |x| |i|)
    (RETURN
     (SEQ
      (LETT |i| (SPADCALL NIL (QREFELT $ 36)) . #2=(|FSAGG-;intersect;3A;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
             (COND
              ((SPADCALL |x| |t| (QREFELT $ 25))
               (SPADCALL |x| |i| (QREFELT $ 23))))))
           (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
      (EXIT |i|))))) 

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

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

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

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

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

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

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

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

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

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

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

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

(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?|) |FSAGG-;subset?;2AB;8|
              (|OutputForm|) (60 . |coerce|) (|List| $) (65 . |brace|)
              |FSAGG-;coerce;AOf;9| (70 . |brace|) |FSAGG-;intersect;3A;10|
              (75 . |copy|) (80 . |remove!|) |FSAGG-;difference;3A;11|
              |FSAGG-;symmetricDifference;3A;12| |FSAGG-;union;3A;13|
              (86 . |size|) (|PositiveInteger|) (90 . |index|)
              (95 . |universe|) (99 . |universe|) (103 . |complement|)
              (108 . |size|) (|Integer|) (112 . |bit?|) (118 . |index|)
              (123 . |random|) (127 . |random|) (131 . |random|)
              (135 . |random|) (139 . |size|) (143 . |index|) (148 . |random|)
              (152 . |lookup|) (157 . |lookup|) (162 . |max|) (|Mapping| 7 7 7)
              (168 . |reduce|) (174 . |max|) (179 . |min|) (185 . |min|))
           '#(|universe| 190 |union| 194 |symmetricDifference| 200 |subset?|
              206 |size| 212 |set| 216 |random| 221 |min| 225 |max| 230
              |lookup| 235 |intersect| 240 |index| 246 |difference| 251 |count|
              257 |construct| 263 |complement| 268 |coerce| 273 |cardinality|
              278 |brace| 283 = 288 < 294)
           '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 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|)) 
