
(/VERSIONCHECK 2) 

(PUT '|LMOPS;makeUnit;$;1| '|SPADreplace| '(XLAM NIL NIL)) 

(DEFUN |LMOPS;makeUnit;$;1| ($) NIL) 

(DEFUN |LMOPS;size;$Nni;2| (|l| $)
  (LENGTH (SPADCALL |l| (QREFELT $ 13)))) 

(DEFUN |LMOPS;coerce;S$;3| (|s| $) (LIST (CONS |s| (QREFELT $ 8)))) 

(DEFUN |LMOPS;coerce;$Of;4| (|l| $) (SPADCALL |l| (QREFELT $ 18))) 

(DEFUN |LMOPS;makeTerm;SE$;5| (|s| |e| $)
  (COND
    ((SPADCALL |e| (QREFELT $ 21)) (SPADCALL (QREFELT $ 10)))
    ('T (LIST (CONS |s| |e|))))) 

(PUT '|LMOPS;makeMulti;L$;6| '|SPADreplace| '(XLAM (|l|) |l|)) 

(DEFUN |LMOPS;makeMulti;L$;6| (|l| $) |l|) 

(DEFUN |LMOPS;=;2$B;7| (|f| |g| $) (SPADCALL |f| |g| (QREFELT $ 24))) 

(PUT '|LMOPS;listOfMonoms;$L;8| '|SPADreplace| '(XLAM (|l|) |l|)) 

(DEFUN |LMOPS;listOfMonoms;$L;8| (|l| $) |l|) 

(DEFUN |LMOPS;nthExpon;$IE;9| (|f| |i| $)
  (QCDR (SPADCALL |f| (+ (- |i| 1) (SPADCALL |f| (QREFELT $ 27)))
            (QREFELT $ 28)))) 

(DEFUN |LMOPS;nthFactor;$IS;10| (|f| |i| $)
  (QCAR (SPADCALL |f| (+ (- |i| 1) (SPADCALL |f| (QREFELT $ 27)))
            (QREFELT $ 28)))) 

(PUT '|LMOPS;reverse;2$;11| '|SPADreplace| 'REVERSE) 

(DEFUN |LMOPS;reverse;2$;11| (|l| $) (REVERSE |l|)) 

(PUT '|LMOPS;reverse!;2$;12| '|SPADreplace| 'NREVERSE) 

(DEFUN |LMOPS;reverse!;2$;12| (|l| $) (NREVERSE |l|)) 

(DEFUN |LMOPS;mapGen;M2$;13| (|f| |l| $)
  (PROG (#0=#:G1862 |x| #1=#:G1863)
    (RETURN
      (SEQ (PROGN
             (LETT #0# NIL . #2=(|LMOPS;mapGen;M2$;13|))
             (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 (LETT #0#
                                   (CONS
                                    (CONS (SPADCALL (QCAR |x|) |f|)
                                     (QCDR |x|))
                                    #0#) . #2#)))
                  (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                  (EXIT (NREVERSE0 #0#)))))))) 

(DEFUN |LMOPS;mapExpon;M2$;14| (|f| |l| $)
  (PROG (|x| #0=#:G1870 |a| |ans|)
    (RETURN
      (SEQ (LETT |ans| NIL . #1=(|LMOPS;mapExpon;M2$;14|))
           (SEQ (LETT |x| NIL . #1#) (LETT #0# |l| . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (LETT |a| (SPADCALL (QCDR |x|) |f|) . #1#)
                     (EXIT (COND
                             ((NULL (SPADCALL |a| (|spadConstant| $ 35)
                                     (QREFELT $ 36)))
                              (LETT |ans|
                                    (CONS (CONS (QCAR |x|) |a|) |ans|) . #1#)))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT (SPADCALL |ans| (QREFELT $ 32))))))) 

(DEFUN |LMOPS;outputForm;$2MIOf;15| (|l| |op| |opexp| |id| $)
  (PROG (#0=#:G1878 |p| #1=#:G1879)
    (RETURN
      (SEQ (COND
             ((NULL |l|) (SPADCALL |id| (QREFELT $ 39)))
             ('T
              (SEQ (LETT |l|
                         (PROGN
                           (LETT #0# NIL
                                 . #2=(|LMOPS;outputForm;$2MIOf;15|))
                           (SEQ (LETT |p| NIL . #2#)
                                (LETT #1# |l| . #2#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |p| (CAR #1#) . #2#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (LETT #0#
                                       (CONS
                                        (COND
                                          ((SPADCALL (QCDR |p|)
                                            (QREFELT $ 8)
                                            (QREFELT $ 36))
                                           (SPADCALL (QCAR |p|)
                                            (QREFELT $ 40)))
                                          ('T
                                           (SPADCALL
                                            (SPADCALL (QCAR |p|)
                                             (QREFELT $ 40))
                                            (SPADCALL (QCDR |p|)
                                             (QREFELT $ 41))
                                            |opexp|)))
                                        #0#) . #2#)))
                                (LETT #1# (CDR #1#) . #2#) (GO G190)
                                G191 (EXIT (NREVERSE0 #0#)))) . #2#)
                   (EXIT (SPADCALL |op| |l| (QREFELT $ 44)))))))))) 

(DEFUN |LMOPS;retractIfCan;$U;16| (|l| $)
  (SEQ (COND
         ((NULL (NULL |l|))
          (COND
            ((NULL (CDR |l|))
             (COND
               ((SPADCALL (QCDR (|SPADfirst| |l|)) (QREFELT $ 8)
                    (QREFELT $ 36))
                (EXIT (CONS 0 (QCAR (|SPADfirst| |l|))))))))))
       (EXIT (CONS 1 "failed")))) 

(DEFUN |LMOPS;rightMult;$S$;17| (|f| |s| $)
  (PROG (|h|)
    (RETURN
      (SEQ (COND
             ((NULL |f|) (SPADCALL |s| (QREFELT $ 16)))
             ((SPADCALL |s|
                  (QCAR (SPADCALL |f| '|last| (QREFELT $ 49)))
                  (QREFELT $ 50))
              (SEQ (SPADCALL
                       (LETT |h| (SPADCALL |f| (QREFELT $ 51))
                             |LMOPS;rightMult;$S$;17|)
                       (CONS |s|
                             (SPADCALL
                                 (QCDR (SPADCALL |f| '|last|
                                        (QREFELT $ 49)))
                                 (QREFELT $ 8) (QREFELT $ 52)))
                       (QREFELT $ 53))
                   (EXIT |h|)))
             ('T
              (SPADCALL |f| (CONS |s| (QREFELT $ 8)) (QREFELT $ 54)))))))) 

(DEFUN |LMOPS;leftMult;S2$;18| (|s| |f| $)
  (COND
    ((NULL |f|) (SPADCALL |s| (QREFELT $ 16)))
    ((SPADCALL |s| (QCAR (|SPADfirst| |f|)) (QREFELT $ 50))
     (CONS (CONS |s|
                 (SPADCALL (QCDR (|SPADfirst| |f|)) (QREFELT $ 8)
                     (QREFELT $ 52)))
           (CDR |f|)))
    ('T (CONS (CONS |s| (QREFELT $ 8)) |f|)))) 

(DEFUN |LMOPS;commutativeEquality;2$B;19| (|s1| |s2| $)
  (PROG (|t1| #0=#:G1908 #1=#:G1907)
    (RETURN
      (SEQ (EXIT (COND
                   ((NULL (EQL (LENGTH |s1|) (LENGTH |s2|))) 'NIL)
                   ('T
                    (SEQ (SEQ (LETT |t1| NIL
                                    . #2=(|LMOPS;commutativeEquality;2$B;19|))
                              (LETT #0# |s1| . #2#) G190
                              (COND
                                ((OR (ATOM #0#)
                                     (PROGN
                                       (LETT |t1| (CAR #0#) . #2#)
                                       NIL))
                                 (GO G191)))
                              (SEQ (EXIT
                                    (COND
                                      ((NULL
                                        (SPADCALL |t1| |s2|
                                         (QREFELT $ 57)))
                                       (PROGN
                                         (LETT #1# 'NIL . #2#)
                                         (GO #1#))))))
                              (LETT #0# (CDR #0#) . #2#) (GO G190) G191
                              (EXIT NIL))
                         (EXIT 'T)))))
           #1# (EXIT #1#))))) 

(DEFUN |LMOPS;plus!| (|s| |n| |f| $)
  (PROG (|g| |m| |l| #0=#:G1917 |h| |h1|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |h|
                            (LETT |g| (CONS (CONS |s| |n|) |f|)
                                  . #1=(|LMOPS;plus!|)) . #1#)
                      (LETT |h1| (CDR |h|) . #1#)
                      (SEQ G190
                           (COND
                             ((NULL (COND ((NULL |h1|) 'NIL) ('T 'T)))
                              (GO G191)))
                           (SEQ (EXIT (COND
                                        ((SPADCALL |s|
                                          (QCAR (|SPADfirst| |h1|))
                                          (QREFELT $ 50))
                                         (SEQ
                                          (LETT |l|
                                           (COND
                                             ((SPADCALL
                                               (LETT |m|
                                                (SPADCALL |n|
                                                 (QCDR
                                                  (|SPADfirst| |h1|))
                                                 (QREFELT $ 52)) . #1#)
                                               (QREFELT $ 21))
                                              (CDR |h1|))
                                             ('T
                                              (CONS (CONS |s| |m|)
                                               (CDR |h1|)))) . #1#)
                                          (SPADCALL |h| |l|
                                           (QREFELT $ 59))
                                          (EXIT
                                           (PROGN
                                             (LETT #0# (CDR |g|) . #1#)
                                             (GO #0#)))))
                                        ('T
                                         (SEQ (LETT |h| |h1| . #1#)
                                          (EXIT
                                           (LETT |h1| (CDR |h1|) . #1#)))))))
                           NIL (GO G190) G191 (EXIT NIL))
                      (EXIT |g|)))
           #0# (EXIT #0#))))) 

(DEFUN |LMOPS;plus;SE2$;21| (|s| |n| |f| $)
  (|LMOPS;plus!| |s| |n| (SPADCALL |f| (QREFELT $ 51)) $)) 

(DEFUN |LMOPS;plus;3$;22| (|f| |g| $)
  (COND
    ((< (LENGTH |f|) (LENGTH |g|)) (|LMOPS;localplus| |f| |g| $))
    ('T (|LMOPS;localplus| |g| |f| $)))) 

(DEFUN |LMOPS;localplus| (|f| |g| $)
  (PROG (|x| #0=#:G1926)
    (RETURN
      (SEQ (LETT |g| (SPADCALL |g| (QREFELT $ 51))
                 . #1=(|LMOPS;localplus|))
           (SEQ (LETT |x| NIL . #1#) (LETT #0# |f| . #1#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |x| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (LETT |g|
                                 (SPADCALL (QCAR |x|) (QCDR |x|) |g|
                                     (QREFELT $ 60)) . #1#)))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (EXIT |g|))))) 

(DEFUN |ListMonoidOps| (&REST #0=#:G1927)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1928)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (|devaluateList| #0#)
                       (HGET |$ConstructorCache| '|ListMonoidOps|)
                       '|domainEqualList|)
                   . #2=(|ListMonoidOps|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (APPLY (|function| |ListMonoidOps;|) #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache| '|ListMonoidOps|))))))))))) 

(DEFUN |ListMonoidOps;| (|#1| |#2| |#3|)
  (PROG (DV$1 DV$2 DV$3 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|ListMonoidOps|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT |dv$| (LIST '|ListMonoidOps| DV$1 DV$2 DV$3) . #0#)
        (LETT $ (GETREFV 64) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|ListMonoidOps|
            (LIST DV$1 DV$2 DV$3) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9
            (|List| (|Record| (|:| |gen| |#1|) (|:| |exp| |#2|))))
        $)))) 

(MAKEPROP '|ListMonoidOps| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) '|Rep| |LMOPS;makeUnit;$;1|
             (|Record| (|:| |gen| 6) (|:| |exp| 7)) (|List| 11)
             |LMOPS;listOfMonoms;$L;8| (|NonNegativeInteger|)
             |LMOPS;size;$Nni;2| |LMOPS;coerce;S$;3| (|OutputForm|)
             (0 . |coerce|) |LMOPS;coerce;$Of;4| (|Boolean|)
             (5 . |zero?|) |LMOPS;makeTerm;SE$;5|
             |LMOPS;makeMulti;L$;6| (10 . =) |LMOPS;=;2$B;7|
             (|Integer|) (16 . |minIndex|) (21 . |elt|)
             |LMOPS;nthExpon;$IE;9| |LMOPS;nthFactor;$IS;10|
             |LMOPS;reverse;2$;11| |LMOPS;reverse!;2$;12|
             (|Mapping| 6 6) |LMOPS;mapGen;M2$;13| (27 . |Zero|)
             (31 . =) (|Mapping| 7 7) |LMOPS;mapExpon;M2$;14|
             (37 . |coerce|) (42 . |coerce|) (47 . |coerce|)
             (|Mapping| 17 17 17) (|List| 17) (52 . |reduce|)
             |LMOPS;outputForm;$2MIOf;15| (|Union| 6 '"failed")
             |LMOPS;retractIfCan;$U;16| '"last" (58 . |elt|) (64 . =)
             (70 . |copy|) (75 . +) (81 . |setlast!|) (87 . |concat|)
             |LMOPS;rightMult;$S$;17| |LMOPS;leftMult;S2$;18|
             (93 . |member?|) |LMOPS;commutativeEquality;2$B;19|
             (99 . |setrest!|) |LMOPS;plus;SE2$;21| |LMOPS;plus;3$;22|
             (|String|) (|SingleInteger|))
          '#(~= 105 |size| 111 |rightMult| 116 |reverse!| 122 |reverse|
             127 |retractIfCan| 132 |retract| 137 |plus| 142
             |outputForm| 155 |nthFactor| 163 |nthExpon| 169 |mapGen|
             175 |mapExpon| 181 |makeUnit| 187 |makeTerm| 191
             |makeMulti| 197 |listOfMonoms| 202 |leftMult| 207 |latex|
             213 |hash| 218 |commutativeEquality| 223 |coerce| 229 =
             239)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0))
                (CONS '#(|SetCategory&| |BasicType&| |RetractableTo&|
                         NIL)
                      (CONS '#((|SetCategory|) (|BasicType|)
                               (|RetractableTo| 6) (|CoercibleTo| 17))
                            (|makeByteWordVec2| 63
                                '(1 9 17 0 18 1 7 20 0 21 2 9 20 0 0 24
                                  1 9 26 0 27 2 9 11 0 26 28 0 7 0 35 2
                                  7 20 0 0 36 1 26 17 0 39 1 6 17 0 40
                                  1 7 17 0 41 2 43 17 42 0 44 2 9 11 0
                                  48 49 2 6 20 0 0 50 1 9 0 0 51 2 7 0
                                  0 0 52 2 9 11 0 11 53 2 9 0 0 11 54 2
                                  9 20 11 0 57 2 9 0 0 0 59 2 0 20 0 0
                                  1 1 0 14 0 15 2 0 0 0 6 55 1 0 0 0 32
                                  1 0 0 0 31 1 0 46 0 47 1 0 6 0 1 2 0
                                  0 0 0 61 3 0 0 6 7 0 60 4 0 17 0 42
                                  42 26 45 2 0 6 0 26 30 2 0 7 0 26 29
                                  2 0 0 33 0 34 2 0 0 37 0 38 0 0 0 10
                                  2 0 0 6 7 22 1 0 0 12 23 1 0 12 0 13
                                  2 0 0 6 0 56 1 0 62 0 1 1 0 63 0 1 2
                                  0 20 0 0 58 1 0 0 6 16 1 0 17 0 19 2
                                  0 20 0 0 25)))))
          '|lookupComplete|)) 
