
(/VERSIONCHECK 2) 

(DEFUN |SCPKG;matrix2Vector| (|m| $)
  (PROG (|li| |lili|)
    (RETURN
     (SEQ
      (LETT |lili| (SPADCALL |m| (QREFELT $ 9)) . #1=(|SCPKG;matrix2Vector|))
      (LETT |li| (SPADCALL (ELT $ 11) |lili| (QREFELT $ 13)) . #1#)
      (EXIT (SPADCALL |li| (QREFELT $ 15))))))) 

(DEFUN |SCPKG;coordinates;MLV;2| (|x| |b| $)
  (PROG (#1=#:G1834 |res| |i| |transitionMatrix| |n| |m| #2=#:G1815)
    (RETURN
     (SEQ
      (LETT |m|
            (PROG1
                (LETT #2# (SPADCALL |b| (QREFELT $ 18))
                      . #3=(|SCPKG;coordinates;MLV;2|))
              (|check-subtype| (>= #2# 0) '(|NonNegativeInteger|) #2#))
            . #3#)
      (LETT |n|
            (* (QVSIZE (SPADCALL |b| 1 (QREFELT $ 20)))
               (SPADCALL (SPADCALL |b| 1 (QREFELT $ 20)) (QREFELT $ 22)))
            . #3#)
      (LETT |transitionMatrix|
            (SPADCALL |n| |m| (|spadConstant| $ 23) (QREFELT $ 24)) . #3#)
      (SEQ (LETT |i| 1 . #3#) G190 (COND ((QSGREATERP |i| |m|) (GO G191)))
           (SEQ
            (EXIT
             (SPADCALL |transitionMatrix| |i|
                       (|SCPKG;matrix2Vector| (SPADCALL |b| |i| (QREFELT $ 20))
                        $)
                       (QREFELT $ 25))))
           (LETT |i| (QSADD1 |i|) . #3#) (GO G190) G191 (EXIT NIL))
      (LETT |res|
            (SPADCALL |transitionMatrix| (|SCPKG;matrix2Vector| |x| $)
                      (QREFELT $ 29))
            . #3#)
      (COND
       ((NULL (NULL (QCDR |res|)))
        (|error| "coordinates: the second argument is linearly dependent")))
      (EXIT
       (COND
        ((QEQCAR (QCAR |res|) 1)
         (|error|
          "coordinates: first argument is not in linear span of second argument"))
        ('T
         (PROG2
             (LETT #1# (QCAR |res|) . #3#)
             (QCDR #1#)
           (|check-union| (QEQCAR #1# 0) (|Vector| (QREFELT $ 6)) #1#))))))))) 

(DEFUN |SCPKG;structuralConstants;LV;3| (|b| $)
  (PROG (|k| |covec| |j| |i| |sC| #1=#:G1847 #2=#:G1846 |m| #3=#:G1838)
    (RETURN
     (SEQ
      (LETT |m|
            (PROG1
                (LETT #3# (SPADCALL |b| (QREFELT $ 18))
                      . #4=(|SCPKG;structuralConstants;LV;3|))
              (|check-subtype| (>= #3# 0) '(|NonNegativeInteger|) #3#))
            . #4#)
      (LETT |sC|
            (PROGN
             (LETT #2# (GETREFV |m|) . #4#)
             (SEQ (LETT #1# 0 . #4#) (LETT |k| 1 . #4#) G190
                  (COND ((QSGREATERP |k| |m|) #5=(GO G191)))
                  (SEQ
                   (EXIT
                    (SETELT #2# #1#
                            (SPADCALL |m| |m| (|spadConstant| $ 23)
                                      (QREFELT $ 24)))))
                  (LETT |k| (PROG1 (QSADD1 |k|) (LETT #1# (QSADD1 #1#) . #4#))
                        . #4#)
                  #6=(GO G190) G191 (EXIT NIL))
             #2#)
            . #4#)
      (SEQ (LETT |i| 1 . #4#) G190 (COND ((QSGREATERP |i| |m|) #5#))
           (SEQ
            (EXIT
             (SEQ (LETT |j| 1 . #4#) G190 (COND ((QSGREATERP |j| |m|) #5#))
                  (SEQ
                   (LETT |covec|
                         (SPADCALL
                          (SPADCALL (SPADCALL |b| |i| (QREFELT $ 20))
                                    (SPADCALL |b| |j| (QREFELT $ 20))
                                    (QREFELT $ 31))
                          |b| (QREFELT $ 30))
                         . #4#)
                   (EXIT
                    (SEQ (LETT |k| 1 . #4#) G190
                         (COND ((QSGREATERP |k| |m|) #5#))
                         (SEQ
                          (EXIT
                           (SPADCALL (SPADCALL |sC| |k| (QREFELT $ 33)) |i| |j|
                                     (SPADCALL |covec| |k| (QREFELT $ 34))
                                     (QREFELT $ 35))))
                         (LETT |k| (QSADD1 |k|) . #4#) #6# G191 (EXIT NIL))))
                  (LETT |j| (QSADD1 |j|) . #4#) #6# G191 (EXIT NIL))))
           (LETT |i| (QSADD1 |i|) . #4#) #6# G191 (EXIT NIL))
      (EXIT |sC|))))) 

(DEFUN |SCPKG;structuralConstants;LMV;4| (|ls| |mt| $)
  (PROG (|lscopy| |gamma| |c| |p| |j| |i| |s| |mat| |nn|)
    (RETURN
     (SEQ (LETT |nn| (LENGTH |ls|) . #1=(|SCPKG;structuralConstants;LMV;4|))
          (COND
           ((EQL (QVSIZE |mt|) |nn|)
            (COND
             ((NULL (EQL (SPADCALL |mt| (QREFELT $ 38)) |nn|))
              (EXIT
               (|error|
                #2="structuralConstants: size of second argument does not agree with number of generators")))))
           ('T (EXIT (|error| #2#))))
          (LETT |gamma| NIL . #1#)
          (LETT |lscopy| (SPADCALL |ls| (QREFELT $ 40)) . #1#)
          (SEQ G190
               (COND
                ((NULL (COND ((NULL |lscopy|) 'NIL) ('T 'T))) #3=(GO G191)))
               (SEQ
                (LETT |mat|
                      (SPADCALL |nn| |nn| (|spadConstant| $ 42) (QREFELT $ 43))
                      . #1#)
                (LETT |s| (|SPADfirst| |lscopy|) . #1#)
                (SEQ (LETT |i| 1 . #1#) G190 (COND ((QSGREATERP |i| |nn|) #3#))
                     (SEQ
                      (EXIT
                       (SEQ (LETT |j| 1 . #1#) G190
                            (COND ((QSGREATERP |j| |nn|) #3#))
                            (SEQ (LETT |p| (QAREF2O |mt| |i| |j| 1 1) . #1#)
                                 (EXIT
                                  (COND
                                   ((< 1 (SPADCALL |p| |ls| (QREFELT $ 45)))
                                    (|error|
                                     "structuralConstants: entries of second argument must be linear polynomials in the generators"))
                                   ('T
                                    (SEQ
                                     (LETT |c|
                                           (SPADCALL |p| |s| 1 (QREFELT $ 47))
                                           . #1#)
                                     (EXIT
                                      (COND
                                       ((NULL
                                         (SPADCALL |c| (|spadConstant| $ 42)
                                                   (QREFELT $ 49)))
                                        (QSETAREF2O |mat| |i| |j| |c| 1
                                                    1)))))))))
                            (LETT |j| (QSADD1 |j|) . #1#) #4=(GO G190) G191
                            (EXIT NIL))))
                     (LETT |i| (QSADD1 |i|) . #1#) #4# G191 (EXIT NIL))
                (LETT |gamma| (CONS |mat| |gamma|) . #1#)
                (EXIT (LETT |lscopy| (CDR |lscopy|) . #1#)))
               NIL #4# G191 (EXIT NIL))
          (EXIT (SPADCALL (REVERSE |gamma|) (QREFELT $ 52))))))) 

(DEFUN |SCPKG;structuralConstants;LMV;5| (|ls| |mt| $)
  (PROG (|lscopy| |gamma| |c| |p| |q| |r| |j| |i| |s| |mat| |nn|)
    (RETURN
     (SEQ (LETT |nn| (LENGTH |ls|) . #1=(|SCPKG;structuralConstants;LMV;5|))
          (COND
           ((EQL (QVSIZE |mt|) |nn|)
            (COND
             ((NULL (EQL (SPADCALL |mt| (QREFELT $ 55)) |nn|))
              (EXIT
               (|error|
                #2="structuralConstants: size of second argument does not agree with number of generators")))))
           ('T (EXIT (|error| #2#))))
          (LETT |gamma| NIL . #1#)
          (LETT |lscopy| (SPADCALL |ls| (QREFELT $ 40)) . #1#)
          (SEQ G190
               (COND
                ((NULL (COND ((NULL |lscopy|) 'NIL) ('T 'T))) #3=(GO G191)))
               (SEQ
                (LETT |mat|
                      (SPADCALL |nn| |nn| (|spadConstant| $ 57) (QREFELT $ 58))
                      . #1#)
                (LETT |s| (|SPADfirst| |lscopy|) . #1#)
                (SEQ (LETT |i| 1 . #1#) G190 (COND ((QSGREATERP |i| |nn|) #3#))
                     (SEQ
                      (EXIT
                       (SEQ (LETT |j| 1 . #1#) G190
                            (COND ((QSGREATERP |j| |nn|) #3#))
                            (SEQ (LETT |r| (QAREF2O |mt| |i| |j| 1 1) . #1#)
                                 (LETT |q| (SPADCALL |r| (QREFELT $ 59)) . #1#)
                                 (COND
                                  ((NULL
                                    (EQL (SPADCALL |q| |ls| (QREFELT $ 45)) 0))
                                   (EXIT
                                    (|error|
                                     "structuralConstants: entries of second argument must be (linear) polynomials in the generators"))))
                                 (LETT |p| (SPADCALL |r| (QREFELT $ 60)) . #1#)
                                 (EXIT
                                  (COND
                                   ((< 1 (SPADCALL |p| |ls| (QREFELT $ 45)))
                                    (|error|
                                     "structuralConstants: entries of second argument must be linear polynomials in the generators"))
                                   ('T
                                    (SEQ
                                     (LETT |c|
                                           (SPADCALL |p| |s| 1 (QREFELT $ 47))
                                           . #1#)
                                     (EXIT
                                      (COND
                                       ((NULL
                                         (SPADCALL |c| (|spadConstant| $ 42)
                                                   (QREFELT $ 49)))
                                        (QSETAREF2O |mat| |i| |j|
                                                    (SPADCALL |c| |q|
                                                              (QREFELT $ 62))
                                                    1 1)))))))))
                            (LETT |j| (QSADD1 |j|) . #1#) #4=(GO G190) G191
                            (EXIT NIL))))
                     (LETT |i| (QSADD1 |i|) . #1#) #4# G191 (EXIT NIL))
                (LETT |gamma| (CONS |mat| |gamma|) . #1#)
                (EXIT (LETT |lscopy| (CDR |lscopy|) . #1#)))
               NIL #4# G191 (EXIT NIL))
          (EXIT (SPADCALL (REVERSE |gamma|) (QREFELT $ 65))))))) 

(DEFUN |StructuralConstantsPackage| (#1=#:G1872)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1873)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|StructuralConstantsPackage|)
                                           '|domainEqualList|)
                . #3=(|StructuralConstantsPackage|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT
              (PROG1 (|StructuralConstantsPackage;| #1#) (LETT #2# T . #3#))
            (COND
             ((NOT #2#)
              (HREM |$ConstructorCache| '|StructuralConstantsPackage|))))))))))) 

(DEFUN |StructuralConstantsPackage;| (|#1|)
  (PROG (|pv$| $ |dv$| DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|StructuralConstantsPackage|))
      (LETT |dv$| (LIST '|StructuralConstantsPackage| DV$1) . #1#)
      (LETT $ (GETREFV 67) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|StructuralConstantsPackage| (LIST DV$1)
                  (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      $)))) 

(MAKEPROP '|StructuralConstantsPackage| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|List| 10) (|Matrix| 6)
              (0 . |listOfLists|) (|List| 6) (5 . |concat|)
              (|Mapping| 10 10 10) (11 . |reduce|) (|Vector| 6)
              (17 . |construct|) (|Integer|) (|List| 8) (22 . |maxIndex|)
              (27 . |One|) (31 . |elt|) (|NonNegativeInteger|) (37 . |ncols|)
              (42 . |Zero|) (46 . |new|) (53 . |setColumn!|)
              (|Union| 14 '"failed")
              (|Record| (|:| |particular| 26) (|:| |basis| (|List| 14)))
              (|LinearSystemMatrixPackage| 6 14 14 8) (60 . |solve|)
              |SCPKG;coordinates;MLV;2| (66 . *) (|Vector| 8) (72 . |elt|)
              (78 . |elt|) (84 . |setelt|) |SCPKG;structuralConstants;LV;3|
              (|Matrix| 41) (92 . |ncols|) (|List| 46) (97 . |copy|)
              (|Polynomial| 6) (102 . |Zero|) (106 . |new|) (113 . |One|)
              (117 . |totalDegree|) (|Symbol|) (123 . |coefficient|)
              (|Boolean|) (130 . =) (|List| 37) (|Vector| 37) (136 . |vector|)
              |SCPKG;structuralConstants;LMV;4| (|Matrix| 56) (141 . |ncols|)
              (|Fraction| 41) (146 . |Zero|) (150 . |new|) (157 . |denom|)
              (162 . |numer|) (167 . |One|) (171 . /) (|List| 54) (|Vector| 54)
              (177 . |vector|) |SCPKG;structuralConstants;LMV;5|)
           '#(|structuralConstants| 182 |coordinates| 199) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 66
                                                 '(1 8 7 0 9 2 10 0 0 0 11 2 7
                                                   10 12 0 13 1 14 0 10 15 1 17
                                                   16 0 18 0 6 0 19 2 17 8 0 16
                                                   20 1 8 21 0 22 0 6 0 23 3 8
                                                   0 21 21 6 24 3 8 0 0 16 14
                                                   25 2 28 27 8 14 29 2 8 0 0 0
                                                   31 2 32 8 0 16 33 2 14 6 0
                                                   16 34 4 8 6 0 16 16 6 35 1
                                                   37 21 0 38 1 39 0 0 40 0 41
                                                   0 42 3 37 0 21 21 41 43 0 41
                                                   0 44 2 41 21 0 39 45 3 41 0
                                                   0 46 21 47 2 41 48 0 0 49 1
                                                   51 0 50 52 1 54 21 0 55 0 56
                                                   0 57 3 54 0 21 21 56 58 1 56
                                                   41 0 59 1 56 41 0 60 0 56 0
                                                   61 2 56 0 41 41 62 1 64 0 63
                                                   65 2 0 51 39 37 53 2 0 64 39
                                                   54 66 1 0 32 17 36 2 0 14 8
                                                   17 30)))))
           '|lookupComplete|)) 
