
(/VERSIONCHECK 2) 

(DEFUN |LEXP;ident| (|l1| |l2| $)
  (PROG (|r| |c2| |u2| |c1| |u1| #1=#:G1822 |t| #2=#:G1821 #3=#:G1820
         #4=#:G1819)
    (RETURN
     (SEQ
      (COND
       ((NULL |l1|)
        (PROGN
         (LETT #4# NIL . #5=(|LEXP;ident|))
         (SEQ (LETT |t| NIL . #5#) (LETT #3# |l2| . #5#) G190
              (COND
               ((OR (ATOM #3#) (PROGN (LETT |t| (CAR #3#) . #5#) NIL))
                (GO G191)))
              (SEQ
               (EXIT
                (LETT #4#
                      (CONS
                       (SPADCALL (|spadConstant| $ 10) (QCDR |t|)
                                 (QREFELT $ 12))
                       #4#)
                      . #5#)))
              (LETT #3# (CDR #3#) . #5#) (GO G190) G191
              (EXIT (NREVERSE #4#)))))
       ((NULL |l2|)
        (PROGN
         (LETT #2# NIL . #5#)
         (SEQ (LETT |t| NIL . #5#) (LETT #1# |l1| . #5#) G190
              (COND
               ((OR (ATOM #1#) (PROGN (LETT |t| (CAR #1#) . #5#) NIL))
                (GO G191)))
              (SEQ
               (EXIT
                (LETT #2#
                      (CONS
                       (SPADCALL (QCDR |t|) (|spadConstant| $ 10)
                                 (QREFELT $ 12))
                       #2#)
                      . #5#)))
              (LETT #1# (CDR #1#) . #5#) (GO G190) G191
              (EXIT (NREVERSE #2#)))))
       (#6='T
        (SEQ (LETT |u1| (QCAR (|SPADfirst| |l1|)) . #5#)
             (LETT |c1| (QCDR (|SPADfirst| |l1|)) . #5#)
             (LETT |u2| (QCAR (|SPADfirst| |l2|)) . #5#)
             (LETT |c2| (QCDR (|SPADfirst| |l2|)) . #5#)
             (EXIT
              (COND
               ((SPADCALL |u1| |u2| (QREFELT $ 15))
                (SEQ (LETT |r| (SPADCALL |c1| |c2| (QREFELT $ 16)) . #5#)
                     (EXIT
                      (COND
                       ((SPADCALL |r| (|spadConstant| $ 10) (QREFELT $ 17))
                        (|LEXP;ident| (CDR |l1|) (CDR |l2|) $))
                       (#6#
                        (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|) $)))
               (#6#
                (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 (|l2| |l1|)
    (RETURN
     (SEQ
      (LETT |l1| (SPADCALL |x| (QREFELT $ 31))
            . #1=(|LEXP;identification;2$L;4|))
      (LETT |l2| (SPADCALL |y| (QREFELT $ 31)) . #1#)
      (EXIT (|LEXP;ident| |l1| |l2| $)))))) 

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

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

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

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

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

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

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

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

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

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

(DEFUN |LieExponentials;| (|#1| |#2| |#3|)
  (PROG (|pv$| $ |dv$| DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|LieExponentials|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT |dv$| (LIST '|LieExponentials| DV$1 DV$2 DV$3) . #1#)
      (LETT $ (GETREFV 75) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|LieExponentials| (LIST DV$1 DV$2 DV$3)
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (SETF |pv$| (QREFELT $ 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 |listOfTerms| 192 |latex| 197 |inv| 202
              |identification| 207 |hash| 213 |exp| 218 |conjugate| 223
              |commutator| 229 |coerce| 235 ^ 250 |One| 268 |LyndonCoordinates|
              272 |LyndonBasis| 277 = 282 / 288 * 294)
           '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
                                         35 0 36 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 5 0 66 1 0 71 0 1 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 2 0 13 0 0 54 2 0 0 0 0 1 2 0 0
                                         0 0 44)))))
           '|lookupComplete|)) 
