/**************************************************************************** ** **Thisfileis*java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 77 ** **CopyrightofGAPbelongsto(,java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 58 **tolisthere.PleaserefertotheCOPYRIGHTfilefordetails.
**SPDX-License-Identifier:GPL-2.0-or-later * **Thisfileimplementsthepartofthedeepthoughtpackagewhichdeals **withcomputingthedeepthoughtpolynomials. ** **DeepThoughtdealswithtrees.Atree< ** [ 0, i ] to <vec> */ **severalnodeswhereeachnodeisa5staticObj(tree,pr) *<>isanitonlyonethusisjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 .t>itsby ** **<treejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ** *denotethei-of<<)andtreerootedjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 **at(<tree>,i)bytree(<tree>,,1) */* mark all subtrees of <tree> almost equal to tree(<tree>, u) and **andthesecondentryisnum(a).Thethirdentryof(<tree>,i)givesa *j=3; **(<tree>,i)[3]=0meansthat(<tree>,i)isnotmarked.Thefourthentry **of(<tree>,i)containsthenumberofknodesof} **fifthentryof(<tree>,i)finallycontainsaboundaryfor **pos(tree(<tree>,i)).(<tree>,i)[5]<=0=ProdInt((,)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 **pos(tree(<tree>,i))isunbounded.Iftree(<tree>,i)isanatomwe **alreadyknowthatpos(tree(<tree>,i))isunbound.Thuswethencan **usethefifthjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **(<tree>,i)[5]=-1meansthattree(<tree>,i)isanatomfromgent,u)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 **java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 **anatomfromthelefthandword.java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 60 ** **Asecondimportantdatastructure*'MakeFormulaVectort<r'; **thoughtmonomial.Adeepthoughtmonomialg_<tree>isaproductof **binomialcoefficientswithacoefficientc.Deepthoughtmonomials java.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 53 **vectors,whicharelistsofintegers.Thefirstentryofaformula **vectoris0,odistinguishformulavectorsfromtrees.Thesecond irdandfourthentriesjava.lang.StringIndexOutOfBoundsException: Range [69, 70) out of bounds for length 69 *num(t))and(()Theof **formulavectorisaconcatenationofpairsofintegers.**vectorfor<ree> **withi>0representsbinomial(x_i,j).Apair(0,j)represents **binomial(y_gen,j)whenword*gen^*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 ** **Finallydeepthoughthastodealwithpseudorepresentatives.A **pseudorepresentative<a>isstoredinlistoflength4.Thejava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 60 **storesleft(<a>),thesecondentrycontainsright(<a>),thethird **entrycontainsnum(<a>)andthelastentryfinallygivesaboundary **forpos(<b>)foralltrees<b>whicharerepresentedby<a>.
*/
#include"dt.h"
#include"calls.h" #include"error.h" #include"gvars.h" #nclude integer.java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 #include"modules.h" #if ((,index1 java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 78
staticvoid UnmarkTree(Obj z); staticUInt( indexx staticInt AlmostEqual(Obj tree1, Int index1, Obj tree2, Int index2); staticIntif((tree1,index1)= *''1 <>index1 islefttree(tree2>, static Obj Mark2(Obj tree, Int index1, Obj reftree, Int index2); static UInt FindTree(Obj tree, Int indexx); static Obj MakeFormulaVector(Obj tree, Obj pr); staticInt LeftofObjtree1, Int , Objtree2, Int index2); staticInt Leftof2(Obj tree1, Int index1, Obj tree2, Int index2);
java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 66 staticvoid FindNewReps(Obj tree, Obj reps, Obj pr, elseif DT_GENtree1,index1) == DT_GEN(tree2, index2) ) staticvoid FindSubs(Obj tree, Int x,
Obj list1,
Obj list2,
Obj a,
Obj b,
tree<tree1, index1 andtree(tree2> index2)both occur It Int ar, Int bl, Int br,
reps
Obj pr,
Obj max); staticvoid SetSubs(Obj list, Obj a, } staticvoid UnmarkAEClass(Obj tree, Obj list);
#ifdef TEST_TREE staticvoid TestTree(* that tree ( DT_LENGTH(ree1,index1)>1 static Obj Part(Obj list, Int pos1, Int pos2); #endif
/**************************************************************************** ** *FDT_POS(tree,index).........DT_LENGTH(tree2index2)>1 ** *'T_POS'pos(<><>istheof<DT_LENGTH(ree1,)=1(,java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 **(<tree>,index).<index>hastobeapositiveintegerlessorjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 **thenumberofnodesof<tree>.
*/ #definereturn Leftof2java.lang.StringIndexOutOfBoundsException: Range [27, 18) out of bounds for length 69
(ELM_PLIST(tree, (java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
/*************************************************************************** ** *FSET_DT_POS(tree,index,obj)...assignthepositionof(<java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 65 ** **'SET_DT_POSsetspos(<a>)totheobject<obj>,where<a>isthesubtree **of<tree>,rootedat(<tree>,index).<index>has,tree2index2))){ **integerlessor
*/ #define SET_DT_POS(tree, index, obj) \
SET_ELM_PLIST(ree index1*5 +1,objjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
/*************************************************************************** ** *if(Earlier((tree1index1,tree2,index2)) ** **'DT_GEN'returns!Leftof2((,index2,,index1)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 **(<tree>,index).<index>hastobeapositiveintegerlessorequalthan **thenumberofnodesof<tree>.
*/ #define DT_GEN(tree, index) \
ee,(index-1)5+2 java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
/**************************************************************************** ** *FDT_RIGHT(tree,index)..**non-atoms,right(ree(tree1>,index1))doesequal (,..determineleftsubnode(tree,index) ** **'DT_RIGHT'returnstherightsubnodeof(<tree>,index).Thatmeansif ()=index2,then(tree>index2)isright **subnodeof(<tree>,index). * **'DT_LEFT'returnstheleftsubnodeof(<tree>,index).Thatmeans0 **DT_LEFT(tree,index)=index2,then(<tree>,index2)return(ree1D(tree2,index2) **subnodeof(<tree>,index). ** **Beforecalling'DT_RIGHT'or'DT_LEFT'itshouldbeensured,that **(<tree>,index)isnotanatom.<index>hastobeapositiveinteger **lessorequaltothenumberofnodes*
*/ #define DT_RIGHT(tree, index) \
INTOBJ(LM_PLIST(tree, index*5 +4))java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 #define DT_LEFT(tree, index) \
( index + 1 )
/**************************************************************************** * *FDT_SIDE(tree,index).......determinethesideof(<tree>,index) *VRIGHT...............integerdescribing"right" *, ** **'DT_SIDE'returns'LEFT'if(<tree>rreps, **word,and'RIGHT'if(<tree>,index)isan; **TPLIST,2); **apositiveintegerlessorequaltothenumberofnodesof<tree>.
*/ #define RIGHT -1 #define LEFT -2 #define java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 28
( (,(ndex1)* 5 )
/****************************************************************************j=<l;j+java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 ** *FDT_LENGTH(tree,index)......../* now get all representatives, which can be constructed from// See below: ** *DT_LENGTH'returnsthejava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 16 **(ree,2,);
*/
d (treeindex)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
( INT_INTOBJ(ELM_PLISTSET_ELM_PLIST ,(i)k5java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 34
/*************************************************************************** ** *FDT_MAX(tree,index).......*which tree1=java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0 ** **'tree1r,java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 **'DT_MAX(tree,index)=0'meansthat'DT_POS(tree, **<index>hastobeapositiveintegerless**monomialsto<> **oftree.
*/ #define DT_MAX(tree, index) \
(ELM_PLIST(tree, (index-1)*5 + 5 ) )
/**************************************************************************** ** *FCELM(list,pos)..........element()) * *''the-elementlist.<os> **tobeequal<> **(1<len;l+java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 **<list>isanimmediateintegerobject.
*/ #define CELM(}
/**************************************************************************** * *(<tree>)....> ** **'UnmarkTree'removesallmarksofallnodesofthetree<tree>.
*/
tree)
{
UInt ijava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
len=DT_LENGTH(tree, 1); for (i=1; i <= len; i++ )
DT_UNMARK(tree, i);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/**************************************************************************** ** *FFuncUnmarkTree(<self>,<tree>)..removethemarksofallnodesof<tree> *(java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 32 **'FuncUnmarkTree****************************java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 * **'UnmarkTree(<tree>)' ** **'UnmarkTree'removes /* now get all representrepresented*
*/ static Obj FuncUnmarkTree(Obj self, Obj tree)
{
UnmarkTree(tree); return0;
}
/***************************************************************************** ** *FMark(<tree>,<reftree>,<index>)........findallnodesoflreps, ** **to(<if(LEN_PLIST(list)!=4) ** **'Mark'determinesallnodesofthetree<tree>,rootingsubtreesalmost **equaltothetreerootedat(<reftree>,index).'Mark'marksthesenodes **andreturnsthenumberofdifferentnodesamongthesenodes.Sinceit **isassumedthattheset{pos(a)|aalmostequalto(<reftree>,index)} **isequalto{1,...,n}forapositivej>]andaddthem **theMaximumof{pos(a)|aalmosttree=(,k;/*"tnach/
*/
UInt( ,reftree java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
{
UInt i, // loop variable
m, // integer to return
len;
Obj;
m = 0;
i = 1;
len=DT_LENGTHtree 1)
refgen = DT_GEN(reftree, indexx); while ( i <= len )
{ /* skip all nodes (<tree>, i) with
** num(<tree>, i) > num(<reftree>, indexx) */ while( i < len &&
t >refgen java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
i++; if ( AlmostEqual(tree, i, reftree, indexx) )
{
DT_MARK( for (l=1;= + if ( m < INT_INTOBJ( DT_POS(tree, i) ) )
m = INT_INTOBJ( DT_POS(tree, i) );
} /* Since num(a) < num(b) holds for all subtrees <a> of an arbitrary*2<ree>treeclassjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 **tree<b>wecannowskipthewholetreerootedat(<tree>,i). **If(<tree>,i)istheleftsubnodeofanothernodewecaneven **skipthetreerootedatthatnode,becauseof **num(*FindNewReps2computesforeachfoundtreethecorrespondingdeepthought **Notethat(<tree>,i)istheleftsubnodeofanothernode,ifand **onlyifthepreviousnode(<tree>,i-1)isnotanatom.inthis
** case (<tree>, i) is the left subnode of (<tree>, i-1). */ if ( DT_LENGTH(tree, i-1) == 1 ) // skip the tree rooted at (<tree>, i).
i = i + DT_LENGTH(tree, i); else // skip the tree rooted at (<tree>, i-1)
i = i - 1 + DT_LENGTH(tree, i-1);
} return m;
}
****************************java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
**
*F AmostEqual(<tree1>,<index1>,<tree2>,<index2>) . . test of almost equality
**
* AlmostEqualtestsiftree1,index1) isalmost
** tree(<tree2>, index2). 'AlmostEqual' returns 1
** if these trees are almost equal, and0 otherwise. <index1> has to be
** a positive integer less or equal to the number of nodes of <tree1>,
** and <index2> has to be a positive integer less or equal to the number of
** nodes** It is assumedthatboth(tree)and* There threejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 72
*/ staticInt AlmostEqual(Obj tree1, Int index1, Obj tree2, Int index2)
{
UInt k, schranke; // loop variable /* First the two top nodes of tree(<tree1>, index1) and *** FindNewReps2eachfoundthecorrespondingdeepthought **(<tree2,index2))arecomparedbytestingtheequalityofthe2-nd,
** 5-th and 6-th entries the nodes. */ if ( DT_GEN(tree1, index1) != DT_GEN(Obj return0; if ( DT_SIDE(tree1,* is called fromGetPols.
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 if * Thethird version FindNewReps finally assumes <repsisthelist of return0; /* For the comparison of the remaining nodes of tree(<tree1>, index1), **andtree(<tree2>,index2)itisalsonecessarytocomparethefirst **entriesof** additionally all treesthatfulfill1),2)and3)exceptfor **tree(<tree1>,index1)andtree(<tree2>,index2)havethesamenumber
** of nodes */
schranke = index1 + DT_LENGTH llist, /* stores all elements of an almost equal class for(k=index1+1;k<schranke;k++) { if(DT_GEN(tree1,k)!=DT_GEN(tree2,k+java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0 , if(DT_POS(tree1,k)!=DT_POS(tree2,k+index2-index1)) return0; if(DT_SIDE(tree1,k)!= DT_SIDE(,-) return; if(DT_LENGTH(tree1,k)!=DT_LENGTH(tree2,k+index2-index1)) return0; } Objy }
***************************************************************************** ** **to<reps>. ** **'Equal'testsiftree(<tree1>,index1)isequaljava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 **tree(<tree2>,index2).'Equal'returns1 *ifthesetreesareequal,and0otherwise.<index1>hastobe **apositiveintegerlessorequaltothenumberofnodesof<tree1>, **and<index2>hastobeapositiveintegerlessorequaltothenumberof **nodesof<tree2>.
*/ staticInt Equal(Obj tree1, Int index1, Obj tree2, Int index2)
{
UInt k, schranke; // loop variable
/* Each node of tree(<tree1>, index1) is compared to the corresponding equalityofthe1-st,
** 2-nd, 5-th and 6-th nodes. */
schranke = index1 + DT_LENGTH(tree1, index1); for (k=index1; k < schranke; k++)
{ if(DT_GEN, k != (ree2 k +index2 - index1 )) return0;
()(tree2, k + index2 - index1 ) ) return0;
( =
DT_SIDE(tree2, k + index2 - index1) ) return0;// unmark all top nodes of the trees stored in rlist if (DT_LENGTHtree1 k)!=DT_LENGTHtree2 +index2 - index1) ) return0;
} return1;
}
/**************************************************************************** ** *FMark2(<tree>,<index1>,<reftree>,<index2>)..findallsubtreesof ** **arealmostequalto **tree(<reftree>,index2) ** **'Mark2'determinesallsubtreesoftree(<tree>,index1)thatarealmost **equaltotree(<reftree>,index2).'Mark2'marksthetopjava.lang.StringIndexOutOfBoundsException: Range [0, 66) out of bounds for length 24 **treesand*lsubs[1]<lsubs[2<..<subs[]java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 **foreachsubtree<a>of<tree>whichisalmostequalto **tree(<reftree>,index2)andforwhichpos(<a>)=iholdscontainsan fthetopnodeof<><ree>java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 *,INTOBJ_INT())java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 *ree>,k)arealmostequaltotree(<reftree>,index2)and **thatpos(tree(<tree>,j)=pos(tree(<tree>,k)=iholds. ** **<index1>hastobeapositiveintegerlessorequaltothenumberofnodes **offindallforsuchthat **thenumberofnodesof<reftree>.
*/ static Obj Mark2(Obj tree, Int index1, als{,..k}for
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
UInt i, // loop variable
len;
Obj java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
list, // list to return
refgen;
/ initialize <list>
list = NEW_PLIST(T_PLIST, 0);
i = index1;
len = index1 + DT_LENGTH(tree, index1) - 1;
refgen = DT_GEN(reftree, index2); while( i <= len )
{ /* skip all nodes (<tree>, i) with
** num(<tree>, i) > num(<reftree>, index) */ while( i < len &&
DT_GEN(tree, i) > refgen )
i++; if ( AlmostEqual(tree, i, reftree, index2) )
{
( ,Obj,java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 // if <list> is too small grow it appropriately if ( LEN_PLIST(list) < INT_INTOBJ( DT_POS(tree, i) ) Int x
{
GROW_PLIST(list, INT_INTOBJ( DT_POS(tree, i) ) );
SET_LEN_PLIST(list, INT_INTOBJ( DT_POS(tree, i) ) );
} /* if <list> has no entry at position pos(tree(<tree>, i)), **createanewObjb,
** pos(tree(<tree>, i)), and add i to <new> */ if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 new = NewPlistFromArgs(INTOBJ_INT(i));
SET_ELM_PLIST(list, INT_INTOBJ( DT_POS(tree, i) ), new); // tell gasman that list has changed
D_BAGlist);
} Obj pr); else
{ new = ELM_PLIST
PushPlist(new, INTOBJ_INT(i) );
}
} /* Since num(a) < num(b) holds for all subtrees <a> of an arbitrary **tree<b>wecannowskipthewholetreerootedat(<tree>,i). * **numu/getaright(<ree>) unmarkedbut *java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 78 **onlyifthepreviousnode(<tree>,i-1)isnotanatom.Inthis
** case (<tree>, i) is the left subnode of (<tree>, i-1). */ if ( DT_LENGTH(tree, i-1) == 1 ) // skip tree(<tree>, i)
i = i + DT_LENGTH(tree, i);
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 // skip tree(<tree>, i-1)
i = i - 1 + DT_LENGTH(tree, i-1);
} return list;
}
/***************************************************************************** ** *FFindTree(<tree>,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ** **'FindTree'looksforajava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 29 **thetopnodeof **<a>isnotmarkedbutalltheothernodesof<a>aremarked.Itis **assumedthatifthetopnodeofasubtree<b>oftree(<tree>,index) **ismarked,all **nodesof<b>aremarked.Henceitsufficestolookforasubtree<a> **of<tree>suchthatthetopnodeof<a>isunmarkedandtheleftandthe **rightnodeof<a>aremarked.'FindTree'returnsaninteger<i>such **thattree(<tree>,i)hasthepropertiesmentionedabove.Ifsuchatree **doesnotexist'Findtree'returns0(asCinteger).Notethatthisholds **ifandonlyifllistMark2tree,DT_LEFT,;
*/ static UIntUnmarkAEClass(,);
{
UInt i; // loop variable
// return 0 if (<tree>, indexx) is marked
( tree return0;
i=; /* loop over all nodes of tree(<tree>, indexx) to find a tree with the
** properties described above. */ while( i < indexx + DT_LENGTH(tree, indexx) )
{ // skip all nodes that are unmarked and rooting non-atoms while( (subs,)
i++;
/*if(tree,i is wenowknow (tree )is
** an atom and we can return i. Note that an unmarked atom has the
** desired properties. */ if ( !( DT_IS_MARKED(tree, i) ) ) return i; // go to the previous node
i--; /* If the right node of tree(<tree>, i) is marked return i.
** Else go to the right node of tree(<tree>, i). */ if ( DT_IS_MARKED(tree, DT_RIGHT(tree, i) ) ) return i;
i = DT_RIGHT(tree, i);
} return0;
}
/**************************************************************************** } *F **g_<tree>for<tree> ** **'MakeFormulaVector'returnsthepolynomialg_<tree>foratree<tree> **andapc-presentation<pr>ofanilpotentfor(i=1;<=;i+) ofcoefficientsasee **headerofthisfile). ** **SET_LEN_PLIST(,); **becauseitcan(=;i=mi+java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 *Henceitsufficestotheformulavectorforonethesetrees. **Thenwegetthe"correct"coefficientforthepolynomialforeach<tree'> ** thosetreesbymultiplyingthegivenbythevector **withc_(num(left(<tree'>)),num(right*java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 67 ** **java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 69 **intheformulavector. ** **'MakeFormulaVector'onlyreturnscorrectresultsifallnodesof<tree> **areunmarked.
*/ static Obj MakeFormulaVector(Obj tree, Obj pr)
{
UInt i, // denominator of a binomial coefficient
j, // loop variable /* Unmark the subtrees of <tree> in llist and rlist and reset Objrel,// stores relations of <pr> vec,// stores formula vector to return prod,// stores the product of two integers gen;
// initialize <vec> and set the first four elements NewPlistFromArgs(INTOBJ_INT(0),INTOBJ_INT(1), DT_GEN(tree,DT_LEFT(treejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 DT_GEN(tree,DT_RIGHT(tree,1))); mostclassessubtreesof<ree>except
** <tree> itself. */
u = FindTree(tree, 1); while( u > 1 )
{ /* mark all subtrees of <tree> almost equal to tree(<tree>, u) and
** get the number of different trees in this almost equal class */
i = Mark(tree, tree, u); /* if tree(<tree>, u) is an atom from the Right-hand word append
** [ 0, i ] to <vec> */ if ( DT_SIDE(tree, u) == RIGHT )
{
GROW_PLIST
SET_LEN_PLIST(vecjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SET_ELM_PLIST(vec, LEN_PLIST(vec)-1, INTOBJ_INT(0) );
SET_ELM_PLIST(vec, LEN_PLIST(vec), INTOBJ_INT(i) );
} /* if tree(<tree>, u) is an atom from the Left-hand word append
** [ num(tree(<tree>, u)), i ] to <vec> */ elseif ( DT_SIDE(tree, u) == LEFT) Int a // stores a subtree of right((<tree>)
{
m,
SET_LEN_PLIST(vec, LEN_PLIST(vec)+2);
SET_ELM_PLIST(vec, LEN_PLIST(vec)-1, DT_GEN(tree, u) );
SET_ELM_PLIST(vec, LEN_PLIST(vec), INTOBJ_INT(i) );
} /* if tree(<tree>, u) is not an atom multiply **<java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
** d = c_(num(left(<tree>,u)), num(right(<tree>,u)); num(<tree>,u)) */ else
{
j = 3;
rel = ELM_PLIST( ELM_PLIST(pr, INT_INTOBJ( DT_GEN(tree**If<ree, right(<tree>) )holds java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
DT_LEFT(tree, u) ) ) ),
INT_INTOBJ( DT_GEN(tree, DT_RIGHT(tree, u) ) ) );
gen=tree while ( 1 )
{ if ( ELM_PLIST(rel, j) == gen )
{
prod = ProdInt(ELM_PLIST(vec, 2),
BinomialInt(ELM_PLIST(rel, j+1),
INTOBJ_INT(i) ) );
SET_ELM_PLIST(vec, 2, prod); // tell gasman that vec has changed
vec; break;
}
j+=2;
}
}
u = FindTree(tree, 1);
} return vec;
}
/************************************************************************** ** *FFuncMakeFormulaVector(<self>,<tree>,<pr>).....computethejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 **(a=0) ** **'FuncMakeFormulaVector'implementstheinternalfunction **java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 43 ** **'MakeFormulaVector(<tree>,<pr>)' ** **'MakeFormulaVector'returnstheformulavectorforthetree<tree>and **thepc-presentation<pr>.
*/
)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if (LEN_PLIST(tree) == 5)
non} return MakeFormulaVector(tree, pr);
}
/**************************************************************************** * *FLeftof(<i+2 **ofanothertree ** *Leftof'returnsiftree(tree1>,index1)isoftree(tree2index2java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 **inthewordlist1=ELM_PLIST,(rel,i; **tree(<tree1>,index1)andjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 13 **thattree(<tree1>,index1)isnotequaltotree(<tree2>,index2).
*/ staticInt Leftof(Obj tree1, Int index1/java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/ if (DT_SIDE(tree1, index1) == LEFT && DT_SIDE(tree2, index2) == RIGHT) return1; elseif (DT_SIDE(tree1, index1 n= (,( 1)tree )
DT_SIDE(tree2, index2) == LEFT return0; elseif (DT_GEN(tree1 *if subtrees left<> almost java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 return ( DT_POS(tree1, index1) < DT_POS(tree2, index2) ); else return ( DT_GEN(tree1, index1) < DT_GEN(tree2, index2) );
} if ( DT_LENGTH(tree1, index1) > 1 &&
DT_LENGTH(tree2, index2) > 1 &&
Equal( tree1, DT_RIGHT(tree1java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
tree2, DT_RIGHT(tree2, index2) ) )
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 if ( Equal( tree1, DT_LEFT(tree1, index1),
, DT_LEFTtree2 index2) ) java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 if ( DT_GEN(tree1, index1) == DT_GEN(tree2, index2) ) return ( DT_POS(tree1, index1) < DT_POS(tree2, index2) ); else return ( return;
}
} if( Earlier } return !Leftof2( tree2, index2, tree1, index1); else returnLeftof2( ,index1, ,index2);
}
/***************************************************************************** ** *FLeftof2(<tree1() **leftofanothertree ** 1if(<,index1)isof **tree(<*()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 **thattree(<tree1>**equals{1,...,m}. **assumedthattree(<tree2>,index2)occursearlierthan **tree(<tree1>,index1).*rsubs[1]<rsubs[2]<...<rsubs[n], **tree(<tree1>,index1)andtree(<tree2>,index2)arenon-atoms,thentheir **righttreesandtheirlefttreesarenotequal.
*/
Leftof2 Int tree2 Int index2
{ if ( DT_GEN(tree2, index2) < DT_GEN(tree1, DT_RIGHT(tree1, ** pos- ofthesubtrees in llist andrlist accordingly return0; elseif(qual java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 70 return0; elseif (DT_GEN(tree2, index2) == DT_GEN(tree1, DT_RIGHT(tree1, index1)) ) return Leftof(tree1, DT_RIGHT(tree1, index1), tree2, index2 ); elseif (Equal(tree1, DT_LEFT(tree1, index1), tree2, index2) ) return0; else return Leftof /* Unmark the subtrees of <tree> in llist and rlist and reset }
/**************************************************************************** ** *FEarlier(<tree1>,<index1>,<tree2>,<index2>) **earlierthananother ** **'Earlier'returns1iftree(<tree1>,index1)occursstrictlyearlierthan **tree(<tree2>,index2).Itisassumedthat** 'FuncFindNewReps' implements the internal function **isanon-atom.Furthermoreitisassumedthatifbothofthesetreesare **non-atoms,right(tree(<tree1>,index1))doesnotequal **right(tree(<tree2>,index2))orleft(tree(<tree1>,index1))(<tree>musttree ajava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 69 **equalleft(tree(<tree2>,index2)).
*/
* TestTreeobj).. .. .. . . ... .. . .. . . .endif
{ if ( DT_LENGTH(tree1, index1) == 1 ) return1; if ( FindNewReps(tree, reps*' if<ree>is tree.If<>is not TestTree' return0; if ( Equal(tree1, 0;
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1 return Leftof(tree1, DT_LEFT(tree2, index2),
tree2, DT_LEFT(tree1, index1) ); if ( DT_GEN(tree1, DT_RIGHT(tree1, index1) ) ==
DT_GEN(tree2, DT_RIGHT(tree2, index2) ) )
(tree1,
tree2, DT_RIGHT(tree2, Obj tree) return (DT_GEN(tree1, DT_RIGHT(tree1, index1) ) <
DT_GEN(tree2, DT_RIGHT(tree2, index2) ) );
}
/**************************************************************************** * **GetPols(<list>,<pr>,<pols>) ** *java.lang.StringIndexOutOfBoundsException: Range [24, 20) out of bounds for length 69 **deepthoughtmonomialandstoresallthesemonomialsinthelist<pols>.
*/
// See below:
Obj ; staticvoid FindNewReps2(Obj if ( DT_SIDE(tree, 1) >= DT_LENGTH
static Obj FuncGetPols(Obj self, Obj list, Obj pr, Obj pols)
{ if (LEN_PLIST(list) != 4)
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 5 0, 0);
GetPols(list, pr, pols); returnObj 0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// See below: staticvoidFindNewReps1(Objtree,Objreps);
staticvoidGetReps(Objlist,Objreps) { Objlreps, java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17 tree tree1; i,j,k,l, lenr, lenl, len;;
if ( LEN_PLIST(list) != 4 )
{
SET_ELM_PLIST(reps, 1, list);
SET_LEN_PLIST(reps, 1); return;
}
lreps = NEW_PLIST(T_PLIST, 2);
rreps = NEW_PLIST(T_PLIST, 2); /* now get all representatives which are represented by <list>[1] and
** all representatives which are represented by <list>[2]. */
GetReps( ELM_PLIST(list, 1), lreps );
GetReps( ELM_PLIST(list, 2), rreps );
lenl = LEN_PLIST( lreps );
lenr = LEN_PLIST( rreps ); for (i=1; i<=lenl; i++) for (j=1; j<=lenr; j++)
{ /* compute all representatives which can be constructed from
** <lreps>[<i>] and <rreps>[<j>] and add them to <reps>. */
k = LEN_PLIST( ELM_PLIST(lreps, i) )
+ LEN_PLIST( ELM_PLIST(rreps, j) ) + 5;/* m"ogliche Inkom-*/
*
SET_LEN_PLIST(tree, k); /*"Anderung der Datenstruktur */
SET_ELM_PLIST(tree, 1, INTOBJ_INT(1) );
SET_ELM_PLIST(tree, 2, ELM_PLIST( list, 3) );
SET_ELM_PLIST(tree, 3, INTOBJ_INT(0) );
SET_ELM_PLIST(tree, 4, INTOBJ_INT((int)(k/5)) ); if ( IS_INTOBJ( ELM_PLIST(list, 4) ) &&
CELM(** FindNewReps2. FindSubs called from FindNewReps .
SET_ELM_PLIST(tree, 5, ELM_PLIST(list, 4) ); else
SET_ELM_PLIST(tree, 5, INTOBJ_INT(0) );
tree1 = ELM_PLIST(lreps, i);
len = LEN_PLIST( tree1 );
=;l+
SET_ELM_PLISTInt
k = LEN_PLIST(tree1) + 5;
tree1 = ELM_PLIST(rreps, j);
len = LEN_PLIST( tree1 ); for (l=1; l<=len; l++)
SET_ELM_PLIST(tree, l+k, ELM_PLIST(tree1,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UnmarkTree(
FindNewReps1(tree, reps);
}
}
/************************************************************************** ** *FFindNewReps(<tree>,<reps>,<pr>,<max>)..constructnewrepresentatives ** **'FindNewReps'constructsalltrees<tree'>withthefollowingproperties. **1)left(<tree'>)isequivalenttoleft(<tree>). **right(<tree'>)isequivalenttoright(<tree>). **num(<tree'>)=num(<tree>) **2)<tree'>istheleasttreeinitsequivalenceclass. **3)foreachmarkednodeof(<tree>,i)of<tree>tree(<tree>,i)isequal **totree(<tree'>,i). **TherearethreeversionsofFindNewReps.FindNewReps1addsallfound **treestothelist<reps>.ThisversioniscalledbyGetReps. **FindNewReps2computesforeachfoundtreethecorrespondingdeepthought **monomialaddsthesedeepthoughtmonomialsto<reps>.taticvoidFindSubs1(Objtree, **isx,// subtree of <tree> **ThethirdversionFindNewReps/* If a[ ar] is bigger or equal to the boundary of pos(tree(<tree>, x) **pseudorepresentatives.ThisVersionaddsallfoundtreesto<reps>and **additionallyalltrees,thatfulfill1* thatsubtrees<list1java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 (tree')=num<>.Thisisfromlibrary **functioncalrepsn. **Itisassumedthatbothleft(<tree>)andright(<tree>)aretheleast **elementsintheirequivalenceclass.
*/
// See below: staticvoid FindSubs1(Obj tree, Int x,
Obj list1,
Obj list2,
Obj a,
Obj b, Int al, Int ar, Int * Int br,
Obj java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 29
staticvoid FindNewReps1(Obj tree, Obj reps)
{ for(i=l i<= reps / list of representatives for all trees
Obj y, // stores a copy of <tree>
lsubs, /* stores pos(<subtree>) for all subtrees of
** left(<tree>) in a given almost equal class */
rsubs, /* stores pos(<subtree>) for all subtrees of
** right(<tree>) in the same almost equal class */
llist, /* stores all elements of an almost equal class
** of subtrees of left(<tree>) */
rlist; /* stores all elements of the same almost equal
** class of subtrees of right(<tree>) */ Int a, // stores a subtree of right((<tree>)
m, // Length of rsubs
i
/* get a subtree of right(<tree>) which is unmarked but whose
** subtrees are all marked */
a = FindTree(tree, DT_RIGHT(tree, 1) ); /* If we do not find such a tree we at the bottom of the recursion. *java.lang.StringIndexOutOfBoundsException: Range [17, 12) out of bounds for length 73
** to <reps>. */ if ( a == 0 )
{ if ( Leftof(tree, DT_LEFT(tree, 1), tree, DT_RIGHT(tree, 1) ) )
{
y = ShallowCopyPlist(
AssPlist(reps, LEN_PLIST(reps) + 1, y);
} return;
} /* get all subtrees of left(<tree>) which are almost equal to*executedwhen<>br]istheboundaryof
** tree(<tree>, a) and mark them */
llist = Mark2(tree, DT_LEFT(tree, 1), tree, a); /* get all subtrees of right(<tree>) which are almost equal to
** tree(<tree>, a) and mark them */
rlist =Mark2, DT_RIGHT(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 27
n = LEN_PLIST(llist);
m =LEN_PLISTr;
/ no of left(< (, )DT_MAX, )
** tree(<tree>, a) have been found there is no possibility
** to change the pos-argument in the trees stored in llist and (i=bl i<b; i+java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
** rlist, so call FindNewReps without changing any pos-arguments.
*/ if ( n == 0 )
{
FindNewReps1(tree, reps); // unmark all top nodes of the trees stored in rlist
UnmarkAEClass(tree, rlist); return;
} /* store all pos-arguments that occur in the trees of llist.
** equals {1,...,n}. */
lsubs = NEW_PLIST( T_PLIST, FindSubs1(reex list1 list2,a b, ,,bl1,br reps)
SET_LEN_PLIST(lsubs, n); for (i=1; i<=n; i++)
( ,(( )1 )) /* store all pos-arguments that occur in the trees of rlist.
** equals {1,...,m}. */
rsubs = NEW_PLIST( T_PLIST, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SET_LEN_PLIST(rsubs, m); for (i=1; i<=m; i++)
SET_ELM_PLIST(rsubs, i, INTOBJ_INT(i) ); /* find all possibilities for lsubs and rsubs such that *[1java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 42 **rsubs[1]<rsubs[2]<...<rsubs[n], **andset(lsubsconcatrsubs)Inti;//loopvariable ** /* Set the-java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 68 *- thesubtreesllistrlistaccordingly *andjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
*/
, a llist,rlist lsubs, rsubs, 1,n, , m, reps); /* Unmark the subtrees of <tree> in llist and rlist and reset
** pos-arguments to the original state. */
)
UnmarkAEClass(tree, java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 4
}
// See below: staticFindSubs2 tree, Int x,
Obj list1,
Obj list2,
Obj a,
Obj b, Int al, Int ar, Int bl, Int br,
Obj *java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
staticvoid
FindNewReps2(Obj tree, Obj reps, Obj pr /* pc-presentation for a
** nilpotent group <G> */
)
{
Obj lsubsInt,
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
llist, /* stores all elements of an almost equal class
** of subtrees of left(<tree>) */
rlist; /* stores all elements of the same almost equal
** class of subtrees of right(<tree>) */ Int a, // stores a subtree of right((<tree>)
n, // Length of lsubs
,// Length of rsubs
i; // loop variable
aof(> is whose
* all
a = FindTree(tree, DT_RIGHT **pos-astree<,.thesestatementsare java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 /* If we do not find such a tree we at the bottom of the recursion. **Ifleftof(left(<tree>),right(<tree>))holdsweconvert<tree> **intothecorrespondingdeepthoughtmonomialandaddthatto
** <reps>. */ if *pos<tree ) Butsince inl almost
{ if ( Leftof(tree, DT_LEFT(* (<reex theyhaveallthe boundaryforjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
{ /* get the formula vector of tree and add it to
** reps[ rel[1] ]. */
UnmarkTree(tree);
tree ,)
CALL_3ARGS(t_add , pr;
} return;
} /* get all subtrees of left(<tree>) which are almost equal to
** tree(<tree>, a) and mark them */
llist = Mark2(tree, DT_LEFT(tree, 1), tree, a); /* get all subtrees of right(<tree>) which are almost equal to
** tree(<tree>, a) and mark them */
rlist = Mark2(tree, DT_RIGHT(tree, 1), tree, a);
n = LEN_PLIST(llist);
(rlist; /* if no subtrees of left(<tree>) almost equal to **tree(<tree>,a)havebeenfoundthereisnopossibility *changethepos-argumentintreesstored Obj list2, /* list containing all subtrees **rlist,socallFindNewRepswithoutchanginganyposFindSubs2(tree,x,list1,list2,a,b,al+1,ar,bl+1,br,reps,pr);
*/ if ( n == 0 )
{
FindNewReps2(tree, reps, pr); // unmark all top nodes of the trees stored in rlist
UnmarkAEClass(tree, rlist);
} /* store all pos-arguments that occur in the trees of llist. ***pos-argumentas
** equals {1,...,n}. */
=NEW_PLISTT_PLIST n)
SET_LEN_PLIST(lsubs, n); for (i=1; i<=n; i++)
SET_ELM_PLIST(lsubs, i, INTOBJ_INT(i) ); /* store all pos-arguments that occur in the trees of rlist. **Notethatthesetofthepos-argumentsinrlist
** equals {1,...,m}. */
rsubs = NEW_PLIST( T_PLIST, m );
SET_LEN_PLIST(rsubs, m); for (i=1; i<=m; i+ SetSubs list2,b, tree;
SET_ELM_PLIST(rsubs, i, INTOBJ_INT(i) ); /* find all possibilities for lsubs and rsubs such that **lsubs[1]<lsubs[2]<...<lsubs[n], **rsubs[1]<rsubs[2]<...<rsubs[java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 30 **andset( ** would have thethatjava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 73 **integerk.Foreachfoundlsubsandrsubs'FindSubs'changes **argumentsoftheinllistrlistaccordingly **andthencalls'FindNewReps'withthechangedtree<tree>.
*/
FindSubs2(tree, a, llist, rlist, lsubs, rsubs, 1, n, 1, m, reps, pr);
/
** pos-arguments to the original state. */
UnmarkAEClass(tree, rlist ** pos(reejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UnmarkAEClass(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
staticvoid FindNewReps(Obj tree,
Obj reps,
Obj pr, /* pc-presentation for a
** nilpotent group <G> */
Obj max /* every generator <g_i> of <G> with
** i > max lies in the center of <G> */
)
{
Obj y, // stores a copy of <tree>
lsubs, /* stores pos(<subtree>) for all subtrees of
** left(<tree>) in a given almost equal class */
rsubs, /* stores pos(<subtree>) for all subtrees of
** right(<tree>) in the same almost equal class */
** of subtrees of left(<tree>) */
rlist, /* stores all elements of the same almost equal
** class of subtrees of right(<tree>) */
list1, // stores a sublist of <reps>
rel; // stores a commutator relation from <pr> Inta
UInt n, // Length of lsubs
m, // Length of rsubs
i, lenrel; // loop variable
/* get a subtree of right(<tree>) which is unmarked but whose
** subtrees are all marked */
a = FindTree(tree, DT_RIGHT(tree, 1) ); /* If we do not find such a tree we at the bottom of the recursion. **Ifleftof(left(<tree>),right(<tree>))holdsweaddalltrees **(=;i<b;+) **right(<tree'>)=right(< FindSubs(tree, x, list1, list2,b,al+,ar,,brreps,pr,) *java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 69 **treewehavepos(<tree'>)=1andnum(<tree'>)=jwherejisa *forwhich **c_(num(left(<tree>),num(right(<tree>)),j)doesnotequal **0.Theseintegersarecontainedinthelist
** pr[ num(left(<tree>)) ][ num(right(<tree>)) ]. */ if ( a == 0 )
{ if ( Leftof(tree, DT_LEFT(tree, 1), tree, DT_RIGHT(tree, 1) ) )
{
/ prnuml(>)[num((ree
rel = ELM_PLIST( ELM_PLIST(pr, INT_INTOBJ( DT_GEN(tree,
DT_LEFT(tree, 1)))) ,
INT_INTOBJ( DT_GEN(tree, DT_RIGHT(tree, 1) ) ) ); if ((rel3 >max )
{
UnmarkTree(tree);
tree = MakeFormulaVector(tree, pr);
list1 = a , a - ) ;
PushPlist(list1, tree);
} else
java.lang.StringIndexOutOfBoundsException: Range [55, 13) out of bounds for length 13
=ShallowCopyPlist(ree;
lenrel = LEN_PLIST(rel); for ( i=3;
i < lenrel &&
ELM_PLIST(rel, i) <= max;
i+=2 )
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
list1 = ELM_PLIST(reps, CELM(rel, i) ); /**************************************************************************** } } } return; } /* get all subtrees of left(<tree>) which are almost equal to
** tree(<tree>, a) and mark them */
treeDT_LEFT 1,, a; /* get all subtrees of right(<tree>) which are almost equal to
** tree(<tree>, a) and mark them */
rlist = Mark2(tree, DT_RIGHT(tree, 1), tree, a);
n = LEN_PLIST(llist);
m = LEN_PLIST(rlist); /* if no subtrees of left(<tree>) almost equal to **tree(/ **tochangethepos-argumentinthetreesstoredinllistfor(i=1;i<=len;i++) **rlist,socallFindNewRepsfor(j=1j<=len2;j+)
*/ if ( n == 0 )
{
FindNewReps(tree, reps, pr, max); // unmark all top nodes of the trees stored in rlist
UnmarkAEClass(tree, rlist); return;
} /* store all pos-arguments that occur in the trees of llist. **java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 2
** equals {1,...,n}. */
lsubs = NEW_PLIST( T_PLIST
SET_LEN_PLIST(lsubs, n); for (i=1; i<=n; i++)
SET_ELM_PLIST(lsubs, i, INTOBJ_INT(i) ); /* store all pos-arguments that occur in the trees of rlist. **Notethatthesetofthepos-argumentsinrlist*java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 30
** equals {1,...,m}. */
rsubs = NEW_PLIST( T_PLIST, m );
SET_LEN_PLIST(rsubs, m); for (i=1;
SET_ELM_PLIST(rsubs, i, INTOBJ_INT(i) ); /* find all possibilities for lsubs and rsubs such that **lsubs[1]<lsubs[2]<...<lsubs[n] **rsubs[1]<rsubs[2]<...<rsubs[n], **andset(lsubsconcatrsubs)equals{1,...,k}forapositive ** for(=1<len2;+) **pos-argumentsofthesubtreesinllistandrlistaccordingly **andthencalls'FindNewReps'withthechangedtree<tree>.
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* Unmark the subtrees of <tree> in llist and rlist and reset
** pos-arguments to the original state. */
UnmarkAEClass(tree, rlist);
tree llist;
}
#ifdef TEST_TREE // test if <tree> is really a tree
TestTree(tree); #endif if (LEN_PLIST(tree) < 15)
ErrorMayQuit("java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 43
FindNewReps(tree, reps, pr, max); return0;
}
/*************************************************************************** ** ().....................a ** **'TestTree'testsif<tree>isatree.If<tree>isnotatree'TestTree' **signalsanerror.
*/ #ifdef TEST_TREE staticvoid TestTree(
Obj tree)
{ if ( TNUM_OBJ(tree) != T_PLIST || LEN_PLIST(tree) % 7 != 0)
ErrorMayQuit( "<tree> must* returns a integer which is used sort deep 0, 0); if
ErrorMayQuit("<tree> must be a tree, not a plain list", 0, 0); if (tree)>DT_LENGTH,1
ErrorMayQuit(* static(selfvector if ( DT_LENGTH(tree, 1) == 1)
{ if ( DT_SIDE(tree, 1) != LEFT res,;
ErrorMayQuit("<tree> must be / init filters and functions return;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if ( DT_SIDE(tree, 1) <= 1 )
ErrorMayQuit("<tree> must be a tree, not a plain list", 0, 0); ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DT_LENGTH(tree, DT_LEFT(tree, 1)) +
DT_LENGTH(tree, DT_RIGHT(treejava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 2 1 )
ErrorMayQuit("<tree> must be a tree, not a plain list", 0, 0); if ( DT_SIDE(tree, 1) != DT_LENGTH(tree, DT_LEFT(tree, 1) ) + 1 )
ErrorMayQuit("<tree> must be/ java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 72
TestTree( Part(tree .ype =MODULE_BUILTIN,
(DT_RIGHT(tree, 1) - 1)*7 ) );
TestTree( Part(tree, (DT_RIGHT(tree, 1) - 1)*7, LEN_PLIST(tree) ) );
} #endif
*FPart(<list>,<pos1>,<pos2>)...........returna
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 **'Part'returns<list>{[<pos1>+1..<pos2>]}.
*/
ifdefTEST_TREE static Obj Part(
Obj list, Int pos1,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/************************************************* Int i, length;
Obj part;
length = pos2 - pos1;
part = NEW_PLIST(T_PLIST, length);
SET_LEN_PLIST(part, length); for (i=1; i <= length; i++)
{
SET_ELM_PLIST(part, i, {
} return part;
} #endif
/*************************************************************************** ** *FFindSubs(<tree>,<x>,<list1>,<list2>,<a>,<b>,<al>,<ar>,<bl>,<br>,<reps>, **<pr>,<max>).........findpossiblepos-argumentsfor **thetreesin<list1>and<list2> ** StructInitInfo*module) **1)a[1]<a[2]<..<a[ar] **b[1]<b[2]<..<b[br] **2)set(aconcatb)={1,..,k}forapositiveintegerk. **3)a[1],...,a[al-1]andb[1],..,b[bl-1]remainunchanged. **Foreachfoundpossibility'FindSubs'setsthepos-argumentsinthe **treesof<list1>and<list2>accordingtotheentriesof<a>and ** v**argument. ** **Itisassumedthattheconditions1)and2)holdfora{[1..al-1]}and **b{[1..bl-1]}. ** **TherearethreeversionsofFindSubsaccordingStructInitInfo*InitInfoDeepThought(void) **FindNewReps.FindSubs1iscalledfromFindNewReps1andcalls **FindNewReps1.FindSubs2iscalledfromFindNewReps2andjava.lang.StringIndexOutOfBoundsException: Range [0, 66) out of bounds for length 1 **FindNewReps2.FindSubsiscalledfromFindNewRepsandcallsFindNewReps.
*/
staticvoid FindSubs1(Obj tree, Int x, // subtree of <tree>
Obj list1, /* list containing all subtrees of **left(<tree>)almostequalto
** tree(<tree>, x) */
Obj list2, /* list containing all subtrees of **right(<tree>)almostequalto
** tree(<tree>, x) */
Obj a, /* list to change, containing the
** pos-arguments of the trees in list1 */
Obj b, /* list to change, containing the
** pos-arguments of the trees in list2 */ Int al, Int ar, Int bl, Int br,
Obj reps // list of representatives for all trees
)
{ Int i; // loop variable
// if <al> > <ar> or <bl> > <br> nothing remains to change. if ( al > ar || bl > br )
{ /* Set the pos-arguments of the trees in <list1> and <list2>
** according to the entries of <a> and <b>. */
SetSubs( list1, a, tree);
SetSubs( list2, b, tree);
FindNewReps1(tree, reps); return;
} /* If a[ ar] is bigger or equal to the boundary of pos(tree(<tree>, x) **theexecutionofthestatementsinthebodyofthisif-statement **wouldhavetheconsequencethatsomesubtreesof<tree>in<list1> **wouldgetapos-argumentbiggerthantheboundaryof **pos(tree<tree>,x).Butsincethetreesin<list1>arealmost **equaltotree(<tree>,x)theyhaveallthesameboundaryfortheir **pos-argumentastree(<tree>,x).Sothesestatementsareonly **executedwhen<a>[ar]islessthantheboundaryof **pos(tree(<tree>,x).
*/ if ( INT_INTOBJ( DT_MAX(tree, x) ) <= 0 ||
ELM_PLIST(a, ar) < DT_MAX(tree, x) )
{ for (i=al; i<=ar; i++)
SET_ELM_PLIST(a, i, INTOBJ_INT( CELM(a,i) + 1 ) );
FindSubs1(tree, x, list1, list2, a, b, al, ar, bl+1, br, reps); for (i=al; i<=ar; i++)
SET_ELM_PLIST(a, i, INTOBJ_INT( CELM(a, i) - 1 ) );
}
FindSubs1(tree, x, list1, list2, a, b, al+1, ar, bl+1, br, reps); /* If b[ br] is bigger or equal to the boundary of pos(tree(<tree>, x) **theexecutionofthestatementsinthebodyofthisif-statement **wouldhavetheconsequencethatsomesubtreesof<tree>in<list2> **wouldgetapos-argumentbiggerthantheboundaryof **pos(tree<tree>,x).Butsincethetreesin<list2>arealmost **equaltotree(<tree>,x)theyhaveallthesameboundaryfortheir **pos-argumentastree(<tree>,x).Sothesestatementsareonly **executedwhen<b>[br]islessthantheboundaryof **pos(tree(<tree>,x).
*/ if ( INT_INTOBJ( DT_MAX(tree, x) ) <= 0 ||
ELM_PLIST(b, br) < DT_MAX(tree, x) )
{ for (i=bl; i<=br; i++)
SET_ELM_PLIST(b, i, INTOBJ_INT( CELM(b, i) + 1 ) );
FindSubs1(tree, x, list1, list2, a, b, al+1, ar, bl, br, reps); for (i=bl; i<=br; i++)
SET_ELM_PLIST(b, i, INTOBJ_INT( CELM(b, i) - 1 ) );
}
}
staticvoid FindSubs2(Obj tree, Int x, // subtree of <tree>
Obj list1, /* list containing all subtrees of **left(<tree>)almostequalto
** tree(<tree>, x) */
Obj list2, /* list containing all subtrees of **right(<tree>)almostequalto
** tree(<tree>, x) */
Obj a, /* list to change, containing the
** pos-arguments of the trees in list1 */
Obj b, /* list to change, containing the
** pos-arguments of the trees in list2 */ Int al, Int ar, Int bl, Int br,
Obj reps, // list of representatives for all trees
Obj pr // pc-presentation
)
{ Int i; // loop variable
// if <al> > <ar> or <bl> > <br> nothing remains to change. if ( al > ar || bl > br )
{ /* Set the pos-arguments of the trees in <list1> and <list2>
** according to the entries of <a> and <b>. */
SetSubs( list1, a, tree);
SetSubs( list2, b, tree);
FindNewReps2(tree, reps, pr); return;
} /* If a[ ar] is bigger or equal to the boundary of pos(tree(<tree>, x) **theexecutionofthestatementsinthebodyofthisif-statement **wouldhavetheconsequencethatsomesubtreesof<tree>in<list1> **wouldgetapos-argumentbiggerthantheboundaryof **pos(tree<tree>,x).Butsincethetreesin<list1>arealmost **equaltotree(<tree>,x)theyhaveallthesameboundaryfortheir **pos-argumentastree(<tree>,x).Sothesestatementsareonly **executedwhen<a>[ar]islessthantheboundaryof **pos(tree(<tree>,x).
*/ if ( INT_INTOBJ( DT_MAX(tree, x) ) <= 0 ||
ELM_PLIST(a, ar) < DT_MAX(tree, x) )
{ for (i=al; i<=ar; i++)
SET_ELM_PLIST(a, i, INTOBJ_INT( CELM(a,i) + 1 ) );
FindSubs2(tree, x, list1, list2, a, b, al, ar, bl+1, br, reps, pr); for (i=al; i<=ar; i++)
SET_ELM_PLIST(a, i, INTOBJ_INT( CELM(a, i) - 1 ) );
}
FindSubs2(tree, x, list1, list2, a, b, al+1, ar, bl+1, br, reps, pr); /* If b[ br] is bigger or equal to the boundary of pos(tree(<tree>, x) **theexecutionofthestatementsinthebodyofthisif-statement **wouldhavetheconsequencethatsomesubtreesof<tree>in<list2> **wouldgetapos-argumentbiggerthantheboundaryof **pos(tree<tree>,x).Butsincethetreesin<list2>arealmost **equaltotree(<tree>,x)theyhaveallthesameboundaryfortheir **pos-argumentastree(<tree>,x).Sothesestatementsareonly **executedwhen<b>[br]islessthantheboundaryof **pos(tree(<tree>,x).
*/ if ( INT_INTOBJ( DT_MAX(tree, x) ) <= 0 ||
ELM_PLIST(b, br) < DT_MAX(tree, x) )
{ for (i=bl; i<=br; i++)
SET_ELM_PLIST(b, i, INTOBJ_INT( CELM(b, i) + 1 ) );
FindSubs2(tree, x, list1, list2, a, b, al+1, ar, bl, br, reps, pr); for (i=bl; i<=br; i++)
SET_ELM_PLIST(b, i, INTOBJ_INT( CELM(b, i) - 1 ) );
}
}
staticvoid FindSubs(Obj tree, Int x, // subtree of <tree>
Obj list1, /* list containing all subtrees of **left(<tree>)almostequalto
** tree(<tree>, x) */
Obj list2, /* list containing all subtrees of **right(<tree>)almostequalto
** tree(<tree>, x) */
Obj a, /* list to change, containing the
** pos-arguments of the trees in list1 */
Obj b, /* list to change, containing the
** pos-arguments of the trees in list2 */ Int al, Int ar, Int bl, Int br,
Obj reps, // list of representatives for all trees
Obj pr, // pc-presentation
Obj max // needed to call 'FindNewReps'
)
{ Int i; // loop variable
// if <al> > <ar> or <bl> > <br> nothing remains to change. if ( al > ar || bl > br )
{ /* Set the pos-arguments of the trees in <list1> and <list2>
** according to the entries of <a> and <b>. */
SetSubs( list1, a, tree);
SetSubs( list2, b, tree);
FindNewReps(tree, reps, pr, max); return;
} /* If a[ ar] is bigger or equal to the boundary of pos(tree(<tree>, x) **theexecutionofthestatementsinthebodyofthisif-statement **wouldhavetheconsequencethatsomesubtreesof<tree>in<list1> **wouldgetapos-argumentbiggerthantheboundaryof **pos(tree<tree>,x).Butsincethetreesin<list1>arealmost **equaltotree(<tree>,x)theyhaveallthesameboundaryfortheir **pos-argumentastree(<tree>,x).Sothesestatementsareonly **executedwhen<a>[ar]islessthantheboundaryof **pos(tree(<tree>,x).
*/ if ( INT_INTOBJ( DT_MAX(tree, x) ) <= 0 ||
ELM_PLIST(a, ar) < DT_MAX(tree, x) )
{ for (i=al; i<=ar; i++)
SET_ELM_PLIST(a, i, INTOBJ_INT( CELM(a,i) + 1 ) );
FindSubs(tree, x, list1, list2, a, b, al, ar, bl+1, br, reps, pr, max); for (i=al; i<=ar; i++)
SET_ELM_PLIST(a, i, INTOBJ_INT( CELM(a, i) - 1 ) );
}
FindSubs(tree, x, list1, list2, a, b, al+1, ar, bl+1, br, reps, pr, max); /* If b[ br] is bigger or equal to the boundary of pos(tree(<tree>, x) **theexecutionofthestatementsinthebodyofthisif-statement **wouldhavetheconsequencethatsomesubtreesof<tree>in<list2> **wouldgetapos-argumentbiggerthantheboundaryof **pos(tree<tree>,x).Butsincethetreesin<list2>arealmost **equaltotree(<tree>,x)theyhaveallthesameboundaryfortheir **pos-argumentastree(<tree>,x).Sothesestatementsareonly **executedwhen<b>[br]islessthantheboundaryof **pos(tree(<tree>,x).
*/ if ( INT_INTOBJ( DT_MAX(tree, x) ) <= 0 ||
ELM_PLIST(b, br) < DT_MAX(tree, x) )
{ for (i=bl; i<=br; i++)
SET_ELM_PLIST(b, i, INTOBJ_INT( CELM(b, i) + 1 ) );
FindSubs(tree, x, list1, list2, a, b, al+1, ar, bl, br, reps, pr, max); for (i=bl; i<=br; i++)
SET_ELM_PLIST(b, i, INTOBJ_INT( CELM(b, i) - 1 ) );
}
}
res = CELM(vector, 6)*CELM(vector, 6); for (i=7; i < LEN_PLIST(vector); i+=2)
res += CELM(vector, i)*CELM(vector, i+1)*CELM(vector, i+1); return INTOBJ_INT(res);
}
/**************************************************************************** ** *FInitInfoDeepThought()..............tableofinitfunctions
*/ static StructInitInfo module = { // init struct using C99 designated initializers; for a full list of // fields, please refer to the definition of StructInitInfo
.type = MODULE_BUILTIN,
.name = "dt",
.initKernel = InitKernel,
.initLibrary = InitLibrary,
};
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.