
(/VERSIONCHECK 2) 

(DEFUN |PARTPERM;partitions;3IS;1| (M N |n| $)
  (PROG (|c|)
    (RETURN
      (SEQ (COND
             ((ZEROP |n|)
              (SPADCALL NIL (SPADCALL (QREFELT $ 7)) (QREFELT $ 9)))
             ((OR (ZEROP M) (OR (ZEROP N) (< |n| 0)))
              (SPADCALL (QREFELT $ 7)))
             ('T
              (SEQ (LETT |c|
                         (SPADCALL
                             (CONS #'|PARTPERM;partitions;3IS;1!0|
                                   (VECTOR $ N))
                             (SPADCALL (- M 1) N (- |n| N)
                                 (QREFELT $ 12))
                             (QREFELT $ 14))
                         |PARTPERM;partitions;3IS;1|)
                   (EXIT (SPADCALL |c|
                             (SPADCALL M (- N 1) |n| (QREFELT $ 12))
                             (QREFELT $ 15)))))))))) 

(DEFUN |PARTPERM;partitions;3IS;1!0| (|#1| $$)
  (SPADCALL (QREFELT $$ 1) |#1| (QREFELT (QREFELT $$ 0) 11))) 

(DEFUN |PARTPERM;partitions;IS;2| (|n| $)
  (SPADCALL |n| |n| |n| (QREFELT $ 12))) 

(DEFUN |PARTPERM;partitions;2IS;3| (M N $)
  (PROG (#0=#:G1832 |i| #1=#:G1833 |aaa|)
    (RETURN
      (SEQ (LETT |aaa|
                 (PROGN
                   (LETT #0# NIL . #2=(|PARTPERM;partitions;2IS;3|))
                   (SEQ (LETT |i| 0 . #2#) (LETT #1# (* M N) . #2#)
                        G190 (COND ((QSGREATERP |i| #1#) (GO G191)))
                        (SEQ (EXIT (LETT #0#
                                    (CONS
                                     (SPADCALL M N |i| (QREFELT $ 12))
                                     #0#) . #2#)))
                        (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                        (EXIT (NREVERSE0 #0#)))) . #2#)
           (EXIT (SPADCALL (SPADCALL |aaa| (QREFELT $ 19))
                     (QREFELT $ 21))))))) 

(DEFUN |PARTPERM;nogreq| (|n| |x| $)
  (PROG (|i| #0=#:G1838 #1=#:G1836 #2=#:G1834 #3=#:G1835)
    (RETURN
      (SEQ (PROGN
             (LETT #3# NIL . #4=(|PARTPERM;nogreq|))
             (SEQ (LETT |i| NIL . #4#) (LETT #0# |x| . #4#) G190
                  (COND
                    ((OR (ATOM #0#)
                         (PROGN (LETT |i| (CAR #0#) . #4#) NIL))
                     (GO G191)))
                  (SEQ (EXIT (COND
                               ((COND ((< |i| |n|) 'NIL) (#5='T 'T))
                                (PROGN
                                  (LETT #1# 1 . #4#)
                                  (COND
                                    (#3# (LETT #2# (+ #2# #1#) . #4#))
                                    ('T
                                     (PROGN
                                       (LETT #2# #1# . #4#)
                                       (LETT #3# 'T . #4#)))))))))
                  (LETT #0# (CDR #0#) . #4#) (GO G190) G191 (EXIT NIL))
             (COND (#3# #2#) (#5# 0))))))) 

(DEFUN |PARTPERM;conjugate;2L;5| (|x| $)
  (PROG (#0=#:G1842 |i| #1=#:G1843)
    (RETURN
      (SEQ (COND
             ((NULL |x|) NIL)
             ('T
              (PROGN
                (LETT #0# NIL . #2=(|PARTPERM;conjugate;2L;5|))
                (SEQ (LETT |i| 1 . #2#)
                     (LETT #1# (|SPADfirst| |x|) . #2#) G190
                     (COND ((QSGREATERP |i| #1#) (GO G191)))
                     (SEQ (EXIT (LETT #0#
                                      (CONS
                                       (|PARTPERM;nogreq| |i| |x| $)
                                       #0#) . #2#)))
                     (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                     (EXIT (NREVERSE0 #0#)))))))))) 

(DEFUN |PARTPERM;conjugates;2S;6| (|z| $)
  (SPADCALL (ELT $ 23) |z| (QREFELT $ 14))) 

(DEFUN |PARTPERM;shuffle;2LS;7| (|x| |y| $)
  (PROG ()
    (RETURN
      (COND
        ((NULL |x|)
         (SPADCALL |y| (SPADCALL (QREFELT $ 7)) (QREFELT $ 9)))
        ((NULL |y|)
         (SPADCALL |x| (SPADCALL (QREFELT $ 7)) (QREFELT $ 9)))
        ('T
         (SPADCALL
             (SPADCALL
                 (CONS #'|PARTPERM;shuffle;2LS;7!0| (VECTOR $ |x|))
                 (SPADCALL (CDR |x|) |y| (QREFELT $ 26))
                 (QREFELT $ 14))
             (SPADCALL
                 (CONS #'|PARTPERM;shuffle;2LS;7!1| (VECTOR $ |y|))
                 (SPADCALL |x| (CDR |y|) (QREFELT $ 26))
                 (QREFELT $ 14))
             (QREFELT $ 15))))))) 

(DEFUN |PARTPERM;shuffle;2LS;7!1| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |PARTPERM;shuffle;2LS;7|)
    (RETURN
      (PROGN
        (SPADCALL (SPADCALL (QREFELT $$ 1) (QREFELT $ 25)) |#1|
            (QREFELT $ 11)))))) 

(DEFUN |PARTPERM;shuffle;2LS;7!0| (|#1| $$)
  (PROG ($)
    (LETT $ (QREFELT $$ 0) |PARTPERM;shuffle;2LS;7|)
    (RETURN
      (PROGN
        (SPADCALL (SPADCALL (QREFELT $$ 1) (QREFELT $ 25)) |#1|
            (QREFELT $ 11)))))) 

(DEFUN |PARTPERM;shufflein;L2S;8| (|x| |yy| $)
  (SPADCALL
      (SPADCALL (CONS #'|PARTPERM;shufflein;L2S;8!0| (VECTOR $ |x|))
          |yy| (QREFELT $ 29))
      (QREFELT $ 21))) 

(DEFUN |PARTPERM;shufflein;L2S;8!0| (|#1| $$)
  (SPADCALL (QREFELT $$ 1) |#1| (QREFELT (QREFELT $$ 0) 26))) 

(DEFUN |PARTPERM;rpt| (|n| |m| $)
  (PROG (#0=#:G1852 |i|)
    (RETURN
      (SEQ (PROGN
             (LETT #0# NIL . #1=(|PARTPERM;rpt|))
             (SEQ (LETT |i| 1 . #1#) G190
                  (COND ((QSGREATERP |i| |n|) (GO G191)))
                  (SEQ (EXIT (LETT #0# (CONS |m| #0#) . #1#)))
                  (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                  (EXIT (NREVERSE0 #0#)))))))) 

(DEFUN |PARTPERM;zrpt| (|x| |y| $)
  (SPADCALL (CONS (|function| |PARTPERM;rpt|) $)
      (SPADCALL |x| (QREFELT $ 32)) (SPADCALL |y| (QREFELT $ 32))
      (QREFELT $ 35))) 

(DEFUN |PARTPERM;sequences;2LS;11| (|x| |y| $)
  (SPADCALL (SPADCALL NIL (SPADCALL (QREFELT $ 7)) (QREFELT $ 9))
      (ELT $ 30) (|PARTPERM;zrpt| |x| |y| $) (QREFELT $ 37))) 

(DEFUN |PARTPERM;sequences;LS;12| (|x| $)
  (PROG (#0=#:G1859 |i| #1=#:G1860)
    (RETURN
      (SEQ (SPADCALL |x|
               (PROGN
                 (LETT #0# NIL . #2=(|PARTPERM;sequences;LS;12|))
                 (SEQ (LETT |i| 0 . #2#)
                      (LETT #1# (- (LENGTH |x|) 1) . #2#) G190
                      (COND ((QSGREATERP |i| #1#) (GO G191)))
                      (SEQ (EXIT (LETT #0# (CONS |i| #0#) . #2#)))
                      (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 38)))))) 

(DEFUN |PARTPERM;permutations;IS;13| (|n| $)
  (PROG (#0=#:G1863 |i|)
    (RETURN
      (SEQ (SPADCALL (|PARTPERM;rpt| |n| 1 $)
               (PROGN
                 (LETT #0# NIL . #1=(|PARTPERM;permutations;IS;13|))
                 (SEQ (LETT |i| 1 . #1#) G190
                      (COND ((QSGREATERP |i| |n|) (GO G191)))
                      (SEQ (EXIT (LETT #0# (CONS |i| #0#) . #1#)))
                      (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                      (EXIT (NREVERSE0 #0#))))
               (QREFELT $ 38)))))) 

(DEFUN |PartitionsAndPermutations| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G1865)
        (RETURN
          (COND
            ((LETT #0#
                   (HGET |$ConstructorCache|
                         '|PartitionsAndPermutations|)
                   . #1=(|PartitionsAndPermutations|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache|
                                   '|PartitionsAndPermutations|
                                   (LIST
                                    (CONS NIL
                                     (CONS 1
                                      (|PartitionsAndPermutations;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#)
                  (HREM |$ConstructorCache|
                        '|PartitionsAndPermutations|))))))))))) 

(DEFUN |PartitionsAndPermutations;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|PartitionsAndPermutations|)
              . #0=(|PartitionsAndPermutations|))
        (LETT $ (GETREFV 41) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|PartitionsAndPermutations|
            NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        $)))) 

(MAKEPROP '|PartitionsAndPermutations| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL (|Stream| 8) (0 . |empty|)
             (|List| 10) (4 . |concat|) (|Integer|) (10 . |concat|)
             |PARTPERM;partitions;3IS;1| (|Mapping| 8 8) (16 . |map|)
             (22 . |concat|) |PARTPERM;partitions;IS;2| (|List| 6)
             (|Stream| 6) (28 . |coerce|) (|StreamFunctions1| 8)
             (33 . |concat|) |PARTPERM;partitions;2IS;3|
             |PARTPERM;conjugate;2L;5| |PARTPERM;conjugates;2S;6|
             (38 . |first|) |PARTPERM;shuffle;2LS;7| (|Mapping| 6 8)
             (|StreamFunctions2| 8 6) (43 . |map|)
             |PARTPERM;shufflein;L2S;8| (|Stream| 10) (49 . |coerce|)
             (|Mapping| 8 10 10) (|StreamFunctions3| 10 10 8)
             (54 . |map|) (|Mapping| 6 8 6) (61 . |reduce|)
             |PARTPERM;sequences;2LS;11| |PARTPERM;sequences;LS;12|
             |PARTPERM;permutations;IS;13|)
          '#(|shufflein| 68 |shuffle| 74 |sequences| 80 |permutations|
             91 |partitions| 96 |conjugates| 114 |conjugate| 119)
          'NIL
          (CONS (|makeByteWordVec2| 1 'NIL)
                (CONS '#()
                      (CONS '#()
                            (|makeByteWordVec2| 40
                                '(0 6 0 7 2 6 0 8 0 9 2 8 0 10 0 11 2 6
                                  0 13 0 14 2 6 0 0 0 15 1 18 0 17 19 1
                                  20 6 18 21 1 8 10 0 25 2 28 18 27 6
                                  29 1 31 0 8 32 3 34 6 33 31 31 35 3
                                  28 6 6 36 6 37 2 0 6 8 6 30 2 0 6 8 8
                                  26 2 0 6 8 8 38 1 0 6 8 39 1 0 6 10
                                  40 1 0 6 10 16 3 0 6 10 10 10 12 2 0
                                  6 10 10 22 1 0 6 6 24 1 0 8 8 23)))))
          '|lookupComplete|)) 

(MAKEPROP '|PartitionsAndPermutations| 'NILADIC T) 
