
(/VERSIONCHECK 2) 

(DEFUN |IDPO;=;2$B;1| (|x| |y| $)
  (PROG (#1=#:G671)
    (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 $ 10)))
                  (NULL
                   (SPADCALL (QCDR (|SPADfirst| |x|)) (QCDR (|SPADfirst| |y|))
                             (QREFELT $ 11))))
                 (PROGN (LETT #1# 'NIL . #2=(|IDPO;=;2$B;1|)) (GO #1#)))
                ('T
                 (SEQ (LETT |x| (CDR |x|) . #2#)
                      (EXIT (LETT |y| (CDR |y|) . #2#)))))))
             NIL (GO G190) G191 (EXIT NIL))
        (EXIT (COND ((NULL |x|) (NULL |y|)) ('T 'NIL)))))
      #1# (EXIT #1#))))) 

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

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

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

(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 |IDPO;compareterm| (|a| |b| $)
  (SPADCALL (QCAR |b|) (QCAR |a|) (QREFELT $ 26))) 

(DEFUN |IDPO;construct;L$;9| (|lx| $)
  (SPADCALL (CONS (|function| |IDPO;compareterm|) $) |lx| (QREFELT $ 29))) 

(PUT '|IDPO;constructOrdered;L$;10| '|SPADreplace| '(XLAM (|lx|) |lx|)) 

(DEFUN |IDPO;constructOrdered;L$;10| (|lx| $) |lx|) 

(DEFUN |IDPO;leadingTerm;$R;11| (|x| $)
  (COND
   ((NULL |x|)
    (|error| "Can't take leadingCoefficient of empty product element"))
   ('T (|SPADfirst| |x|)))) 

(PUT '|IDPO;listOfTerms;$L;12| '|SPADreplace| '(XLAM (|x|) |x|)) 

(DEFUN |IDPO;listOfTerms;$L;12| (|x| $) |x|) 

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

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

(MAKEPROP '|IndexedDirectProductObject| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL (|local| |#1|) (|local| |#2|) '|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|
              (33 . <) (|Record| (|:| |k| 7) (|:| |c| 6)) (|Mapping| 9 27 27)
              (39 . |sort|) (|List| 27) |IDPO;construct;L$;9|
              |IDPO;constructOrdered;L$;10| |IDPO;leadingTerm;$R;11|
              |IDPO;listOfTerms;$L;12| (|String|) (|SingleInteger|))
           '#(~= 45 |reductum| 51 |monomial| 56 |map| 62 |listOfTerms| 68
              |leadingTerm| 73 |leadingSupport| 78 |leadingCoefficient| 83
              |latex| 88 |hash| 93 |constructOrdered| 98 |construct| 103
              |coerce| 108 = 113)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0 0))
                 (CONS '#(NIL |SetCategory&| |BasicType&| NIL)
                       (CONS
                        '#((|IndexedDirectProductCategory| 6 7) (|SetCategory|)
                           (|BasicType|) (|CoercibleTo| 13))
                        (|makeByteWordVec2| 36
                                            '(2 7 9 0 0 10 2 6 9 0 0 11 1 7 13
                                              0 14 1 6 13 0 15 2 13 0 0 0 16 1
                                              13 0 17 18 2 7 9 0 0 26 2 8 0 28
                                              0 29 2 0 9 0 0 1 1 0 0 0 23 2 0 0
                                              6 7 20 2 0 0 21 0 22 1 0 30 0 34
                                              1 0 27 0 33 1 0 7 0 25 1 0 6 0 24
                                              1 0 35 0 1 1 0 36 0 1 1 0 0 30 32
                                              1 0 0 30 31 1 0 13 0 19 2 0 9 0 0
                                              12)))))
           '|lookupComplete|)) 
