
(/VERSIONCHECK 2) 

(DEFPARAMETER |StackAggregate;CAT| 'NIL) 

(DEFPARAMETER |StackAggregate;AL| 'NIL) 

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

(DEFUN |StackAggregate;| (|t#1|)
  (PROG (#0=#:G1815)
    (RETURN
      (PROG1 (LETT #0#
                   (|sublisV|
                       (PAIR '(|t#1|) (LIST (|devaluate| |t#1|)))
                       (COND
                         (|StackAggregate;CAT|)
                         ('T
                          (LETT |StackAggregate;CAT|
                                (|Join| (|BagAggregate| '|t#1|)
                                        (|finiteAggregate|)
                                        (|mkCategory| '|domain|
                                         '(((|push!| (|t#1| |t#1| $))
                                            T)
                                           ((|pop!| (|t#1| $)) T)
                                           ((|top| (|t#1| $)) T)
                                           ((|depth|
                                             ((|NonNegativeInteger|) $))
                                            T))
                                         NIL '((|NonNegativeInteger|))
                                         NIL))
                                . #1=(|StackAggregate|))))) . #1#)
        (SETELT #0# 0 (LIST '|StackAggregate| (|devaluate| |t#1|))))))) 
