
(/VERSIONCHECK 2) 

(DEFPARAMETER |MultisetAggregate;CAT| 'NIL) 

(DEFPARAMETER |MultisetAggregate;AL| 'NIL) 

(DEFUN |MultisetAggregate| (#0=#:G1816)
  (LET (#1=#:G1817)
    (COND
      ((SETQ #1# (|assoc| #2=(|devaluate| #0#) |MultisetAggregate;AL|))
       (CDR #1#))
      (T (SETQ |MultisetAggregate;AL|
               (|cons5| (CONS #2#
                              (SETQ #1# (|MultisetAggregate;| #0#)))
                        |MultisetAggregate;AL|))
         #1#)))) 

(DEFUN |MultisetAggregate;| (|t#1|)
  (PROG (#0=#:G1815)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1|) (LIST (|devaluate| |t#1|)))
                       (COND
                         (|MultisetAggregate;CAT|)
                         ('T
                          (LETT |MultisetAggregate;CAT|
                                (|Join| (|MultiDictionary| '|t#1|)
                                        (|SetAggregate| '|t#1|))
                                . #1=(|MultisetAggregate|))))) . #1#)
        (SETELT #0# 0 (LIST '|MultisetAggregate| (|devaluate| |t#1|))))))) 
