
(/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=#:G683 |res| |i| |transitionMatrix| |n| |m| #2=#:G674)
    (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|
            (* (SPADCALL (SPADCALL |b| 1 (QREFELT $ 20)) (QREFELT $ 22))
               (SPADCALL (SPADCALL |b| 1 (QREFELT $ 20)) (QREFELT $ 23)))
            . #3#)
      (LETT |transitionMatrix|
            (SPADCALL |n| |m| (|spadConstant| $ 24) (QREFELT $ 25)) . #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 $ 26))))
           (LETT |i| (QSADD1 |i|) . #3#) (GO G190) G191 (EXIT NIL))
      (LETT |res|
            (SPADCALL |transitionMatrix| (|SCPKG;matrix2Vector| |x| $)
                      (QREFELT $ 30))
            . #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=#:G696 #2=#:G695 |m| #3=#:G687)
    (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| $ 24)
                                      (QREFELT $ 25)))))
                  (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 $ 32))
                          |b| (QREFELT $ 31))
                         . #4#)
                   (EXIT
                    (SEQ (LETT |k| 1 . #4#) G190
                         (COND ((QSGREATERP |k| |m|) #5#))
                         (SEQ
                          (EXIT
                           (SPADCALL (SPADCALL |sC| |k| (QREFELT $ 34)) |i| |j|
                                     (SPADCALL |covec| |k| (QREFELT $ 35))
                                     (QREFELT $ 36))))
                         (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 (SPADCALL |mt| (QREFELT $ 39)) |nn|)
            (COND
             ((NULL (EQL (SPADCALL |mt| (QREFELT $ 40)) |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 $ 42)) . #1#)
          (SEQ G190
               (COND
                ((NULL (COND ((NULL |lscopy|) 'NIL) ('T 'T))) #3=(GO G191)))
               (SEQ
                (LETT |mat|
                      (SPADCALL |nn| |nn| (|spadConstant| $ 44) (QREFELT $ 45))
                      . #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| (SPADCALL |mt| |i| |j| (QREFELT $ 46))
                                   . #1#)
                             (EXIT
                              (COND
                               ((< 1 (SPADCALL |p| |ls| (QREFELT $ 48)))
                                (|error|
                                 "structuralConstants: entries of second argument must be linear polynomials in the generators"))
                               ('T
                                (SEQ
                                 (LETT |c| (SPADCALL |p| |s| 1 (QREFELT $ 50))
                                       . #1#)
                                 (EXIT
                                  (COND
                                   ((NULL
                                     (SPADCALL |c| (|spadConstant| $ 44)
                                               (QREFELT $ 52)))
                                    (SPADCALL |mat| |i| |j| |c|
                                              (QREFELT $ 53))))))))))
                            (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 $ 56))))))) 

(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 (SPADCALL |mt| (QREFELT $ 59)) |nn|)
            (COND
             ((NULL (EQL (SPADCALL |mt| (QREFELT $ 60)) |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 $ 42)) . #1#)
          (SEQ G190
               (COND
                ((NULL (COND ((NULL |lscopy|) 'NIL) ('T 'T))) #3=(GO G191)))
               (SEQ
                (LETT |mat|
                      (SPADCALL |nn| |nn| (|spadConstant| $ 62) (QREFELT $ 63))
                      . #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| (SPADCALL |mt| |i| |j| (QREFELT $ 64))
                                   . #1#)
                             (LETT |q| (SPADCALL |r| (QREFELT $ 65)) . #1#)
                             (COND
                              ((NULL
                                (EQL (SPADCALL |q| |ls| (QREFELT $ 48)) 0))
                               (EXIT
                                (|error|
                                 "structuralConstants: entries of second argument must be (linear) polynomials in the generators"))))
                             (LETT |p| (SPADCALL |r| (QREFELT $ 66)) . #1#)
                             (EXIT
                              (COND
                               ((< 1 (SPADCALL |p| |ls| (QREFELT $ 48)))
                                (|error|
                                 "structuralConstants: entries of second argument must be linear polynomials in the generators"))
                               ('T
                                (SEQ
                                 (LETT |c| (SPADCALL |p| |s| 1 (QREFELT $ 50))
                                       . #1#)
                                 (EXIT
                                  (COND
                                   ((NULL
                                     (SPADCALL |c| (|spadConstant| $ 44)
                                               (QREFELT $ 52)))
                                    (SPADCALL |mat| |i| |j|
                                              (SPADCALL |c| |q| (QREFELT $ 68))
                                              (QREFELT $ 69))))))))))
                            (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 $ 72))))))) 

(DEFUN |StructuralConstantsPackage| (#1=#:G718)
  (PROG ()
    (RETURN
     (PROG (#2=#:G719)
       (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 74) . #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 . |nrows|)
              (42 . |ncols|) (47 . |Zero|) (51 . |new|) (58 . |setColumn!|)
              (|Union| 14 '"failed")
              (|Record| (|:| |particular| 27) (|:| |basis| (|List| 14)))
              (|LinearSystemMatrixPackage| 6 14 14 8) (65 . |solve|)
              |SCPKG;coordinates;MLV;2| (71 . *) (|Vector| 8) (77 . |elt|)
              (83 . |elt|) (89 . |setelt|) |SCPKG;structuralConstants;LV;3|
              (|Matrix| 43) (97 . |nrows|) (102 . |ncols|) (|List| 49)
              (107 . |copy|) (|Polynomial| 6) (112 . |Zero|) (116 . |new|)
              (123 . |qelt|) (130 . |One|) (134 . |totalDegree|) (|Symbol|)
              (140 . |coefficient|) (|Boolean|) (147 . =) (153 . |qsetelt!|)
              (|List| 38) (|Vector| 38) (161 . |vector|)
              |SCPKG;structuralConstants;LMV;4| (|Matrix| 61) (166 . |nrows|)
              (171 . |ncols|) (|Fraction| 43) (176 . |Zero|) (180 . |new|)
              (187 . |qelt|) (194 . |denom|) (199 . |numer|) (204 . |One|)
              (208 . /) (214 . |qsetelt!|) (|List| 58) (|Vector| 58)
              (222 . |vector|) |SCPKG;structuralConstants;LMV;5|)
           '#(|structuralConstants| 227 |coordinates| 244) 'NIL
           (CONS (|makeByteWordVec2| 1 'NIL)
                 (CONS '#()
                       (CONS '#()
                             (|makeByteWordVec2| 73
                                                 '(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 1 8 21 0 23 0
                                                   6 0 24 3 8 0 21 21 6 25 3 8
                                                   0 0 16 14 26 2 29 28 8 14 30
                                                   2 8 0 0 0 32 2 33 8 0 16 34
                                                   2 14 6 0 16 35 4 8 6 0 16 16
                                                   6 36 1 38 21 0 39 1 38 21 0
                                                   40 1 41 0 0 42 0 43 0 44 3
                                                   38 0 21 21 43 45 3 38 43 0
                                                   16 16 46 0 43 0 47 2 43 21 0
                                                   41 48 3 43 0 0 49 21 50 2 43
                                                   51 0 0 52 4 38 43 0 16 16 43
                                                   53 1 55 0 54 56 1 58 21 0 59
                                                   1 58 21 0 60 0 61 0 62 3 58
                                                   0 21 21 61 63 3 58 61 0 16
                                                   16 64 1 61 43 0 65 1 61 43 0
                                                   66 0 61 0 67 2 61 0 43 43 68
                                                   4 58 61 0 16 16 61 69 1 71 0
                                                   70 72 2 0 55 41 38 57 2 0 71
                                                   41 58 73 1 0 33 17 37 2 0 14
                                                   8 17 31)))))
           '|lookupComplete|)) 
