
(/VERSIONCHECK 2) 

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

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

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

(DEFUN |OFMONOID;varList;$L;4| (|x| $)
  (PROG (#0=#:G1855 |t| #1=#:G1856 |le|)
    (RETURN
      (SEQ (LETT |le|
                 (PROGN
                   (LETT #0# NIL . #2=(|OFMONOID;varList;$L;4|))
                   (SEQ (LETT |t| NIL . #2#)
                        (LETT #1# (SPADCALL |x| (QREFELT $ 10)) . #2#)
                        G190
                        (COND
                          ((OR (ATOM #1#)
                               (PROGN (LETT |t| (CAR #1#) . #2#) NIL))
                           (GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS (QCAR |t|) #0#) . #2#)))
                        (LETT #1# (CDR #1#) . #2#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #2#)
           (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 (|x| |fx| #0=#:G1861)
    (RETURN
      (SEQ (LETT |x| (SPADCALL |w| (QREFELT $ 10))
                 . #1=(|OFMONOID;rest;2$;6|))
           (EXIT (COND
                   ((NULL |x|) (|error| "empty word !!!"))
                   ('T
                    (SEQ (LETT |fx| (|SPADfirst| |x|) . #1#)
                         (EXIT (COND
                                 ((EQL (QCDR |fx|) 1)
                                  (SPADCALL (CDR |x|) (QREFELT $ 13)))
                                 ('T
                                  (SPADCALL
                                      (CONS
                                       (CONS (QCAR |fx|)
                                        (PROG1
                                         (LETT #0#
                                          (- (QCDR |fx|) 1) . #1#)
                                          (|check-subtype| (>= #0# 0)
                                           '(|NonNegativeInteger|) #0#)))
                                       (CDR |x|))
                                      (QREFELT $ 13))))))))))))) 

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

(DEFUN |OFMONOID;<;2$B;8| (|a| |b| $)
  (PROG (|la| |lb|)
    (RETURN
      (SEQ (LETT |la| (SPADCALL |a| (QREFELT $ 25))
                 . #0=(|OFMONOID;<;2$B;8|))
           (LETT |lb| (SPADCALL |b| (QREFELT $ 25)) . #0#)
           (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| (#0=#:G1892)
  (PROG ()
    (RETURN
      (PROG (#1=#:G1893)
        (RETURN
          (COND
            ((LETT #1#
                   (|lassocShiftWithFunction| (LIST (|devaluate| #0#))
                       (HGET |$ConstructorCache| '|OrderedFreeMonoid|)
                       '|domainEqualList|)
                   . #2=(|OrderedFreeMonoid|))
             (|CDRwithIncrement| #1#))
            ('T
             (UNWIND-PROTECT
               (PROG1 (|OrderedFreeMonoid;| #0#) (LETT #1# T . #2#))
               (COND
                 ((NOT #1#)
                  (HREM |$ConstructorCache| '|OrderedFreeMonoid|))))))))))) 

(DEFUN |OrderedFreeMonoid;| (|#1|)
  (PROG (DV$1 |dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT DV$1 (|devaluate| |#1|) . #0=(|OrderedFreeMonoid|))
        (LETT |dv$| (LIST '|OrderedFreeMonoid| DV$1) . #0#)
        (LETT $ (GETREFV 45) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|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| $) (|:| |rm| $))
             (|Union| 37 '"failed")
             (|Record| (|:| |lm| $) (|:| |mm| $) (|:| |rm| $))
             (|Union| 6 '"failed") (|PositiveInteger|)
             (|SingleInteger|) (|String|) (|OutputForm|))
          '#(~= 59 |varList| 65 |size| 70 |sample| 75 |rquo| 79
             |retractIfCan| 91 |retract| 96 |rest| 101 |recip| 106
             |overlap| 111 |one?| 117 |nthFactor| 122 |nthExpon| 128
             |mirror| 134 |min| 139 |max| 145 |lquo| 151 |lexico| 163
             |length| 169 |latex| 174 |hcrf| 179 |hclf| 185 |hash| 191
             |first| 196 |factors| 201 |div| 206 |coerce| 212 ^ 222
             |One| 234 >= 238 > 244 = 250 <= 256 < 262 ** 268 * 286)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0 0 0 0 0 0 0))
                (CONS '#(NIL NIL |Monoid&| |OrderedSet&| |SemiGroup&|
                         |SetCategory&| |RetractableTo&| |BasicType&|
                         NIL)
                      (CONS '#((|OrderedMonoid|) (|OrderedSemiGroup|)
                               (|Monoid|) (|OrderedSet|) (|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 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 39 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 38 0 0 1 1 0 0 6 1 1 0 44 0
                                  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
                                  20 1 2 0 0 0 20 1 2 0 0 0 41 1 2 0 0
                                  0 6 1 2 0 0 6 0 1 2 0 0 0 0 1)))))
          '|lookupComplete|)) 
