
(/VERSIONCHECK 2) 

(DEFUN |PSEUDLIN;inv| (|m| $)
  (PROG (#0=#:G1824)
    (RETURN
      (PROG2 (LETT #0# (SPADCALL |m| (QREFELT $ 9)) |PSEUDLIN;inv|)
             (QCDR #0#)
        (|check-union| (QEQCAR #0# 0) (|Matrix| (QREFELT $ 6)) #0#))))) 

(DEFUN |PSEUDLIN;changeBase;2MAMM;2| (M A |sig| |der| $)
  (SPADCALL (|PSEUDLIN;inv| A $)
      (SPADCALL
          (SPADCALL M
              (SPADCALL
                  (CONS #'|PSEUDLIN;changeBase;2MAMM;2!0|
                        (VECTOR $ |sig|))
                  A (QREFELT $ 13))
              (QREFELT $ 14))
          (SPADCALL |der| A (QREFELT $ 13)) (QREFELT $ 15))
      (QREFELT $ 14))) 

(DEFUN |PSEUDLIN;changeBase;2MAMM;2!0| (|#1| $$)
  (SPADCALL (QREFELT $$ 1) |#1| (QREFELT (QREFELT $$ 0) 11))) 

(DEFUN |PSEUDLIN;normalForm;MAMR;3| (M |sig| |der| $)
  (|PSEUDLIN;normalForm0| M |sig| (SPADCALL |sig| (QREFELT $ 17)) |der|
      $)) 

(DEFUN |PSEUDLIN;companionBlocks;MVL;4| (R |w| $)
  (PROG (|n| |j| #0=#:G1835 |v| |k| |l| |i|)
    (RETURN
      (SEQ (LETT |i| 1 . #1=(|PSEUDLIN;companionBlocks;MVL;4|))
           (LETT |n| (SPADCALL R (QREFELT $ 21)) . #1#)
           (LETT |l| NIL . #1#)
           (SEQ G190
                (COND
                  ((NULL (COND ((< |n| |i|) 'NIL) ('T 'T)))
                   #2=(GO G191)))
                (SEQ (LETT |j| |i| . #1#)
                     (SEQ G190
                          (COND
                            ((NULL (COND
                                     ((< |n| (+ |j| 1)) 'NIL)
                                     ('T
                                      (SPADCALL
                                       (SPADCALL R |j| (+ |j| 1)
                                        (QREFELT $ 24))
                                       (|spadConstant| $ 22)
                                       (QREFELT $ 26)))))
                             #2#))
                          (SEQ (EXIT (LETT |j| (+ |j| 1) . #1#))) NIL
                          #3=(GO G190) G191 (EXIT NIL))
                     (LETT |v|
                           (SPADCALL
                               (PROG1 (LETT #0#
                                       (+ (- |j| |i|) 1) . #1#)
                                 (|check-subtype| (>= #0# 0)
                                     '(|NonNegativeInteger|) #0#))
                               (|spadConstant| $ 27) (QREFELT $ 29)) . #1#)
                     (SEQ (LETT |k| |i| . #1#) G190
                          (COND ((> |k| |j|) #2#))
                          (SEQ (EXIT (SPADCALL |v| (+ (- |k| |i|) 1)
                                      (SPADCALL |w| |k| (QREFELT $ 30))
                                      (QREFELT $ 31))))
                          (LETT |k| (+ |k| 1) . #1#) #3# G191
                          (EXIT NIL))
                     (LETT |l|
                           (CONS (CONS (SPADCALL R |i| |j| |i| |j|
                                        (QREFELT $ 32))
                                       |v|)
                                 |l|) . #1#)
                     (EXIT (LETT |i| (+ |j| 1) . #1#)))
                NIL #3# G191 (EXIT NIL))
           (EXIT |l|))))) 

(DEFUN |PSEUDLIN;normalForm0| (M |sig| |siginv| |der| $)
  (PROG (N #0=#:G1865 #1=#:G1866 #2=#:G1864 |recOfMatrices| #3=#:G1867
           #4=#:G1868 |k| |j| E B |Binv| |i|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT N (SPADCALL M (QREFELT $ 21))
                            . #5=(|PSEUDLIN;normalForm0|))
                      (LETT B
                            (SPADCALL
                                (PRIMVEC2ARR
                                    (PROGN
                                      (LETT #0# (GETREFV N) . #5#)
                                      (SEQ (LETT #1# 0 . #5#)
                                       (LETT |k| 1 . #5#) G190
                                       (COND
                                         ((QSGREATERP |k| N)
                                          #6=(GO G191)))
                                       (SEQ
                                        (EXIT
                                         (SETELT #0# #1#
                                          (|spadConstant| $ 22))))
                                       (LETT |k|
                                        (PROG1 (QSADD1 |k|)
                                          (LETT #1# (QSADD1 #1#) . #5#)) . #5#)
                                       #7=(GO G190) G191 (EXIT NIL))
                                      #0#))
                                (QREFELT $ 36)) . #5#)
                      (LETT |Binv| (SPADCALL B (QREFELT $ 37)) . #5#)
                      (COND
                        ((SPADCALL M (QREFELT $ 38))
                         (PROGN
                           (LETT #2# (VECTOR M B |Binv|) . #5#)
                           (GO #2#))))
                      (LETT |i| 1 . #5#)
                      (SEQ G190 (COND ((NULL (< |i| N)) #6#))
                           (SEQ (LETT |j| (+ |i| 1) . #5#)
                                (SEQ G190
                                     (COND
                                       ((NULL
                                         (COND
                                           ((< N |j|) 'NIL)
                                           ('T
                                            (SPADCALL
                                             (SPADCALL M |i| |j|
                                              (QREFELT $ 24))
                                             (|spadConstant| $ 27)
                                             (QREFELT $ 26)))))
                                        #6#))
                                     (SEQ
                                      (EXIT (LETT |j| (+ |j| 1) . #5#)))
                                     NIL #7# G191 (EXIT NIL))
                                (EXIT (COND
                                        ((< N |j|)
                                         (SEQ
                                          (SEQ (LETT |j| |i| . #5#)
                                           G190 (COND ((< |j| 2) #6#))
                                           (SEQ
                                            (EXIT
                                             (SEQ
                                              (LETT |k|
                                               (+ |i| 1) . #5#)
                                              G190
                                              (COND ((> |k| N) #6#))
                                              (SEQ
                                               (LETT E
                                                (|PSEUDLIN;addMatrix| N
                                                 |k| (- |j| 1)
                                                 (SPADCALL M |k| |j|
                                                  (QREFELT $ 24))
                                                 $) . #5#)
                                               (LETT M
                                                (SPADCALL M E |sig|
                                                 |der| (QREFELT $ 16)) . #5#)
                                               (LETT B
                                                (SPADCALL B E
                                                 (QREFELT $ 14)) . #5#)
                                               (EXIT
                                                (LETT |Binv|
                                                 (SPADCALL
                                                  (|PSEUDLIN;inv| E $)
                                                  |Binv|
                                                  (QREFELT $ 14)) . #5#)))
                                              (LETT |k|
                                               (+ |k| 1) . #5#)
                                              #7# G191 (EXIT NIL))))
                                           (LETT |j| (+ |j| -1) . #5#)
                                           #7# G191 (EXIT NIL))
                                          (LETT |j| (+ |i| 1) . #5#)
                                          (SEQ G190
                                           (COND
                                             ((NULL
                                               (COND
                                                 ((< N |j|) 'NIL)
                                                 ('T
                                                  (SPADCALL
                                                   (SPADCALL M |j| 1
                                                    (QREFELT $ 24))
                                                   (|spadConstant| $
                                                    27)
                                                   (QREFELT $ 26)))))
                                              #6#))
                                           (SEQ
                                            (EXIT
                                             (LETT |j| (+ |j| 1) . #5#)))
                                           NIL #7# G191 (EXIT NIL))
                                          (EXIT
                                           (COND
                                             ((< N |j|)
                                              (SEQ
                                               (LETT |recOfMatrices|
                                                (SPADCALL
                                                 (SPADCALL M (+ |i| 1)
                                                  N (+ |i| 1) N
                                                  (QREFELT $ 32))
                                                 |sig| |der|
                                                 (QREFELT $ 19)) . #5#)
                                               (SPADCALL M (+ |i| 1)
                                                (+ |i| 1)
                                                (QVELT |recOfMatrices|
                                                 0)
                                                (QREFELT $ 40))
                                               (LETT E
                                                (SPADCALL
                                                 (PRIMVEC2ARR
                                                  (PROGN
                                                    (LETT #3#
                                                     (GETREFV N) . #5#)
                                                    (SEQ
                                                     (LETT #4# 0 . #5#)
                                                     (LETT |k| 1 . #5#)
                                                     G190
                                                     (COND
                                                       ((QSGREATERP |k|
                                                         N)
                                                        #6#))
                                                     (SEQ
                                                      (EXIT
                                                       (SETELT #3# #4#
                                                        (|spadConstant|
                                                         $ 22))))
                                                     (LETT |k|
                                                      (PROG1
                                                       (QSADD1 |k|)
                                                        (LETT #4#
                                                         (QSADD1 #4#) . #5#)) . #5#)
                                                     #7# G191
                                                     (EXIT NIL))
                                                    #3#))
                                                 (QREFELT $ 36)) . #5#)
                                               (SPADCALL E (+ |i| 1)
                                                (+ |i| 1)
                                                (QVELT |recOfMatrices|
                                                 1)
                                                (QREFELT $ 40))
                                               (LETT B
                                                (SPADCALL B E
                                                 (QREFELT $ 14)) . #5#)
                                               (SPADCALL E (+ |i| 1)
                                                (+ |i| 1)
                                                (QVELT |recOfMatrices|
                                                 2)
                                                (QREFELT $ 40))
                                               (LETT |Binv|
                                                (SPADCALL E |Binv|
                                                 (QREFELT $ 14)) . #5#)
                                               (EXIT
                                                (LETT |i| N . #5#))))
                                             ('T
                                              (SEQ
                                               (LETT E
                                                (|PSEUDLIN;permutationMatrix|
                                                 N 1 |j| $) . #5#)
                                               (LETT M
                                                (SPADCALL M E |sig|
                                                 |der| (QREFELT $ 16)) . #5#)
                                               (LETT B
                                                (SPADCALL B E
                                                 (QREFELT $ 14)) . #5#)
                                               (LETT |Binv|
                                                (SPADCALL E |Binv|
                                                 (QREFELT $ 14)) . #5#)
                                               (EXIT
                                                (LETT |i| 1 . #5#))))))))
                                        ('T
                                         (SEQ
                                          (COND
                                            ((NULL (EQL |j| (+ |i| 1)))
                                             (SEQ
                                              (LETT E
                                               (|PSEUDLIN;permutationMatrix|
                                                N (+ |i| 1) |j| $) . #5#)
                                              (LETT M
                                               (SPADCALL M E |sig|
                                                |der| (QREFELT $ 16)) . #5#)
                                              (LETT B
                                               (SPADCALL B E
                                                (QREFELT $ 14)) . #5#)
                                              (EXIT
                                               (LETT |Binv|
                                                (SPADCALL E |Binv|
                                                 (QREFELT $ 14)) . #5#)))))
                                          (LETT E
                                           (|PSEUDLIN;mulMatrix| N
                                            (+ |i| 1)
                                            (SPADCALL |siginv|
                                             (SPADCALL
                                              (SPADCALL M |i| (+ |i| 1)
                                               (QREFELT $ 24))
                                              (QREFELT $ 41))
                                             (QREFELT $ 11))
                                            $) . #5#)
                                          (LETT M
                                           (SPADCALL M E |sig| |der|
                                            (QREFELT $ 16)) . #5#)
                                          (LETT B
                                           (SPADCALL B E
                                            (QREFELT $ 14)) . #5#)
                                          (LETT |Binv|
                                           (SPADCALL
                                            (|PSEUDLIN;inv| E $) |Binv|
                                            (QREFELT $ 14)) . #5#)
                                          (SEQ (LETT |j| 1 . #5#) G190
                                           (COND
                                             ((QSGREATERP |j| N) #6#))
                                           (SEQ
                                            (EXIT
                                             (COND
                                               ((NULL
                                                 (EQL |j| (+ |i| 1)))
                                                (SEQ
                                                 (LETT E
                                                  (|PSEUDLIN;addMatrix|
                                                   N (+ |i| 1) |j|
                                                   (SPADCALL |siginv|
                                                    (SPADCALL
                                                     (SPADCALL M |i|
                                                      |j|
                                                      (QREFELT $ 24))
                                                     (QREFELT $ 42))
                                                    (QREFELT $ 11))
                                                   $) . #5#)
                                                 (LETT M
                                                  (SPADCALL M E |sig|
                                                   |der|
                                                   (QREFELT $ 16)) . #5#)
                                                 (LETT B
                                                  (SPADCALL B E
                                                   (QREFELT $ 14)) . #5#)
                                                 (EXIT
                                                  (LETT |Binv|
                                                   (SPADCALL
                                                    (|PSEUDLIN;inv| E
                                                     $)
                                                    |Binv|
                                                    (QREFELT $ 14)) . #5#)))))))
                                           (LETT |j|
                                            (QSADD1 |j|) . #5#)
                                           #7# G191 (EXIT NIL))
                                          (EXIT
                                           (LETT |i| (+ |i| 1) . #5#)))))))
                           NIL #7# G191 (EXIT NIL))
                      (EXIT (VECTOR M B |Binv|))))
           #2# (EXIT #2#))))) 

(DEFUN |PSEUDLIN;mulMatrix| (N |i| |a| $)
  (PROG (#0=#:G1872 #1=#:G1873 |j| M)
    (RETURN
      (SEQ (LETT M
                 (SPADCALL
                     (PRIMVEC2ARR
                         (PROGN
                           (LETT #0# (GETREFV N)
                                 . #2=(|PSEUDLIN;mulMatrix|))
                           (SEQ (LETT #1# 0 . #2#) (LETT |j| 1 . #2#)
                                G190
                                (COND ((QSGREATERP |j| N) (GO G191)))
                                (SEQ (EXIT
                                      (SETELT #0# #1#
                                       (|spadConstant| $ 22))))
                                (LETT |j|
                                      (PROG1 (QSADD1 |j|)
                                        (LETT #1# (QSADD1 #1#) . #2#)) . #2#)
                                (GO G190) G191 (EXIT NIL))
                           #0#))
                     (QREFELT $ 36)) . #2#)
           (SPADCALL M |i| |i| |a| (QREFELT $ 43)) (EXIT M))))) 

(DEFUN |PSEUDLIN;addMatrix| (N |i| |k| |a| $)
  (PROG (#0=#:G1877 #1=#:G1878 |j| A)
    (RETURN
      (SEQ (LETT A
                 (SPADCALL
                     (PRIMVEC2ARR
                         (PROGN
                           (LETT #0# (GETREFV N)
                                 . #2=(|PSEUDLIN;addMatrix|))
                           (SEQ (LETT #1# 0 . #2#) (LETT |j| 1 . #2#)
                                G190
                                (COND ((QSGREATERP |j| N) (GO G191)))
                                (SEQ (EXIT
                                      (SETELT #0# #1#
                                       (|spadConstant| $ 22))))
                                (LETT |j|
                                      (PROG1 (QSADD1 |j|)
                                        (LETT #1# (QSADD1 #1#) . #2#)) . #2#)
                                (GO G190) G191 (EXIT NIL))
                           #0#))
                     (QREFELT $ 36)) . #2#)
           (SPADCALL A |i| |k| |a| (QREFELT $ 43)) (EXIT A))))) 

(DEFUN |PSEUDLIN;permutationMatrix| (N |i| |k| $)
  (PROG (#0=#:G1882 #1=#:G1883 |j| P)
    (RETURN
      (SEQ (LETT P
                 (SPADCALL
                     (PRIMVEC2ARR
                         (PROGN
                           (LETT #0# (GETREFV N)
                                 . #2=(|PSEUDLIN;permutationMatrix|))
                           (SEQ (LETT #1# 0 . #2#) (LETT |j| 1 . #2#)
                                G190
                                (COND ((QSGREATERP |j| N) (GO G191)))
                                (SEQ (EXIT
                                      (SETELT #0# #1#
                                       (|spadConstant| $ 22))))
                                (LETT |j|
                                      (PROG1 (QSADD1 |j|)
                                        (LETT #1# (QSADD1 #1#) . #2#)) . #2#)
                                (GO G190) G191 (EXIT NIL))
                           #0#))
                     (QREFELT $ 36)) . #2#)
           (SPADCALL P |i| |i|
               (SPADCALL P |k| |k| (|spadConstant| $ 27)
                   (QREFELT $ 43))
               (QREFELT $ 43))
           (SPADCALL P |i| |k|
               (SPADCALL P |k| |i| (|spadConstant| $ 22)
                   (QREFELT $ 43))
               (QREFELT $ 43))
           (EXIT P))))) 

(DEFUN |PseudoLinearNormalForm| (#0=#:G1884)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1885)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache|
                             '|PseudoLinearNormalForm|)
                       '|domainEqualList|)
                   . #2=(|PseudoLinearNormalForm|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|PseudoLinearNormalForm;| #0#)
                 (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache| '|PseudoLinearNormalForm|))))))))))) 

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

(MAKEPROP '|PseudoLinearNormalForm| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|)
             (|Union| $ '"failed") (|Matrix| 6) (0 . |inverse|)
             (|Automorphism| 6) (5 . |elt|) (|Mapping| 6 6)
             (11 . |map|) (17 . *) (23 . +)
             |PSEUDLIN;changeBase;2MAMM;2| (29 . |inv|)
             (|Record| (|:| R 8) (|:| A 8) (|:| |Ainv| 8))
             |PSEUDLIN;normalForm;MAMR;3| (|NonNegativeInteger|)
             (34 . |nrows|) (39 . |One|) (|Integer|) (43 . |elt|)
             (|Boolean|) (50 . =) (56 . |Zero|) (|Vector| 6)
             (60 . |new|) (66 . |elt|) (72 . |setelt|)
             (79 . |subMatrix|) (|Record| (|:| C 8) (|:| |g| 28))
             (|List| 33) |PSEUDLIN;companionBlocks;MVL;4|
             (88 . |diagonalMatrix|) (93 . |copy|) (98 . |diagonal?|)
             (103 . |One|) (107 . |setsubMatrix!|) (115 . |inv|)
             (120 . -) (125 . |setelt|))
          '#(|normalForm| 133 |companionBlocks| 140 |changeBase| 146)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 43
                                '(1 8 7 0 9 2 10 6 0 6 11 2 8 0 12 0 13
                                  2 8 0 0 0 14 2 8 0 0 0 15 1 10 0 0 17
                                  1 8 20 0 21 0 6 0 22 3 8 6 0 23 23 24
                                  2 6 25 0 0 26 0 6 0 27 2 28 0 20 6 29
                                  2 28 6 0 23 30 3 28 6 0 23 6 31 5 8 0
                                  0 23 23 23 23 32 1 8 0 28 36 1 8 0 0
                                  37 1 8 25 0 38 0 10 0 39 4 8 0 0 23
                                  23 0 40 1 6 0 0 41 1 6 0 0 42 4 8 6 0
                                  23 23 6 43 3 0 18 8 10 12 19 2 0 34 8
                                  28 35 4 0 8 8 8 10 12 16)))))
          '|lookupComplete|)) 
