
(/VERSIONCHECK 2) 

(DEFUN |IDPO;=;2$B;1| (|x| |y| $)
  (PROG (#0=#:G1824)
    (RETURN
      (SEQ (EXIT (SEQ (SEQ G190
                           (COND
                             ((NULL (COND
                                      ((OR (NULL |x|) (NULL |y|)) 'NIL)
                                      ('T 'T)))
                              (GO G191)))
                           (SEQ (EXIT (COND
                                        ((OR
                                          (NULL
                                           (SPADCALL
                                            (QCAR (|SPADfirst| |x|))
                                            (QCAR (|SPADfirst| |y|))
                                            (QREFELT $ 11)))
                                          (NULL
                                           (SPADCALL
                                            (QCDR (|SPADfirst| |x|))
                                            (QCDR (|SPADfirst| |y|))
                                            (QREFELT $ 12))))
                                         (PROGN
                                           (LETT #0# 'NIL
                                            . #1=(|IDPO;=;2$B;1|))
                                           (GO #0#)))
                                        ('T
                                         (SEQ
                                          (LETT |x| (CDR |x|) . #1#)
                                          (EXIT
                                           (LETT |y| (CDR |y|) . #1#)))))))
                           NIL (GO G190) G191 (EXIT NIL))
                      (EXIT (COND ((NULL |x|) (NULL |y|)) ('T 'NIL)))))
           #0# (EXIT #0#))))) 

(DEFUN |IDPO;coerce;$Of;2| (|x| $)
  (PROG (#0=#:G1827 |t| #1=#:G1828)
    (RETURN
      (SEQ (SPADCALL
               (PROGN
                 (LETT #0# NIL . #2=(|IDPO;coerce;$Of;2|))
                 (SEQ (LETT |t| NIL . #2#) (LETT #1# |x| . #2#) G190
                      (COND
                        ((OR (ATOM #1#)
                             (PROGN (LETT |t| (CAR #1#) . #2#) NIL))
                         (GO G191)))
                      (SEQ (EXIT (LETT #0#
                                       (CONS
                                        (SPADCALL
                                         (SPADCALL (QCAR |t|)
                                          (QREFELT $ 15))
                                         (SPADCALL (QCDR |t|)
                                          (QREFELT $ 16))
                                         (QREFELT $ 17))
                                        #0#) . #2#)))
                      (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 19)))))) 

(DEFUN |IDPO;monomial;AS$;3| (|r| |s| $) (LIST (CONS |s| |r|))) 

(DEFUN |IDPO;map;M2$;4| (|f| |x| $)
  (PROG (#0=#:G1833 |tm| #1=#:G1834)
    (RETURN
      (SEQ (PROGN
             (LETT #0# NIL . #2=(|IDPO;map;M2$;4|))
             (SEQ (LETT |tm| NIL . #2#) (LETT #1# |x| . #2#) G190
                  (COND
                    ((OR (ATOM #1#)
                         (PROGN (LETT |tm| (CAR #1#) . #2#) NIL))
                     (GO G191)))
                  (SEQ (EXIT (LETT #0#
                                   (CONS
                                    (CONS (QCAR |tm|)
                                     (SPADCALL (QCDR |tm|) |f|))
                                    #0#) . #2#)))
                  (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                  (EXIT (NREVERSE0 #0#)))))))) 

(PUT '|IDPO;reductum;2$;5| '|SPADreplace| 'CDR) 

(DEFUN |IDPO;reductum;2$;5| (|x| $) (CDR |x|)) 

(DEFUN |IDPO;leadingCoefficient;$A;6| (|x| $)
  (COND
    ((NULL |x|)
     (|error| "Can't take leadingCoefficient of empty product element"))
    ('T (QCDR (|SPADfirst| |x|))))) 

(DEFUN |IDPO;leadingSupport;$S;7| (|x| $)
  (COND
    ((NULL |x|)
     (|error| "Can't take leadingCoefficient of empty product element"))
    ('T (QCAR (|SPADfirst| |x|))))) 

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

(DEFUN |IndexedDirectProductObject;| (|#1| |#2|)
  (PROG (DV$1 DV$2 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|)
              . #0=(|IndexedDirectProductObject|))
        (LETT DV$2 (|devaluate| |#2|) . #0#)
        (LETT |dv$|
              (LIST '|IndexedDirectProductObject| DV$1 DV$2) . #0#)
        (LETT $ (GETREFV 29) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|IndexedDirectProductObject|
            (LIST DV$1 DV$2) (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6 |#1|)
        (QSETREFV $ 7 |#2|)
        (QSETREFV $ 8 (|Record| (|:| |k| |#2|) (|:| |c| |#1|)))
        (QSETREFV $ 9 (|List| (QREFELT $ 8)))
        $)))) 

(MAKEPROP '|IndexedDirectProductObject| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|)
             '|Term| '|Rep| (|Boolean|) (0 . =) (6 . =) |IDPO;=;2$B;1|
             (|OutputForm|) (12 . |coerce|) (17 . |coerce|)
             (22 . |rarrow|) (|List| $) (28 . |bracket|)
             |IDPO;coerce;$Of;2| |IDPO;monomial;AS$;3| (|Mapping| 6 6)
             |IDPO;map;M2$;4| |IDPO;reductum;2$;5|
             |IDPO;leadingCoefficient;$A;6| |IDPO;leadingSupport;$S;7|
             (|SingleInteger|) (|String|))
          '#(~= 33 |reductum| 39 |monomial| 44 |map| 50
             |leadingSupport| 56 |leadingCoefficient| 61 |latex| 66
             |hash| 71 |coerce| 76 = 81)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0))
                (CONS '#(NIL |SetCategory&| |BasicType&| NIL)
                      (CONS '#((|IndexedDirectProductCategory| 6 7)
                               (|SetCategory|) (|BasicType|)
                               (|CoercibleTo| 14))
                            (|makeByteWordVec2| 28
                                '(2 7 10 0 0 11 2 6 10 0 0 12 1 7 14 0
                                  15 1 6 14 0 16 2 14 0 0 0 17 1 14 0
                                  18 19 2 0 10 0 0 1 1 0 0 0 24 2 0 0 6
                                  7 21 2 0 0 22 0 23 1 0 7 0 26 1 0 6 0
                                  25 1 0 28 0 1 1 0 27 0 1 1 0 14 0 20
                                  2 0 10 0 0 13)))))
          '|lookupComplete|)) 
