Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quellcode-Bibliothek pperm.cc   Sprache: C

 

/****************************************************************************
*
*  This  of GAP  computational 
**
**  Copyright of GAP belongs to its developers, whose names are too numerous
 details.
**
**  SPDX-License-Identifier: GPL-2.0-or-later
*/


/*****************************************************************************
*
 * A partial perm is of the /
 *
 * [image set, domain, codegree, java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 2
 *
 * An element of the internal rep of a partial perm in T_PPERM2 must be
 * at most 65535*
 the inverse  equivalently maximum  theimage.
 *
 *****************************************************************************/


extern "C" {

#include "pperm.h"

#include "ariths.h"
#include "bool.h"
#include "error.h"
#include "gapstate.h"
#include "gvarsjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 15
#includejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// convert TNUM to underlying C data type
i i."
#include "listfunc.h"
#include "lists.h"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#    typedef ;
#template >
# "list.h"
#include "saveload.h"

} // extern "C"

#include "permutat_intern.}


//
// convert TNUM to underlying C data type
//
template <UInt tnum>
;

 >
struct DataType<T_PPERM2> {
  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
<
struct struct T_PPERM<UInt4> {
    typedef   ;
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


//
// convert underlying C data type to TNUM
//
template <typenamestatic voidASSERT_IS_PPERM )
 T_PPERM {
};
template <>
struct T_PPERM<UInt2> {
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

template
struct <Int4 {
    static const UInt tnum = T_PPERM4;
};


//
// Various helper functions for partial permutations
//
templatet Tjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
static voidASSERT_IS_PPERM( ppermjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    TNUM_OBJpperm)= T_PPERMT::tnum;
}

ejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21
T *ADDR_PPERM( )
{
    ASSERT_IS_PPERMjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    return #efineMIN )a<b?  )
}

template <typename T>
static java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
{
    ASSERT_IS_PPERM<T>(f);
    return (const TRequireArgumentConditionfuncname ,IS_PPERMop,                    \
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

template <typename java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static inline java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
{
    java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 6
return(IZE_OBJ() -sizeof   O) /sizeofT
}


#define MAX(a, b) (a < b ? b : a)
#define MIN(a, b) (a < b ? a : b)

#define IMAGEPP(i, ptf, deg) (i <= deg ? ptf[i - 1] : 0)

static Obj EmptyPartialPerm;

#define RequirePartialPerm(funcname, op)                                     \
    RequireArgumentCondition(     *
                                  * ''ishandlea  oftypeT,which is


static ModuleStateOffset PPermStateOffset = -1;

typedef struct {

    /**************************************************************************
     *
     *V TmpPPerm . . . . . . . handle of the buffer bag of the pperm package
     *
     * 'TmpPPerm' is the handle of a bag of type 'T_PPERM4', which is
     * created at initialization time of this package.  Functions in this
              java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
         
     *
     * The buffer is *not* guaranteed to have any particular value, routines
     * that require a{
     */

    Obj

}java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19


#defineT(;

static inline void ResizeTmpPPerm(UInt len    **ADDR_OBJ(f  )=codeg
{
    if static CODEG_PPERMObjf
 =
            if(<T()! ){
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    else if (SIZE_OBJ(TmpPPerm UInt    codeg ;
             (len + 1)    UInt    i
       TmpPPerm,(  ) sizeof()+2  (;
    }
}

/*****************************************************************************
 * Static     for (i = 0; <<f;i+){
 *****************************************************************************/


template 
inlineUInt ( fjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
    ASSERT_IS_PPERM<T>(f);
    return *(const
}

template O 
tatic SET_CODEG_PPERMf
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    ASSERT_IS_PPERMjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24
    *(T *java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

< >
static UInt CODEG_PPERM(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    ASSERT_IS_PPERM
    if _PERM2UInt )
{
    }
        // The following is only ever entered by the EmptyPartialPerm.
        returnNEW_PPERM>deg
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      *  CONST_ADDR_PPERM()
    for (i = 0{
         (ptfi>) {
            codeg = ptf[i];
        static inlineObjIMG_PPERM fjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
   }
   <( )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    return codeg;
}

static inline void SET_CODEG_PPERM2(java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 1
{
    }
}

static java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    SET_CODEG_PPERM<(f, )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1

UInt CODEG_PPERM2(Obj f    ()0 =;
{
    return CODEG_PPERM<UInt2>(f);
}

UInt CODEG_PPERM4(Obj f)
{
return CODEG_PPERMUInt4>f)
}

template <typename T>
  Obj (UInt deg)
{
    return  

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

Obj NEW_PPERM2(UInt
{
    static UInt INIT_PPERM(Obj f)
    // degree might be a UInt4.
     <Int2()
}

Obj NEW_PPERM4UInt )
{
     NEW_PPERMUInt4();
}

static inline IMG_PPERMObj)
{
    GAP_ASSERT(IS_PPERMdeg = DEG_PPERM<>;
    return CONST_ADDR_OBJ(f     ( = 0 {
}

static inline Obj DOM_PPERM(Obj f)
{
    GAP_ASSERT(IS_PPERM(f));
    return         (,dom)
}

static inline void SET_IMG_PPERM( degjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    GAP_ASSERT(IS_PPERM(f));
    GAP_ASSERT(IS_PLISTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    GAP_ASSERT((f =  |
               
    // TODO check entries of img are valid (  ;i<deg i+){
    ADDR_OBJ(f)[0] =         if (ptf[i] != 0)
}

static inline void SET_DOM_PPERM(Obj f, Obj             SET_ELM_PLIST(img, rank, INTOBJ_INT;
{    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    GAP_ASSERT(())
    GAP_ASSERT(IS_PLIST(dom) && !IS_PLIST_MUTABLE(dom
GAP_ASSERT(MG_PPERMf = NULL ||
               LEN_PLIST(dom) == LEN_PLIST(IMG_PPERM(f)));
    // TODO check entries of img are valid
= dom;
}

// find domain and img set (unsorted) return the rank

template <typename T>
static UInt     SET_DOM_PPERM(f(f,dom)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        return ;

    UInt    deg, rank, i;
    T *     java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    Obj     

deg  DEG_PPERMT()

    if ( = 0 {
        dom = java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 10
        java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
        SET_IMG_PPERM )java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
        CHANGED_BAG{
        return deg;
    }

    dom = NEW_PLIST_IMM(T_PLIST_CYC_SSORT, deg);
img =(T_PLIST_CYC deg)

    // renew the ptr in case of garbage collection                                 : LEN_PLIST())java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0

      ;
    for (i = 0; }
        if (tf[!0 java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
+;
            SET_ELM_PLIST(dom         res
            img,rank ptf]);
        }
    }
    GAP_ASSERT

    SHRINK_PLIST(img, (Int)rank);
    ( Int));
    SHRINK_PLIST(dom, {
    SET_LEN_PLIST(dom, (Int)rank);

    SET_DOM_PPERM(f, dom);
    SET_IMG_PPERM(f, img);
    CHANGED_BAG(f);
    return rank;
}

static UInt    <>f)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
{
    if (TNUM_OBJ(f) == T_PPERM2) {
        return    = INT_INTOBJpt;
    }
    else {
         INIT_PPERM<Int4()
    }
}

template <typename T>
tatic  RANK_PPERMObj )
{
    ASSERT_IS_PPERM<T>(f);
return(java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 51
       : (IMG_PPERMf))java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
}

UInt RANK_PPERM2(Obj f)
{
    return RANK_PPERM<Int2()
}

UInt RANK_PPERM4(Obj f)
{
    return <UInt4()
}

static }
{
    GAP_ASSERT(())
    if (LEN_PLIST(res) == 0)
        res

    SortPlistByRawObj(res);
    RetypeBagSM(res, T_PLIST_CYC_SSORT *************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return res;
}

template <typename T>
static Obj PreImagePPermInt(
{
    GAP_ASSERT(IS_INTOBJ(,img)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    ASSERT_IS_PPERM<T>(f);

    const T * ptf;
    UInt    i,UInt4 *ptf4

    cpt = INT_INTOBJ(pt);
    if ( if (EN_LISTimg)= 0)
        return Fail;

    i = 0;
    ptf = CONST_ADDR_PPERM<
    deg =DEG_PPERMT>f;
    whiledeg  LEN_LISTimg);
        i++;
    if (i ==     (eg   &java.lang.StringIndexOutOfBoundsException: Range [36, 27) out of bounds for length 36
        return Fail }
     ( +1;
}

/*****************************************************************************
 * GAP functions for partial perms
 *****************************************************************************/


static Obj FuncEmptyPartialPerm(Obj self)
{
    return 
}        (f,codeg;// codeg is already known

// method for creating a partial perm
jFuncDensePartialPermNC(bj,Objimg)
{
    RequireSmallList(SELF_NAME, img);

UInt    deg, i, j, codeg;
    UInt2 * ptf2;
    UInt4 * ptf4;
         f;

    if (LEN_LIST(img) == 0)
        return EmptyPartialPermj=INT_INTOBJ(LM_LISTi,i  1);

    // remove trailing 0s
    deg = LEN_LIST(img);
while (deg > 0 && ELM_LIST(img, deg) == INTOBJ_INT(0))
        deg--;

    if (deg == 0)
        returnEmptyPartialPermjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

    // find if we are PPERM2 or PPERM4
    codeg = 0;
    i = deg;
    while (codeg < 65536
        =INT_INTOBJ((img,i-)
        if (j > codeg ( );
            codeg =j;
    }
    if (odeg 65536){
        f      ;
        ptf2 = java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 17
         (  ;i  ; +){
            j = INT_INTOBJ(ELM_LIST(img, i + 1));
            (om)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        SET_CODEG_PPERM2(f, codeg=0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    }
    else {
 = (eg;
        ptf4 = ADDR_PPERM4(f);
        for (i = 0; i < deg         (j>codeg)
                        =jjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
            if (j > codeg)
                codeg = j;
            *ptf4++ = (UInt4)j;
        }
        SET_CODEG_PPERM4// create the pperm
    }
    return f;
}

// assumes that dom is a set and that img is duplicatefree
 Obj FuncSparsePartialPermNCObjself, , Obj img)
{
    RequireSmallList(SELF_NAME, dom);
            for  = 1;i < ;i+){
    RequireSameLength(SELF_NAME, dom            j =INT_INTOBJELM_PLIST,i)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

        rank,deg,i, j, codeg;
    Obj     f;
    UInt2 * ptf2;
    UInt4 * ptf4;

    LEN_LIST(dom) = 0)
        return EmptyPartialPerm;

    // make sure we have plain lists
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 23
dom PLAIN_LIST_COPYdom;
    if (!IS_PLIST(img))
        = PLAIN_LIST_COPYimg)

    // make img immutablecodeg=jjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    MakeImmutable(img);
    MakeImmutable(dom        (f,codegjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

    rank = LEN_PLIST(dom    (f)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0

d   PPERM2or
    codeg = 0;
    i =     RequirePa(ELF_NAME,)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    while (codeg < 65536 }
        j = INT_INTOBJ(ELM_PLIST(img, i--java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
        if (j > codeg)
            =j
    }

    // create the pperm
    if (codeg <// the rank is the number of points where it is defined
        f = NEW_PPERM2(deg);
        ptf2  (SELF_NAME ;
         (= 1i< ;i+){
            j = INT_INTOBJ(ELM_PLIST(img, i));
            ptf2[java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
        }
        ( );
    }
    else {
        f = NEW_PPERM4(deg);
= f)
        for (i = 1;         return IMG_PP){
            j = INT_INTOBJ(ELM_PLISTjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 28
)
                codeg = j;
            ptf4[INT_INTOBJ(return NewImmutableEmptyPlist
        }
        ()
    }
SET_DOM_PPERMf,;
    SET_IMG_PPERM(f, img);
    CHANGED_BAG    (out, ank;
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0


// the degree of pperm is the maximum point where it is defined
static Obj                ,i,ptf2[(ELM_PLIST(om ) -1);
{
    RequirePartialPerm(SELF_NAME           =();
TD(f)
}

// the codegree of pperm is the maximum point in its image

static Obj FuncCoDegreeOfPartialPerm(Obj self, Obj f)
{
    RequirePartialPerm    out;
   returnINTOBJ_INT(ODEG_PPERM()java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
}

// the rank is the number of points where it is defined
static uirePartialPerm(,f;
{
    RequirePartialPerm(SELF_NAME, f);
    return INTOBJ_INT(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
}

// domain of a partial perm
static Obj FuncDOMAIN_PPERM(Obj self}
{
    RequirePartialPerm(SELF_NAMEelse ((()){

    if (DOM_PPERM(f) ==         return SORT_PLIST_INTOBIMG_PPERM();
        INIT_PPERM(f)    }
    }
    return // preimage under a partial perm
}

// image list of pperm
static Obj{
{
   RequirePartialPermS f)

    if(()  )java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        INIT_PPERM<Int2>pt )
        return IMG_PPERM
    }
    if IMG_PPERM() {
        return IMG_PPERM(f);
    }

       ()
    if (rank == 0) {
         NewImmutableEmptyPlist;
    }

    Obj dom
 NEW_PLIST_IMM( ;
    SET_LEN_PLIST(     =java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35

    if (TNUM_OBJ     (i=1  = +)
        UInt2 * ptf2 = ADDR_PPERM2(f);
for ( i  1;i =rank;+) {
            SET_ELM_PLIST(
                out, i, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
        }
    }
    {
        UInt4 * java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 1
        for (UInt    i len,j, pow,rank  ,njava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
           SET_ELM_PLIST(
                out,  ord;
        }
    }
    returnoutjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}

// image set of partial perm
static Obj     =IMG_PPERM(;
{
    RequirePartialPerm(SELF_NAME, f);

    if (IMG_PPERM(f) == NULL) 
        INIT_PPERM(f);
        return SORT_PLIST_INTOBJ(IMG_PPERM(f));
    }
    else if (!IS_SSORT_LIST(IMG_PPERM(f))) {
        return SORT_PLIST_INTOBJ        deg=DEG_PPERM2()
    }
     IMG_PPERMf;
}

// preimage under a partial perm
java.lang.StringIndexOutOfBoundsException: Range [33, 6) out of bounds for length 58
{
    ,;
    RequireSmallInt(SELF_NAME, pt);
    if (TNUM_OBJ            if ([j]= 0){
        return PreImagePPermInt<UInt2>(pt, f);
    else
        return                 for (k [] k< deg& [k- ] ! 0)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
}                }

// find img(f)
static UInt4 * FindImg(UInt n, UInt rank, Obj img)
{
    GAP_ASSERT(    GAP_ASSERT(IS_PLIST;

    UInt            java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
4*ptseen;

    ResizeTmpPPerm(n);
    ptseen = ADDR_PPERM4(TmpPPerm=d )  ;
    memset(ptseen, 0 if ptseenj =){

    for (i = 1; i( =j;k =+;  java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 64
        ptseen[INT_INTOBJ(ELM_PLIST(                    ptseen[k  1]=0;

    return ptseen;
}

// the least m, r such that f^m=f^m+r
static Obj                 // ,in   
{
    RequirePartialPerm(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 13

        , ,j,pow rank,k 
    UInt2 * = DOM_PPERM(f);
    UInt4 * ptseen, *ptf4;
    Obj     dom, img, ord;

    pow = 0;
    ord for ( = 1;i < rank; i++){
     =MAX() (f);

    rank             (ptseen[]= 0 java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    img = IMG_PPERM(f);
    ptseen = FindImg(n, rank, img);

    if (TNUM_OBJ(f) == T_PPERM2) {
        deg = DEG_PPERM2(f);
        ptf2 = ADDR_PPERM2(f);
                for (k=ptf4[j] (k<=deg&& ptf4[k -1 ! 0);

        // find chains
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJELM_PLIST(dom, i) -1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            if (ptseen[j] == 0) {
                ptseen[j] = 2;
                len = 1;
                for (k = ptf2[j]; (k <= deg && ptf2[k - 1] != 0)                if(en )
                     k = ptf2[k -        // find cycles
                    len+;
                    ptseen[k - 1] = 2;
                }
                ptseen[k - 1] = 2;
                if (len ]== 1)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
                     =len;
            }
        }

        // find cycles                    len+;
        for (i = 1; i <= rank;                     [k -1]=;
            j =                 ord = LcmIntINTOBJ_INT())java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
            if p[j] =1){
                len = 1;
                for (k = ptf2[j];    }

                    ptseen[k - 1] = 0;
                }
                ord = LcmInt(ord_PERM self Objfjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
                // update ptseen, in case a garbage collection happened
                ptseen
            }
        }
    }
    else {
        deg = DEG_PPERM4(f);
        =ADDR_PPERM4(f;
        dom D(f);

        // find chains
                  SumInt(ow, per;
            j = INT_INTOBJ(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
            if// there exists <j> in <out> and a pos int <k> such that <j^(f^k)=i>.
      java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 30
                lenjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 17
for ]k  &-] ;
                     k = ptf4[k - 1]) {
                     =DEG_PPERMf)
                    ptseen     =(T_PLIST_CYC,deg;
                }
                ptseen[k -  img =IMG_PPERM;
ifl >)
                    pow = len;
            }
        }

        // find cycles
        for (i = 1; i <= rank; i++) {
            = (dom )  1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            if (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
len java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
fork [j     ; java.lang.StringIndexOutOfBoundsException: Range [58, 54) out of bounds for length 64
                    len+;
                                     ( = j (< & [ -1  )  =[-]java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
                }
 INTOBJ_INT)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                        
                        // find cycles
            }
        }
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    return NewPlistFromArgs[j ;
}

// the least power of <f> which is an idempotent
  )
{
    SET_ELM_PLIST +,java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 60

    Obj java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 10

    x = FuncINDEX_PERIOD_PPERM(self, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      ;
    per = ELM_PLIST(x, 2);  java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
    pow = per;
    (pow)
        pow = SumInt(pow, per[  ] ;
                   [k 1  ;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

// returns the least list <out> such that for all <i> in [1..degree(f)]
// there exists <j> in <out> and a pos int <k> such that <j^(f^k)=i>.
static Obj FuncCOMPONENT_REPS_PPERM(Obj self             java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
{
    RequirePartialPerm ([j]    +;  java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 62

    UInt    i, jjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 60
    UInt2 * java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
    UInt4 * ptseen, *ptf4;
    Obj     dom, img, out;

    n =// the number of components of a partial permjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 51

    if (n == 0) {
        out = NewEmptyPlist();
        return out;
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    deg = (f)
    nr = 0;
out  NEW_PLIST(, )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

rank = RANK_PPERM(f);
    img = IMG_PPERM(f);
    ptseen = FindImg(n, rank, img

    if (TNUM_OBJ(frank=RANK_PPERM()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
        dom      =FindImg(n, rank, img);
        ptf2 = ADDR_PPERM2(java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 0

        // find chains
        for (i = 1; i <=  deg  DEG_PPERM2()
j =INT_INTOBJ(ELM_PLISTdom );
            if (ptseen[j - 1] == 0) {
                for (k = j; (k <= deg && ptf2[k 
                    ptseen[k - 1] = 2;
                ptseen[k  1]=2java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                SET_ELM_PLIST(out, ++nr, ELM_PLIST(dom, i));
            }
        }

        // find cycles
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
if pj =1){
                ptseen[j] = 0;
                for (k = ptf2[j]; k !=             [ - 1 =0){
                    ptseen[k - 1] = 0;
IST(,+nr, ELM_PLIST(dom,);
            }
        }
    }
    else {
        dom = DOM_PPERM(f);
        ptf4 = ADDR_PPERM4(f);

        // find chains
        for (i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            j = INT_INTOBJ(ELM_PLIST(dom, i             =INT_INTOBJEdom,i)-1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            if ptseen[  1]=0){
                for (k = j; (k <= deg && ptf4[k - 1] != 0); k = ptf4[k - 1])
                    ptseen[k - 1] = 2;
                ptseen[k - 1] = 2;
                (,+nr ELM_PLIST(, );
            }
        }

          // find cycles
for(i =1; i< ; i+ java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    j= (ELM_PLIST(dom, i)) - 1;
            if (ptseen[j] == 1) {
                ptseen[j] = 0
                for (k = ptf4[j]; k != j + 1; k = ptf4[k - 
                    ptseen[ -1 =0;
               SET_ELM_PLISTo,nr java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        }
}

    SHRINK_PLIST(}
    SET_LEN_PLIST(out, (Int)nr);
return;
}

// the number of components of a partial perm (as a functional digraph)
static Obj FuncNR_COMPONENTS_PPERM(Obj             j = INT_INTOBJ(ELM_PLIST(dom, i
{
                    nr++

    UInt    i, j,  fork= ptf4[;k !j+;k    ]
    UInt2*;
    UInt4 * ptseen, *java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 13
     INTOBJ_INTnr;

    n = MAX(DEG_PPERM(f), CODEG_PPERM}
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

    rank = RANK_PPERM(java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
    img = IMG_PPERM
ptseen=  );

    ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        deg = out = NewEmptyPlist
        ptf2 = java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5
        dom

        // find chains
        i ;=;+{
            j = INT_INTOBJ(ELM_PLIST(dom, i));
            if (ptseen[[j - 1 ==0) {
                nr++;
                for (k = j; (k <= deg && ptf2[k - 1] != 0); k = ptf2[k - 1])
                    ptseen[k - 1] = 2;
                ptseen[k     (TNUM_OBJ( =T_PPERM2) {{
            }
        }

        // find cycles

              )  java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            if (ptseen[j] == 1) {

                ptseen[j] = 0;if(ONST_ADDR_PPERM4)j- 1]= ){
                for (k = ptf2[j]; SET_ELM_PLIST + 30)
                    ptseen[k                 ;
            }
        }
    }
    else {
        deg = DEG_PPERM4Tk-1  ;
        =java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 30
        dom java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 54

        // find chains
        for (i = }
            j =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            if (ptseen[j - 1]               java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
                +
                for (                out
                    ptseen[k - 1] = 
                ptseen[k - 1] = 2;
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        }

        // find cycles
        for (i = 1; i  ( ,
j java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
ifptseen[ =1){
                nr++;
            }
                for (k = ptf4[j]; k != j + 1; k = ptf4[k - 1])
                    ptseen[k     else {
            }
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }
         i =1  <rank i++)
}

// the components of a partial perm (as a functional digraph)
static Obj FuncCOMPONENTS_PPERM(Obj self, Obj f)
{
    RequirePartialPerm(SELF_NAME, f);

    UInt i, j, n, rank, k, deg, nr, len;
    Objk = IMAGEPPk,ADDR_PPERM4),deg;

    n = MAX(DEG_PPERM} while (k !);

          SHRINK_PLISTout ), len);
        out = NewEmptyPlist();
        return out;
    }

    nr = 0;

    rank  ();
    img =}
    out = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
    FindImgj =INT_INTOBJ(om,i));

if(NUM_OBJ()=T_PPERM2){
        deg = DEG_PPERM2(f);
        dom = DOM_PPERM(f);

        // find chains
        forCHANGED_BAGo)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            j                 {
             AssPlist(,,+ java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 71
                SET_ELM_PLISTout+, (,);
                CHANGED_BAG(out);
                 =0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
                k ;
do
                    AssPlist(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 33
                    ADDR_PPERM4(
k  f,)
                } while (k !=out );
                SHRINK_PLIST(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
                SET_LEN_PLIST(ELM_PLIST(out, nr), (Intstatic FuncCOMPONENT_PPERM_INTObj,Obj ,Obj )
CHANGED_BAG()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            }
        }

        // find cycles
        for
j =INT_INTOBJ((om );
            if (CONST_ADDR_PPERM4(TmpPPerm)[j - 1] == 1) {
                ,+,java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
                CHANGED_BAG(out);
                  ;
                k =  =NewEmptyPlist;
                            return out;
                    AssPlist(ELM_PLIST(out, nr), ++len,        }
                            out = NEW_PLIST(T_PLIST, 30);
                    k = ADDR_PPERM2(f)[k - 1];
                } while (k !         =java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
                  (j, ADDR_PPERM2) )
((utnI)lenjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
            }
        }
    }
    else {
        deg = DEG_PPERM4(f);
        dom = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0

        // find chains
        for (i = 1; istatic FuncFIXED_PTS_PPERM self f
            j = INT_INTOBJ(ELM_PLIST(dom, i));
            if (CONST_ADDR_PPERM4(TmpPPerm)[j - 1] == 0) {
                SET_ELM_PLIST(out, ++nr, NEW_PLIST(T_PLIST_CYC, 30));
                CHANGED_BAG(out);    (SELF_NAME )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                len = 0;
                k = j;
                 {
    UInt4*ptf4;
                    java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
                    k = IMAGEPP(k, ADDR_PPERM4(out= ;
                } while =;i< i+ {
                SHRINK_PLIST(LM_PLIST, ) len;
                SET_LEN_PLIST(ELM_PLIST(out, nr), (Int)len);
                CHANGED_BAG(out);
            }
        }

        // find cycles
        for (i = 1; java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 9
             =INT_INTOBJ(LM_PLISTdom i);
            if ([-]= ){
                SET_ELM_PLIST(out, ++nr              NEW_PLISTT_PLIST_CYC_SSORT,rank;
                CHANGED_BAG(out);
                len = 0;
                k = j;
                do {
ssPlist(ELM_PLIST(out,nr, +len,INTOBJ_INT(k));
                    ADDR_PPERM4(TmpPPerm)[k - 1] = 0;
                    k = ADDR_PPERM4                 =INT_INTOBJ(ELM_PLIST(om, );
                 whilek !=j;
                SHRINK_PLISTELM_PLISTo, ) len;
                SET_LEN_PLIST(ELM_PLIST(out, nr), (Int)len);
                CHANGED_BAG(out);
            }
        }
    }

    SHRINK_PLIST(out, (Int)nr);
    SET_LEN_PLIST(out, (Int)nr);
    return out;
}

// the points that can be obtained from <pt> by successively applying <f>.
      out  NEW_PLIST, deg;
{
    RequirePartialPerm(SELF_NAME, f);
RequireSmallIntSELF_NAME,pt;

    UInt i,                  (i]=   1){
    Obj  out;

}

    if (            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        deg = DEG_PPERM2(f);

        if (i > deg || (             =(,java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            out = NewEmptyPlist();
            return out;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        out = NEW_PLIST(T_PLIST_CYC, 30);
        len= java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
        j = i;

        do {
            AssPlist ( =0)
                    (,T_PLIST_EMPTY
        } while (j != 0 &&    (out )
    }
    else {
        deg = DEG_PPERM4returnoutjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

         i >deg | (DDR_PPERM4(f))[i  1 = ) {
            out = NewEmptyPlist();
            return out;
        }

        SELF_NAME, f;
        len =
j ;

        do { *ptf2
            AssPlist(out, ++java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
            j = IMAGEPP(j, ADDR_PPERM4(       deg ()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        }while ( ! 0 &&j!=)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    }
    SHRINK_PLIST(out, (Int)len);
    SET_LEN_PLIST(out, (Int)len);
    return out;
}

// the fixed points of a partial perm
static Obj FuncFIXED_PTS_PPERM(Obj self, Obj        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{
    RequirePartialPerm(SELF_NAME, f);

    UInt                 i=1;i =rank;++ {
    Obj     out, dom;
                      INT_INTOBJ((dom i)  1;


                nr+;
                
        deg =
        if (DOM_PPERM(f) == NULL) {
            out = NEW_PLIST(T_PLIST_CYC_SSORT, deg);
            ptf2 = ADDR_PPERM2(f);
i < deg i+){
                if (ptf2[i] == i + 1) {
                    SET_ELM_PLIST(out, ++len, INTOBJ_INT(i + 1));
                    nr+;
                    }
        }
        else {
            dom=DOM_PPERM(f);
            rank = RANK_PPERM2(f);
            out =              = DOM_PPERM(f;
            (f);
            for (i = 1;              (i =1;i =rank;i+ 
                j = INT_INTOBJ(ELM_PLISTjava.lang.StringIndexOutOfBoundsException: Range [28, 18) out of bounds for length 37
                
                    SET_ELM_PLIST// the moved points of a partial perm
                
            java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        }
    }
    else {
        deg = DEG_PPERM4(f);
        if (DOM_PPERM(f) == NULLObj      ;
            out = UInt4java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
           ptf4=()
            for (i =      TNUM_OBJ()=  java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                if (ptf4[i] == i +             out  java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 52
                    SET_ELM_PLIST(out, ++len, INTOBJ_INT(i + 1));
                }
            }
        }
        else {
            dom=DOM_PPERMf;
            rank = RANK_PPERM4(f);
            out = NEW_PLIST(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 13
            ptf4 =             dom = DOM_PPERM(f
            for (i = 1; i <= rank;             =NEW_PLISTT_LIST_CYC_SSORT rank;
( )
                if (ptf4[j - 1] ==                  java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 54
                    SET_ELM_PLIST(out, ++len,                
                }
            }
        }
    }
    if (len == 0)
        (, )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38

    SHRINK_PLIST(out, len);
   java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33

    return out;
}

static Obj FuncNR_FIXED_PTS_PPERM(Obj self, Obj f)
{
    RequirePartialPerm(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 9

    UInt    nr  (f;
    Obj     dom   )
    UInt2   java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 34
    UInt4 * ptf4;

                     =INT_INTOBJ((dom )-1java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    if (                    (out ++len, INTOBJ_INTj+1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
deg  f;
         f;
        if (DOM_PPERM(f) == NULL) {
            for (i = 0;     SET_LEN_PLIST(out, (I)len;
                if (ptf2[i] = nr  , java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
                    nr++;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        else{
            dom = DOM_PPERM        deg =DEG_PPERM2f;
             = RANK_PPERM2(f);
            for (i = 1; i <= ULL {
                 =INT_INTOBJ(LM_PLIST(,) -1java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
                if (ptf2[j] == j + 1)
                    nr++;
            }
        }
    }
    else {
        deg = DEG_PPERM4(f);
                    for (i =1 i <= rank +) {
        if (DOM_PPERM(f) == NULL) {
(i 0 i <deg; i++
                if (ptf4[i] == i + 1)
                    nr++;
        }
        else {
            dom = DOM_PPERM(f);
            rank = RANK_PPERM4(f);
            for (i          =()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (ptf4[j] == j + 1)
                    nr++;
            }
        }
    }
    return INTOBJ_INT(nr);
}

// the moved points of a partial perm
static Obj FuncMOVED_PTS_PPERM(Obj self, Obj f)
{
    RequirePartialPerm(ELF_NAME, f);

    UInt    len, i, j, deg, rank;
    Obj     ,dom
    UInt2 * ptf2;
    UInt4 * ptf4;

    len = 0;
    if (TNUM_OBJ(f) == T_PPERM2) {
        deg = DEG_PPERM2(f);
        if (DOM_PPERM(f) == NULL) {
            out = NEW_PLIST(T_PLIST_CYC_SSORT, deg);
             =f
                                +
                if
SET_ELM_PLIST,+len,INTOBJ_INT(  1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
                }
            }
        }
        else{
              f;
                        
            out = NEW_PLIST(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             i ;   i+{
                j = INT_INTOBJ(ELM_PLISTptf2=(;
ifj !  )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
                    (out+len INTOBJ_INT( +1)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
                
            }
        }
    }
    else {
        deg = DEG_PPERM4(f        else {
       if(DOM_PPERM)= ){
            out = NEW_PLIST(T_PLIST_CYC_SSORT, deg);
            ptf4 = ADDR_PPERM4(f);
            for (i = 0; i < deg; i++)                 if ptf2j !=   )
                java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 13
                    SET_ELM_PLIST(out          java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 28
                 fori=;0 - java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
            }
        }
        else {
            dom = DOM_PPERM(f);
            rank = RANK_PPERM4        }
            out = NEW_PLIST(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
            ptf4 = ADDR_PPERM4j (dom )-1
            for (i = 1; i <= rank; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (ptf4[j] != j + 1) {
                    return (j + 1);
                }
            }
     0;
    }
    if (len == 0)
        (out T_PLIST_EMPTY);
    SHRINK_PLIST{
    SET_LEN_PLIST(out, (Int)len);
 java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static Obj 
{
    RequirePartialPerm(SELF_NAME, f);

             = DEG_PPERM2(f;
             = ADDR_PPERM2(f);
    UInt2 * ptf2;
    UInt4 * ptf4;

    nr = 0;
    if((f =T_PPERM2){
        deg = DEG_PPERM2(f);
        java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
        if (DOM_PPERM(f) == NULL) {
            for (i = 0; i < deg; i++)
                             =RANK_PPERM2()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                    nr++;
        }
        else {
            dom =(f);
            rank =                     return(j +1;
            for (i = 1; i <= rank; i++)             
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (ptf2[j] != j + 1)
                    nr+;
            }
        }
    }
    else {
        deg = DEG_PPERM4(f);
        ptf4 = ADDR_PPERM4(f);
if(f =NULL)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
            for (i = 0; i < deg; i++)
                if (ptf4[i] != 0 && ptf4[i] !=            }
                    nr++;
        }
        else {
            (f);
            rank = RANK_PPERM4(f);
            for (i = 1; i <= rank; i             (  ;i < rank i+ java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
                jINT_INTOBJ(ELM_PLIST(om i) -1;
                if (ptf4[j] != j + 1)
                    ++;
            }
        }
    }
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
}

static Obj FuncLARGEST_MOVED_PT_PPERM(Obj self// convert a T_PPERM4 with codeg<65536 to a T_PPERM2
{
    RequirePartialPerm(SELF_NAME, f);

    UInt    i, j, deg;
    Obj     dom;
    UInt2 * ptf2;


    if (TNUM_OBJ(f) ==     UInt    deg, i
         =DEG_PPERM2();
        ptf2 = ADDR_PPERM2(f);
        if (DOM_PPERM(f) == NULL) {
            ( deg; i  0;i-){
                if (ptf2[i - 1] != 0 && ptf2[i - 1] != i)
                     java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 41
            }
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        else {
            dom = DOM_PPERM(f);
            for (i = RANK_PPERM2(f); i >= 1;   ResizeBag(f (deg + 1 * sizeof(UInt2) + 2 * sizeof(Obj));
                = INT_INTOBJELM_PLIST i)-1;
                if (ptf2[j] !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                    return INTOBJ_INT(j + 1);
            }
        }
    }
    else {
        deg = java.lang.StringIndexOutOfBoundsException: Range [34, 18) out of bounds for length 34
        ptf4         if (  ){
        if (DOM_PPERM(f) == NULL)             java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 33
for(  deg i> 0;i-){
                if (ptf4[i - 1] != 0 && ptf4[i - 1] != i)
                                  *(bj)sizeofU),
            }
        }
         (int)4* DEG_PPERM4f)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
            dom =DOM_PPERM(f);
            for (i = RANK_PPERM4(f); i >= 1; i--) {
                j =     return HASHKEY_BAG_NC(fUInt4)255,2*sizeofObj)+sizeof()java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                if (ptf4[j] != j + 1)
                    return INTOBJ_INT(j +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            }
        }
    }
    return INTOBJ_INT(0);
}

static Obj FuncSMALLEST_MOVED_PT_PPERM(Obj self, Obj f)
{
    RequirePartialPerm(SELF_NAME, f);

    UInt    i, jS,;
    Obj     dom;
     * ptf2;
    UInt4 * ptf4;

    if (TNUM_OBJUInt    deg i,j,rank;
        deg = DEG_PPERM2(f);
        ptf2 = ADDR_PPERM2(f);
        if (DOM_PPERM(f) == NULL) {
            for (i = 0  (f)= T_PPERM2) {
                if (ptf2[i] != 0 && ptf2[i] != i + 1)
        returnINTOBJ_INT +1);
            }
        }
        else {
           dom=DOM_PPERMf)
            rank = RANK_PPERM2(f);
            for (i = 1; i <= rank             (i = 0; i < deg+) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
                java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31
                if (ptf2[j] != j + 1)
                    return INTOBJ_INT(j + 1);
}
        }
    }
    else
        deg = DEG_PPERM4                if(tf2j &[]!=j + 1
        ptf4 = ADDR_PPERM4(f);
        if (DOM_PPERM(f) == NULL
            for (i = 0; i < deg; i {
                if (ptf4[i] != 0 && ptf4[i] != i + 1)
                    return INTOBJ_INT )
            }
        }
        else {
            dom = DOM_PPERM(f);
            rank = RANK_PPERM4(f);
            for (i = 1; i <= rank}
                j = INT_INTOBJ(ELM_PLIST(dom,             =DOM_PPERMf;
                if (ptf4              (f)
                     INTOBJ_INT +1)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
            }
        
    }
    return Fail;
}

// convert a T_PPERM4 with codeg<65536 to a T_PPERM2
static Obj FuncTRIM_PPERM(Obj self,     return True
{
    RequirePartialPerm(SELF_NAME, f);

    UInt    deg, i;
    UInt4 * ptf;

    if (TNUM_OBJ(f) != T_PPERM4
;

    ptf =         dom java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
    deg = DEG_PPERM4(    UInt2 *ptg2java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    for (i = 0; i java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        ((UInt2 *)ptf)[i] = (UInt2)ptf[i];

    RetypeBagf T_PPERM2
    ResizeBag(f, (deg=DEG_PPERM2f;
    return (Obj)0;
 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10

Int HashFuncForPPerm(Obj f    
{
   UIntcodeg;

(f)java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 67

    if i ; = +java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        codeg = CODEG_PPERM4(f);
        if codeg <65536 {
            FuncTRIM_PPERM(0, f);
        }
        else {
            return HASHKEY_BAG_NC(f, (UInt4)255,
                                  2 * sizeof(Obj) + java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 5
                                  (int)4 * java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 28
        }
    }
    return HASHKEY_BAG_NC(f, (UInt4)255, 2 * sizeof(Obj) + sizeof(UInt2),
                          (int)2 * DEG_PPERM2(f));
}

static Obj FuncHASH_FUNC_FOR_PPERM(Obj self, Obj f, Obj data)
{
    return INTOBJ_INT g
}

// test if a partial perm is an idempotent
staticFuncRIGHT_ONE_PPERMObj  f
{
    RequirePartialPerm(SELF_NAME, f);

    UInt2 * ptf2;
    UInt4* ptf4;
    UInt    deg, i, j,  UInt   ,j codeg rank;
    Obj     dom;

    *;
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
                co  fjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
            deg = DEG_PPERM2(f);
            for (i = 0; i < deg; i++) {    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
                if (ptf2[i] != 0 && ptf2[i] != i + 1)
                    return False;
            }
        }
        else {
            dom=DOM_PPERM(f)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
            rank = RANK_PPERM2(f);
            for (i = 1; i <= rank; i++)               java.lang.StringIndexOutOfBoundsException: Range [36, 26) out of bounds for length 50
                j =( ;
                if (ptf2[java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
                    return )
            }
}
    }
   
        ptf4 =             []  ;
        if (DOM_PPERM(f) == NULL) {
            deg = DEG_PPERM4(f);
            for (i = 0; java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
                if (ptf4[java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
                    // f<=g if and only if f is a restriction of g
            }
        }
        else NaturalLeqPartialPerm(   g
            dom = DOM_PPERM(f);
            rank = RANK_PPERM4(f);
            for (i = 1; i <= rank    def  ,,java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
                j = INT_INTOBJ(ELM_PLIST    Obj    domjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
                if (ptf4[j] != 0 && ptf4[j] != jptf=CONST_ADDR_PPERMTF;
                    return False;
            }
        }
    }
    return True;
}

// an idempotent partial perm <e> with ker(e)=ker(f)
static Obj FuncLEFT_ONE_PPERM <(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
{
(, f;

    Obj     dom, g;
    UInt    deg, i, j, rank;
    UInt2 * ptg2java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
    UInt4 * ptg4;

    if (TNUM_OBJ
        rank = RANK_PPERM2(f);
        java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
deg )
    }
    else {
        rank = RANK_PPERM4(f);
        dom = DOM_PPERM(f);
=f;
    }

    if ( < 65536 {
        g = NEW_PPERM2(deg);
        ptg2= ()
        for (i = 1; i java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 57
              java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 50
            ptg2[returnjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 57
        
        return NaturalLeqPartialPerm<UInt4,}
        SET_DOM_PPERM(g, template <typename TF, typenam
        SET_IMG_PPERM(g, dom);
    }
     java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        g =     Obj   join =  ;
        ptg4 = ADDR_PPERM4(g);
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ptg4[j] = 
        }
       java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 33
        SET_DOM_PPERM(g,);
        SET_IMG_PPERM(g, dom);
    }
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    SET_CODEG<> )


// an idempotent partial perm <e> with im(e)=im(f)
static   ;   java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    RequirePartialPerm(SELF_NAME, f);

    Obj     g, img;
    UInt    iireturnjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 16
    UInt2 * ptg2;
     *ptg4;

    if (TNUM_OBJ(f) == T_PPERM2) 
codeg (fjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        rank = RANK_PPERM2(f);
        img = IMG_PPERM(f);
    }
    else {
  (f)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        rank = RANK_PPERM4(f);
        img = IMG_PPERM(f);
    }

    if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        g = NEW_PPERM2(codeg);
        ptg2 = ADDR_PPERM2(g);
        for (i = 
            j = INT_INTOBJ i))-1
            ptg2[j] = j + 1;
        }
        if (IS_SSORT_LIST(img)) {
            SET_DOM_PPERM(g, img);
SET_IMG_PPERM(g, img);
        }
        SET_CODEG_PPERM2(g, codeg);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    else {
        g = NEW_PPERM4(codeg);
        ptg4 = ADDR_PPERM4(g);
        for (i = 1;
deg ,,degf degg,, rank;
            ptg4[j] = j + 1;
        }
        if (IS_SSORT_LIST(img)) {
            SET_DOM_PPERM(g, img);
            SET_IMG_PPERM(g, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 19
// init the buffer
          =CODEG_PPERM,CODEG_PPERM(g));
    }
    CHANGED_BAG(g);
    ;
}

// f<=g if and only if f is a restriction of g
template <typename java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 31
static Obj NaturalLeqPartialPerm(Obj f, Obj g)
{
,,, ;
*
    
Obj    dom

    def = DEG_PPERM<TF=<>(;
=<TF(f);
    if (def =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;

=>java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    ptg = ptjoin[j=j;
            [  ]=;
        for (i = 0; i < def
            if (ptf[i]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                return False;
          1  =;+
    }
    else {
        dom = DOM_PPERM(f);
        java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 33
        for (i = 1; i <= rank; i++) {
             (dom );
            if                 
                return False return;   
}
    }

    return True;
 }

static
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    RequirePartialPerm(SELF_NAME, f);
    RequirePartialPerm(SELF_NAME, g);

    if 1 =)
                                java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 43
    }
    else if (TNUM_OBJ(f)                     
        return                 Fail
    }
    else if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM2)    elseif (tjoin] ! [i] 
        return NaturalLeqPartialPerm<UInt4, UInt2>(f, g);
    }
    else /* if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM4) */ {
        return NaturalLeqPartialPerm<UInt4, UInt4
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

template <typename TF, typename TG>
static Obj JOIN_IDEM_PPERMS(                        ptjoin[i];
{
    typedef typename ResultType<TF, TG>::type Res;

            java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 36
    Obj   join = NULL;
    Res * ptjoin;
    const TF * ptf;
    const TG * ptg;

    def = DEG_PPERM(f);
    deg = DEG_PPERM(g);

    GAP_ASSERT(def <= java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0

    join = NEW_PPERM (,;
SET_CODEG_PPERM<es>join,deg;
    ptjoin = ADDR_PPERM<Res>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             f;
    ptg = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
fori ;i  ;+ java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        ptjoin[i] = (ptf[i] != 0 ? ptf[i] : ptg[i]);
}
    for (; i < deg; i++) {
        ptjoin[i] = ptg[i];
    }

    return join;
}

 Obj ( self, Obj , Objg)
{
    RequirePartialPerm(SELF_NAME, f);
    RequirePartialPerm(SELF_NAME, g);

    UInt def, deg;


        return f;
    }

    def = DEG_PPERM(f);
    deg = DEG_PPERM(g);

    if (def > deg) {
        SWAP(Obj, f, g);
           ,i , java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 40
    }

    if (TNUM_OBJ(f    Obj    meetjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
   UInt2 >,g;
    }
    else if (TNUM_OBJ(f) == T_PPERM2 && TNUM_OBJ(g ifj!  &j= (eg ptg2 degg)
        return JOIN_IDEM_PPERMS<UInt2, UInt4>(f, g);
    }
else/* if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM4) */ {
        return JOIN_IDEM_PPERMS<UInt4          (meet);
    }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1


// the union of f and g where this defines an injective function
template <typename TF,             if (IMAGEPP(i + 1 = java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
static Obj JOIN_PPERMS(Obj f, Obj g)
{
    typedef java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 13

    UInt   ,degf ,codeg ;
    Res *   ptjoin;
    const TF * ptf     if(TNUM_OBJ) =  &&TNUM_OBJ() =T_PPERM2)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
    const TG*ptg;
    UInt4 *          (;
    Obj    join, dom;

    // init the buffer
    codeg = MAX(CODEG_PPERM(f), CODEG_PPERM(g));
    ResizeTmpPPerm(codeg);
    ptseen = ADDR_PPERM4(TmpPPerm);
    for (i = 0; i < codeg; i++)
        ptseen[i] = 0;

    degf <>(;
    degg = DEG_PPERM<TG>(g);
                ;
    join = 
    SET_CODEG_PPERM<Res>(join, codeg);

    ptjoin        meet  NEW_PPERM2)
>
 java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 34
    ptseen = ADDR_PPERM4(TmpPPerm);

    if (DOM_PPERM(f) != NULL            =(  1  )java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
        dom = DOM_PPERM(f);
        rank= RANK_PPERM<F>(f);
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ptjoin[j] = ptf[j];
            ptseen[ptf[j] - 1] = 1;
        }
    }

    if (     if(() = T_PPERM2(g =T_PPERM4){
        dom = DOM_PPERM(g);
        rank = RANK_PPERM<TG>(g);
        for (i = 1; i         degf  java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 29
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            if (ptjoin
                if (ptseen[ptg[j] - 1] == 0) {
                    ptjoin[j] = ptg[j];
                    ptseen[ptg[j] - 1] = 1;
                }
                else {
                    return Fail;    // join is not injective
                }
            }
                    ptmeet2()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
return;
            }
        }
    }

    if (DOM_PPERM(f) == NULL) {
        for (i = 0; i <            j =IMAGEPPi +1, ptf2,degf;
            if (ptf[i] != 0) {
                if (ptjoin[i] == 0) {
                    if (ptseen[ptf[i] - 1] == 0) {
                        ptjoin[i] = ptf[i];
                        java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 38
                    }
                    else
                        return Fail;
                    }
                }
                else if (ptjoin// find degree
                    returnFail;
                }
            }
        }
    }

    if (DOM_PPERM(g) == NULL) {
        for (i = 0; i < degg; i+java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             ptg[]! 0) {
                ([i]= ){
                    if (ptseen[ptg[i] - 1] == 0) {
                        ptjoin[i] = ptg[i];
                        ptseen[tg]  1 =1
}
                    else {
                        return Failjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                    }
                }
                else if (ptjoin[i] != ptg[i])         }
                    return Fail;
                 return meet;
            }
        }
    }
    return join;
}

static Obj FuncJOIN_PPERMS(Obj self, Obj f, Obj g)
{
    (SELF_NAME f);
    RequirePartialPerm(SELF_NAME, g);

    if (EQ(f, g))
        return;

    ((f) = T_PPERM2&& TNUM_OBJ( =){
        return JOIN_PPERMS<UInt2, UInt2>(f, g);
    }
    else if (TNUM_OBJ(f) == T_PPERM2 && TNUM_OBJ(g) == T_PPERM4) {
        return JOIN_PPERMS<UInt2, UInt4>(f, g);
    }
    else if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) =    codeg = 0;
        return JOIN_PPERMS<UInt4, UInt2>(f, g);
    }
    else/* if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM4) */ {
        return JOIN_PPERMS<UInt4, UInt4>(f, g);
    }
}

static  FuncMEET_PPERMS(bj self, Obj f,Obj gjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
{
    RequirePartialPerm(SELF_NAME, f);
    RequirePartialPerm(SELF_NAME, g);

    UInt   deg, i, j, degf,             n--;
    , *ptg2, *ptmeet2;
    UInt4n-;
    Obj            if (n  ( == 0)

    codeg = 0;
    if (TNUM_OBJ(f) == T_PPERM2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        degf = DEG_PPERM2(f);
        degg = DEG_PPERM2(g);
        ptf2 = ADDR_PPERM2();
        ptg2 = ADDR_PPERM2(g);

        // find degree
         deg=MIN(, degg) deg >0 deg-{
            j = IMAGEPP(deg, ptf2, degf);
             j ! 0 && j== MAGEPPdeg ptg2,degg))
                break;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        meet =NEW_PPERM2)
        ptmeet2 = ADDR_PPERM2(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 9
        ptf2 = ADDR_PPERM2(f);
        ptg2 = ADDR_PPERM2(g);

        for ( = 0 i <; i 
j (i  )
            if (IMAGEPP(i + 1, ptg2, java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 30
                []=j
                if (j > codeg)
                    codeg         n> & ptf4[((,n) - 1]=0)
            }
        }
        SET_CODEG_PPERM2(meet, codeg);
    }
    else if (TNUM_OBJ(f) == T_PPERM4 && TNUM_OBJ(g) == T_PPERM2) {
        degf = DEG_PPERM4(f);
        degg = DEG_PPERM2(g);
        ptf4 = ADDR_PPERM4(f);
        ptg2 = ADDR_PPERM2(g);

        // find degree
        for (deg = (degf < degg ?j=(,+  java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
            j = IMAGEPP(deg, ptf4, degf             ([j]>codeg)
            if (j != 0 && j == IMAGEPP(deg, ptg2,  }
                break;
        

        meet = NEW_PPERM2(deg);
        ptmeet2 = ADDR_PPERM2(meet);
        ptf4 = ADDR_PPERM4(f);
        ptg2 = ADDR_PPERM2(g);

        for (i = 0; i < deg; i++) {
            j = IMAGEPP(i + 1, ptf4, java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 32
            java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                [i  ;
                if (j > codeg)
                    codeg = j;
            }
        }
        SET_CODEG_PPERM2(meet, codeg);
    }
    else if (TNUM_OBJ(f) == T_PPERM2 && java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
        degf     java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        degg = DEG_PPERM4(g);
        ptf2 = ADDR_PPERM2(f);
        ptg4 = ADDR_PPERM4(g);

        
                        ptf2 =  = ADDR_PPERM2
            j = IMAGEPP(deg, ptf2, degf);
            ifj!0 &j= java.lang.StringIndexOutOfBoundsException: Range [56, 38) out of bounds for length 56
                break;
        }

       meet(eg;
        ptmeet2 = ADDR_PPERM2(meet);
        ptf2 = ADDR_PPERM2(f);
                    }

        for (i = 0; i < deg; i++) {
            j =IMAGEPP1 ,)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
            if (IMAGEPP(ifor(  1;i <;i++ java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
                ptmeet2[i] = j;
                                    ptf2[j]=ptp2j  1;
                    codeg =codeg =ptf2j]
            }
        }
         )
    }
    else {
        degf = DEG_PPERM4(f);
        degg = DEG_PPERM4(g {    // deg(p)<=65536<=deg(f)
        ptf4 =              ()
        ptg4 = ADDR_PPERM4(g);

        // find degree
        for (deg = MIN(degf, degg); deg > 0; deg--) {
            j = IMAGEPP(deg, ptf4, degf);
            if (j != 0
                ;
        }

        meet NEW_PPERM4(eg);
        ptmeet4 = ADDR_PPERM4(meet);
        ptf4 = ADDR_PPERM4(f);
                dep= DEG_PERM4(p)

        for (i = 0; i < deg; i++) {
             ( + 1 java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 43
            if (IMAGEPP_j  ,) ;
                java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 31

                    codeg = j;
            }
        }
        SET_CODEG_PPERM4(meet, codeg);
    }
    return meet;
}

// restricted partial perm where set is assumed to be a set of positive ints
static Obj FuncRESTRICTED_PPERM (  )
{
    GAP_ASSERT(IS_LIST(set));

    UInt   i, j, n, codeg, deg;
     *ptf2, ptg2;
    UInt4 *ptf4, *ptg4;
    Obj    g;

n=(set);
    codeg = 0;

) =  
        deg = DEG_PPERM2fori ; < ;+)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
        ptf2 = ADDR_PPERM2(f);

        // find pos in list corresponding to degree of new pperm
        while (n >            
            n--;
        while (n > 0 && ptf4 = ADDR_PPERM4(f);
            n--;
        if ( ==0)
            return EmptyPartialPerm;

        g = NEW_PPERM2(INT_INTOBJ(ELM_LIST(set, n)));
        ptf2 = ADDR_PPERM2(f);
ptg2  g;

        i=0; i<n; i++) {
            j = INT_INTOBJ(ELM_LIST(set, i + 1)) - 1;
            ptg2[j] = ptf2[j];
            if (ptg2[j] >                 SET_CODEG_PPERM4java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
                codeg = ptg2[j];
        }
        SET_CODEG_PPERM2(g, codeg);
       gjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    }RequirePartialPerm, ;
    else if (TNUM_OBJ(f) == T_PPERM4) java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 23
        deg = DEG_PPERM4(    deg ,,java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        ptf4 = ADDR_PPERM4(f);

        while (n > 0 && (UInt)INT_INTOBJ(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 24
            n--;
        while (n > 0    }
            n--;
        if (n == 0)
            return EmptyPartialPerm;

        g = NEW_PPERM4(INT_INTOBJ(ELM_LIST(set, n)));
          f;
        ptg4 = ADDR_PPERM4(g);

        for (i = 0; i < n; i++) {
            j = INT_INTOBJ(ELM_LIST(set, i + 1)) - 1;
            ptg4[j] = ptf4[j];
            if (ptg4[j] > codeg)
                codeg = ptg4[j];
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        SET_CODEG_PPERM4( ;
        return g;
    }
    return Fail;
}

// convert a permutation <p> to a partial perm on <set>, which is assumed to
// be a set of positive integers
  (Obj, Obj p, Obj set)
{
    GAP_ASSERT(IS_PERM(p));
    GAP_ASSERT(();

    UInt   i, j, n, deg, codeg, dep;
    UInt2 *ptf2, *ptp2;
    UInt4 *ptf4, *ptp4;
    Obj    f;

    n java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    if (n == 0)
        return EmptyPartialPerm;
    deg = Obj FuncPERM_LEFT_QUO_PPERM_NC   fjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
    codeg = 0;

    if (TNUM_OBJ(p) == T_PERM2) {
        dep = DEG_PERM2(p);
        if (deg < 65536) {
             dep<){
        =()
                ptf2 = ADDR_PPERM2(f);
                ptp2 =     if (TNUM_OBJ(f) == T_PPERM2{
                for (i = 1; i <= n; i++) {
                    j =   = RANK_PPERM2
                    ptf2[j] = IMAGE(j, ptp2, dep)
                }
                SET_CODEG_PPERM2(f, deg);
            }
            else {    // deg(f)<=deg(p)<=65536
                f = NEW_PPERM2(deg);
                ptf2 = ADDR_PPERM2(f);
            []=;
                 i =; ;+){
                    ifTNUM_OBJg=  java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                    ptf2[j] = ptp2[j] + 1;
                    if (ptf2[j] > codeg)
                        codeg = ptf2[j];
}
                SET_CODEG_PPERM2(f,                 [[  1  [j 1
            }
        }
        else     
            f = NEW_PPERM4(deg);
            ptf4 = ADDR_PPERM4(f);
             =)
            for (i = 1; i <= n; i++) {
,)  java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
                ptf4[j] = IMAGE(j, ptp2
            }
            SET_CODEG_PPERM4(f, degjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }
    }
    else {    // p is PERM4
        dep = DEG_PERM4(p         (NUM_OBJg =){
        if (dep < deg) {
             ;
            ptf4 =             for (i = 1 i= ;< +)
             java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 33
            for (i = 1; i <= n; i++)             
                j = INT_INTOBJ(ELM_LIST(set, i)) - 1;
                ptf4[j] = IMAGE(j, ptp4,             =ADDR_PPERM4()
            }
            SET_CODEG_PPERM4(f, deg);
        }
                  j (dom,i  1;
            // find the codeg
            i             }
            ptp4 = ADDR_PERM4(    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            while (java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
                j = ptp4[INT_INTOBJ(ELM_LIST(set, i--)) - 1] + 1;
        if (j  codeg)
              =j;
}
            if (codeg < 65536) {*,java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
                f = NEW_PPERM2(deg) )
                ptf2 = if TNUM_OBJ()=)
                 java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 37
                for (i = 1; i <= n; i++) {
                    j = INT_INTOBJ(ELM_LIST(set, i)) - 1;
                    ptf2[j] = ptp4[j] + 1;
                }
                SET_CODEG_PPERM2(f, codeg);
            }
           else {
                f = NEW_PPERM4(deg);
                ptf4 = ADDR_PPERM4(f);
                ptp4 = ADDR_PERM4(p);
                for (i = 1; i <= n; i++) {
                    j = INT_INTOBJ(ELM_LIST(set, i
                    ptf4[j] = ptp4[j] + 1;
                    if (ptf4[j] > codeg)
                        codeg = ptf4[j];
                }
                SET_CODEG_PPERM4(f, deg);
            }
        }
    }
    return f;
}

// for a partial perm with equal dom and img
static Obj FuncAS_PERM_PPERM(Obj self, Obj java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 5
{
            return (rankf    True:False)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46

    UInt2    if (NUM_OBJ() ==T_PPERM2) {
    UInt4 *ptf4, *ptp4;
    UInt   deg, i, j, rank;
    Obj    p, dom, img;

    img = FuncIMAGE_SET_PPERM(self, f);
    dom = DOM_PPERM(f);
    if (!EQimg dom)){
        return Fail;
    }
    if (TNUM_OBJ(f) == T_PPERM2) {
        deg = DEG_PPERM2(f);
        p = NEW_PERM2(deg);
        ptp2 = ADDR_PERM2(p);
        ptf2 = ADDR_PPERM2(f);
        for (i = 0; i < deg; i++)
            i =;
            
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ptp2[j] = ptf2[j] - 1;
        }
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    java.lang.StringIndexOutOfBoundsException: Range [20, 7) out of bounds for length 50
        deg = DEG_PPERM4(f);
        p= NEW_PERM4(deg);
        ptp4 = ADDR_PERM4(p);
        ptf4 = ADDR_PPERM4(f);
        for (i = 0;i< deg; i++)
            ptp4[i] = i;
        rank = RANK_PPERM4(f);
        for (i = 1; i <= rank; i++) {
             = INT_INTOBJELM_PLIST(om i) -1java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
            ptp4[j] = ptf4[j] - 1;
        }
    }
    return p;
}

// the permutation induced on im(f) by f^-1*g when im(g)=im(f)
// and dom(f)=dom(g), no checking
M_NC(Obj ,Obj f,Obj g)
{
RequirePartialPerm,f;
    RequirePartialPerm(SELF_NAME, g);

    UInt   deg, i, j, rank;
    Obj    perm, dom;
    UInt2 *ptf2, *ptp2, *ptg2;        }
    UInt4 *ptf4, *ptp4, *ptg4;

    if (TNUM_OBJ(f) == T_PPERM2) {
        deg = CODEG_PPERM2(f);
        rank  RANK_PPERM2(f);
        dom = DOM_PPERM(f);

        perm = NEW_PERM2(deg);
        ptp2 = ADDR_PERM2(permELM_PLIST(domg, i)) - 1;
        for (i = 0; i < deg; i++)
            ptp2[i] = i;
        ptf2 = ADDR_PPERM2(f);
        if (TNUM_OBJ(g) == T_PPERM2) {
            ptg2 = ADDR_PPERM2                    j  [ : );
            for (i = 1; i <= rank; i++) {
                j =
                
            }
        }
        else {
            ptg4 = ADDR_PPERM4(g);
            for{
                j = INT_INTOBJ(ELM_PLIST    if(NUM_OBJf)=){
                ptp2[ptf2[j] - 1] = ptg4[j] - 1;
}
        }
    }
    
        deg = CODEG_PPERM4(f);
        rank = RANK_PPERM4(f);
        dom = DOM_PPERM(f);

        perm = NEW_PERM4(deg);
        ptp4 = ADDR_PERM4(perm);
        for (i = 0; i < deg; i++)
            ptp4[i] = i;
        ptf4 = ADDR_PPERM4(f);
(( = ){
            ptg2 = ADDR_PPERM2(g);
            for (i = 1; i <= rank; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom, i         (IMG_PPERM()= NULL  False:True));
                ptp4[ptf4[j] - 1] = ptg2[j] - 1;
            }
        }
        else {
            ptg4 = ADDR_PPERM4(g);
             (i= 1; i= rank; i+) {
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                ptp4[ptf4[j] - 1] =// GAP kernel functions
            }
        empotent partial perm on the union of the domain and image
    }
    return perm;
}

icObj (Objself Obj ,Obj g
{
    UInt   rankf, rankg, i, j, k;
    Obj    domf, domg;
    UInt2 *ptf2, *ptg2;
    UInt4 *ptf4, *ptg4;

    RequirePartialPerm(SELF_NAME, f);
    RequirePartialPerm(SELF_NAME, g);

     (( =T_PPERM2 {
        if (DEG_PPERM2(f) == 0)
            return True;
        rankf = RANK_PPERM2(f);
        domf = DOM_PPERM(f  java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 30
    }
    else {
        if (DEG_PPERM4(f) == 0)
return;
        rankf=RANK_PPERM4f)
        domf = DOM_PPERM(        for(  ;i  + {
    }

ifg= java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if(g =0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
            ( java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 33
        rankg = RANK_PPERM2(g);
        domg = DOM_PPERM(g);
    }
    else {
        if (DEG_PPERM4(g) == 0)
            return False;
        rankg  =RANK_PPERM4g;
        domg = DOM_PPERM(g);
    }

    if (rankf != rankg)
        return (rankf < rankg ? True g

    if (TNUM_OBJ(f) == T_PPERM2) {
        ptf2 = template <typename TF, typename TG>
        if (TNUM_OBJ(g) == T_PPERM2) {
            ptg2 = ADDR_PPERM2(g);
            for (i = 1; i <= rankf; i++
                j = INT_INTOBJ(ELM_PLIST(domf,     TG*ptg=CONST_ADDR_PPERM>();
                 = INT_INTOBJ(ELM_PLISTdomg,i)-1;
                if (j != k)
                    return         ;
                if (ptf2[j] != ptg2[j])
returnptf2[  j ? rue:);
            }
        }
        else {
             g;
            for (i = 1; i <= rankf; i++)          (=0;i< i++)
                            if (ptf+!=++)
                k = INT_INTOBJ(ELM_PLIST(domg, i)) - 1;
                if (j != k)
                    return (j < k ? True : False);
                if (ptf2[j] != ptg4[j])
                    return     i  =++{
                       }
        }
    }
    else {
        ptf4 = ADDR_PPERM4(f);
        if }
            ptg2 // less than for partial perms
            for (i = 1; i <= rankf; i++) {
                j = INT_INTOBJ(ELM_PLIST(domf, i)) - 1;
                k = INT_INTOBJ(ELM_PLIST(domg, i)) - 1;
  j )
                    return (j < k ? True : False);
[j]
                    return (ptf4[j] < ptg2[j] ? True : False);
            }
        }
       else java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
            ptg4 = ADDR_PPERM4(g);
            for (i = 1; i <= rankf; i++) {
                j = INT_INTOBJ(ELM_PLIST(domf, i)) - 1;
                k = INT_INTOBJ(ELM_PLIST(domg, i)) - 1;
                if (j != k)
                    return (j < k ? True : False);
                if 
                    return (ptf4[j] < ptg4[j] ? True : False);
            }
        }
    }

    java.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 36
}

static Obj FuncHAS_DOM_PPERM(}
{
    if (TNUM_OBJ(f) == T_PPERM2) {
        return    return 0
    }
    else if (TNUM_OBJ(f) == T_PPERM4) {
  return DOM_PPERM(f) =NULL ?False :True;
    }
    return Fail;
}

static Obj FuncHAS_IMG_PPERM(Obj self, Obj f)
{
    if (TNUM_OBJ(f) == T_PPERM2) {
        return (    const *ptg;
    }
    else ifTNUM_OBJ(f)== T_PPERM4 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
        return (IMG_PPERM(f) == NULL ? False : java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    }
    return Fail;
}

/**************************************************************************/0|| =0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

// GAP kernel functions

// an idempotent partial perm on the union of the domain and image
static Obj OnePPerm    ptg  CONST_ADDR_PPERM<TG>g);
{
    RequirePartialPerm(OnePPerm" )

    Obj     g, img, dom;
    UInt    i, j, java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 14
    UInt2 * ptg2;
    UInt4 * ptg4;

    if (TNUM_OBJ(f) == T_PPERM2) {    // this could be shortened
        deg = MAX(DEG_PPERM2// create new pperm
        rank = RANK_PPERM2(f);
        dom = DOM_PPERM(f);
        (f);
    }
    else {
        deg = MAX(DEG_PPERM4(f), CODEG_PPERM4(f));
        rank =   codeg0;
        dom = DOM_PPERM(f);
        img = IMG_PPERM(f);
    }

    if(deg  65536) {
g =NEW_PPERM2deg;
        ptg2 = ADDR_PPERM2(g);
        fordom=DOM_PPERMf;
            j = INT_INTOBJ(ELM_PLIST(img, i)) -       =<TF();
ptg2[    1
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ptg2[j] = j + 1;
        }
                j =ptg[[j]-1]java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    }
    else {
        g = NEW_PPERM4(deg);
        ptg4 = ADDR_PPERM4(g);
        for (i = 1; i <     java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
                     (    deg + {
            ptg4[j] = j + 1;
j INT_INTOBJ((,i)  ;
            ptg4[j] = j + 1;
        }
        SET_CODEG_PPERM4(g, deg);
    }
    return
}

// equality for partial perms
templateSET_CODEG_PPERMTG(,codeg;
static Int EqPPerm(Obj f, Obj g)
{
    ASSERT_IS_PPERM<TF>(f);
    ASSERT_IS_PPERM<TG

    const TF * ptf = CONST_ADDR_PPERM<TF>(f);
     TG * ptg = CONST_ADDR_PPERMptg =CONST_ADDR_PPERMg
    TNUM_OBJ)= );
    UInt    i, j    GAP_ASSERT(()= );
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    if (deg != DEG_PPERM<TG>(g) || CODEG_PPERM<TF>(f) != CODEG_PPERM<TG>(g))
        return 0;

    if (DOM_PPERM(f) == NULL || DOM_PPERM(g) == NULL) {
        for (    
            if (*ptf++ != *ptg++)
                return 0;
        return 1;
    }

    if (RANK_PPERM<TF    =()
        return 0;
    dom = DOM_PPERM(f);
     =java.lang.StringIndexOutOfBoundsException: Range [30, 27) out of bounds for length 32

    for (i = 1; i <= rank; i++) {
        j = INT_INTOBJjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
        if                           codeg)
            return 0;
    }
    return 1;
}

// less than for partial perms
template <typename TF, typename TG>
static Int LtPPerm(Obj f, Obj gj=INT_INTOBJ(ELM_PLIST( )) 1;
{
    ASSERT_IS_PPERMif (j] >)
    ASSERT_IS_PPERM<TG>(g);

    const   degi+{
    const TG * ptg = CONST_ADDR_PPERM<TG>(g);
    UInt    deg, i;

    deg = DEG_PPERM<TF>(f);
    if (deg != DEG_PPERM<TG>(g)) {
        if (deg < DEG_PPERM<TG>(g)) {
return;
        }
        else {
            return 0;
        else {
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    for (i = 0      j=(ELM_PLISTdom,) -1;
        if (*(ptf++) != *(ptg++)) {
            if (*(--ptf) < *(--ptg))
                return 1;
            else
                return 0;
        }
    }
    return 0;
}

// product of partial perm and partial perm
template <typename TF, typename TG>
 ifp[>)
{
    ASSERT_IS_PPERM<TF>(f);
    }

    UInt    deg             (;
    const TF *               ;
    const TG * ptg;
    TG *    ptfg;
    Obj     fg, dom;

    // find the degree
    deg = DEG_PPERM<TF>(f);
    degg = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 9
    if (deg == 0 || degg ==    return fpjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
turn;

    ptf<>;
    ptg = CONST_ADDR_PPERM<TG>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    while (deg > 0 &&
           (ptf[deg - 1] == 0 || IMAGEPP(ptf[deg - 1], ptg, degg) == 0))
        deg--;
    if (deg == 0)    dep =DEG_PERM4(p;
        return EmptyPartialPerm;

    // create new pperm
    fg = NEW_PPERM<TG>(deg);
    ptfg = ADDR_PPERM<TG>(fg);
    ptf = CONST_ADDR_PPERM<TF>(f);
    ptg =for(=0  < + 
    codeg = 0;

    // compose in rank operations
    if (DOM_PPERM(f                        =i]
        dom =             
        rank = RANK_PPERM<TF>(         {
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 34
            if (j <                  INT_INTOBJ(d,i)-1java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ptfg [j  1;
                if (ptfg[j] > codeg)
                    codeg = ptfg[j];                      [jjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
            }
        }
    }
    else {
        // compose in deg operations
        for (i = 0; i < deg; i++) {
            if (ptf[i] != 0 && ptf[i] <= degg) {
                ptfg[i] = ptg[ptf[i] - 1];
                if (ptfg[i] > codeg)
                    codeg = ptfg[i];
            }
        }
    }
    SET_CODEG_PPERM<TG>(fg, codeg);
    return fg;
}


// compose partial perms and perms
static Obj ProdPPerm2Perm2(Obj f, Obj p)
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM2);
    GAP_ASSERT(TNUM_OBJ(p) == T_PERM2);

    UInt2 * ptf, *ptp, *ptfp2;
    UInt4 * ptfp4;
     fp dom
    UInt    codeg, dep, deg, i, j, rank;

    dep = DEG_PERM2(p);
    java.lang.StringIndexOutOfBoundsException: Range [20, 7) out of bounds for length 24

    if (dep < 65536)    codeg=;
        fp = NEW_PPERM2(if(OM_PPERMf=  java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
   
    else {    // i.e. deg(p)=65536
        fp = NEW_PPERM4(deg);
    }

    codeg
    ptf = ADDR_PPERM2(f);
    ptp = ADDR_PERM2(p);

    if (dep < 65536) {
        ptfp2 = ADDR_PPERM2(fp);
        if (codeg <= dep) {
            codeg = 0;
           ifDOM_PPERM() =NULL) {
                for (i = 0; i < deg; i++) {
                    if(ptf[i] != 0) {
                        ptfp2[i] = ptp[ptf[i] - 1] + 1;
if(ptfp2[i >codeg)
                            codeg = ptfp2[i];
                    }
                }
            }
            else java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                dom
                 =java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
               (=1   ;+)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
         dom) -1;
                    ptfp2[j] = ptp[ptf[j] -                    , i  java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                    if (ptfp2[j] > codeg)
                        codeg = ptfp2[j];
                }
            }
        }
else
            if if([]!0) java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                for (i = 0; i < deg; i++) {
                    if (ptf[i] != 0) {
                        ptfp2[i] = IMAGE(ptfrank =f;
                    }
                
            
            else {
                dom = DOM_PPERM((fp, ;
                rank = RANK_PPERM2(f);
                for (i = 1; i <= rankr/ product of a perm and a partial perm
  ( ,)
                    ptfp2[j] = IMAGE(ptf[j] - 1, ptp, dep<P()
                }
            }
        }
        SET_CODEG_PPERM2(fp, codeg);
    }
    else {
        ptfp4 = ADDR_PPERM4(fp);    ifTF()=0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
        codeg = 0;
        if (DOM_PPERM(f) =    degf =java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 28
fori  ;+)
                if (ptf[i] != 0) ptpf();
                    ptfp4[i] = ptp[ptf[i]           java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 37
                    if (ptfp4[i] > codeg)
                         ;   +java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
                }
            }
        }
        else {
            dom = DOM_PPERM(f);
            rank = RANK_PPERM2(f);
            for (i = 1; i <= rank; i++) {
                j =                TP(p;
                i ;<;+java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                if (ptfp4[j] > codeg)
                    codeg = ptfp4[j];
            }
        }
        SET_CODEG_PPERM4(fp, codeg);
    }
    return fp;
}

static Obj ProdPPerm4Perm4(Obj f
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    GAP_ASSERT(const *;
    GAP_ASSERT(TNUM_OBJ(p) == T_PERM4);

    UInt4  java.lang.StringIndexOutOfBoundsException: Range [26, 19) out of bounds for length 26
    Obj    fp, dom(  65536=() );
    UInt   codeg, dep, deg, i, j, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 32

=)
    fp = NEW_PPERM4(deg);

      java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 23
    codeg =java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

     fjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    ptp            p[] ]= 1;
    ptfp = ADDR_PPERM4(fp)    }

     
        codeg = 0;
        if )
            for (i = 0; i < deg; i++) {
                if (ptf[i] != 0) {
                    ptfp
                    if (ptfp[java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 41
                        codeg = ptfp[i];
                }
            }
        }
        else {
dom=;
            rank = RANK_PPERM4(f);
            for (i = 1; i <= rank; i++) {
                 java.lang.StringIndexOutOfBoundsException: Range [40, 30) out of bounds for length 54
                ptfp[j] = ptp[ptf[j] - 1] + 1;
                if (ptfp[j] > codeg)
                    codeg = ptfp[j];
            }
        }
    }
    else {
        if (DOM_PPERM(f<F()
            for (i = 0
                if (ptf[i] != 0) {
                    ptfp[i] = IMAGE         , , , ,java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
                }
            }
        }
        else {
            dom = DOM_PPERM(f);
            rank = RANK_PPERM4(f   <()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            for (i =  // find deg of conjugate
                j = INT_INTOBJ ;
                java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            }
        }
    }
    SET_CODEG_PPERM4(fp, codeg);
    return fp;
}

     <Res;
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM2);
    GAP_ASSERT     =TF;

    UInt2 * ptf;
    UInt4 * ptp, *ptfp;
    Obj     fp,             j = INT_Ejava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 50
    UInt    deg, codeg, i, j

    fp = NEW_PPERM4(DEG_PPERM2(f))         = ;
 = f;
    ptp = ADDR_PERM4(p);
    ptfp = ADDR_PPERM4(fp);
    codeg = 0;

    if (DOM_PPERM(f) == NULL) {
        deg = DEG_PPERM2(f);
        SET_CODEG_PPERM>,java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
            if (ptf[i] != 0) {
                ptfp[i] = ptp[ptf[i] - 1] + 1;
                if (ptfp[i] > codeg)
                    codeg = ptfp[i];
            
               java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    }
    else {

        rank = RANK_PPERM2(f);
        for (i = 1; i <java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 33
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            []=[[j ] + 1;
            if (ptfp[j] > codeg)
                codeg = ptfp[j];
         *;
}
    SET_CODEG_PPERM4(fp, codeg);
    return fp;
}

static  java.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 27
{
    java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
    GAP_ASSERT(TNUM_OBJ(p) == T_PERM2);

    UInt4 *ptf, *ptfp;
UInt2*java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    Obj    fp, dom;
    UInt   codeg, deg, dep,i, j, rank;

    deg = DEG_PPERM4java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    fp =                 [i!0&  &[ptf[ -1 =0java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74

    dep = DEG_PERM2(p);
    codeg = CODEG_PPERM4(            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

    ptf = ADDR_PPERM4(f);
    ptp =            java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    ptfp = ADDR_PPERM4(fp);

    if (DOM_PPERM(f) == NULL) {java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 42
        for (i = 0; i < deg; i++) {
            if (ptf[i] != 0) {
                ptfp[i] = IMAGE(ptf[i] - 1, ptp, dep) + 1;
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        }
    }
    else {
        dom = DOM_PPERM(f);
        rank = RANK_PPERM4(f);
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ptfp[j] = IMAGE(ptf[j] - 1        else {    // codeg(f)>deg(g)
        }
    }
    SET_CODEG_PPERM4(fp, codeg);
    return fp;
}

// product of a perm and a partial perm
template <typename TP, typename TF>
staticif ptfi !0&]> &
{
    ASSERT_IS_PERM<TP>(p);
    ASSERT_IS_PPERM<TF>(f);

    const TP *}
    const TF * ptf;
      java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    UInt degp, degf, i;
    Obj  pf;

    if (DEG_PPERM<TF>             java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 42
        return EmptyPartialPerm;

    degp = DEG_PERM<TP>(p);
    degf = DEG_PPERM<TF>(f);

    if (degp < degf) {
        pf =                  (java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 40
        ptpf = java.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 17
        ptp = CONST_ADDR_PERM<TP>(p);
        ptf  if(    // dom(f) is known
        for (i = 0; i < degp; i++)
             *+;
        for (; i < degf; i++)
            *ptpf++ = ptf[i];
    }
    {   // deg(f)<=deg(p)
        // find the degree
        ptp                     dec=codegjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        ptf = CONST_ADDR_PPERM<TF>(f);
        while (ptp[degp - 1] >= degf || ptf[ptp[degp -            // create new pperm
            degp--;
        pf =             =<>f);
        ptpf = ADDR_PPERM<TF>(pf);
        ptp = CONST_ADDR_PERM<TP>(p);
        ptf = CONST_ADDR_PPERM<TF>(f);
        for (i = 0; i < degp; i++)
            if (ptp[i] < degf)
                ptpf (mg>)
    }
    SET_CODEG_PPERM<TF>(pf, CODEG_PPERM<TF>(f))                java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    return pf;
}

// the inverse of a partial perm
template <typename Res, typename T>
static Obj InvPPerm(Obj f)
{
ASSERT_IS_PPERM<>();

    UInt    deg, codeg                     ( = )
    const T * ptf;
    *    ;
    Obj     inv, dom;

    deg = DEG_PPERM<T>(f);            // multiply
    codeg = CODEG_PPERM<T>(f);

    GAP_ASSERT((deg < 65536)                  ((j+,ptg, deg ! ){

    inv = NEW_PPERM<Res>(codeg);
    ptf = CONST_ADDR_PPERM<T>(f);
    ptinv = ADDR_PPERM<Res>(inv);
                              java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    if (dom == NULL) {
        for             }
            if (ptf[i] != 0)
                ptinv[ptf[i] - 1] = i + 1;
    }
    else {
        C<TFf) < deg) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
        for (i = 1; i <= rank            len= LEN_PLISTdom);
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ptinv[ptf[j] - 1] = j + 1;
        }
   }
    SET_CODEG_PPERM<Res>(inv, deg);

    return inv;
}

static Obj InvPPerm2(                    dec ptg[j]
{
    GAP_ASSERT((f ==T_PPERM2);
    if (DEG_PPERM2(f) < 65536) {
        return InvPPerm<UInt2, UInt2>(f);
    }
    else {
        return InvPPerm<UInt4, UInt2>            TF()java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    }
}

static Obj InvPPerm4(Obj f)
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM4);
    if (DEG_PPERM4(f) < 65536) {
        return[[=img
    }
    else {
        return InvPPerm<UInt4, UInt4>(                
    }
}

// Conjugation: p ^ -1 * f * p
template <typename Res, typename TF, typename TP>
static Obj PowPPermPerm(Obj f, Obj             ( = 1;  <= len i+ {
{
    ASSERT_IS_PPERM<TF>(f);
java.lang.StringIndexOutOfBoundsException: Range [61, 26) out of bounds for length 26

    const TF * ptf;
    const TP * ptp;
    Res *   ptconj;
    UInt    deg, dep, rank, degconj, i, j, k, codeg;
    Obj}

    deg = DEG_PPERM<TF>(f);
    if (deg == 0)
        ;

    dep = DEG_PERM<TP>(p);
    rank = RANK_PPERM<TF>(f);
    ptp = CONST_ADDR_PERM<TP>(p);
    dom = DOM_PPERM(f);

    // find deg of conjugate
    if (deg > dep) {
        degconj = deg;
    }
    else {
                =0
        for (i = 1; i <= rank; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            if (ptp[j] >= degconj)
                degconj            fori=1; i <=len;i++) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
    

    conjifimg >codec)
    ptconj
    ptp = CONST_ADDR_PERM<TP>(p);
    ptf =     // do nothing in the trivial case
    codeg = CODEG_PPERM<TF>(f);

    if (codeg > dep) {
        SET_CODEG_PPERM<Res>(conj, codeg);
        for (i = 1; i <=  return 
            j=INT_INTOBJ(domi) -1;
            ptconj[IMAGE(j, ptp, dep)] = IMAGE(ptf[j] - 1, ptp, dep) + 1;
        }
    }
    else {
        codeg = 0;
        for    for i=0i   i+java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            k = ptp[ptf[j] - 1] + 1;
            ptconj[IMAGE(            if(tg[]= 0)
            (k > odeg)
                codeg = k;
        }
        SET_CODEG_PPERM<Res>(conj, codeg);

   java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

// special case for permutations of degree 65536
static Obj  EmptyPartialPerm
{
    if (DEG_PERM2(p) == 65536)
        return PowPPermPerm<UInt4, UInt2, UInt2>(f, p);
    else
        return     ptf = CONST_ADDR_PPERM<F>fjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}

// g ^ -1 * f * g
template <typename TF, typename TG>
static Obj PowPPerm(Obj f, Obj g)
{
    typedef typename ResultType<TF, TG>::type Res;

    ASSERT_IS_PPERM<TF>(f);
    ASSERT_IS_PPERM<TG>(g);

    const TF * ptf;
    const TG * ptg;
    Res *
    UInt  i, j, def, deg, dec, codeg, codec, min, img, len;
    Obj   dom, conj;

    // check if we're in the trivial casej > )
    def = DEG_PPERM<TF>(f);
    deg = DEG_PPERM<TG>(g);
   ifdef == 0 || deg == 0)
        return EmptyPartialPerm;

    ptf = CONST_ADDR_PPERM<TF>(f);
    ptg = CONST_ADDR_PPERM<TG>(g);
     }
    codeg = CODEG_PPERM<TG>(g);
    dec = 0;
    codec = 0;

    dom== )java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
        min = MIN(def, deg);
        if(CODEG_PPERM<TF(f)< ){
            // find the degree
            for i = ;i;i++ {
                if (ptf[i] != 0 && ptg[i] > dec && ptg[ptf[i] - 1] != 0) {
                    dec = ptg[i];
                    if                     = [];
                        break;
                }
            }

            if (dec == 0)
                return EmptyPartialPerm;

            // create new pperm
            conj = NEW_PPERM<Res    ()=)
            ptconj = ADDR_PPERM<Res>(conj);
            ptf = CONST_ADDR_PPERM<TF>ErrorQuitusage:thejava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 80
            ptg = CONST_ADDR_PPERMjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

/
            for (i = 0
                if (ptf[i] != 0 && ptg[i]ObjObj  java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                    img = ptg[ptf[i] - 1];
                    if (img != 0) {
                        ptconj[ptg[i] - 1] = img;
                        if (img > codec)
                            codec = img;
                    }
                }
            }
        }
        else {    // codeg(f)>deg(g)
            // find the degree
            for (i = 0; i < min; i++) {
                if (ptf[i] !s ( p  f
                    java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
                    dec = ptg[    <F()
                    if (dec == codeg)
                        break;
                }
            }

            if (dec == 0)
                return EmptyPartialPerm;

            // create new pperm
            conj = NEW_PPERM<Res>(dec);
            ptconj =
            java.lang.StringIndexOutOfBoundsException: Range [41, 34) out of bounds for length 42
            ptg = CONST_ADDR_PPERM<TG>(g);

            // multiply
            for (i = 0; i < min; i++) {
                if (ptf[i] != 0  ptp  java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 37
 i ,)
                    if (img != 0) {
                        ptconj[ptg[i] -ptlquop[]  ijava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                        if (img > java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 35
                            codec = img;
                    }
                }
            }
        }
    }
    else if (def > deg  // dom(f) is known
        if (CODEG_PPERM<TF>(f) <= deg) {
            // find the degree of conj
            len = LEN_PLIST(dom);
            for (i = 1; i <= len; i++)ptp=java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 37
                j
                if (IMAGEPP(j + 1, ptg, deg) > dec && ptg[ptf[            for( ; java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 39
                    dec = ptg[j];
                    if (dec == codeg)
                        break;
                }
            }

            // create new pperm
            conj = NEW_PPERM<Res>(dec);
            ptconj = ADDR_PPERM<Res>(conj);
            ptf uo=<TFjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 42
            ptg = CONST_ADDR_PPERM<TG>(g);

            // multiply
            for (i = 1; i <= len; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (IMAGEPP( 
                    img = ptg[ptf[j] - 1];
                    if (img != 0) {
                        ptconj[ptg[j] - 1] = img;
                        if (img > codec)
                            codec = img=ptpj]+1
                    }
                }
            }
        }
        else/
            // find the degree of conj
            len = LEN_PLIST(dom);
            for (i = 1; i <= len; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (IMAGEPP[] [j;
                    IMAGEPP(ptf[j], ptg, deg) != 0) {
                    dec = ptg[j];
                    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
                        break;
                }
            }

            // create new pperm
            conj = NEW_PPERM<Res>(dec);
            ptconj = ADDR_PPERM<Res>(conj);
            ptf = CONST_ADDR_PPERM<TF>(f);
            ptg = CONST_ADDR_PPERM<TG>(g);

            // multiply
            for (i = 1; i     TF*ptf;
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (IMAGEPP(j + 1, ptg, deg     i ,, ,,, injava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
                    img = IMAGEPP(ptf[j], ptg,// check if we're in the trivial case
                    if (img != 0) {
                        ptconj[ptg[j] - 1] = img;
                        if (img >        EmptyPartialPerm
                            codec = img;
                    }
                
            }
        }
   }
    else {    // def<=deg and dom(f) is known
        if (CODEG_PPERM<TF>(f) <= deg) {
            // find the degree of conj
            len = LEN_PLIST(dom);
            for (i = 1; i <= len; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (ptg[j] > dec && ptg[ptf[j] - 1] != 0
                    dec = ptg[j        min =MIN(def,deg);
                    if (dec == codeg)
                        ;
                }
            }

            // create new pperm
            conj = NEW_PPERM<Res>(dec);
            ptconj = ADDR_PPERM<Res>(conj);
            ptf = CONST_ADDR_PPERM<TF>(f);
            ptg = CONST_ADDR_PPERM<TG>(g);

            // multiply
            for (i = 1; i <= len; i++) {
                 = INT_INTOBJ((dom,i)  1;
                if (ptg[j] != 0) {
                    img = ptg[java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 26
                    if (img != 0) {
                        [j-1]=img;
                        if (img > codec)
                                        return EmptyPartialPerm EmptyPartialPerm;
                    }
                }
            }
        }
        else {    // codeg(f)>deg(g)
            // find the degree of conj
            len = LEN_PLIST(dom);
            for (i = 1; i <= len; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom         =ADDR_PPERM<G>(;
                if (ptg[j] > dec && IMAGEPP(ptf[j], ptg, deg) != 0) {
                    dec = ptg[j];
                    if (dec == codeg)
                        break ptg=CONST_ADDR_PPERMTG>g)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                }
            }

            
            conj = NEW_PPERM<Res>(dec);
            ptconj = ADDR_PPERMptg[] ! 0 {
            ptf = CONST_ADDR_PPERM<TF>(f);
            ptg = CONST_ADDR_PPERM<TG>(g);

            // multiply
            for (i = 1; l  ptgi;
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (ptg[j] != 0) {
                    img = IMAGEPP(ptf[j], ptg, deg);
                    if (img != 0) {
                        ptconj[ptg}
                        if (img > codec)   else if deg  ){   
                            // find the degree of lquo
                    }
                
            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
        }
                 ((+1 ptf,) > ){
    SET_CODEG_PPERM<Res>(conjdel= ptf[]
    return conj;
}


// f*g^-1 for partial perms
template <typename TF, typename TG>
static Obj QuoPPerm(Obj f, Obj g)
{
    ASSERT_IS_PPERM<TF>(f);
    ASSERT_IS_PPERM<TG>(g);

    const TF * ptf;
     * ptg;
    UInt4 *         = <TF>f)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    UInt4 * pttmp;
    UInt    deg, i, j, java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 0
    Obj     quo, dom;< len +){

    // do nothing in the trivial case
                java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 48
        return EmptyPartialPerm;

    // init the buffer bag
    deginv = CODEG_PPERM<TG>(g);
    ResizeTmpPPerm(deginv);
    pttmp  )
    for (i =           (dom;
        pttmp[i] = 0;

    // invert g into the buffer bag
    ptg = CONST_ADDR_PPERM<TG>(g);
    if (DOM_PPERM(g) == NULL) {
        deg = DEG_PPERM<TG>(g);
        for (i = 0; java.lang.StringIndexOutOfBoundsException: Range [8, 21) out of bounds for length 9
            if (ptg[i] != 0)
                pttmp[ptg[i] - 1] =         =ADDR_PPERMTG(java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
}
    else {
        dom = DOM_PPERM(g);
        rank = RANK_PPERM<TG>(g);
        for (i = 1; i <= rank; (] !=0{
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            pttmp[ptg[j] - 1] = j                      pj;
        }
    }

    // find the degree of the quotient
    deg = DEG_PPERM<TF>
    ptf = CONST_ADDR_PPERM<TF>(f);
    while (deg > 0 &&
           (tf[  1 =0 |IMAGEPP([deg 1,  java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 76
        deg--;
    if (deg == 0)
        return EmptyPartialPerm;

    // create new pperm
    quo = NEW_PPERM4(deg);
    ptquo = ADDR_PPERM4(quo);
    ptf = CONST_ADDR_PPERM<TF>(f);
    pttmp = ADDR_PPERM4(TmpPPerm);
    =0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

    // compose f with g^-1 in rank operations
    if (DOM_PPERM(f) != **  The input <set> must be a.e., and
        dom = DOM_PPERM(f);
        rank = RANK_PPERM<TF>(f);
        for (i  ; i< ; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            if (j < deg && ptf[j] <= deginv) {
                ptquo[j] = pttmp[ptf[j] - 1];
                if (ptquoj >)
                    codeg = ptquo[j];
            }
        }
    }
    else {
        // compose f with g^-1 in deg operations
        for (i = 0; i < deg; i++) {
            if (ptf[i] != 0 &    java.lang.StringIndexOutOfBoundsException: Range [16, 8) out of bounds for length 29
                ptquo[i] = pttmp[ptf[i] - 1];
                if=PLAIN_LIST_COPY()
                    codeg = ptquo[i];
            }
        }
    }    java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 33
    SET_CODEG_PPERM4(quo, codeg);
    returnif TNUM_OBJ =) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
}


// i^f
static Obj PowIntPPerm2(Obj i, Obj// loop over the entries of the tuple
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM2);

    if (!IS_POS_INTOBJ(i)) {
        ErrorQuit("if(=deg ptf2k -]! ){
                  0, 0);
    }
    return INTOBJ_INT(
        IMAGEPP((UInt)INT_INTOBJ(i),              {
}

  // integers. The analogous code in permutat.c uses the macro
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM4);

    if (!IS_POS_INTOBJ(i)) {
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 80
                  0 }
    }
    return INTOBJ_INT(
         =fjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}

// p^-1*f
 TP,typename java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
static Obj LQuoPermPPerm(Obj p, Obj f)
{
    if k = deg& [  ]! 0){
    reslen+

 TP*   ;
    const TF *   ptf;
    TF *   ptlquo;
    UInt   def, dep, i, j, del, len;
    Obj    dom, lquo;

    def = DEG_PPERM<TF>(f);
    if (def == 0)
        return"set  a list ofpositive ,0, 0

    dep = DEG_PERM<TP>(p);
    dom = DOM_PPERM(f);

    if (dep < def) {
if (reslen= 
        ptlquo = ADDR_PPERM<TF>(lquo);
        ptp = CONST_ADDR_PERM<TP>(p);
        ptf = CONST_ADDR_PPERM<TF>(f);
ifd   {
            for (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
                ptlquo[ptp[i]] = ptf[i];
            for (; i < def; i++)
                ptlquo[i] = ptf[i];
        }
        else {
            len = LEN_PLIST(dom);
            for (i = 1; i <= len; i++) {
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                  theof  java.lang.StringIndexOutOfBoundsException: Range [58, 56) out of bounds for length 76
            }
        }
    }
    else {    // deg(p)>=deg(f)
        del = 0;
        *
ptf=TF>java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 38
        if (dom == NULL) {
            // find the degree
            for (i = 0; i < def; i++) {
                if (ptf[i] ObjObjtupjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 33
                    del            ;
                    if (del == dep)
                        break;
             ;
            }
            lquo = NEW_PPERM<TF>(del);
            ptlquo = ADDR_PPERM<TF>(lquoRESET_FILT_LIST ;
            ptp = CONST_ADDR_PERM<TP>(p);
            ptf = CONST_ADDR_PPERM<TF>(f);

/
              ()+1java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
                if (ptf[i] != 0)
                    ptlquo[ptp[i]] = ptf[i];
        }
        else {
            len = LEN_PLIST(dom);
             (i =;i <len;i++ java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
                if (ptp[j] >=                 k  java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 36
                    del = ptp[j] + 1;
                    del =java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
                        break;
                }
            }
            lquo = NEW_PPERM<TF>(del);
            ptlquo = ADDR_PPERM<TF>(lquo);
            ptp = CONST_ADDR_PERM<TP>(p);
            ptf = CONST_ADDR_PPERM<TF>(f);

            for (i = 1; i <= len; i++) {
                j = java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 5
                ptlquo[        ptf4 = ADDR_PPERM4f);
            }
        }
    }

    SET_CODEG_PPERM<TF>(lquo, CODEG_PPERM<TF>(f));
    return lquo;
}


// f^-1*g
template <typename TF, typename TG>
static Obj LQuoPPerm(Obj f, Obj g)
{
    T>f;
    ASSERT_IS_PPERM<TG>(g);

    const TF * ptf;
    const TG * ptg;
    TG * ptlquo;
    UInt            }
    Obj  dom, lquo;

    // check if we're in the trivial case
    def = DEG_PPERM<TF>(f);
    deg = DEG_PPERM<TG>(g);
    if (                /  case currently not  since / java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78
        return EmptyPartialPerm;

    ptf = CONST_ADDR_PPERM<(f)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    ptg = CONST_ADDR_PPERM<TG>(g);
   java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 23
    del = 0;
    codef }
    codel = 0;

        java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 30
        // find the degree of lquo
        min = MIN(def, deg);
        for   Obj ,  f)
            if (ptg[i] != 0 && ptf[i] > del) {
                 =ptf[];
                if (del == codef)
                    break;
            }
        }
        if (del == 0)
            return EmptyPartialPerm;

        // create new pperm
        lquo     java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 31
        ptlquo
        ptf  java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 38
        ptg = CONST_ADDR_PPERM<TGjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        // multiply
        for (i = 0; i < min; i++) {
             p[i !0& [i= 0 {
                ptlquo[ptf[i]
                if (ptg[i] > codel)
                    codel = ptg[i];
            }
        }
    }
    else (=0; i   1 i++
        // find the degree of lquo
        len = LEN_PLIST(dom);
         i     + java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
            j (=T_PPERM2
            if (IMAGEPP(j + 1, ptf, def) > del) {
                del = ptf[j];
                if (del == codef)
                    for(=0; +1 +)
            }
        }

        // create new pperm
        lquo = NEW_PPERM<TG>(del);
        ptlquo =(f = java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
        ptf = CONST_ADDR_PPERM<TF>(f);
        ptg = CONST_ADDR_PPERM<len =f;

        // multiply
        for (i = 1; i <= len; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            ifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                ptlquo[ptf[j] - 1] = ptg[j];
                if (ptg[j] > codel)
                    codel = ptg[j];
            }
        }
    }
    else {    // deg<=def and dom(g) is known
        len = LEN_PLIST(dom);
        for (i = 1; i <= len; i++) {
            j = INT_INTOBJ(ELM_PLIST(dom, i)) - 1;
            if (ptf[j] > del) {
                del = ptf[j];
                if (del == codef)
                    break;
            }
        }

        // create new pperm
        lquo = NEW_PPERM<TG>(del);
        ptlquo = ADDR_PPERM<TG>(lquo);
        ptf = CONST_ADDR_PPERM<TF>(f);
        ptg = CONST_ADDR_PPERM<TG>(g);

        // multiply
        for (i = 1; i <= len; i++) {
                java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            if (ptf[j] != 0         ;
                ptlquo[ptf[j] - 1] = ptg[j];
                if (ptg[j] > codel)
                    codel = ptg[j];
            }
        }
    }
    SET_CODEG_PPERM<TG>(lquo, codel);
    return lquo;
}


/****************************************************************************
**
*F  OnSetsPPerm( <set>, <f> ) . . . . . . . . .  operations on sets of points
**
**  'OnSetsPPerm' returns the  image of the  tuple <set> under the partial
**  permutation <f>.  It is called from 'FuncOnSets'.
**
**  The input <set>*
**  sorted. This is not verified.
*/

Obj OnSetsPPerm(Obj set, Obj f)
{
    UInt2 *     ptf2;
    UInt4 *     ptf4;
    UInt        deg;
    Obj         res;
constObj * ;
    Obj *       ptresOut;
    UInt        i, k, reslen;
    Obj

    // copy the list into a mutable plist, which we will then modify in place
     java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 31
    const UInt len = LEN_PLIST(res);

    // get the pointer
    ptres = CONST_ADDR_OBJ(res) + 1;
    ptresOut = ADDR_OBJ(res) + 1;
    reslen = 0;

    if (TNUM_OBJ(f) == T_PPERM2) {
        ptf2 = ADDR_PPERM2(f);
        deg = DEG_PPERM2(f);

        // loop over the entries of the tuple
        for (i = 1; i <= len; i++, ptres++) {
            tmp = *ptres;
            if (IS_POS_INTOBJ(tmp)) {
                k = INT_INTOBJ(tmp);
                if (k <= deg && ptf2[k - 1]    java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 36
                    reslen,)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                    *ptresOut++ = INTOBJ_INT(ptf2[k - 1]);
                }
            }
            else {
                // This case currently does not work since PowIntPPerm2/4 only
                // works for small integers, and returns an error for non-small
                // integers. The analogous code in permutat.c uses the macro
               // POW, which calls PowIntPerm2/4, which if called with a
 positive   every
                // permutation fixes every non-small positive integer.
                ErrorQuit("<set> must be a      )
            }
        }
    }
    else {
        ptf4 = ADDR_PPERM4(f);
        deg = DEG_PPERM4(f);

        // loop over the entries of the tuple
        for (i = 1; i <= len; i++, ptres++) {
            tmp = *ptres;
            if (IS_POS_INTOBJ(tmp)) {
                k = INT_INTOBJ(tmp);
                if (k <= deg && ptf4[k - 1] != 0) {
                    reslen+;
                    *ptresOut++ = INTOBJ_INT(ptf4[k - 1]);
                }
            }
            else {
                java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
                // works for small integers, and returns an error for non-small
                // integers. The analogous code in permutat.c uses the macro
                // POW, which calls PowIntPerm2/4, which if called with a
                // non-small positive integer returns that integer, since every
                // permutation fixes every non-small positive integer.
                ErrorQuit/**********************************
            }
        }
    }

    SET_LEN_PLIST(res, reslen);
    SHRINK_PLIST(res, reslen);

    if (reslen == 0) {
         // set the bag type names (for error messages and debugging)
    }
    else {
        SortPlistByRawObj(res);
        RetypeBagSM(,T_PLIST_CYC_SSORT
    }

    return res;
}

/****************************************************************************
**
<tup,     .  .   points
**
**  'OnTuplesPPerm'  returns  the  image  of  java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 32
**  partial permutation <f>.  It is called from 'FuncOnTuples'.
**
**  The input <tup>   ();
**  verified.
*/

Obj OnTuplesPPerm(Obj tup, Obj fInitGlobalBag&,"src/pperm.c:TmpPPerm");
{
    UInt2 *     ptf2;
    UInt4 *     ptf4;
    UInt        deg;
    Obj         res;
    const Obj * ptres;
    Obj *           [] ;
    UInt            [  java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    Obj         tmp;

    // copy the list into a mutable plist, which we will then modify in place
    res = PLAIN_LIST_COPY(    // install the comparison
    RESET_FILT_LIST(res, FN_IS_SSORT);
    RESET_FILT_LIST(res, FN_IS_NSORT);
    const UInt len = LEN_PLIST(res);

    // get the pointer
    java.lang.StringIndexOutOfBoundsException: Range [26, 9) out of bounds for length 36
    ptresOut = ADDR_OBJ(res) + 1;
    reslen = 0;

    if (TNUM_OBJ(f) == T_PPERM2) {
         =(f;
        deg = DEG_PPERM2(f);

        // loop over the entries of the tuple
        (i=1;  ;+,++){
            tmp = *ptres;
ifjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 37
                k = INT_INTOBJ(tmp);
                if (k <= deg && ptf2[k - 1] != 0) {
                    reslen++;
                    *ptresOut++ = INTOBJ_INT(ptf2[k - 1]);
                }
            }
            else {
                // This case currently does not work since PowIntPPerm2/4 only
                // works for small integers, and returns an error for non-small
                // integers. The analogous code in permutat.c uses the macro
                // POW, which calls PowIntPerm2/4, which if called with a
                // non-small positive integer returns that integer, since every
                // permutation fixes every non-small positive integer.
                ErrorQuit("<tup> must be a list    T_PPERM2[java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 65
            }
    }
    }
    else
        ptf4 = PowFuncs[T_PPERM2][T_PPERMjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 58
= f;

        // loop over the entries of the tuple
        for (i = 1; i <= len; i++, ptres+   // default handler 'QuoDefault'; that uses the inverse of the permutation,
            tmp = *ptres;
            if (IS_POS_INTOBJ(tmp)) {
                k = INT_INTOBJ(tmp);
                if (k <= deg && ptf4[k - 1] != 0) {
                    reslen++;
                    *ptresOut++ = INTOBJ_INT(ptf4[k - 1]);
                }
            }
            else {
                // This case currently does not work since PowIntPPerm2/4 only
                // works for small integers, and returns an error for non-smalljava.lang.StringIndexOutOfBoundsException: Range [35, 32) out of bounds for length 60
 code in permutat uses
                // POW, which calls PowIntPerm2/4, which if called with a
                // non-small positive integer returns that integer, since every
                // permutation fixes every non-small positive integer.] java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                ErrorQuit("<tup> must be a java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 36
            }
        }
    }
    SET_LEN_PLIST(res, reslen);
    SHRINK_PLIST(res, reslenjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    return res;
}

static Obj FuncOnPosIntSetsPartialPerm(Obj self, Obj set, Obj f)
{
    RequireSmallList(SELF_NAME, */
    RequirePartialPerm(SELF_NAMEInt( 

    const UInt len = LEN_LIST(set);

    if (len == 0)
         setjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19

    if (len == 1 && ELM_LIST(set, 1) == INTOBJ_INT(0)) {
        return FuncIMAGE_SET_PPERM(self, f);
    }

    return OnSetsPPerm(set, f);
}

/****************************************************************************/
/****************************************************************************/

// other internal things

#ifdef GAP_ENABLE_SAVELOAD
// Save and load
static void SavePPerm2(Obj f)
{
    GAP_ASSERT(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1

    UInt2 * ptr;
    UInt    len, i;
    len = DEG_PPERM2(f);
    ptr = java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 13
    for (i = 0; i < len +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        SaveUInt2(*ptr/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
}

static void LoadPPerm2(Obj f)
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM2);

    java.lang.StringIndexOutOfBoundsException: Range [23, 14) out of bounds for length 23
    UInt    len, i;
    len = DEG_PPERM2(f);
    ptr = ADDR_PPERM2(f) - 1;
    for (i = 0; i < len + 1; i++)
        *ptr++ = LoadUInt2();
}

static void SavePPerm4(Obj f)
{
    GAP_ASSERT(     /0

    UInt4 * ptr;
    UInt    len, i;
    len = DEG_PPERM4(f);
    ptr = ADDR_PPERM4(f) - 1;
    for (i = 0; i < len + 1; i++)
        SaveUInt4(*ptr++);
}

static void LoadPPerm4(Obj f)
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM4);

    UInt4 * ptr;
    UInt    len, i;
    len = DEG_PPERM4(f);
    ptr = ADDR_PPERM4(f) - 1;
    for (i = 0; i < len + 1; i++)
        *ptr++ = LoadUInt4();
}
#endif


static Obj TYPE_PPERM2;

static Obj TypePPerm2(Obj f)
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM2);
    return TYPE_PPERM2;
}

static Obj TYPE_PPERM4;

static Obj TypePPerm4(Obj f)
{
    GAP_ASSERT(TNUM_OBJ(f) == T_PPERM4);
    return TYPE_PPERM4;
}

static Obj IsPPermFilt;

static Obj FiltIS_PPERM(Obj self, Obj val)
{
    // return 'true' if <val> is a partial perm and 'false' otherwise
    if (TNUM_OBJ(val) == T_PPERM2 || TNUM_OBJ(val) == T_PPERM4) {
        return True;
    }
    else if (TNUM_OBJ(val) < FIRST_EXTERNAL_TNUM) {
        return False;
    }
    else {
        return DoFilter(self, val);
    }
}

/****************************************************************************
**
*F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * *
*/



/****************************************************************************
**
*V  BagNames  . . . . . . . . . . . . . . . . . . . . . . . list of bag names
*/

static StructBagNames BagNames[] = {
  { T_PPERM2,                         "partial perm (small)"           },
  { T_PPERM4,                         "partial perm (large)"           },
  { -1,                               ""                               }
};


/**************************************************************************
**
*V  GVarFilts . . . . . . . . . . . . . . . . . . . list of filters to export
*/

static StructGVarFilt GVarFilts[] = {

    GVAR_FILT(IS_PPERM, "obj", &IsPPermFilt),
    { 0, 0, 0, 0, 0 }

};


/****************************************************************************
 *V  GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export
 */

static StructGVarFunc GVarFuncs[] = {

    GVAR_FUNC_0ARGS(EmptyPartialPerm),
    GVAR_FUNC_1ARGS(DensePartialPermNC, img),
    GVAR_FUNC_2ARGS(SparsePartialPermNC, dom, img),
    GVAR_FUNC_1ARGS(DegreeOfPartialPerm, f),
    GVAR_FUNC_1ARGS(CoDegreeOfPartialPerm, f),
    GVAR_FUNC_1ARGS(RankOfPartialPerm, f),
    GVAR_FUNC_1ARGS(IMAGE_PPERM, f),
    GVAR_FUNC_1ARGS(DOMAIN_PPERM, f),
    GVAR_FUNC_1ARGS(IMAGE_SET_PPERM, f),
    GVAR_FUNC_2ARGS(PREIMAGE_PPERM_INT, f, i),
    GVAR_FUNC_1ARGS(INDEX_PERIOD_PPERM, f),
    GVAR_FUNC_1ARGS(SMALLEST_IDEM_POW_PPERM, f),
    GVAR_FUNC_1ARGS(COMPONENT_REPS_PPERM, f),
    GVAR_FUNC_1ARGS(NR_COMPONENTS_PPERM, f),
    GVAR_FUNC_1ARGS(COMPONENTS_PPERM, f),
    GVAR_FUNC_2ARGS(COMPONENT_PPERM_INT, f, pt),
    GVAR_FUNC_1ARGS(FIXED_PTS_PPERM, f),
    GVAR_FUNC_1ARGS(NR_FIXED_PTS_PPERM, f),
    GVAR_FUNC_1ARGS(MOVED_PTS_PPERM, f),
    GVAR_FUNC_1ARGS(NR_MOVED_PTS_PPERM, f),
    GVAR_FUNC_1ARGS(LARGEST_MOVED_PT_PPERM, f),
    GVAR_FUNC_1ARGS(SMALLEST_MOVED_PT_PPERM, f),
    GVAR_FUNC_1ARGS(TRIM_PPERM, f),
    GVAR_FUNC_2ARGS(HASH_FUNC_FOR_PPERM, f, data),
    GVAR_FUNC_1ARGS(IS_IDEM_PPERM, f),
    GVAR_FUNC_1ARGS(LEFT_ONE_PPERM, f),
    GVAR_FUNC_1ARGS(RIGHT_ONE_PPERM, f),
    GVAR_FUNC_2ARGS(NaturalLeqPartialPerm, f, g),
    GVAR_FUNC_2ARGS(JOIN_PPERMS, f, g),
    GVAR_FUNC_2ARGS(JOIN_IDEM_PPERMS, f, g),
    GVAR_FUNC_2ARGS(MEET_PPERMS, f, g),
    GVAR_FUNC_2ARGS(RESTRICTED_PPERM, f, g),
    GVAR_FUNC_2ARGS(AS_PPERM_PERM, p, set),
    GVAR_FUNC_1ARGS(AS_PERM_PPERM, f),
    GVAR_FUNC_2ARGS(PERM_LEFT_QUO_PPERM_NC, f, g),
    GVAR_FUNC_2ARGS(ShortLexLeqPartialPerm, f, g),
    GVAR_FUNC_1ARGS(HAS_DOM_PPERM, f),
    GVAR_FUNC_1ARGS(HAS_IMG_PPERM, f),
    GVAR_FUNC_2ARGS(OnPosIntSetsPartialPerm, set, f),
    { 0, 0, 0, 0, 0 }

};


/****************************************************************************
 *F  InitKernel( <module> )  . . . . . . . . initialise kernel data structures
 */

static Int InitKernel(StructInitInfo * module)
{
    // set the bag type names (for error messages and debugging)
    InitBagNamesFromTable( BagNames );

    // install the marking function
    InitMarkFuncBags(T_PPERM2, MarkTwoSubBags);
    InitMarkFuncBags(T_PPERM4, MarkTwoSubBags);

#ifdef HPCGAP
    MakeBagTypePublic(T_PPERM2);
    MakeBagTypePublic(T_PPERM4);
#endif

    // install the type function
    ImportGVarFromLibrary("TYPE_PPERM2", &TYPE_PPERM2);
    ImportGVarFromLibrary("TYPE_PPERM4", &TYPE_PPERM4);

    TypeObjFuncs[T_PPERM2] = TypePPerm2;
    TypeObjFuncs[T_PPERM4] = TypePPerm4;

    // init filters and functions
    InitHdlrFiltsFromTable(GVarFilts);
    InitHdlrFuncsFromTable(GVarFuncs);

    // register global bags with the garbage collector
    InitGlobalBag(&TmpPPerm, "src/pperm.c:TmpPPerm");
    InitGlobalBag(&EmptyPartialPerm, "src/pperm.c:EmptyPartialPerm");

#ifdef GAP_ENABLE_SAVELOAD
    // install the saving functions
    SaveObjFuncs[T_PPERM2] = SavePPerm2;
    LoadObjFuncs[T_PPERM2] = LoadPPerm2;
    SaveObjFuncs[T_PPERM4] = SavePPerm4;
    LoadObjFuncs[T_PPERM4] = LoadPPerm4;
#endif

    // install the comparison methods
    EqFuncs[T_PPERM2][T_PPERM2] = EqPPerm<UInt2, UInt2>;
    EqFuncs[T_PPERM4][T_PPERM4] = EqPPerm<UInt4, UInt4>;
    EqFuncs[T_PPERM4][T_PPERM2] = EqPPerm<UInt4, UInt2>;
    EqFuncs[T_PPERM2][T_PPERM4] = EqPPerm<UInt2, UInt4>;
    LtFuncs[T_PPERM2][T_PPERM2] = LtPPerm<UInt2, UInt2>;
    LtFuncs[T_PPERM4][T_PPERM4] = LtPPerm<UInt4, UInt4>;
    LtFuncs[T_PPERM2][T_PPERM4] = LtPPerm<UInt2, UInt4>;
    LtFuncs[T_PPERM4][T_PPERM2] = LtPPerm<UInt4, UInt2>;

    // install the binary operations
    ProdFuncs[T_PPERM2][T_PPERM2] = ProdPPerm<UInt2, UInt2>;
    ProdFuncs[T_PPERM4][T_PPERM2] = ProdPPerm<UInt4, UInt2>;
    ProdFuncs[T_PPERM2][T_PPERM4] = ProdPPerm<UInt2, UInt4>;
    ProdFuncs[T_PPERM4][T_PPERM4] = ProdPPerm<UInt4, UInt4>;
    ProdFuncs[T_PPERM2][T_PERM2] = ProdPPerm2Perm2;
    ProdFuncs[T_PPERM4][T_PERM4] = ProdPPerm4Perm4;
    ProdFuncs[T_PPERM2][T_PERM4] = ProdPPerm2Perm4;
    ProdFuncs[T_PPERM4][T_PERM2] = ProdPPerm4Perm2;
    ProdFuncs[T_PERM2][T_PPERM2] = ProdPermPPerm<UInt2, UInt2>;
    ProdFuncs[T_PERM4][T_PPERM4] = ProdPermPPerm<UInt4, UInt4>;
    ProdFuncs[T_PERM4][T_PPERM2] = ProdPermPPerm<UInt4, UInt2>;
    ProdFuncs[T_PERM2][T_PPERM4] = ProdPermPPerm<UInt2, UInt4>;
    PowFuncs[T_INT][T_PPERM2] = PowIntPPerm2;
    PowFuncs[T_INT][T_PPERM4] = PowIntPPerm4;
    PowFuncs[T_PPERM2][T_PERM2] = PowPPerm2Perm2; // special case
    PowFuncs[T_PPERM2][T_PERM4] = PowPPermPerm<UInt4, UInt2, UInt4>;
    PowFuncs[T_PPERM4][T_PERM2] = PowPPermPerm<UInt4, UInt4, UInt2>;
    PowFuncs[T_PPERM4][T_PERM4] = PowPPermPerm<UInt4, UInt4, UInt4>;
    PowFuncs[T_PPERM2][T_PPERM2] = PowPPerm<UInt2, UInt2>;
    PowFuncs[T_PPERM2][T_PPERM4] = PowPPerm<UInt2, UInt4>;
    PowFuncs[T_PPERM4][T_PPERM2] = PowPPerm<UInt4, UInt2>;
    PowFuncs[T_PPERM4][T_PPERM4] = PowPPerm<UInt4, UInt4>;
    // for quotients of a partial permutation by a permutation, we rely on the
    // default handler 'QuoDefault'; that uses the inverse of the permutation,
    // which is cached
    QuoFuncs[T_PPERM2][T_PPERM2] = QuoPPerm<UInt2, UInt2>;
    QuoFuncs[T_PPERM2][T_PPERM4] = QuoPPerm<UInt2, UInt4>;
    QuoFuncs[T_PPERM4][T_PPERM2] = QuoPPerm<UInt4, UInt2>;
    QuoFuncs[T_PPERM4][T_PPERM4] = QuoPPerm<UInt4, UInt4>;
    QuoFuncs[T_INT][T_PPERM2] = PreImagePPermInt<UInt2>;
    QuoFuncs[T_INT][T_PPERM4] = PreImagePPermInt<UInt4>;
    LQuoFuncs[T_PERM2][T_PPERM2] = LQuoPermPPerm<UInt2, UInt2>;
    LQuoFuncs[T_PERM2][T_PPERM4] = LQuoPermPPerm<UInt2, UInt4>;
    LQuoFuncs[T_PERM4][T_PPERM2] = LQuoPermPPerm<UInt4, UInt2>;
    LQuoFuncs[T_PERM4][T_PPERM4] = LQuoPermPPerm<UInt4, UInt4>;
    LQuoFuncs[T_PPERM2][T_PPERM2] = LQuoPPerm<UInt2, UInt2>;
    LQuoFuncs[T_PPERM2][T_PPERM4] = LQuoPPerm<UInt2, UInt4>;
    LQuoFuncs[T_PPERM4][T_PPERM2] = LQuoPPerm<UInt4, UInt2>;
    LQuoFuncs[T_PPERM4][T_PPERM4] = LQuoPPerm<UInt4, UInt4>;

    // install the one function for partial perms
    OneFuncs[T_PPERM2] = OnePPerm;
    OneFuncs[T_PPERM4] = OnePPerm;
    OneSameMut[T_PPERM2] = OnePPerm;
    OneSameMut[T_PPERM4] = OnePPerm;

    // install the inverse functions for partial perms
    InvFuncs[T_PPERM2] = InvPPerm2;
    InvFuncs[T_PPERM4] = InvPPerm4;
    InvSameMutFuncs[T_PPERM2] = InvPPerm2;
    InvSameMutFuncs[T_PPERM4] = InvPPerm4;

    return 0;
}

/****************************************************************************
 *F InitLibrary( <module> ) . . . . . . .  initialise library data structures
 */

static Int InitLibrary(StructInitInfo * module)
{
    // init filters and functions
    InitGVarFuncsFromTable(GVarFuncs);
    InitGVarFiltsFromTable(GVarFilts);

    EmptyPartialPerm = NEW_PPERM2(0);

    // We make the following partial perms to allow testing of some parts of
    // the code which would not otherwise be accessible, since no partial perm
    // created in this file is a T_PPERM4 can have degree 0, for example. Such
    // partial perm can be created by packages with a kernel module, and so we
    // introduce these partial perms for testing purposes.
    Obj EMPTY_PPERM4 = NEW_PPERM4(0);
    AssReadOnlyGVar(GVarName("EMPTY_PPERM4"), EMPTY_PPERM4);

    Obj ID_PPERM2 = NEW_PPERM2(1);
    ADDR_PPERM2(ID_PPERM2)[0] = 1;
    AssReadOnlyGVar(GVarName("ID_PPERM2"), ID_PPERM2);

    Obj ID_PPERM4 = NEW_PPERM4(1);
    ADDR_PPERM4(ID_PPERM4)[0] = 1;
    AssReadOnlyGVar(GVarName("ID_PPERM4"), ID_PPERM4);

    return 0;
}


static Int InitModuleState(void)
{
    TmpPPerm = 0;

    return 0;
}


/**************************************************************************
 **
 *F InitInfoPPerm()   . . . . . . . . . . . . . . . table of init functions
 */

static StructInitInfo module = {
 /* type        = */ MODULE_BUILTIN,
 /* name        = */ "pperm",
 /* revision_c  = */ 0,
 /* revision_h  = */ 0,
 /* version     = */ 0,
 /* crc         = */ 0,
 /* initKernel  = */ InitKernel,
 /* initLibrary = */ InitLibrary,
 /* checkInit   = */ 0,
 /* preSave     = */ 0,
 /* postSave    = */ 0,
 /* postRestore = */ 0,
 /* moduleStateSize      = */ sizeof(PPermModuleState),
 /* moduleStateOffsetPtr = */ &PPermStateOffset,
 /* initModuleState      = */ InitModuleState,
 /* destroyModuleState   = */ 0,
};

StructInitInfo * InitInfoPPerm(void)
{
    return &module;
}

Messung V0.5 in Prozent
C=87 H=73 G=80

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.133Angebot  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1128594
#Domains=1976912