
(/VERSIONCHECK 2) 

(DEFUN |OFMONOID;lquo;$SU;1| (|w| |l| $)
  (PROG (#1=#:G1818 |fx| |x|)
    (RETURN
     (SEQ (LETT |x| (SPADCALL |w| (QREFELT $ 10)) . #2=(|OFMONOID;lquo;$SU;1|))
          (EXIT
           (COND ((NULL |x|) (CONS 1 "failed"))
                 (#3='T
                  (SEQ (LETT |fx| (|SPADfirst| |x|) . #2#)
                       (COND
                        ((NULL (SPADCALL (QCAR |fx|) |l| (QREFELT $ 12)))
                         (EXIT (CONS 1 "failed"))))
                       (EXIT
                        (COND
                         ((EQL (QCDR |fx|) 1)
                          (CONS 0 (SPADCALL (CDR |x|) (QREFELT $ 13))))
                         (#3#
                          (CONS 0
                                (SPADCALL
                                 (CONS
                                  (CONS (QCAR |fx|)
                                        (PROG1
                                            (LETT #1# (- (QCDR |fx|) 1) . #2#)
                                          (|check-subtype| (>= #1# 0)
                                                           '(|NonNegativeInteger|)
                                                           #1#)))
                                  (CDR |x|))
                                 (QREFELT $ 13)))))))))))))) 

(DEFUN |OFMONOID;rquo;$SU;2| (|w| |l| $)
  (PROG (|r| |u|)
    (RETURN
     (SEQ (LETT |u| (SPADCALL |w| (QREFELT $ 17)) . #1=(|OFMONOID;rquo;$SU;2|))
          (LETT |r| (SPADCALL |u| |l| (QREFELT $ 16)) . #1#)
          (EXIT
           (COND ((QEQCAR |r| 1) (CONS 1 "failed"))
                 ('T (CONS 0 (SPADCALL (QCDR |r|) (QREFELT $ 18)))))))))) 

(DEFUN |OFMONOID;length;$Nni;3| (|x| $)
  (PROG (#1=#:G1838 |f| #2=#:G1837)
    (RETURN
     (SEQ
      (SPADCALL (ELT $ 21)
                (PROGN
                 (LETT #2# NIL . #3=(|OFMONOID;length;$Nni;3|))
                 (SEQ (LETT |f| NIL . #3#)
                      (LETT #1# (SPADCALL |x| (QREFELT $ 10)) . #3#) G190
                      (COND
                       ((OR (ATOM #1#) (PROGN (LETT |f| (CAR #1#) . #3#) NIL))
                        (GO G191)))
                      (SEQ (EXIT (LETT #2# (CONS (QCDR |f|) #2#) . #3#)))
                      (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                      (EXIT (NREVERSE0 #2#))))
                0 (QREFELT $ 24)))))) 

(DEFUN |OFMONOID;varList;$L;4| (|x| $)
  (PROG (|le| #1=#:G1844 |t| #2=#:G1843)
    (RETURN
     (SEQ
      (LETT |le|
            (PROGN
             (LETT #2# NIL . #3=(|OFMONOID;varList;$L;4|))
             (SEQ (LETT |t| NIL . #3#)
                  (LETT #1# (SPADCALL |x| (QREFELT $ 10)) . #3#) G190
                  (COND
                   ((OR (ATOM #1#) (PROGN (LETT |t| (CAR #1#) . #3#) NIL))
                    (GO G191)))
                  (SEQ (EXIT (LETT #2# (CONS (QCAR |t|) #2#) . #3#)))
                  (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                  (EXIT (NREVERSE0 #2#))))
            . #3#)
      (EXIT (SPADCALL (SPADCALL |le| (QREFELT $ 27)) (QREFELT $ 28))))))) 

(DEFUN |OFMONOID;first;$S;5| (|w| $)
  (PROG (|x|)
    (RETURN
     (SEQ (LETT |x| (SPADCALL |w| (QREFELT $ 10)) |OFMONOID;first;$S;5|)
          (EXIT
           (COND ((NULL |x|) (|error| "empty word !!!"))
                 ('T (QCAR (|SPADfirst| |x|))))))))) 

(DEFUN |OFMONOID;rest;2$;6| (|w| $)
  (PROG (#1=#:G1849 |fx| |x|)
    (RETURN
     (SEQ (LETT |x| (SPADCALL |w| (QREFELT $ 10)) . #2=(|OFMONOID;rest;2$;6|))
          (EXIT
           (COND ((NULL |x|) (|error| "empty word !!!"))
                 (#3='T
                  (SEQ (LETT |fx| (|SPADfirst| |x|) . #2#)
                       (EXIT
                        (COND
                         ((EQL (QCDR |fx|) 1)
                          (SPADCALL (CDR |x|) (QREFELT $ 13)))
                         (#3#
                          (SPADCALL
                           (CONS
                            (CONS (QCAR |fx|)
                                  (PROG1 (LETT #1# (- (QCDR |fx|) 1) . #2#)
                                    (|check-subtype| (>= #1# 0)
                                                     '(|NonNegativeInteger|)
                                                     #1#)))
                            (CDR |x|))
                           (QREFELT $ 13))))))))))))) 

(DEFUN |OFMONOID;lexico;2$B;7| (|a| |b| $)
  (PROG (|la| |lb| #1=#:G1859 #2=#:G1856 #3=#:G1868)
    (RETURN
     (SEQ
      (EXIT
       (SEQ
        (LETT |la| (SPADCALL |a| (QREFELT $ 10))
              . #4=(|OFMONOID;lexico;2$B;7|))
        (LETT |lb| (SPADCALL |b| (QREFELT $ 10)) . #4#)
        (SEQ G190
             (COND
              ((NULL (COND ((OR (NULL |la|) (NULL |lb|)) 'NIL) ('T 'T)))
               (GO G191)))
             (SEQ
              (EXIT
               (COND
                ((SPADCALL (QCAR (|SPADfirst| |lb|)) (QCAR (|SPADfirst| |la|))
                           (QREFELT $ 32))
                 (PROGN (LETT #3# 'NIL . #4#) (GO #3#)))
                ((SPADCALL (QCAR (|SPADfirst| |la|)) (QCAR (|SPADfirst| |lb|))
                           (QREFELT $ 32))
                 (PROGN (LETT #3# 'T . #4#) (GO #3#)))
                ((EQL (QCDR (|SPADfirst| |la|)) (QCDR (|SPADfirst| |lb|)))
                 (SEQ (LETT |la| (CDR |la|) . #4#)
                      (EXIT (LETT |lb| (CDR |lb|) . #4#))))
                ((< (QCDR (|SPADfirst| |lb|)) (QCDR (|SPADfirst| |la|)))
                 (SEQ
                  (LETT |la|
                        (CONS
                         (CONS (QCAR (|SPADfirst| |la|))
                               (PROG1
                                   (LETT #2#
                                         (- (QCDR (|SPADfirst| |la|))
                                            (QCDR (|SPADfirst| |lb|)))
                                         . #4#)
                                 (|check-subtype| (>= #2# 0)
                                                  '(|NonNegativeInteger|)
                                                  #2#)))
                         (CDR |lb|))
                        . #4#)
                  (EXIT (LETT |lb| (CDR |lb|) . #4#))))
                ('T
                 (SEQ
                  (LETT |lb|
                        (CONS
                         (CONS (QCAR (|SPADfirst| |lb|))
                               (PROG1
                                   (LETT #1#
                                         (- (QCDR (|SPADfirst| |lb|))
                                            (QCDR (|SPADfirst| |la|)))
                                         . #4#)
                                 (|check-subtype| (>= #1# 0)
                                                  '(|NonNegativeInteger|)
                                                  #1#)))
                         (CDR |la|))
                        . #4#)
                  (EXIT (LETT |la| (CDR |la|) . #4#)))))))
             NIL (GO G190) G191 (EXIT NIL))
        (EXIT
         (COND ((NULL |la|) (COND ((NULL |lb|) 'NIL) (#5='T 'T)))
               (#5# 'NIL)))))
      #3# (EXIT #3#))))) 

(DEFUN |OFMONOID;<;2$B;8| (|a| |b| $)
  (PROG (|lb| |la|)
    (RETURN
     (SEQ (LETT |la| (SPADCALL |a| (QREFELT $ 25)) . #1=(|OFMONOID;<;2$B;8|))
          (LETT |lb| (SPADCALL |b| (QREFELT $ 25)) . #1#)
          (EXIT
           (COND ((EQL |la| |lb|) (SPADCALL |a| |b| (QREFELT $ 33)))
                 ('T (< |la| |lb|)))))))) 

(DEFUN |OFMONOID;mirror;2$;9| (|x| $) (SPADCALL |x| (QREFELT $ 17))) 

(DEFUN |OrderedFreeMonoid| (#1=#:G1881)
  (PROG ()
    (RETURN
     (PROG (#2=#:G1882)
       (RETURN
        (COND
         ((LETT #2#
                (|lassocShiftWithFunction| (LIST (|devaluate| #1#))
                                           (HGET |$ConstructorCache|
                                                 '|OrderedFreeMonoid|)
                                           '|domainEqualList|)
                . #3=(|OrderedFreeMonoid|))
          (|CDRwithIncrement| #2#))
         ('T
          (UNWIND-PROTECT (PROG1 (|OrderedFreeMonoid;| #1#) (LETT #2# T . #3#))
            (COND
             ((NOT #2#)
              (HREM |$ConstructorCache| '|OrderedFreeMonoid|))))))))))) 

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

(MAKEPROP '|OrderedFreeMonoid| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL (|FreeMonoid| 6) (|local| |#1|) '|Rep|
              (|Record| (|:| |gen| 6) (|:| |exp| 20)) (|List| 8)
              (0 . |listOfMonoms|) (|Boolean|) (5 . =) (11 . |makeMulti|)
              (16 . |One|) (|Union| $ '"failed") |OFMONOID;lquo;$SU;1|
              (20 . |reverse|) (25 . |reverse!|) |OFMONOID;rquo;$SU;2|
              (|NonNegativeInteger|) (30 . +) (|Mapping| 20 20 20) (|List| 20)
              (36 . |reduce|) |OFMONOID;length;$Nni;3| (|List| 6)
              (43 . |removeDuplicates|) (48 . |sort!|) |OFMONOID;varList;$L;4|
              |OFMONOID;first;$S;5| |OFMONOID;rest;2$;6| (53 . <)
              |OFMONOID;lexico;2$B;7| |OFMONOID;<;2$B;8| |OFMONOID;mirror;2$;9|
              (|Integer|) (|Record| (|:| |lm| $) (|:| |mm| $) (|:| |rm| $))
              (|Record| (|:| |lm| $) (|:| |rm| $)) (|Union| 38 '"failed")
              (|Union| 6 '"failed") (|PositiveInteger|) (|SingleInteger|)
              (|String|) (|OutputForm|))
           '#(~= 59 |varList| 65 |smaller?| 70 |size| 76 |sample| 81 |rquo| 85
              |retractIfCan| 97 |retract| 102 |rest| 107 |recip| 112 |overlap|
              117 |one?| 123 |nthFactor| 128 |nthExpon| 134 |mirror| 140 |min|
              145 |max| 151 |lquo| 157 |lexico| 169 |length| 175 |latex| 180
              |hcrf| 185 |hclf| 191 |hash| 197 |first| 202 |factors| 207
              |divide| 212 |coerce| 218 ^ 228 |One| 246 >= 250 > 256 = 262 <=
              268 < 274 * 280)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 0 0 0))
                 (CONS
                  '#(NIL NIL |OrderedSet&| |Monoid&| NIL |SemiGroup&|
                     |SetCategory&| |RetractableTo&| |BasicType&| NIL)
                  (CONS
                   '#((|OrderedMonoid|) (|OrderedSemiGroup|) (|OrderedSet|)
                      (|Monoid|) (|Comparable|) (|SemiGroup|) (|SetCategory|)
                      (|RetractableTo| 6) (|BasicType|) (|CoercibleTo| 44))
                   (|makeByteWordVec2| 44
                                       '(1 7 9 0 10 2 6 11 0 0 12 1 7 0 9 13 0
                                         0 0 14 1 7 0 0 17 1 7 0 0 18 2 20 0 0
                                         0 21 3 23 20 22 0 20 24 1 26 0 0 27 1
                                         26 0 0 28 2 6 11 0 0 32 2 0 11 0 0 1 1
                                         0 26 0 29 2 0 11 0 0 1 1 0 20 0 1 0 0
                                         0 1 2 0 15 0 6 19 2 0 15 0 0 1 1 0 40
                                         0 1 1 0 6 0 1 1 0 0 0 31 1 0 15 0 1 2
                                         0 37 0 0 1 1 0 11 0 1 2 0 6 0 36 1 2 0
                                         20 0 36 1 1 0 0 0 35 2 0 0 0 0 1 2 0 0
                                         0 0 1 2 0 15 0 6 16 2 0 15 0 0 1 2 0
                                         11 0 0 33 1 0 20 0 25 1 0 43 0 1 2 0 0
                                         0 0 1 2 0 0 0 0 1 1 0 42 0 1 1 0 6 0
                                         30 1 0 9 0 1 2 0 39 0 0 1 1 0 0 6 1 1
                                         0 44 0 1 2 0 0 6 20 1 2 0 0 0 20 1 2 0
                                         0 0 41 1 0 0 0 14 2 0 11 0 0 1 2 0 11
                                         0 0 1 2 0 11 0 0 1 2 0 11 0 0 1 2 0 11
                                         0 0 34 2 0 0 6 0 1 2 0 0 0 6 1 2 0 0 0
                                         0 1)))))
           '|lookupComplete|)) 
