
(/VERSIONCHECK 2) 

(DEFUN |TENSPOW;coerce;$Of;1| (|x| $)
  (PROG (|le| |ko| #1=#:G1823 |b| #2=#:G1822 #3=#:G1821 |rec|)
    (RETURN
     (SEQ
      (COND
       ((SPADCALL |x| (QREFELT $ 11))
        (SPADCALL (|spadConstant| $ 12) (QREFELT $ 14)))
       ('T
        (SEQ (LETT |le| NIL . #4=(|TENSPOW;coerce;$Of;1|))
             (SEQ (LETT |rec| NIL . #4#)
                  (LETT #3# (REVERSE (SPADCALL |x| (QREFELT $ 17))) . #4#) G190
                  (COND
                   ((OR (ATOM #3#) (PROGN (LETT |rec| (CAR #3#) . #4#) NIL))
                    #5=(GO G191)))
                  (SEQ
                   (LETT |ko|
                         (SPADCALL (ELT $ 18)
                                   (PROGN
                                    (LETT #2# NIL . #4#)
                                    (SEQ (LETT |b| NIL . #4#)
                                         (LETT #1#
                                               (SPADCALL (QCAR |rec|)
                                                         (QREFELT $ 21))
                                               . #4#)
                                         G190
                                         (COND
                                          ((OR (ATOM #1#)
                                               (PROGN
                                                (LETT |b| (CAR #1#) . #4#)
                                                NIL))
                                           #5#))
                                         (SEQ
                                          (EXIT
                                           (LETT #2#
                                                 (CONS
                                                  (SPADCALL |b| (QREFELT $ 22))
                                                  #2#)
                                                 . #4#)))
                                         (LETT #1# (CDR #1#) . #4#)
                                         #6=(GO G190) G191
                                         (EXIT (NREVERSE0 #2#))))
                                   (QREFELT $ 25))
                         . #4#)
                   (EXIT
                    (COND
                     ((SPADCALL (QCDR |rec|) (|spadConstant| $ 26)
                                (QREFELT $ 27))
                      (LETT |le| (CONS |ko| |le|) . #4#))
                     ('T
                      (LETT |le|
                            (CONS
                             (SPADCALL (SPADCALL (QCDR |rec|) (QREFELT $ 14))
                                       |ko| (QREFELT $ 28))
                             |le|)
                            . #4#)))))
                  (LETT #3# (CDR #3#) . #4#) #6# G191 (EXIT NIL))
             (EXIT (SPADCALL (ELT $ 29) |le| (QREFELT $ 25)))))))))) 

(DEFUN |TENSPOW;partialTensor| (|bb| |xx| $)
  (PROG (|res| #1=#:G1836 |tt| #2=#:G1835 |s1| #3=#:G1834 |xr| |x1|)
    (RETURN
     (SEQ (LETT |x1| (|SPADfirst| |xx|) . #4=(|TENSPOW;partialTensor|))
          (LETT |xr| (CDR |xx|) . #4#)
          (COND
           ((NULL |xr|)
            (SEQ (LETT |s1| NIL . #4#)
                 (LETT #3# (SPADCALL |x1| (QREFELT $ 33)) . #4#) G190
                 (COND
                  ((OR (ATOM #3#) (PROGN (LETT |s1| (CAR #3#) . #4#) NIL))
                   #5=(GO G191)))
                 (SEQ
                  (EXIT
                   (LETT |res|
                         (CONS (CONS (CONS (QCAR |s1|) |bb|) (QCDR |s1|))
                               |res|)
                         . #4#)))
                 (LETT #3# (CDR #3#) . #4#) #6=(GO G190) G191 (EXIT NIL)))
           ('T
            (SEQ (LETT |s1| NIL . #4#)
                 (LETT #2# (SPADCALL |x1| (QREFELT $ 33)) . #4#) G190
                 (COND
                  ((OR (ATOM #2#) (PROGN (LETT |s1| (CAR #2#) . #4#) NIL))
                   #5#))
                 (SEQ
                  (EXIT
                   (SEQ (LETT |tt| NIL . #4#)
                        (LETT #1#
                              (|TENSPOW;partialTensor| (CONS (QCAR |s1|) |bb|)
                               |xr| $)
                              . #4#)
                        G190
                        (COND
                         ((OR (ATOM #1#)
                              (PROGN (LETT |tt| (CAR #1#) . #4#) NIL))
                          #5#))
                        (SEQ
                         (EXIT
                          (LETT |res|
                                (CONS
                                 (CONS (QCAR |tt|)
                                       (SPADCALL (QCDR |s1|) (QCDR |tt|)
                                                 (QREFELT $ 34)))
                                 |res|)
                                . #4#)))
                        (LETT #1# (CDR #1#) . #4#) #6# G191 (EXIT NIL))))
                 (LETT #2# (CDR #2#) . #4#) #6# G191 (EXIT NIL))))
          (EXIT (REVERSE |res|)))))) 

(DEFUN |TENSPOW;tensor;L$;3| (|bb| $)
  (SPADCALL (|spadConstant| $ 26) (SPADCALL |bb| (QREFELT $ 35))
            (QREFELT $ 36))) 

(DEFUN |TENSPOW;tensor;L$;4| (|xx| $)
  (PROG (|res| #1=#:G1849 |tt|)
    (RETURN
     (SEQ
      (COND
       ((NULL (SPADCALL |xx| (QREFELT $ 6) (QREFELT $ 40)))
        (|error| "wrong size"))
       ('T
        (COND ((SPADCALL (ELT $ 41) |xx| (QREFELT $ 43)) (|spadConstant| $ 44))
              ('T
               (SEQ (LETT |res| NIL . #2=(|TENSPOW;tensor;L$;4|))
                    (SEQ (LETT |tt| NIL . #2#)
                         (LETT #1# (|TENSPOW;partialTensor| NIL |xx| $) . #2#)
                         G190
                         (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |tt| (CAR #1#) . #2#) NIL))
                           (GO G191)))
                         (SEQ
                          (EXIT
                           (LETT |res|
                                 (CONS
                                  (CONS
                                   (SPADCALL (REVERSE (QCAR |tt|))
                                             (QREFELT $ 35))
                                   (QCDR |tt|))
                                  |res|)
                                 . #2#)))
                         (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
                    (EXIT (SPADCALL (REVERSE |res|) (QREFELT $ 45)))))))))))) 

(DEFUN |TENSPOW;*;3$;5| (|x1| |x2| $)
  (PROG (|res| #1=#:G1863 |t| |t1t2| #2=#:G1861 |b1| #3=#:G1862 |b2| #4=#:G1860
         |t2k| |t1k| |t2c| |t1c| #5=#:G1859 |t2| #6=#:G1858 |t1|)
    (RETURN
     (SEQ (LETT |res| NIL . #7=(|TENSPOW;*;3$;5|))
          (SEQ (LETT |t1| NIL . #7#)
               (LETT #6# (SPADCALL |x1| (QREFELT $ 17)) . #7#) G190
               (COND
                ((OR (ATOM #6#) (PROGN (LETT |t1| (CAR #6#) . #7#) NIL))
                 #8=(GO G191)))
               (SEQ
                (EXIT
                 (SEQ (LETT |t2| NIL . #7#)
                      (LETT #5# (SPADCALL |x2| (QREFELT $ 17)) . #7#) G190
                      (COND
                       ((OR (ATOM #5#) (PROGN (LETT |t2| (CAR #5#) . #7#) NIL))
                        #8#))
                      (SEQ (LETT |t1c| (QCDR |t1|) . #7#)
                           (LETT |t2c| (QCDR |t2|) . #7#)
                           (LETT |t1k| (QCAR |t1|) . #7#)
                           (LETT |t2k| (QCAR |t2|) . #7#)
                           (LETT |t1t2|
                                 (SPADCALL
                                  (SPADCALL (QCDR |t1|) (QCDR |t2|)
                                            (QREFELT $ 34))
                                  (SPADCALL
                                   (PROGN
                                    (LETT #4# NIL . #7#)
                                    (SEQ (LETT |b2| NIL . #7#)
                                         (LETT #3#
                                               (SPADCALL (QCAR |t2|)
                                                         (QREFELT $ 21))
                                               . #7#)
                                         (LETT |b1| NIL . #7#)
                                         (LETT #2#
                                               (SPADCALL (QCAR |t1|)
                                                         (QREFELT $ 21))
                                               . #7#)
                                         G190
                                         (COND
                                          ((OR (ATOM #2#)
                                               (PROGN
                                                (LETT |b1| (CAR #2#) . #7#)
                                                NIL)
                                               (ATOM #3#)
                                               (PROGN
                                                (LETT |b2| (CAR #3#) . #7#)
                                                NIL))
                                           #8#))
                                         (SEQ
                                          (EXIT
                                           (LETT #4#
                                                 (CONS
                                                  (SPADCALL
                                                   (SPADCALL
                                                    (|spadConstant| $ 26) |b1|
                                                    (QREFELT $ 47))
                                                   (SPADCALL
                                                    (|spadConstant| $ 26) |b2|
                                                    (QREFELT $ 47))
                                                   (QREFELT $ 48))
                                                  #4#)
                                                 . #7#)))
                                         (LETT #2#
                                               (PROG1 (CDR #2#)
                                                 (LETT #3# (CDR #3#) . #7#))
                                               . #7#)
                                         #9=(GO G190) G191
                                         (EXIT (NREVERSE0 #4#))))
                                   (QREFELT $ 46))
                                  (QREFELT $ 49))
                                 . #7#)
                           (EXIT
                            (SEQ (LETT |t| NIL . #7#)
                                 (LETT #1# (SPADCALL |t1t2| (QREFELT $ 17))
                                       . #7#)
                                 G190
                                 (COND
                                  ((OR (ATOM #1#)
                                       (PROGN (LETT |t| (CAR #1#) . #7#) NIL))
                                   #8#))
                                 (SEQ
                                  (EXIT (LETT |res| (CONS |t| |res|) . #7#)))
                                 (LETT #1# (CDR #1#) . #7#) #9# G191
                                 (EXIT NIL))))
                      (LETT #5# (CDR #5#) . #7#) #9# G191 (EXIT NIL))))
               (LETT #6# (CDR #6#) . #7#) #9# G191 (EXIT NIL))
          (EXIT (SPADCALL |res| (QREFELT $ 50))))))) 

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

(DEFUN |TensorPower;| (|#1| |#2| |#3| |#4|)
  (PROG (|pv$| $ |dv$| DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|TensorPower|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT |dv$| (LIST '|TensorPower| DV$1 DV$2 DV$3 DV$4) . #1#)
      (LETT $ (GETREFV 63) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#4|
                                                         (LIST '|Algebra|
                                                               (|devaluate|
                                                                |#2|)))
                                          (|HasCategory| |#2| '(|Comparable|))
                                          (|HasCategory| |#2|
                                                         '(|CommutativeRing|))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|TensorPower| (LIST DV$1 DV$2 DV$3 DV$4)
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (COND
       ((|testBitVector| |pv$| 1)
        (QSETREFV $ 51 (CONS (|dispatchFunction| |TENSPOW;*;3$;5|) $))))
      $)))) 

(MAKEPROP '|TensorPower| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL (|FreeModule| 7 20) (|local| |#1|)
              (|local| |#2|) (|local| |#3|) (|local| |#4|) (|Boolean|)
              (0 . |zero?|) (5 . |Zero|) (|OutputForm|) (9 . |coerce|)
              (|Record| (|:| |k| 20) (|:| |c| 7)) (|List| 15)
              (14 . |listOfTerms|) (19 . |tensor|) (|List| 8) (|Vector| 8)
              (25 . |parts|) (30 . |coerce|) (|Mapping| 13 13 13) (|List| 13)
              (35 . |reduce|) (41 . |One|) (45 . =) (51 . *) (57 . +)
              |TENSPOW;coerce;$Of;1| (|Record| (|:| |k| 8) (|:| |c| 7))
              (|List| 31) (63 . |listOfTerms|) (68 . *) (74 . |vector|)
              (79 . |monomial|) |TENSPOW;tensor;L$;3| (|NonNegativeInteger|)
              (|List| 9) (85 . |size?|) (91 . |zero?|) (|Mapping| 10 9)
              (96 . |any?|) (102 . |Zero|) (106 . |constructOrdered|)
              |TENSPOW;tensor;L$;4| (111 . |monomial|) (117 . *) (123 . *)
              (129 . |construct|) (134 . *) (|PositiveInteger|)
              (|Union| $ '"failed") (|Integer|) (|Mapping| 7 20)
              (|Union| 20 '"failed") (|Mapping| 7 7) (|List| 7) (|List| 20)
              (|List| $) (|String|) (|SingleInteger|))
           '#(~= 140 |zero?| 146 |tensor| 151 |support| 167 |subtractIfCan| 172
              |smaller?| 178 |sample| 184 |retractIfCan| 188 |retract| 193
              |reductum| 198 |recip| 203 |one?| 208 |numberOfMonomials| 213
              |monomials| 218 |monomial?| 223 |monomial| 228 |monom| 234 |map|
              240 |listOfTerms| 246 |linearExtend| 251 |leadingTerm| 257
              |leadingSupport| 262 |leadingMonomial| 267 |leadingCoefficient|
              272 |latex| 277 |hash| 282 |constructOrdered| 287 |construct| 292
              |coerce| 297 |coefficients| 317 |coefficient| 322
              |characteristic| 328 ^ 332 |Zero| 344 |One| 348 = 352 - 358 + 369
              * 375)
           'NIL
           (CONS
            (|makeByteWordVec2| 2
                                '(0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 2 0 0
                                  0 0 1))
            (CONS
             '#(|TensorPowerCategory&| |FreeModuleCategory&| NIL |Algebra&|
                |Module&| NIL |Ring&| NIL NIL NIL NIL |AbelianGroup&| NIL NIL
                |AbelianMonoid&| NIL |Monoid&| NIL |AbelianSemiGroup&|
                |SemiGroup&| NIL |SetCategory&| |RetractableTo&| |BasicType&|
                NIL NIL)
             (CONS
              '#((|TensorPowerCategory| 6 7 9)
                 (|FreeModuleCategory| 7 (|Vector| 8))
                 (|TensorProductCategory| 7 9 9) (|Algebra| 7) (|Module| 7)
                 (|BiModule| 7 7) (|Ring|) (|LeftModule| 7) (|RightModule| 7)
                 (|Rng|) (|LeftModule| $$) (|AbelianGroup|)
                 (|CancellationAbelianMonoid|) (|SemiRing|) (|AbelianMonoid|)
                 (|SemiRng|) (|Monoid|)
                 (|IndexedDirectProductCategory| 7 (|Vector| 8))
                 (|AbelianSemiGroup|) (|SemiGroup|) (|Comparable|)
                 (|SetCategory|) (|RetractableTo| (|Vector| 8)) (|BasicType|)
                 (|CoercibleTo| 13) (|unitsKnown|))
              (|makeByteWordVec2| 62
                                  '(1 0 10 0 11 0 7 0 12 1 7 13 0 14 1 0 16 0
                                    17 2 13 0 0 0 18 1 20 19 0 21 1 8 13 0 22 2
                                    24 13 23 0 25 0 7 0 26 2 7 10 0 0 27 2 13 0
                                    0 0 28 2 13 0 0 0 29 1 9 32 0 33 2 7 0 0 0
                                    34 1 20 0 19 35 2 0 0 7 20 36 2 39 10 0 38
                                    40 1 9 10 0 41 2 39 10 42 0 43 0 0 0 44 1 0
                                    0 16 45 2 9 0 7 8 47 2 9 0 0 0 48 2 0 0 7 0
                                    49 1 0 0 16 50 2 0 0 0 0 51 2 0 10 0 0 1 1
                                    0 10 0 11 1 0 0 19 37 2 0 0 9 9 1 1 0 0 39
                                    46 1 0 59 0 1 2 0 53 0 0 1 2 2 10 0 0 1 0 0
                                    0 1 1 0 56 0 1 1 0 20 0 1 1 0 0 0 1 1 1 53
                                    0 1 1 1 10 0 1 1 0 38 0 1 1 0 60 0 1 1 0 10
                                    0 1 2 0 0 7 20 36 2 0 0 20 7 1 2 0 0 57 0 1
                                    1 0 16 0 17 2 3 7 55 0 1 1 0 15 0 1 1 0 20
                                    0 1 1 0 20 0 1 1 0 7 0 1 1 0 61 0 1 1 0 62
                                    0 1 1 0 0 16 45 1 0 0 16 50 1 1 0 54 1 1 1
                                    0 7 1 1 0 0 20 1 1 0 13 0 30 1 0 58 0 1 2 0
                                    7 0 20 1 0 1 38 1 2 1 0 0 52 1 2 1 0 0 38 1
                                    0 0 0 44 0 1 0 1 2 0 10 0 0 1 2 0 0 0 0 1 1
                                    0 0 0 1 2 0 0 0 0 1 2 1 0 0 0 51 2 0 0 7 20
                                    1 2 0 0 20 7 1 2 0 0 0 7 1 2 0 0 54 0 1 2 0
                                    0 7 0 49 2 0 0 38 0 1 2 0 0 52 0 1)))))
           '|lookupComplete|)) 
