
(/VERSIONCHECK 2) 

(DEFUN |LEXP;ident| (|l1| |l2| $)
  (PROG (#0=#:G1827 #1=#:G1828 #2=#:G1829 |t| #3=#:G1830 |u1| |c1| |u2|
            |c2| |r|)
    (RETURN
      (SEQ (COND
             ((NULL |l1|)
              (PROGN
                (LETT #0# NIL . #4=(|LEXP;ident|))
                (SEQ (LETT |t| NIL . #4#) (LETT #1# |l2| . #4#) G190
                     (COND
                       ((OR (ATOM #1#)
                            (PROGN (LETT |t| (CAR #1#) . #4#) NIL))
                        #5=(GO G191)))
                     (SEQ (EXIT (LETT #0#
                                      (CONS
                                       (SPADCALL (|spadConstant| $ 10)
                                        (QCDR |t|) (QREFELT $ 12))
                                       #0#) . #4#)))
                     (LETT #1# (CDR #1#) . #4#) #6=(GO G190) G191
                     (EXIT (NREVERSE0 #0#)))))
             ((NULL |l2|)
              (PROGN
                (LETT #2# NIL . #4#)
                (SEQ (LETT |t| NIL . #4#) (LETT #3# |l1| . #4#) G190
                     (COND
                       ((OR (ATOM #3#)
                            (PROGN (LETT |t| (CAR #3#) . #4#) NIL))
                        #5#))
                     (SEQ (EXIT (LETT #2#
                                      (CONS
                                       (SPADCALL (QCDR |t|)
                                        (|spadConstant| $ 10)
                                        (QREFELT $ 12))
                                       #2#) . #4#)))
                     (LETT #3# (CDR #3#) . #4#) #6# G191
                     (EXIT (NREVERSE0 #2#)))))
             (#7='T
              (SEQ (LETT |u1| (QCAR (|SPADfirst| |l1|)) . #4#)
                   (LETT |c1| (QCDR (|SPADfirst| |l1|)) . #4#)
                   (LETT |u2| (QCAR (|SPADfirst| |l2|)) . #4#)
                   (LETT |c2| (QCDR (|SPADfirst| |l2|)) . #4#)
                   (EXIT (COND
                           ((SPADCALL |u1| |u2| (QREFELT $ 15))
                            (SEQ (LETT |r|
                                       (SPADCALL |c1| |c2|
                                        (QREFELT $ 16)) . #4#)
                                 (EXIT (COND
                                         ((SPADCALL |r|
                                           (|spadConstant| $ 10)
                                           (QREFELT $ 17))
                                          (|LEXP;ident| (CDR |l1|)
                                           (CDR |l2|) $))
                                         (#7#
                                          (CONS
                                           (SPADCALL |c1| |c2|
                                            (QREFELT $ 12))
                                           (|LEXP;ident| (CDR |l1|)
                                            (CDR |l2|) $)))))))
                           ((SPADCALL |u1| |u2| (QREFELT $ 18))
                            (CONS (SPADCALL (|spadConstant| $ 10) |c2|
                                      (QREFELT $ 12))
                                  (|LEXP;ident| |l1| (CDR |l2|) $)))
                           ('T
                            (CONS (SPADCALL |c1| (|spadConstant| $ 10)
                                      (QREFELT $ 12))
                                  (|LEXP;ident| (CDR |l1|) |l2| $)))))))))))) 

(DEFUN |LEXP;compareTerm1s| (|u| |v| $)
  (SPADCALL (QCAR |v|) (QCAR |u|) (QREFELT $ 18))) 

(DEFUN |LEXP;out| (|t| $)
  (COND
    ((SPADCALL (QCDR |t|) (|spadConstant| $ 19) (QREFELT $ 17))
     (SPADCALL (SPADCALL (SPADCALL "e" (QREFELT $ 22)) (QREFELT $ 24))
         (SPADCALL (QCAR |t|) (QREFELT $ 25)) (QREFELT $ 26)))
    ('T
     (SPADCALL (SPADCALL (SPADCALL "e" (QREFELT $ 22)) (QREFELT $ 24))
         (SPADCALL (SPADCALL (QCDR |t|) (QREFELT $ 27))
             (SPADCALL (QCAR |t|) (QREFELT $ 25)) (QREFELT $ 28))
         (QREFELT $ 26))))) 

(DEFUN |LEXP;identification;2$L;4| (|x| |y| $)
  (PROG (|l1| |l2|)
    (RETURN
      (SEQ (LETT |l1| (SPADCALL |x| (QREFELT $ 31))
                 . #0=(|LEXP;identification;2$L;4|))
           (LETT |l2| (SPADCALL |y| (QREFELT $ 31)) . #0#)
           (EXIT (|LEXP;ident| |l1| |l2| $)))))) 

(DEFUN |LEXP;LyndonCoordinates;$L;5| (|x| $)
  (PROG (#0=#:G1855 |t| #1=#:G1856 |l| #2=#:G1849 |lt|)
    (RETURN
      (SEQ (LETT |lt|
                 (PROGN
                   (LETT #0# NIL . #3=(|LEXP;LyndonCoordinates;$L;5|))
                   (SEQ (LETT |t| NIL . #3#)
                        (LETT #1# (SPADCALL |x| (QREFELT $ 36)) . #3#)
                        G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |t| (CAR #1#) . #3#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (COND
                                     ((QEQCAR
                                       (LETT |l|
                                        (SPADCALL (QCAR |t|)
                                         (QREFELT $ 39)) . #3#)
                                       0)
                                      (LETT #0#
                                       (CONS
                                        (CONS
                                         (PROG2 (LETT #2# |l| . #3#)
                                          (QCDR #2#)
                                           (|check-union|
                                            (QEQCAR #2# 0)
                                            (|LyndonWord|
                                             (QREFELT $ 6))
                                            #2#))
                                         (QCDR |t|))
                                        #0#) . #3#)))))
                        (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #3#)
           (EXIT (LETT |lt|
                       (SPADCALL
                           (CONS (|function| |LEXP;compareTerm1s|) $)
                           |lt| (QREFELT $ 41)) . #3#)))))) 

(DEFUN |LEXP;*;3$;6| (|x| |y| $)
  (PROG (#0=#:G1857)
    (RETURN
      (SPADCALL |x| |y|
          (PROG1 (LETT #0# (QREFELT $ 8) |LEXP;*;3$;6|)
            (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|) #0#))
          (QREFELT $ 43))))) 

(DEFUN |LEXP;exp;Lp$;7| (|p| $)
  (PROG (#0=#:G1859)
    (RETURN
      (SPADCALL (SPADCALL |p| (QREFELT $ 46))
          (PROG1 (LETT #0# (QREFELT $ 8) |LEXP;exp;Lp$;7|)
            (|check-subtype| (>= #0# 0) '(|NonNegativeInteger|) #0#))
          (QREFELT $ 47))))) 

(DEFUN |LEXP;log;$Lp;8| (|p| $)
  (PROG (#0=#:G1862 #1=#:G1867)
    (RETURN
      (PROG2 (LETT #1#
                   (SPADCALL
                       (SPADCALL |p|
                           (PROG1 (LETT #0# (QREFELT $ 8)
                                        . #2=(|LEXP;log;$Lp;8|))
                             (|check-subtype| (>= #0# 0)
                                 '(|NonNegativeInteger|) #0#))
                           (QREFELT $ 49))
                       (QREFELT $ 51)) . #2#)
             (QCDR #1#)
        (|check-union| (QEQCAR #1# 0)
            (|LiePolynomial| (QREFELT $ 6) (QREFELT $ 7)) #1#))))) 

(DEFUN |LEXP;coerce;$Of;9| (|p| $)
  (PROG (|lt| #0=#:G1875 |t| #1=#:G1876)
    (RETURN
      (SEQ (COND
             ((SPADCALL |p| (|spadConstant| $ 53) (QREFELT $ 54))
              (SPADCALL (|spadConstant| $ 19) (QREFELT $ 27)))
             ('T
              (SEQ (LETT |lt| (SPADCALL |p| (QREFELT $ 31))
                         . #2=(|LEXP;coerce;$Of;9|))
                   (EXIT (SPADCALL (ELT $ 28)
                             (PROGN
                               (LETT #0# NIL . #2#)
                               (SEQ (LETT |t| NIL . #2#)
                                    (LETT #1# |lt| . #2#) G190
                                    (COND
                                      ((OR (ATOM #1#)
                                        (PROGN
                                          (LETT |t| (CAR #1#) . #2#)
                                          NIL))
                                       (GO G191)))
                                    (SEQ
                                     (EXIT
                                      (LETT #0#
                                       (CONS (|LEXP;out| |t| $) #0#) . #2#)))
                                    (LETT #1# (CDR #1#) . #2#)
                                    (GO G190) G191
                                    (EXIT (NREVERSE0 #0#))))
                             (QREFELT $ 57)))))))))) 

(DEFUN |LEXP;LyndonBasis;LL;10| (|lv| $)
  (PROG (#0=#:G1879 |l| #1=#:G1880)
    (RETURN
      (SEQ (PROGN
             (LETT #0# NIL . #2=(|LEXP;LyndonBasis;LL;10|))
             (SEQ (LETT |l| NIL . #2#)
                  (LETT #1#
                        (SPADCALL |lv| (QREFELT $ 8) (QREFELT $ 62)) . #2#)
                  G190
                  (COND
                    ((OR (ATOM #1#)
                         (PROGN (LETT |l| (CAR #1#) . #2#) NIL))
                     (GO G191)))
                  (SEQ (EXIT (LETT #0#
                                   (CONS (SPADCALL |l| (QREFELT $ 63))
                                    #0#) . #2#)))
                  (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                  (EXIT (NREVERSE0 #0#)))))))) 

(PUT '|LEXP;coerce;$Xpbwp;11| '|SPADreplace| '(XLAM (|p|) |p|)) 

(DEFUN |LEXP;coerce;$Xpbwp;11| (|p| $) |p|) 

(DEFUN |LEXP;inv;2$;12| (|x| $)
  (PROG (#0=#:G1887 |t| #1=#:G1888 |lt|)
    (RETURN
      (SEQ (COND
             ((SPADCALL |x| (|spadConstant| $ 53) (QREFELT $ 54))
              (|spadConstant| $ 53))
             ('T
              (SEQ (LETT |lt|
                         (SPADCALL (SPADCALL |x| (QREFELT $ 67))
                             (QREFELT $ 36))
                         . #2=(|LEXP;inv;2$;12|))
                   (LETT |lt|
                         (PROGN
                           (LETT #0# NIL . #2#)
                           (SEQ (LETT |t| NIL . #2#)
                                (LETT #1# |lt| . #2#) G190
                                (COND
                                  ((OR (ATOM #1#)
                                    (PROGN
                                      (LETT |t| (CAR #1#) . #2#)
                                      NIL))
                                   (GO G191)))
                                (SEQ (EXIT
                                      (LETT #0#
                                       (CONS
                                        (CONS (QCAR |t|)
                                         (COND
                                           ((ODDP
                                             (SPADCALL (QCAR |t|)
                                              (QREFELT $ 68)))
                                            (SPADCALL (QCDR |t|)
                                             (QREFELT $ 69)))
                                           ('T (QCDR |t|))))
                                        #0#) . #2#)))
                                (LETT #1# (CDR #1#) . #2#) (GO G190)
                                G191 (EXIT (NREVERSE0 #0#)))) . #2#)
                   (EXIT |lt|)))))))) 

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

(DEFUN |LieExponentials;| (|#1| |#2| |#3|)
  (PROG (DV$1 DV$2 DV$3 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|LieExponentials|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT |dv$| (LIST '|LieExponentials| DV$1 DV$2 DV$3) . #0#)
        (LETT $ (GETREFV 75) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|LieExponentials|
            (LIST DV$1 DV$2 DV$3) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 (|XPBWPolynomial| |#1| |#2|))
        $)))) 

(MAKEPROP '|LieExponentials| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL (|XPBWPolynomial| 6 7) (|local| |#1|)
             (|local| |#2|) (|local| |#3|) '|Rep| (0 . |Zero|)
             (|Equation| 7) (4 . |equation|) (|Boolean|)
             (|LyndonWord| 6) (10 . =) (16 . -) (22 . =)
             (28 . |lexico|) (34 . |One|) (|String|) (|Character|)
             (38 . |char|) (|OutputForm|) (43 . |coerce|)
             (48 . |coerce|) (53 . **) (59 . |coerce|) (64 . *)
             (|Record| (|:| |k| 14) (|:| |c| 7)) (|List| 29)
             |LEXP;LyndonCoordinates;$L;5| (|List| 11)
             |LEXP;identification;2$L;4|
             (|Record| (|:| |k| 38) (|:| |c| 7)) (|List| 34)
             (70 . |ListOfTerms|) (|Union| 14 '"failed")
             (|PoincareBirkhoffWittLyndonBasis| 6)
             (75 . |retractIfCan|) (|Mapping| 13 29 29) (80 . |sort|)
             (|NonNegativeInteger|) (86 . |product|) |LEXP;*;3$;6|
             (|LiePolynomial| 6 7) (93 . |coerce|) (98 . |exp|)
             |LEXP;exp;Lp$;7| (104 . |log|) (|Union| 45 '"failed")
             (110 . |LiePolyIfCan|) |LEXP;log;$Lp;8| (115 . |One|)
             (119 . =) (|Mapping| 23 23 23) (|List| 23)
             (125 . |reduce|) |LEXP;coerce;$Of;9| (|List| $) (|List| 6)
             (|PositiveInteger|) (131 . |LyndonWordsList|)
             (137 . |LiePoly|) (|List| 45) |LEXP;LyndonBasis;LL;10|
             |LEXP;coerce;$Xpbwp;11| (142 . |mirror|) (147 . |length|)
             (152 . -) |LEXP;inv;2$;12| (|XDistributedPolynomial| 6 7)
             (|Integer|) (|Union| $ '"failed") (|SingleInteger|))
          '#(~= 157 |varList| 163 |sample| 168 |recip| 172 |one?| 177
             |mirror| 182 |log| 187 |latex| 192 |inv| 197
             |identification| 202 |hash| 208 |exp| 213 |conjugate| 218
             |commutator| 224 |coerce| 230 ^ 245 |One| 263
             |LyndonCoordinates| 267 |LyndonBasis| 272 |ListOfTerms|
             277 = 282 / 288 ** 294 * 312)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0))
                (CONS '#(|Group&| |Monoid&| |SemiGroup&| |SetCategory&|
                         |BasicType&| NIL NIL)
                      (CONS '#((|Group|) (|Monoid|) (|SemiGroup|)
                               (|SetCategory|) (|BasicType|)
                               (|unitsKnown|) (|CoercibleTo| 23))
                            (|makeByteWordVec2| 74
                                '(0 7 0 10 2 11 0 7 7 12 2 14 13 0 0 15
                                  2 7 0 0 0 16 2 7 13 0 0 17 2 14 13 0
                                  0 18 0 7 0 19 1 21 0 20 22 1 21 23 0
                                  24 1 14 23 0 25 2 23 0 0 0 26 1 7 23
                                  0 27 2 23 0 0 0 28 1 0 35 0 36 1 38
                                  37 0 39 2 30 0 40 0 41 3 9 0 0 0 42
                                  43 1 9 0 45 46 2 9 0 0 42 47 2 9 0 0
                                  42 49 1 9 50 0 51 0 0 0 53 2 0 13 0 0
                                  54 2 56 23 55 0 57 2 14 59 60 61 62 1
                                  45 0 14 63 1 0 0 0 67 1 38 42 0 68 1
                                  7 0 0 69 2 0 13 0 0 1 1 0 60 0 1 0 0
                                  0 1 1 0 73 0 1 1 0 13 0 1 1 0 0 0 67
                                  1 0 45 0 52 1 0 20 0 1 1 0 0 0 70 2 0
                                  32 0 0 33 1 0 74 0 1 1 0 0 45 48 2 0
                                  0 0 0 1 2 0 0 0 0 1 1 0 71 0 1 1 0 5
                                  0 66 1 0 23 0 58 2 0 0 0 72 1 2 0 0 0
                                  42 1 2 0 0 0 61 1 0 0 0 53 1 0 30 0
                                  31 1 0 64 60 65 1 0 35 0 36 2 0 13 0
                                  0 54 2 0 0 0 0 1 2 0 0 0 72 1 2 0 0 0
                                  42 1 2 0 0 0 61 1 2 0 0 0 0 44)))))
          '|lookupComplete|)) 
