
(/VERSIONCHECK 2) 

(DEFUN |IBPTOOLS;mapUnivariate;MSupR;1| (|f| |poly| $)
  (PROG (|ans|)
    (RETURN
      (SEQ (LETT |ans| (|spadConstant| $ 10)
                 . #0=(|IBPTOOLS;mapUnivariate;MSupR;1|))
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((SPADCALL |poly| (QREFELT $ 13)) 'NIL)
                           ('T 'T)))
                   (GO G191)))
                (SEQ (LETT |ans|
                           (SPADCALL |ans|
                               (SPADCALL
                                   (SPADCALL
                                    (SPADCALL |poly| (QREFELT $ 14))
                                    |f|)
                                   (SPADCALL |poly| (QREFELT $ 16))
                                   (QREFELT $ 17))
                               (QREFELT $ 18)) . #0#)
                     (EXIT (LETT |poly|
                                 (SPADCALL |poly| (QREFELT $ 19)) . #0#)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT |ans|))))) 

(DEFUN |IBPTOOLS;mapUnivariate;MRSup;2| (|f| |poly| $)
  (PROG (|ans|)
    (RETURN
      (SEQ (LETT |ans| (|spadConstant| $ 22)
                 . #0=(|IBPTOOLS;mapUnivariate;MRSup;2|))
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((SPADCALL |poly| (QREFELT $ 23)) 'NIL)
                           ('T 'T)))
                   (GO G191)))
                (SEQ (LETT |ans|
                           (SPADCALL |ans|
                               (SPADCALL
                                   (SPADCALL
                                    (SPADCALL |poly| (QREFELT $ 24))
                                    |f|)
                                   (SPADCALL |poly| (QREFELT $ 25))
                                   (QREFELT $ 26))
                               (QREFELT $ 27)) . #0#)
                     (EXIT (LETT |poly|
                                 (SPADCALL |poly| (QREFELT $ 28)) . #0#)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT |ans|))))) 

(DEFUN |IBPTOOLS;mapUnivariateIfCan;MSupU;3| (|f| |poly| $)
  (PROG (|lc| #0=#:G1850 |ans|)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |ans| (|spadConstant| $ 10)
                            . #1=(|IBPTOOLS;mapUnivariateIfCan;MSupU;3|))
                      (SEQ G190
                           (COND
                             ((NULL (COND
                                      ((SPADCALL |poly| (QREFELT $ 13))
                                       'NIL)
                                      ('T 'T)))
                              (GO G191)))
                           (SEQ (LETT |lc|
                                      (SPADCALL
                                       (SPADCALL |poly| (QREFELT $ 14))
                                       |f|) . #1#)
                                (EXIT (COND
                                        ((QEQCAR |lc| 1)
                                         (PROGN
                                           (LETT #0#
                                            (CONS 1 "failed") . #1#)
                                           (GO #0#)))
                                        ('T
                                         (SEQ
                                          (LETT |ans|
                                           (SPADCALL |ans|
                                            (SPADCALL (QCDR |lc|)
                                             (SPADCALL |poly|
                                              (QREFELT $ 16))
                                             (QREFELT $ 17))
                                            (QREFELT $ 18)) . #1#)
                                          (EXIT
                                           (LETT |poly|
                                            (SPADCALL |poly|
                                             (QREFELT $ 19)) . #1#)))))))
                           NIL (GO G190) G191 (EXIT NIL))
                      (EXIT (CONS 0 |ans|))))
           #0# (EXIT #0#))))) 

(DEFUN |IBPTOOLS;mapMatrixIfCan;MMU;4| (|f| |mat| $)
  (PROG (|m| |n| |matOut| |i| |j| |poly| #0=#:G1867)
    (RETURN
      (SEQ (EXIT (SEQ (LETT |m| (SPADCALL |mat| (QREFELT $ 36))
                            . #1=(|IBPTOOLS;mapMatrixIfCan;MMU;4|))
                      (LETT |n| (SPADCALL |mat| (QREFELT $ 37)) . #1#)
                      (LETT |matOut|
                            (SPADCALL |m| |n| (|spadConstant| $ 10)
                                (QREFELT $ 40)) . #1#)
                      (SEQ (LETT |i| 1 . #1#) G190
                           (COND ((QSGREATERP |i| |m|) #2=(GO G191)))
                           (SEQ (EXIT (SEQ (LETT |j| 1 . #1#) G190
                                       (COND
                                         ((QSGREATERP |j| |n|) #2#))
                                       (SEQ
                                        (LETT |poly|
                                         (SPADCALL |f|
                                          (SPADCALL |mat| |i| |j|
                                           (QREFELT $ 42))
                                          (QREFELT $ 34)) . #1#)
                                        (EXIT
                                         (COND
                                           ((QEQCAR |poly| 1)
                                            (PROGN
                                              (LETT #0#
                                               (CONS 1 "failed") . #1#)
                                              (GO #0#)))
                                           ('T
                                            (SPADCALL |matOut| |i| |j|
                                             (QCDR |poly|)
                                             (QREFELT $ 43))))))
                                       (LETT |j| (QSADD1 |j|) . #1#)
                                       #3=(GO G190) G191 (EXIT NIL))))
                           (LETT |i| (QSADD1 |i|) . #1#) #3# G191
                           (EXIT NIL))
                      (EXIT (CONS 0 |matOut|))))
           #0# (EXIT #0#))))) 

(DEFUN |IBPTOOLS;mapBivariate;MUPSup;5| (|f| |poly| $)
  (PROG (|ans|)
    (RETURN
      (SEQ (LETT |ans| (|spadConstant| $ 47)
                 . #0=(|IBPTOOLS;mapBivariate;MUPSup;5|))
           (SEQ G190
                (COND
                  ((NULL (COND
                           ((SPADCALL |poly| (QREFELT $ 48)) 'NIL)
                           ('T 'T)))
                   (GO G191)))
                (SEQ (LETT |ans|
                           (SPADCALL |ans|
                               (SPADCALL
                                   (SPADCALL |f|
                                    (SPADCALL |poly| (QREFELT $ 49))
                                    (QREFELT $ 30))
                                   (SPADCALL |poly| (QREFELT $ 50))
                                   (QREFELT $ 51))
                               (QREFELT $ 52)) . #0#)
                     (EXIT (LETT |poly|
                                 (SPADCALL |poly| (QREFELT $ 53)) . #0#)))
                NIL (GO G190) G191 (EXIT NIL))
           (EXIT |ans|))))) 

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

(DEFUN |IntegralBasisPolynomialTools;| (|#1| |#2| |#3| |#4|)
  (PROG (DV$1 DV$2 DV$3 DV$4 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|IntegralBasisPolynomialTools|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT DV$3 (|devaluate| |#3|) . #0#)
        (LETT DV$4 (|devaluate| |#4|) . #0#)
        (LETT |dv$|
              (LIST '|IntegralBasisPolynomialTools| DV$1 DV$2 DV$3
                    DV$4) . #0#)
        (LETT $ (GETREFV 55) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|IntegralBasisPolynomialTools|
            (LIST DV$1 DV$2 DV$3 DV$4) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 |#3|)
        (QSETREFV $ 9 |#4|)
        $)))) 

(MAKEPROP '|IntegralBasisPolynomialTools| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             (|local| |#3|) (|local| |#4|) (0 . |Zero|) (|Boolean|)
             (|SparseUnivariatePolynomial| 9) (4 . |zero?|)
             (9 . |leadingCoefficient|) (|NonNegativeInteger|)
             (14 . |degree|) (19 . |monomial|) (25 . +)
             (31 . |reductum|) (|Mapping| 6 9)
             |IBPTOOLS;mapUnivariate;MSupR;1| (36 . |Zero|)
             (40 . |zero?|) (45 . |leadingCoefficient|) (50 . |degree|)
             (55 . |monomial|) (61 . +) (67 . |reductum|)
             (|Mapping| 9 6) |IBPTOOLS;mapUnivariate;MRSup;2|
             (|Union| 7 '"failed") (|Union| 6 '"failed")
             (|Mapping| 32 9) |IBPTOOLS;mapUnivariateIfCan;MSupU;3|
             (|Matrix| 12) (72 . |nrows|) (77 . |ncols|) (82 . |Zero|)
             (|Matrix| 7) (86 . |new|) (|Integer|) (93 . |qelt|)
             (100 . |qsetelt!|) (|Union| 39 '"failed")
             |IBPTOOLS;mapMatrixIfCan;MMU;4|
             (|SparseUnivariatePolynomial| 12) (108 . |Zero|)
             (112 . |zero?|) (117 . |leadingCoefficient|)
             (122 . |degree|) (127 . |monomial|) (133 . +)
             (139 . |reductum|) |IBPTOOLS;mapBivariate;MUPSup;5|)
          '#(|mapUnivariateIfCan| 144 |mapUnivariate| 150
             |mapMatrixIfCan| 162 |mapBivariate| 168)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 54
                                '(0 7 0 10 1 12 11 0 13 1 12 9 0 14 1
                                  12 15 0 16 2 7 0 6 15 17 2 7 0 0 0 18
                                  1 12 0 0 19 0 12 0 22 1 7 11 0 23 1 7
                                  6 0 24 1 7 15 0 25 2 12 0 9 15 26 2
                                  12 0 0 0 27 1 7 0 0 28 1 35 15 0 36 1
                                  35 15 0 37 0 6 0 38 3 39 0 15 15 7 40
                                  3 35 12 0 41 41 42 4 39 7 0 41 41 7
                                  43 0 46 0 47 1 8 11 0 48 1 8 7 0 49 1
                                  8 15 0 50 2 46 0 12 15 51 2 46 0 0 0
                                  52 1 8 0 0 53 2 0 31 33 12 34 2 0 12
                                  29 7 30 2 0 7 20 12 21 2 0 44 33 35
                                  45 2 0 46 29 8 54)))))
          '|lookupComplete|)) 
