
(/VERSIONCHECK 2) 

(DEFUN |FRMOD;One;$;1| ($) (QREFELT $ 10)) 

(PUT '|FRMOD;module;V$;2| '|SPADreplace| '(XLAM (|v|) |v|)) 

(DEFUN |FRMOD;module;V$;2| (|v| $) |v|) 

(PUT '|FRMOD;basis;$V;3| '|SPADreplace| '(XLAM (|m|) |m|)) 

(DEFUN |FRMOD;basis;$V;3| (|m| $) |m|) 

(DEFUN |FRMOD;rowdiv| (|r| |f| $)
  (PROG (#1=#:G670 |i| #2=#:G669 #3=#:G668)
    (RETURN
     (SEQ
      (PROGN
       (LETT #3#
             (GETREFV
              (QSADD1 (- #4=(QVSIZE |r|) #5=(SPADCALL |r| (QREFELT $ 29)))))
             . #6=(|FRMOD;rowdiv|))
       (SEQ (LETT #2# 0 . #6#) (LETT |i| #5# . #6#) (LETT #1# #4# . #6#) G190
            (COND ((> |i| #1#) (GO G191)))
            (SEQ
             (EXIT
              (SETELT #3# #2#
                      (SPADCALL (SPADCALL |r| |i| (QREFELT $ 30)) |f|
                                (QREFELT $ 31)))))
            (LETT |i| (PROG1 (+ |i| 1) (LETT #2# (QSADD1 #2#) . #6#)) . #6#)
            (GO G190) G191 (EXIT NIL))
       #3#))))) 

(DEFUN |FRMOD;coerce;$Of;5| (|m| $)
  (SPADCALL (SPADCALL |m| (QREFELT $ 26)) (QREFELT $ 33))) 

(DEFUN |FRMOD;W2A| (|v| $)
  (SPADCALL (SPADCALL |v| (|FRMOD;intmat| $) (QREFELT $ 36)) (QREFELT $ 37))) 

(DEFUN |FRMOD;wmatrix| (|v| $)
  (SPADCALL (SPADCALL |v| (QREFELT $ 39)) (|FRMOD;invintmat| $) (QREFELT $ 40))) 

(DEFUN |FRMOD;getinvintmat| ($)
  (PROG (#1=#:G685 |j| #2=#:G684 |i| |m| #3=#:G678)
    (RETURN
     (SEQ
      (LETT |m|
            (PROG2
                (LETT #3# (SPADCALL (|FRMOD;intmat| $) (QREFELT $ 42))
                      . #4=(|FRMOD;getinvintmat|))
                (QCDR #3#)
              (|check-union| (QEQCAR #3# 0) (|Matrix| (QREFELT $ 7)) #3#))
            . #4#)
      (SEQ (LETT |i| (SPADCALL |m| (QREFELT $ 43)) . #4#)
           (LETT #2# (SPADCALL |m| (QREFELT $ 44)) . #4#) G190
           (COND ((> |i| #2#) #5=(GO G191)))
           (SEQ
            (EXIT
             (SEQ (LETT |j| (SPADCALL |m| (QREFELT $ 45)) . #4#)
                  (LETT #1# (SPADCALL |m| (QREFELT $ 46)) . #4#) G190
                  (COND ((> |j| #1#) #5#))
                  (SEQ
                   (EXIT
                    (SPADCALL (QREFELT $ 21) |i| |j|
                              (SPADCALL |m| |i| |j| (QREFELT $ 47))
                              (QREFELT $ 48))))
                  (LETT |j| (+ |j| 1) . #4#) #6=(GO G190) G191 (EXIT NIL))))
           (LETT |i| (+ |i| 1) . #4#) #6# G191 (EXIT NIL))
      (EXIT 'NIL))))) 

(DEFUN |FRMOD;getintmat| ($)
  (PROG (#1=#:G691 |j| #2=#:G690 |i| |m|)
    (RETURN
     (SEQ
      (LETT |m| (SPADCALL (QREFELT $ 10) (QREFELT $ 39))
            . #3=(|FRMOD;getintmat|))
      (SEQ (LETT |i| (SPADCALL |m| (QREFELT $ 43)) . #3#)
           (LETT #2# (SPADCALL |m| (QREFELT $ 44)) . #3#) G190
           (COND ((> |i| #2#) #4=(GO G191)))
           (SEQ
            (EXIT
             (SEQ (LETT |j| (SPADCALL |m| (QREFELT $ 45)) . #3#)
                  (LETT #1# (SPADCALL |m| (QREFELT $ 46)) . #3#) G190
                  (COND ((> |j| #1#) #4#))
                  (SEQ
                   (EXIT
                    (SPADCALL (QREFELT $ 22) |i| |j|
                              (SPADCALL |m| |i| |j| (QREFELT $ 47))
                              (QREFELT $ 48))))
                  (LETT |j| (+ |j| 1) . #3#) #5=(GO G190) G191 (EXIT NIL))))
           (LETT |i| (+ |i| 1) . #3#) #5# G191 (EXIT NIL))
      (EXIT 'NIL))))) 

(DEFUN |FRMOD;invintmat| ($)
  (SEQ
   (COND
    ((SPADCALL (QREFELT $ 15) (QREFELT $ 49))
     (SPADCALL (QREFELT $ 15) (|FRMOD;getinvintmat| $) (QREFELT $ 50))))
   (EXIT (QREFELT $ 21)))) 

(DEFUN |FRMOD;intmat| ($)
  (SEQ
   (COND
    ((SPADCALL (QREFELT $ 16) (QREFELT $ 49))
     (SPADCALL (QREFELT $ 16) (|FRMOD;getintmat| $) (QREFELT $ 50))))
   (EXIT (QREFELT $ 22)))) 

(DEFUN |FRMOD;vectProd| (|v1| |v2| $)
  (PROG (|k| #1=#:G702 |j| #2=#:G701 |i| |v|)
    (RETURN
     (SEQ
      (LETT |k|
            (SPADCALL
             (LETT |v|
                   (SPADCALL (* (QVSIZE |v1|) (QVSIZE |v2|))
                             (|spadConstant| $ 51) (QREFELT $ 52))
                   . #3=(|FRMOD;vectProd|))
             (QREFELT $ 53))
            . #3#)
      (SEQ (LETT |i| (SPADCALL |v1| (QREFELT $ 54)) . #3#)
           (LETT #2# (QVSIZE |v1|) . #3#) G190
           (COND ((> |i| #2#) #4=(GO G191)))
           (SEQ
            (EXIT
             (SEQ (LETT |j| (SPADCALL |v2| (QREFELT $ 54)) . #3#)
                  (LETT #1# (QVSIZE |v2|) . #3#) G190 (COND ((> |j| #1#) #4#))
                  (SEQ
                   (SPADCALL |v| |k|
                             (SPADCALL (SPADCALL |v1| |i| (QREFELT $ 55))
                                       (SPADCALL |v2| |j| (QREFELT $ 55))
                                       (QREFELT $ 56))
                             (QREFELT $ 57))
                   (EXIT (LETT |k| (+ |k| 1) . #3#)))
                  (LETT |j| (+ |j| 1) . #3#) #5=(GO G190) G191 (EXIT NIL))))
           (LETT |i| (+ |i| 1) . #3#) #5# G191 (EXIT NIL))
      (EXIT |v|))))) 

(DEFUN |FRMOD;norm;$F;13| (|m| $)
  (COND
   ((NULL (EQL (QVSIZE (SPADCALL |m| (QREFELT $ 26))) (QVSIZE (QREFELT $ 10))))
    (|error| "Module not of rank n"))
   ('T
    (SPADCALL
     (SPADCALL (SPADCALL (SPADCALL |m| (QREFELT $ 26)) (QREFELT $ 39))
               (|FRMOD;invintmat| $) (QREFELT $ 40))
     (QREFELT $ 59))))) 

(DEFUN |FRMOD;*;3$;14| (|m1| |m2| $)
  (PROG (|u| #1=#:G714 |i| #2=#:G713 |m| |cd|)
    (RETURN
     (SEQ
      (LETT |m|
            (SPADCALL
             (QCAR
              (LETT |cd|
                    (SPADCALL
                     (|FRMOD;wmatrix|
                      (|FRMOD;vectProd| (SPADCALL |m1| (QREFELT $ 26))
                       (SPADCALL |m2| (QREFELT $ 26)) $)
                      $)
                     (QREFELT $ 63))
                    . #3=(|FRMOD;*;3$;14|)))
             (QREFELT $ 66))
            . #3#)
      (EXIT
       (SPADCALL
        (LIST2VEC
         (PROGN
          (LETT #2# NIL . #3#)
          (SEQ (LETT |i| (SPADCALL |m| (QREFELT $ 67)) . #3#)
               (LETT #1# (SPADCALL |m| (QREFELT $ 68)) . #3#) G190
               (COND ((> |i| #1#) (GO G191)))
               (SEQ
                (EXIT
                 (COND
                  ((SEQ
                    (LETT |u|
                          (|FRMOD;W2A|
                           (|FRMOD;rowdiv| (SPADCALL |m| |i| (QREFELT $ 69))
                            (QCDR |cd|) $)
                           $)
                          . #3#)
                    (EXIT
                     (COND
                      ((SPADCALL |u| (|spadConstant| $ 51) (QREFELT $ 71))
                       'NIL)
                      ('T 'T))))
                   (LETT #2# (CONS |u| #2#) . #3#)))))
               (LETT |i| (+ |i| 1) . #3#) (GO G190) G191
               (EXIT (NREVERSE0 #2#)))))
        (QREFELT $ 25))))))) 

(DEFUN |FRMOD;module;Fi$;15| (|i| $)
  (SPADCALL (SPADCALL (SPADCALL |i| (QREFELT $ 74)) (QREFELT $ 25))
            (SPADCALL (QREFELT $ 10) (QREFELT $ 25)) (QREFELT $ 72))) 

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

(DEFUN |FramedModule;| (|#1| |#2| |#3| |#4| |#5|)
  (PROG (|pv$| $ |dv$| DV$5 DV$4 DV$3 DV$2 DV$1)
    (RETURN
     (PROGN
      (LETT DV$1 (|devaluate| |#1|) . #1=(|FramedModule|))
      (LETT DV$2 (|devaluate| |#2|) . #1#)
      (LETT DV$3 (|devaluate| |#3|) . #1#)
      (LETT DV$4 (|devaluate| |#4|) . #1#)
      (LETT DV$5 (|devaluate| |#5|) . #1#)
      (LETT |dv$| (LIST '|FramedModule| DV$1 DV$2 DV$3 DV$4 DV$5) . #1#)
      (LETT $ (GETREFV 79) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3
                (LETT |pv$|
                      (|buildPredVector| 0 0
                                         (LIST
                                          (|HasCategory| |#4|
                                                         (LIST '|RetractableTo|
                                                               (|devaluate|
                                                                |#2|)))))
                      . #1#))
      (|haddProp| |$ConstructorCache| '|FramedModule|
                  (LIST DV$1 DV$2 DV$3 DV$4 DV$5) (CONS 1 $))
      (|stuffDomainSlots| $)
      (QSETREFV $ 6 |#1|)
      (QSETREFV $ 7 |#2|)
      (QSETREFV $ 8 |#3|)
      (QSETREFV $ 9 |#4|)
      (QSETREFV $ 10 |#5|)
      (QSETREFV $ 11 (|Vector| |#4|))
      (QSETREFV $ 15 (SPADCALL 'T (QREFELT $ 14)))
      (QSETREFV $ 16 (SPADCALL 'T (QREFELT $ 14)))
      (QSETREFV $ 21
                (SPADCALL (QVSIZE |#5|) (QVSIZE |#5|) (|spadConstant| $ 17)
                          (QREFELT $ 20)))
      (QSETREFV $ 22
                (SPADCALL (QVSIZE |#5|) (QVSIZE |#5|) (|spadConstant| $ 17)
                          (QREFELT $ 20)))
      (COND
       ((|testBitVector| |pv$| 1)
        (QSETREFV $ 75 (CONS (|dispatchFunction| |FRMOD;module;Fi$;15|) $))))
      $)))) 

(MAKEPROP '|FramedModule| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
              (|local| |#3|) (|local| |#4|) (|local| |#5|) '|Rep| (|Boolean|)
              (|Reference| 12) (0 . |ref|) '|iflag?| '|wflag?| (5 . |Zero|)
              (|NonNegativeInteger|) (|Matrix| 7) (9 . |new|) '|imat| '|wmat|
              (CONS IDENTITY (FUNCALL (|dispatchFunction| |FRMOD;One;$;1|) $))
              (|Vector| 9) |FRMOD;module;V$;2| |FRMOD;basis;$V;3| (|Integer|)
              (|Vector| 6) (16 . |minIndex|) (21 . |elt|) (27 . /)
              (|OutputForm|) (33 . |coerce|) |FRMOD;coerce;$Of;5| (|Vector| 7)
              (38 . *) (44 . |represents|) (|Vector| $) (49 . |coordinates|)
              (54 . *) (|Union| $ '"failed") (60 . |inverse|)
              (65 . |minRowIndex|) (70 . |maxRowIndex|) (75 . |minColIndex|)
              (80 . |maxColIndex|) (85 . |qelt|) (92 . |setelt|) (100 . |elt|)
              (105 . |setelt|) (111 . |Zero|) (115 . |new|) (121 . |minIndex|)
              (126 . |minIndex|) (131 . |qelt|) (137 . *) (143 . |qsetelt!|)
              (150 . |One|) (154 . |determinant|) |FRMOD;norm;$F;13|
              (|Record| (|:| |num| 64) (|:| |den| 6))
              (|MatrixCommonDenominator| 6 7) (159 . |splitDenominator|)
              (|Matrix| 6) (|ModularHermitianRowReduction| 6) (164 . |rowEch|)
              (169 . |minRowIndex|) (174 . |maxRowIndex|) (179 . |row|)
              (185 . |Zero|) (189 . =) |FRMOD;*;3$;14|
              (|FractionalIdeal| 6 7 8 9) (195 . |basis|) (200 . |module|)
              (|PositiveInteger|) (|String|) (|SingleInteger|))
           '#(~= 205 |sample| 211 |recip| 215 |one?| 220 |norm| 225 |module|
              230 |latex| 240 |hash| 245 |coerce| 250 |basis| 255 ^ 260 |One|
              272 = 276 * 282)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0))
                 (CONS
                  '#(|Monoid&| |SemiGroup&| |SetCategory&| |BasicType&| NIL)
                  (CONS
                   '#((|Monoid|) (|SemiGroup|) (|SetCategory|) (|BasicType|)
                      (|CoercibleTo| 32))
                   (|makeByteWordVec2| 78
                                       '(1 13 0 12 14 0 7 0 17 3 19 0 18 18 7
                                         20 1 28 27 0 29 2 28 6 0 27 30 2 7 0 6
                                         6 31 1 24 32 0 33 2 19 35 35 0 36 1 9
                                         0 35 37 1 9 19 38 39 2 19 0 0 0 40 1
                                         19 41 0 42 1 19 27 0 43 1 19 27 0 44 1
                                         19 27 0 45 1 19 27 0 46 3 19 7 0 27 27
                                         47 4 19 7 0 27 27 7 48 1 13 12 0 49 2
                                         13 12 0 12 50 0 9 0 51 2 24 0 18 9 52
                                         1 24 27 0 53 1 11 27 0 54 2 11 9 0 27
                                         55 2 9 0 0 0 56 3 11 9 0 27 9 57 0 9 0
                                         58 1 19 7 0 59 1 62 61 19 63 1 65 64
                                         64 66 1 64 27 0 67 1 64 27 0 68 2 64
                                         28 0 27 69 0 6 0 70 2 9 12 0 0 71 1 73
                                         24 0 74 1 0 0 73 75 2 0 12 0 0 1 0 0 0
                                         1 1 0 41 0 1 1 0 12 0 1 1 0 7 0 60 1 1
                                         0 73 75 1 0 0 24 25 1 0 77 0 1 1 0 78
                                         0 1 1 0 32 0 34 1 0 24 0 26 2 0 0 0 18
                                         1 2 0 0 0 76 1 0 0 0 23 2 0 12 0 0 1 2
                                         0 0 0 0 72)))))
           '|lookupComplete|)) 
