rep.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 

class REP_OP

class REP_OP is const noOp, startOp, endOp, setR,setRC,setF,setFY,setY,setFn,setYn, checkY,checkR,checkRC,checkT,checkEq2, testSt; -- for function -- noOp, startOp, endOp -- GenMax+compo : setR,setRC,setF,setFY,setY,setFn,setYn, -- checkY, -- Relator.size : checkR,checkRC -- -- checkT,checkEq2,testSt; -- command sequence to set rep. attr func:INT; -- function attr num:INT; attr word:ARRAY{INT}; create:SAME is res:SAME:=new; res.func:=noOp; res.num:=0; res.word:=#; return res; end; end;

class REP

class REP is -- search representation G(k)---> S(Jn) -- Kouji Kodama -- 1998/04/22 K.Kodama -- Covering Distribution of Yang diagram --1997/1 kdm --un-oriented band support -- --1996/10 kdm --LINUX version -- --93/12/31 02:37:04 kdm --bug fix of checkEq. It failed to check on link. --Change InitConj. -- --93/12/30 03:19:52 kdm --Improve checking conjugate rep. --checkEqG: When set up first 2 generators, -- check if it admit representation. -- --generating all 5-fold coverings with 80386/12MHz --knot:k10c121 --old 26sec --new 8sec -- --knot:q101a1 --old 33sec --new 14sec -- --knot:q111a1 --old 33sec --new 13sec -- -- --1990/1 RepM Manual set. --1989/9 Theta curve support --1989/8 Rep Auto search. Modula2 version --1983 --Manual set. Basic version
shared checkTra:ARRAY{INT}; -- [1..REPmaxC] -- list of gen. to check if the rep. is transitive. -- List it in the order of used by setF,setY. -- Be careful about the order, -- because it is used to update representation table. shared rep_tbl:REP_TABLE; shared rep_tbl2:REP_TABLE; shared stack:REP_STACK; shared base:INT; --area for generators shared yangPtr:INT; -- area for Yang diagrams shared longPtr:INT; -- area for longitudes shared merPtr:INT; -- area for meridian shared orbitpPtr:INT; -- area for compo~.number shared orbitmPtr:INT; -- area for br.index shared windLon:INT; --winding of longitude~ shared Rback:INT; -- area for equivalence check of rep. shared Work:INT; shared WorkTop,Bottom:INT; shared setG:ARRAY{REP_OP}; -- [0..2*REPmaxC] shared Dir:BOOL; shared sPtr:INT; shared RepCount:INT; -- #of finded representation shared YangList:ARRAY{INT}; -- for covering distribution_(yang)
shared Relator:ARRAY{WORD}; shared gen2compo:ARRAY{INT}; shared GenMax:INT; -- gen. number --> condition of the gen. shared sg_set:ARRAY{BOOL}; shared sg_compo:ARRAY{INT}; shared sg_freq :ARRAY{INT}; shared sr:ARRAY{BOOL}; -- rel. number-->true if used shared sl:ARRAY{INT}; -- compo--> non-zero if settled. shared g0,g1,g3:INT; shared set0,set1,set3:BOOL; shared freq0,freq1,freq3:INT; -------------- test routines ------------ SwLog is if LOGOUT::enabled then LOGOUT::End; else LOGOUT::Begin; end; end; WriteRepLog(TCode:TCODE,eff:BOOL) is -- if true then write the result, -- else write the state of manual set. maxG::=TCode.number_gen; --tStart:=0; --loop -- if TCode[tStart].gen>maxG then maxG:=TCode[tStart].gen; end; -- tStart:=tStart+1; -- until! (VERTEXC::ts.in(TCode[tStart].sep) -- or VERTEXC::endc.in(TCode[tStart].sep)); --end; LOGOUT::Title("Rep.",RepCount.str); #LOGOUT+"Representation: G(K)-->S(" +stack.Jn.str+")\n"; loop i::=1.upto!(maxG); if ~ eff then if setG[i].func=REP_OP::setF then #OUT+"*"; else #OUT+" "; end; end; #LOGOUT+WORD::gstr(i,0); if (sg_set[i]) then #LOGOUT+"-->"; stack.Fetch(i); stack.WriteStackLog; else #OUT+" is not defined."; end; #LOGOUT+"\n"; end; end; WriteRep(TCode:TCODE, eff:BOOL) is if LOGOUT::enabled then LOGOUT::End; WriteRepLog(TCode,eff); LOGOUT::Begin; else WriteRepLog(TCode,eff); end; end; printD_gen(i:INT, str:STR) is #OUT+str+", x"+setG[i].num.str; end; printD_compo(str:STR, num:INT) is #OUT+str+", compo"+(num-yangPtr).str; end; printD_F(i:INT) is #OUT+i.str+" func: "; case setG[i].func when REP_OP::testSt then #OUT+"testSt"; when REP_OP::startOp then #OUT+"start"; when REP_OP::endOp then #OUT+"end"; when REP_OP::noOp then #OUT+"no"; when REP_OP::checkR then #OUT+"checkR, r"+setG[i].num.str; when REP_OP::checkRC then #OUT+"checkRC, r"+setG[i].num.str; when REP_OP::checkY then printD_compo("checkY",setG[i].num); when REP_OP::checkT then #OUT+"checkT"; when REP_OP::setR then printD_gen(i,"setR"); when REP_OP::setRC then printD_gen(i,"setRC"); when REP_OP::setFY then printD_gen(i,"setFY"); when REP_OP::setY then printD_compo("setY",setG[i].num); when REP_OP::setFn then printD_gen(i,"setFn"); when REP_OP::setYn then printD_compo("setYn",setG[i].num); when REP_OP::setF then printD_gen(i,"setF"); printD_compo(" with",setG[i].word[0]); else #OUT+"un-defined func!"; end; end; printD_G is f:INT; -- function #OUT+"\n"+"setG[*]\n"; gn:INT:=0; loop i::=setG.ind!; f:=setG[i].func; if (f=REP_OP::setFY)or(f=REP_OP::setF)or(f=REP_OP::setFn) then gn:=gn+1; end; printD_F(i); i:=i+1; #OUT+"\n"; end; #OUT+"#Gen.="+gn.str+"\n"; #OUT+(#IN.get_str); end; T1 is #OUT+"sPtr,setG,Dir,stack:"+ sPtr.str+" "; printD_F(sPtr); if Dir then #OUT+" Dir,"; else #OUT+" -Dir,"; end; #OUT+(stack.pt-stack.bottom).str+"\n"; end; InitVar(TCode:TCODE) is RepCount:=0; GenMax:=TCode.number_gen; setG:=#; --setG:=#(GenMax+Relator.size+7); --loop i::=setG.ind!; setG[i]:=#; end; sr:=#(Relator.size); loop i::=sr.ind!; sr[i]:=false; end; sg_set:=#(GenMax+1); sg_freq:=#(GenMax+1); sl:=#(GenMax+1); loop i::=sl.ind!; sg_set[i]:=false; sg_freq[i]:=0; sl[i]:=0; end; loop i::=Relator.ind!; sg_freq[Relator[i][0]]:=sg_freq[Relator[i][0]]+1; end; sg_compo:=#(GenMax+1); loop i::=0.upto!(TCode.length-1); sg_compo[TCode[i].gen]:=TCode[i].compo; end; checkTra:=#; rep_tbl:=#; rep_tbl2:=#; YangList:=#; base:=1; --area for generators yangPtr:=base+GenMax+1; -- area for Yang diagrams longPtr:=yangPtr+GenMax+1; -- area for longitudes merPtr:=longPtr+GenMax+1; -- area for meridian orbitpPtr:=merPtr+GenMax+1; -- area for compo~.number orbitmPtr:=orbitpPtr+GenMax+1; -- area for br.index windLon:=orbitmPtr+GenMax+1; --winding of longitude~ Rback:=windLon+GenMax+1; -- area for equivalence check of rep. Work:=Rback+GenMax+1; WorkTop:=Work+2; loop WorkTop.times!; stack.Pu; end; Bottom:=stack.pt; -- Bottom..Top: area for stack stack.bottom:=Bottom; stack.Unit; stack.Fetch(0); end; --------------------init--------------- setRelG(rn:INT) is -- Assume the relation be the form of -- crossing: (a b a~ c~) or -- theta: (a b c~) or -- un-ori.band: a b g0:=Relator[rn][0]; g1:=Relator[rn][1]; if Relator[rn].w.has_ind(3) then g3:=-Relator[rn][3]; -- crossing elsif Relator[rn].w.has_ind(2) then g3:=-Relator[rn][2]; -- Theta else g3:=g0; -- un-ori. band end; set0:=sg_set[g0]; set1:=sg_set[g1]; set3:=sg_set[g3]; freq0:=sg_freq[g0]; freq1:=sg_freq[g1]; freq3:=sg_freq[g3]; end; Hom is loop rn::=Relator.ind!; setRelG(rn); if (~ sr[rn]) and set0 and set1 and set3 then sr[rn]:=true; sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); --WITH setG[sPtr] ; if Relator[rn].w.has_ind(3) then setG[sPtr].func:=REP_OP::checkRC; -- crossing elsif Relator[rn].w.has_ind(2) then setG[sPtr].func:=REP_OP::checkR; --Theta else setG[sPtr].func:=REP_OP::checkR; -- un-ori. band end; setG[sPtr].num:=rn; setG[sPtr].word:=Relator[rn].w.copy; -- loop i::=0.upto!(3); word[i]:=Relator[rn].r[i]; end; --end; -- INC(sPtr); setG[sPtr].func:=testSt; end; end; --- test sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::testSt; -- end; SetYang(g:INT) is l:INT; sg_set[g]:=true; l:=sg_compo[g]; checkTra:=checkTra.append(|g|); sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].num:=g; if sl[l]>0 then setG[sPtr].func:=REP_OP::setF; setG[sPtr].word:=|l+yangPtr|; sl[l]:=sl[l]+1; -- INC(sPtr); setG[sPtr].func:=checkY; setG[sPtr].num:=l; elsif sPtr=1 then setG[sPtr].func:=REP_OP::setFY; sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::setY; setG[sPtr].num:=l+yangPtr; sl[l]:=1; YangList:=YangList.append(|l+yangPtr|); else setG[sPtr].num:=0; setG[sPtr].func:=REP_OP::setFY; sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::setY; setG[sPtr].num:=l+yangPtr; sl[l]:=1; sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].num:=g; setG[sPtr].func:=REP_OP::setF; setG[sPtr].word:=|l+yangPtr|; YangList:=YangList.append(|l+yangPtr|); -- setG[sPtr].func:=setFn; -- sPtr:=sPtr+1; -- setG[sPtr].func:=setYn; setG[sPtr].num:=l+yangPtr; -- sl[l]:=1; end; --- test sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::testSt; -- end; FsNewG(inout g,inout cn, g1, cn1:INT) is cn1:=cn1+sl[sg_compo[g1]]; if (cn1>cn)or((cn1=cn)and(g1<g)) then g:=g1; cn:=cn1; end; end; Fs1(inout g,inout cn:INT):BOOL is --set g g:=GenMax+1; cn:=0; loop rn::=Relator.ind!; setRelG(rn); if (~ set0) and set1 and set3 then FsNewG(inout g,inout cn,g0,freq0); end; end; return (g<=GenMax); end; Fs2(inout g,inout cn:INT):BOOL is -- set g g:=GenMax+1; cn:=0; loop rn::=Relator.ind!; setRelG(rn); if (~set0)and(~set1)and(set3) then -- Fs2 FsNewG(inout g,inout cn,g0,freq0+freq1); elsif (~set0)and(set1)and(~set3) then --Fs2c FsNewG(inout g,inout cn,g0,freq0+freq3); elsif (set0)and(~set1)and(~set3) then -- Fs3,Fs3c FsNewG(inout g,inout cn,g3,freq1+freq3); FsNewG(inout g,inout cn,g1,freq1+freq3); end; end; return (g<=GenMax); end; Fs4(inout g,inout cn:INT):BOOL is -- set g g:=GenMax+1; cn:=0; loop rn::=Relator.ind!; setRelG(rn); if ~(set0 or set1 or set3) then FsNewG(inout g,inout cn,g0,freq0); end; end; return (g<=GenMax); end; Fs5(inout g,inout cn:INT):BOOL is -- set g g:=1; loop while!((g<=GenMax) and (sg_set[g])); g:=g+1; end; return (g<=GenMax); end; Free is g:INT; cn:INT; if Fs1(inout g,inout cn) or Fs2(inout g,inout cn) or Fs4(inout g,inout cn) or Fs5(inout g,inout cn) then SetYang(g); -- and setG[sPtr].func:=setF/setFY Hom; end; end; RelSr(inout rn:INT, gc:INT, p0,p1,p2:INT) is -- gc:= p0 p1 p2 sr[rn]:=true; sg_set[ gc ]:=true; sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); --WITH setG[sPtr] ; if p2/=0 then setG[sPtr].func:=REP_OP::setRC; setG[sPtr].word:=|p0,p1,p2|; elsif p1/=0 then setG[sPtr].func:=REP_OP::setR; -- Theta setG[sPtr].word:=|p0,p1|; else setG[sPtr].func:=REP_OP::setR; -- un-ori. band setG[sPtr].word:=|p0|; end; setG[sPtr].num:=gc; --- test sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::testSt; -- --end; Hom; rn:=0; end; Rel is rn:INT:=0; loop while!(rn<Relator.size); setRelG(rn); if Relator[rn].w.has_ind(3) then if set0 and (~ set1) and set3 then RelSr(inout rn,g1,-g0,g3,g0); elsif set0 and set1 and (~ set3) then RelSr(inout rn,g3,g0,g1,-g0); else rn:=rn+1; end; elsif Relator[rn].w.has_ind(2) then -- Theta if ~(set0) and set1 and set3 then RelSr(inout rn,g0,g3,-g1,0); elsif set0 and ~(set1) and set3 then RelSr(inout rn,g1,-g0,g3,0); elsif set0 and set1 and ~(set3) then RelSr(inout rn,g3,g0,g1,0); else rn:=rn+1; end; else -- un-ori. band if ~(set0) and set1 then RelSr(inout rn,g0,-g1,0,0); elsif set0 and ~(set1) then RelSr(inout rn,g1,-g0,0,0); else rn:=rn+1; end; end; end; end; Tra is -- check transitive g:INT:=1; -- Check if all generators is arleady setup. loop while!( (g<=GenMax) and sg_set[g]); g:=g+1; end; if g>GenMax then sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::checkT; setG[sPtr].num:=checkTra.size; --- test sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::testSt; -- sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::endOp; setG[sPtr].num:=0; elsif checkTra.size=2 then sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::checkEq2; setG[sPtr].num:=checkTra.size; if setG[2].func/=REP_OP::setY then raise "setY needed in setG[2].func.\n"; end; --- test sPtr:=sPtr+1; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::testSt; -- When first 2 geberators is steup, -- check if they admit new representation in the sense of conjugate. end; end; InitSet(TCode:TCODE) is InitVar(TCode); sPtr:=0; setG:=setG.append(|#REP_OP|); setG[sPtr].func:=REP_OP::startOp; setG[sPtr].num:=0; loop while!(setG[sPtr].func /= REP_OP::endOp) ; Free; -- free set & Yang,hom Rel; -- set with relation & hom Tra; -- transitive & end end; -- printD_G; Dir:=true; sPtr:=1; end; ----------------Set Rep------------------------ checkStack is T1; --wait; WriteLn; --return; if Dir or (setG[sPtr].func=REP_OP::setF)or (setG[sPtr].func=REP_OP::setFY)or (setG[sPtr].func=REP_OP::setFn)or (setG[sPtr].func=REP_OP::startOp) then printD_F(sPtr); end; if setG[sPtr].func=REP_OP::testSt then if setG[sPtr].num=0 then setG[sPtr].num:=stack.pt; elsif setG[sPtr].num/=stack.pt then printD_G; #OUT+"error on Group stack sPtr:"+sPtr.str +" pt0:"+setG[sPtr].num.str +" pt:"+stack.pt.str; if Dir then #OUT+" Dir"; else #OUT+" -Dir"; end; #OUT+"\n"; raise ""; end; end; end; SetRep is flg:BOOL; loop -- checkStack; if Dir then case setG[sPtr].func when REP_OP::setRC then stack.Conjugate(setG[sPtr].word[1],setG[sPtr].word[0]); stack.Store(setG[sPtr].num); sPtr:=sPtr+1; -- set "num"-th generator from birtinger relation. when REP_OP::setR then stack.CMul(setG[sPtr].word); stack.Store(setG[sPtr].num); sPtr:=sPtr+1; when REP_OP::setF then stack.InitGenY(setG[sPtr].word[0]); stack.Store(setG[sPtr].num); stack.Pu; sPtr:=sPtr+1; -- Second generator or afterward of each component are -- generated according to Yang-diagram from 1st generator. when REP_OP::checkRC then -- Check relation word of Wirtinger-type. -- Use for crossing relation. stack.Conjugate(-setG[sPtr].word[3],-setG[sPtr].word[0]); stack.Fetch(setG[sPtr].word[1]); if stack.Eq then sPtr:=sPtr+1; else Dir:=false; sPtr:=sPtr-1; end; when REP_OP::checkR then -- Check relation word in generic form. --Use for vertex relation of Theta curve. stack.CMul(setG[sPtr].word); if stack.Eq1 then sPtr:=sPtr+1; else Dir:=false; sPtr:=sPtr-1; end; when REP_OP::checkEq2 then -- For 1st or 2nd generator, -- check if they admit new representation. -- Use checkEqG whem num=2. if rep_tbl2.checkEqTbl(inout stack, checkTra, setG[sPtr].num,setG[2].num) then sPtr:=sPtr+1; else Dir:=false; sPtr:=sPtr-1; end; when REP_OP::checkT then --Check if representation is transitive --checkTra[] is a table of generators loop i::=checkTra.ind!; stack.Fetch(checkTra[i]); end; stack.OrbitC(setG[sPtr].num); Dir:=(stack.st[stack.pt][0]=1); stack.Pd; if (Dir and rep_tbl.checkEqTbl(inout stack,checkTra, setG[sPtr].num,setG[2].num)) then sPtr:=sPtr+1; Dir:=true; -- Check if the representation is new. else sPtr:=sPtr-1; Dir:=false; end; when REP_OP::setFn then stack.InitGen; flg:=stack.Gen; stack.Store(setG[sPtr].num); stack.Pu; sPtr:=sPtr+1; when REP_OP::setYn then stack.Yang; stack.Store(setG[sPtr].num); sPtr:=sPtr+1; rep_tbl:=#; rep_tbl2:=#; -- For first generator on components of -- 2-ndary or afterword, freely generate and -- register the Yang-diagram to table of component number. when REP_OP::setFY then -- The FIRST generator. -- Generate Yang diagram and an element. stack.InitYang; -- This can be deleted. -- if TCode[TLength].comp=1 then flg:= GenYang; end; if stack.GenYang then end; -- pass by trivial element stack.Store(setG[sPtr].num); stack.Pu; sPtr:=sPtr+1; when REP_OP::setY then stack.Over; stack.Store(setG[sPtr].num); sPtr:=sPtr+1; rep_tbl:=#; rep_tbl2:=#; -- Yang diagram is correspond to conjugacy class of S(n) -- by 1-to-1. And is the same on a link component. --For each component, register Yang diagram. --Use "setY" and "setFY" as a pair. when REP_OP::endOp then break!; when REP_OP::startOp then sPtr:=sPtr+1; else sPtr:=sPtr+1; end; else; case setG[sPtr].func when REP_OP::setF then if stack.GenY then stack.Store(setG[sPtr].num); stack.Pu; sPtr:=sPtr+1; Dir:=true; else sPtr:=sPtr-1; end; when REP_OP::setFY then if stack.GenYang then stack.Store(setG[sPtr].num); stack.Pu; sPtr:=sPtr+1; Dir:=true; else sPtr:=sPtr-1; end; when REP_OP::setFn then if stack.Gen then stack.Store(setG[sPtr].num); stack.Pu; sPtr:=sPtr+1; Dir:=true; else sPtr:=sPtr-1; end; when REP_OP::startOp then break!; else sPtr:=sPtr-1; end; end; end; end; -------------------Rep Auto main----------------------- shared cdYang:COVERING_DIST_YANG; shared cdBranch:COVERING_DIST_BR; shared cdLink:COVERING_DIST_LK; shared cdH1Br:COVERING_DIST_H1; shared cdH1Unbr:COVERING_DIST_H1; NextRep(TCode:TCODE, h1B,h1U,hT,brI,cvL, cdY,cdBr,cdLk,cdH1B,cdH1U:BOOL):BOOL is -- true if search next,false if exit "rep" WriteRepLog(TCode, true); if brI then COVERING_LINKAGE::BrIndex(TCode); end; if cvL then COVERING_LINKAGE::CoveringLinkage(TCode); end; if h1B then HOMOLOGY::H1Cov(TCode,true, cdH1B); end; if h1U then HOMOLOGY::H1Cov(TCode,false,cdH1U); end; if hT then HOMOTOPY::CovHomotopy(TCode); end; if cdY then cdYang.IncCDYang; end; LOGOUT::flush; return true; end; RepSearch(TCode:TCODE, n, form,branchind,covlk,h1b,h1u,fndgr, covDistY,covDistBr,covDistLk,covDistH1B,covDistH1U:INT) pre (2<=n)and(1<=form)and(form<=2) is #OUT+"branchind="+branchind.str +" covlk="+covlk.str+"\n"; h1B,h1U,hT,brI,cvL, cdY,cdBr,cdLk,cdH1B,cdH1U:BOOL; KNOT_GROUP::get_Relator(TCode,out Relator,out gen2compo); cdY:=(covDistY/=0); cdBr:=(covDistBr/=0); cdLk:=(covDistLk/=0); cdH1B:=(covDistH1B/=0); cdH1U:=(covDistH1U/=0); cvL:=(covlk/=0)or(cdLk); brI:=((branchind/=0)or cdBr)and(~ cvL); h1B:=(h1b/=0)or(cdH1B); h1U:=(h1u/=0)or(cdH1U); hT:=(fndgr/=0); if TCode.number_gen>0 then -- Relator.size>1 then -- set & command option -- set stack stack:=#(n); stack.presentationType:=form; InitSet(TCode); RepCount:=0; cdYang:=#; cdBranch:=#; cdLink:=#; cdH1Br:=#; cdH1Unbr:=#; loop if Dir then #OUT+"Searching !\n"; end; SetRep; if ~ Dir then break!; end; -- Now, we find a new representation. Dir:=false; RepCount:=RepCount+1; if ~ NextRep(TCode, h1B,h1U,hT,brI,cvL, cdY,cdBr,cdLk,cdH1B,cdH1U) then break!; end; -- print our & call covering module end; if cdY then cdYang.WriteCDYangLog; end; if cdBr then cdBranch.WriteCDBranchindexLog; end; if cdLk then cdLink.WriteCDLinkingLog; end; if cdH1B then cdH1Br.WriteCDH1Log("b"); end; if cdH1U then cdH1Unbr.WriteCDH1Log("u"); end; cdYang:=#; cdBranch:=#; cdLink:=#; cdH1Br:=#; cdH1Unbr:=#; LOGOUT::flush; else #OUT+"Trivial\n"; end; end; end;