Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346#ifndef AVOID_PRECOMPILED1/* C file produced by GAC */2#include "src/compiled.h"34/* global variables used in handlers */5static GVar G_IS__FUNCTION;6static Obj GF_IS__FUNCTION;7static GVar G_ADD__LIST;8static Obj GF_ADD__LIST;9static GVar G_Error;10static Obj GF_Error;11static GVar G_IS__IDENTICAL__OBJ;12static Obj GF_IS__IDENTICAL__OBJ;13static GVar G_AND__FLAGS;14static Obj GF_AND__FLAGS;15static GVar G_HASH__FLAGS;16static Obj GF_HASH__FLAGS;17static GVar G_WITH__HIDDEN__IMPS__FLAGS;18static Obj GF_WITH__HIDDEN__IMPS__FLAGS;19static GVar G_IS__SUBSET__FLAGS;20static Obj GF_IS__SUBSET__FLAGS;21static GVar G_TRUES__FLAGS;22static Obj GF_TRUES__FLAGS;23static GVar G_FLAGS__FILTER;24static Obj GF_FLAGS__FILTER;25static GVar G_WITH__HIDDEN__IMPS__FLAGS__COUNT;26static GVar G_WITH__HIDDEN__IMPS__FLAGS__CACHE__MISS;27static GVar G_WITH__HIDDEN__IMPS__FLAGS__CACHE__HIT;28static GVar G_IMPLICATIONS;29static Obj GC_IMPLICATIONS;30static GVar G_WITH__IMPS__FLAGS__CACHE;31static Obj GC_WITH__IMPS__FLAGS__CACHE;32static GVar G_WITH__IMPS__FLAGS__COUNT;33static Obj GC_WITH__IMPS__FLAGS__COUNT;34static GVar G_WITH__IMPS__FLAGS__CACHE__HIT;35static Obj GC_WITH__IMPS__FLAGS__CACHE__HIT;36static GVar G_WITH__IMPS__FLAGS__CACHE__MISS;37static Obj GC_WITH__IMPS__FLAGS__CACHE__MISS;38static GVar G_CLEAR__IMP__CACHE;39static GVar G_BIND__GLOBAL;40static Obj GF_BIND__GLOBAL;41static GVar G_UNBIND__GLOBAL;42static Obj GF_UNBIND__GLOBAL;43static GVar G_RANK__FILTERS;44static Obj GC_RANK__FILTERS;45static GVar G_RankFilter;46static GVar G_RANK__FILTER;47static Obj GC_RANK__FILTER;48static Obj GF_RANK__FILTER;49static GVar G_RANK__FILTER__LIST__CURRENT;50static Obj GC_RANK__FILTER__LIST__CURRENT;51static GVar G_RANK__FILTER__LIST;52static Obj GC_RANK__FILTER__LIST;53static GVar G_RANK__FILTER__COUNT;54static Obj GC_RANK__FILTER__COUNT;5556/* record names used in handlers */5758/* information for the functions */59static Obj NameFunc[7];60static Obj NamsFunc[7];61static Int NargFunc[7];62static Obj DefaultName;63static Obj FileName;6465/* handler for function 2 */66static Obj HdlrFunc2 (67Obj self )68{69Obj t_1 = 0;70Bag oldFrame;71OLD_BRK_CURR_STAT7273/* allocate new stack frame */74SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);75REM_BRK_CURR_STAT();76SET_BRK_CURR_STAT(0);7778/* WITH_IMPS_FLAGS_CACHE := [ ]; */79t_1 = NEW_PLIST( T_PLIST, 0 );80SET_LEN_PLIST( t_1, 0 );81AssGVar( G_WITH__IMPS__FLAGS__CACHE, t_1 );8283/* return; */84RES_BRK_CURR_STAT();85SWITCH_TO_OLD_FRAME(oldFrame);86return 0;8788/* return; */89RES_BRK_CURR_STAT();90SWITCH_TO_OLD_FRAME(oldFrame);91return 0;92}9394/* handler for function 3 */95static Obj HdlrFunc3 (96Obj self,97Obj a_flags )98{99Obj l_with = 0;100Obj l_changed = 0;101Obj l_imp = 0;102Obj l_hash = 0;103Obj l_hash2 = 0;104Obj l_i = 0;105Obj t_1 = 0;106Obj t_2 = 0;107Obj t_3 = 0;108Obj t_4 = 0;109Obj t_5 = 0;110Obj t_6 = 0;111Obj t_7 = 0;112Obj t_8 = 0;113Obj t_9 = 0;114Obj t_10 = 0;115Obj t_11 = 0;116Bag oldFrame;117OLD_BRK_CURR_STAT118119/* allocate new stack frame */120SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);121REM_BRK_CURR_STAT();122SET_BRK_CURR_STAT(0);123124/* hash := HASH_FLAGS( flags ) mod 11001; */125t_3 = GF_HASH__FLAGS;126t_2 = CALL_1ARGS( t_3, a_flags );127CHECK_FUNC_RESULT( t_2 )128t_1 = MOD( t_2, INTOBJ_INT(11001) );129l_hash = t_1;130131/* for i in [ 0 .. 3 ] do */132for ( t_1 = INTOBJ_INT(0);133((Int)t_1) <= ((Int)INTOBJ_INT(3));134t_1 = (Obj)(((UInt)t_1)+4) ) {135l_i = t_1;136137/* hash2 := 2 * ((hash + 31 * i) mod 11001) + 1; */138C_PROD_INTOBJS( t_6, INTOBJ_INT(31), l_i )139C_SUM_FIA( t_5, l_hash, t_6 )140t_4 = MOD( t_5, INTOBJ_INT(11001) );141C_PROD_FIA( t_3, INTOBJ_INT(2), t_4 )142C_SUM_FIA( t_2, t_3, INTOBJ_INT(1) )143l_hash2 = t_2;144145/* if IsBound( WITH_IMPS_FLAGS_CACHE[hash2] ) then */146t_4 = GC_WITH__IMPS__FLAGS__CACHE;147CHECK_BOUND( t_4, "WITH_IMPS_FLAGS_CACHE" )148CHECK_INT_POS( l_hash2 )149t_3 = C_ISB_LIST( t_4, l_hash2 );150t_2 = (Obj)(UInt)(t_3 != False);151if ( t_2 ) {152153/* if IS_IDENTICAL_OBJ( WITH_IMPS_FLAGS_CACHE[hash2], flags ) then */154t_4 = GF_IS__IDENTICAL__OBJ;155t_6 = GC_WITH__IMPS__FLAGS__CACHE;156CHECK_BOUND( t_6, "WITH_IMPS_FLAGS_CACHE" )157C_ELM_LIST_FPL( t_5, t_6, l_hash2 )158t_3 = CALL_2ARGS( t_4, t_5, a_flags );159CHECK_FUNC_RESULT( t_3 )160CHECK_BOOL( t_3 )161t_2 = (Obj)(UInt)(t_3 != False);162if ( t_2 ) {163164/* WITH_IMPS_FLAGS_CACHE_HIT := WITH_IMPS_FLAGS_CACHE_HIT + 1; */165t_3 = GC_WITH__IMPS__FLAGS__CACHE__HIT;166CHECK_BOUND( t_3, "WITH_IMPS_FLAGS_CACHE_HIT" )167C_SUM_FIA( t_2, t_3, INTOBJ_INT(1) )168AssGVar( G_WITH__IMPS__FLAGS__CACHE__HIT, t_2 );169170/* return WITH_IMPS_FLAGS_CACHE[hash2 + 1]; */171t_3 = GC_WITH__IMPS__FLAGS__CACHE;172CHECK_BOUND( t_3, "WITH_IMPS_FLAGS_CACHE" )173C_SUM_FIA( t_4, l_hash2, INTOBJ_INT(1) )174CHECK_INT_POS( t_4 )175C_ELM_LIST_FPL( t_2, t_3, t_4 )176RES_BRK_CURR_STAT();177SWITCH_TO_OLD_FRAME(oldFrame);178return t_2;179180}181/* fi */182183}184185/* else */186else {187188/* break; */189break;190191}192/* fi */193194}195/* od */196197/* if i = 3 then */198t_1 = (Obj)(UInt)(((Int)l_i) == ((Int)INTOBJ_INT(3)));199if ( t_1 ) {200201/* WITH_IMPS_FLAGS_COUNT := (WITH_IMPS_FLAGS_COUNT + 1) mod 4; */202t_3 = GC_WITH__IMPS__FLAGS__COUNT;203CHECK_BOUND( t_3, "WITH_IMPS_FLAGS_COUNT" )204C_SUM_FIA( t_2, t_3, INTOBJ_INT(1) )205t_1 = MOD( t_2, INTOBJ_INT(4) );206AssGVar( G_WITH__IMPS__FLAGS__COUNT, t_1 );207208/* i := WITH_IMPS_FLAGS_COUNT; */209t_1 = GC_WITH__IMPS__FLAGS__COUNT;210CHECK_BOUND( t_1, "WITH_IMPS_FLAGS_COUNT" )211l_i = t_1;212213/* hash2 := 2 * ((hash + 31 * i) mod 11001) + 1; */214C_PROD_FIA( t_5, INTOBJ_INT(31), l_i )215C_SUM_FIA( t_4, l_hash, t_5 )216t_3 = MOD( t_4, INTOBJ_INT(11001) );217C_PROD_FIA( t_2, INTOBJ_INT(2), t_3 )218C_SUM_FIA( t_1, t_2, INTOBJ_INT(1) )219l_hash2 = t_1;220221}222/* fi */223224/* WITH_IMPS_FLAGS_CACHE_MISS := WITH_IMPS_FLAGS_CACHE_MISS + 1; */225t_2 = GC_WITH__IMPS__FLAGS__CACHE__MISS;226CHECK_BOUND( t_2, "WITH_IMPS_FLAGS_CACHE_MISS" )227C_SUM_FIA( t_1, t_2, INTOBJ_INT(1) )228AssGVar( G_WITH__IMPS__FLAGS__CACHE__MISS, t_1 );229230/* with := flags; */231l_with = a_flags;232233/* changed := true; */234t_1 = True;235l_changed = t_1;236237/* while changed od */238while ( 1 ) {239t_1 = (Obj)(UInt)(l_changed != False);240if ( ! t_1 ) break;241242/* changed := false; */243t_1 = False;244l_changed = t_1;245246/* for imp in IMPLICATIONS do */247t_4 = GC_IMPLICATIONS;248CHECK_BOUND( t_4, "IMPLICATIONS" )249if ( IS_SMALL_LIST(t_4) ) {250t_3 = (Obj)(UInt)1;251t_1 = INTOBJ_INT(1);252}253else {254t_3 = (Obj)(UInt)0;255t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );256}257while ( 1 ) {258if ( t_3 ) {259if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;260t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );261t_1 = (Obj)(((UInt)t_1)+4);262if ( t_2 == 0 ) continue;263}264else {265if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;266t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );267}268l_imp = t_2;269270/* if IS_SUBSET_FLAGS( with, imp[2] ) and not IS_SUBSET_FLAGS( with, imp[1] ) then */271t_8 = GF_IS__SUBSET__FLAGS;272C_ELM_LIST_FPL( t_9, l_imp, INTOBJ_INT(2) )273t_7 = CALL_2ARGS( t_8, l_with, t_9 );274CHECK_FUNC_RESULT( t_7 )275CHECK_BOOL( t_7 )276t_6 = (Obj)(UInt)(t_7 != False);277t_5 = t_6;278if ( t_5 ) {279t_10 = GF_IS__SUBSET__FLAGS;280C_ELM_LIST_FPL( t_11, l_imp, INTOBJ_INT(1) )281t_9 = CALL_2ARGS( t_10, l_with, t_11 );282CHECK_FUNC_RESULT( t_9 )283CHECK_BOOL( t_9 )284t_8 = (Obj)(UInt)(t_9 != False);285t_7 = (Obj)(UInt)( ! ((Int)t_8) );286t_5 = t_7;287}288if ( t_5 ) {289290/* with := AND_FLAGS( with, imp[1] ); */291t_6 = GF_AND__FLAGS;292C_ELM_LIST_FPL( t_7, l_imp, INTOBJ_INT(1) )293t_5 = CALL_2ARGS( t_6, l_with, t_7 );294CHECK_FUNC_RESULT( t_5 )295l_with = t_5;296297/* changed := true; */298t_5 = True;299l_changed = t_5;300301}302/* fi */303304}305/* od */306307}308/* od */309310/* WITH_IMPS_FLAGS_CACHE[hash2] := flags; */311t_1 = GC_WITH__IMPS__FLAGS__CACHE;312CHECK_BOUND( t_1, "WITH_IMPS_FLAGS_CACHE" )313CHECK_INT_POS( l_hash2 )314C_ASS_LIST_FPL( t_1, l_hash2, a_flags )315316/* WITH_IMPS_FLAGS_CACHE[hash2 + 1] := with; */317t_1 = GC_WITH__IMPS__FLAGS__CACHE;318CHECK_BOUND( t_1, "WITH_IMPS_FLAGS_CACHE" )319C_SUM_FIA( t_2, l_hash2, INTOBJ_INT(1) )320CHECK_INT_POS( t_2 )321C_ASS_LIST_FPL( t_1, t_2, l_with )322323/* return with; */324RES_BRK_CURR_STAT();325SWITCH_TO_OLD_FRAME(oldFrame);326return l_with;327328/* return; */329RES_BRK_CURR_STAT();330SWITCH_TO_OLD_FRAME(oldFrame);331return 0;332}333334/* handler for function 4 */335static Obj HdlrFunc4 (336Obj self,337Obj a_filter )338{339Obj l_rank = 0;340Obj l_flags = 0;341Obj l_i = 0;342Obj t_1 = 0;343Obj t_2 = 0;344Obj t_3 = 0;345Obj t_4 = 0;346Obj t_5 = 0;347Obj t_6 = 0;348Obj t_7 = 0;349Bag oldFrame;350OLD_BRK_CURR_STAT351352/* allocate new stack frame */353SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);354REM_BRK_CURR_STAT();355SET_BRK_CURR_STAT(0);356357/* rank := 0; */358l_rank = INTOBJ_INT(0);359360/* if IS_FUNCTION( filter ) then */361t_3 = GF_IS__FUNCTION;362t_2 = CALL_1ARGS( t_3, a_filter );363CHECK_FUNC_RESULT( t_2 )364CHECK_BOOL( t_2 )365t_1 = (Obj)(UInt)(t_2 != False);366if ( t_1 ) {367368/* flags := FLAGS_FILTER( filter ); */369t_2 = GF_FLAGS__FILTER;370t_1 = CALL_1ARGS( t_2, a_filter );371CHECK_FUNC_RESULT( t_1 )372l_flags = t_1;373374}375376/* else */377else {378379/* flags := filter; */380l_flags = a_filter;381382}383/* fi */384385/* for i in TRUES_FLAGS( WITH_HIDDEN_IMPS_FLAGS( flags ) ) do */386t_5 = GF_TRUES__FLAGS;387t_7 = GF_WITH__HIDDEN__IMPS__FLAGS;388t_6 = CALL_1ARGS( t_7, l_flags );389CHECK_FUNC_RESULT( t_6 )390t_4 = CALL_1ARGS( t_5, t_6 );391CHECK_FUNC_RESULT( t_4 )392if ( IS_SMALL_LIST(t_4) ) {393t_3 = (Obj)(UInt)1;394t_1 = INTOBJ_INT(1);395}396else {397t_3 = (Obj)(UInt)0;398t_1 = CALL_1ARGS( GF_ITERATOR, t_4 );399}400while ( 1 ) {401if ( t_3 ) {402if ( LEN_LIST(t_4) < INT_INTOBJ(t_1) ) break;403t_2 = ELMV0_LIST( t_4, INT_INTOBJ(t_1) );404t_1 = (Obj)(((UInt)t_1)+4);405if ( t_2 == 0 ) continue;406}407else {408if ( CALL_1ARGS( GF_IS_DONE_ITER, t_1 ) != False ) break;409t_2 = CALL_1ARGS( GF_NEXT_ITER, t_1 );410}411l_i = t_2;412413/* if IsBound( RANK_FILTERS[i] ) then */414t_7 = GC_RANK__FILTERS;415CHECK_BOUND( t_7, "RANK_FILTERS" )416CHECK_INT_POS( l_i )417t_6 = C_ISB_LIST( t_7, l_i );418t_5 = (Obj)(UInt)(t_6 != False);419if ( t_5 ) {420421/* rank := rank + RANK_FILTERS[i]; */422t_7 = GC_RANK__FILTERS;423CHECK_BOUND( t_7, "RANK_FILTERS" )424C_ELM_LIST_FPL( t_6, t_7, l_i )425C_SUM_FIA( t_5, l_rank, t_6 )426l_rank = t_5;427428}429430/* else */431else {432433/* rank := rank + 1; */434C_SUM_FIA( t_5, l_rank, INTOBJ_INT(1) )435l_rank = t_5;436437}438/* fi */439440}441/* od */442443/* return rank; */444RES_BRK_CURR_STAT();445SWITCH_TO_OLD_FRAME(oldFrame);446return l_rank;447448/* return; */449RES_BRK_CURR_STAT();450SWITCH_TO_OLD_FRAME(oldFrame);451return 0;452}453454/* handler for function 5 */455static Obj HdlrFunc5 (456Obj self,457Obj a_filter )458{459Obj l_hash = 0;460Obj l_rank = 0;461Obj l_flags = 0;462Obj t_1 = 0;463Obj t_2 = 0;464Obj t_3 = 0;465Bag oldFrame;466OLD_BRK_CURR_STAT467468/* allocate new stack frame */469SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);470REM_BRK_CURR_STAT();471SET_BRK_CURR_STAT(0);472473/* if IS_FUNCTION( filter ) then */474t_3 = GF_IS__FUNCTION;475t_2 = CALL_1ARGS( t_3, a_filter );476CHECK_FUNC_RESULT( t_2 )477CHECK_BOOL( t_2 )478t_1 = (Obj)(UInt)(t_2 != False);479if ( t_1 ) {480481/* flags := FLAGS_FILTER( filter ); */482t_2 = GF_FLAGS__FILTER;483t_1 = CALL_1ARGS( t_2, a_filter );484CHECK_FUNC_RESULT( t_1 )485l_flags = t_1;486487}488489/* else */490else {491492/* flags := filter; */493l_flags = a_filter;494495}496/* fi */497498/* hash := HASH_FLAGS( flags ); */499t_2 = GF_HASH__FLAGS;500t_1 = CALL_1ARGS( t_2, l_flags );501CHECK_FUNC_RESULT( t_1 )502l_hash = t_1;503504/* rank := RANK_FILTER( flags ); */505t_2 = GF_RANK__FILTER;506t_1 = CALL_1ARGS( t_2, l_flags );507CHECK_FUNC_RESULT( t_1 )508l_rank = t_1;509510/* ADD_LIST( RANK_FILTER_LIST_CURRENT, hash ); */511t_1 = GF_ADD__LIST;512t_2 = GC_RANK__FILTER__LIST__CURRENT;513CHECK_BOUND( t_2, "RANK_FILTER_LIST_CURRENT" )514CALL_2ARGS( t_1, t_2, l_hash );515516/* ADD_LIST( RANK_FILTER_LIST_CURRENT, rank ); */517t_1 = GF_ADD__LIST;518t_2 = GC_RANK__FILTER__LIST__CURRENT;519CHECK_BOUND( t_2, "RANK_FILTER_LIST_CURRENT" )520CALL_2ARGS( t_1, t_2, l_rank );521522/* return rank; */523RES_BRK_CURR_STAT();524SWITCH_TO_OLD_FRAME(oldFrame);525return l_rank;526527/* return; */528RES_BRK_CURR_STAT();529SWITCH_TO_OLD_FRAME(oldFrame);530return 0;531}532533/* handler for function 6 */534static Obj HdlrFunc6 (535Obj self,536Obj a_filter )537{538Obj l_hash = 0;539Obj l_flags = 0;540Obj t_1 = 0;541Obj t_2 = 0;542Obj t_3 = 0;543Obj t_4 = 0;544Bag oldFrame;545OLD_BRK_CURR_STAT546547/* allocate new stack frame */548SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);549REM_BRK_CURR_STAT();550SET_BRK_CURR_STAT(0);551552/* if IS_FUNCTION( filter ) then */553t_3 = GF_IS__FUNCTION;554t_2 = CALL_1ARGS( t_3, a_filter );555CHECK_FUNC_RESULT( t_2 )556CHECK_BOOL( t_2 )557t_1 = (Obj)(UInt)(t_2 != False);558if ( t_1 ) {559560/* flags := FLAGS_FILTER( filter ); */561t_2 = GF_FLAGS__FILTER;562t_1 = CALL_1ARGS( t_2, a_filter );563CHECK_FUNC_RESULT( t_1 )564l_flags = t_1;565566}567568/* else */569else {570571/* flags := filter; */572l_flags = a_filter;573574}575/* fi */576577/* hash := HASH_FLAGS( flags ); */578t_2 = GF_HASH__FLAGS;579t_1 = CALL_1ARGS( t_2, l_flags );580CHECK_FUNC_RESULT( t_1 )581l_hash = t_1;582583/* if hash <> RANK_FILTER_LIST[RANK_FILTER_COUNT] then */584t_3 = GC_RANK__FILTER__LIST;585CHECK_BOUND( t_3, "RANK_FILTER_LIST" )586t_4 = GC_RANK__FILTER__COUNT;587CHECK_BOUND( t_4, "RANK_FILTER_COUNT" )588CHECK_INT_POS( t_4 )589C_ELM_LIST_FPL( t_2, t_3, t_4 )590t_1 = (Obj)(UInt)( ! EQ( l_hash, t_2 ));591if ( t_1 ) {592593/* Error( "corrupted completion file" ); */594t_1 = GF_Error;595C_NEW_STRING( t_2, 25, "corrupted completion file" );596CALL_1ARGS( t_1, t_2 );597598}599/* fi */600601/* RANK_FILTER_COUNT := RANK_FILTER_COUNT + 2; */602t_2 = GC_RANK__FILTER__COUNT;603CHECK_BOUND( t_2, "RANK_FILTER_COUNT" )604C_SUM_FIA( t_1, t_2, INTOBJ_INT(2) )605AssGVar( G_RANK__FILTER__COUNT, t_1 );606607/* return RANK_FILTER_LIST[RANK_FILTER_COUNT - 1]; */608t_2 = GC_RANK__FILTER__LIST;609CHECK_BOUND( t_2, "RANK_FILTER_LIST" )610t_4 = GC_RANK__FILTER__COUNT;611CHECK_BOUND( t_4, "RANK_FILTER_COUNT" )612C_DIFF_FIA( t_3, t_4, INTOBJ_INT(1) )613CHECK_INT_POS( t_3 )614C_ELM_LIST_FPL( t_1, t_2, t_3 )615RES_BRK_CURR_STAT();616SWITCH_TO_OLD_FRAME(oldFrame);617return t_1;618619/* return; */620RES_BRK_CURR_STAT();621SWITCH_TO_OLD_FRAME(oldFrame);622return 0;623}624625/* handler for function 1 */626static Obj HdlrFunc1 (627Obj self )628{629Obj t_1 = 0;630Obj t_2 = 0;631Obj t_3 = 0;632Obj t_4 = 0;633Bag oldFrame;634OLD_BRK_CURR_STAT635636/* allocate new stack frame */637SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);638REM_BRK_CURR_STAT();639SET_BRK_CURR_STAT(0);640641/* WITH_HIDDEN_IMPS_FLAGS_COUNT := 0; */642AssGVar( G_WITH__HIDDEN__IMPS__FLAGS__COUNT, INTOBJ_INT(0) );643644/* WITH_HIDDEN_IMPS_FLAGS_CACHE_MISS := 0; */645AssGVar( G_WITH__HIDDEN__IMPS__FLAGS__CACHE__MISS, INTOBJ_INT(0) );646647/* WITH_HIDDEN_IMPS_FLAGS_CACHE_HIT := 0; */648AssGVar( G_WITH__HIDDEN__IMPS__FLAGS__CACHE__HIT, INTOBJ_INT(0) );649650/* IMPLICATIONS := [ ]; */651t_1 = NEW_PLIST( T_PLIST, 0 );652SET_LEN_PLIST( t_1, 0 );653AssGVar( G_IMPLICATIONS, t_1 );654655/* WITH_IMPS_FLAGS_CACHE := [ ]; */656t_1 = NEW_PLIST( T_PLIST, 0 );657SET_LEN_PLIST( t_1, 0 );658AssGVar( G_WITH__IMPS__FLAGS__CACHE, t_1 );659660/* WITH_IMPS_FLAGS_COUNT := 0; */661AssGVar( G_WITH__IMPS__FLAGS__COUNT, INTOBJ_INT(0) );662663/* WITH_IMPS_FLAGS_CACHE_HIT := 0; */664AssGVar( G_WITH__IMPS__FLAGS__CACHE__HIT, INTOBJ_INT(0) );665666/* WITH_IMPS_FLAGS_CACHE_MISS := 0; */667AssGVar( G_WITH__IMPS__FLAGS__CACHE__MISS, INTOBJ_INT(0) );668669/* Unbind( CLEAR_IMP_CACHE ); */670AssGVar( G_CLEAR__IMP__CACHE, 0 );671672/* BIND_GLOBAL( "CLEAR_IMP_CACHE", function ( )673WITH_IMPS_FLAGS_CACHE := [ ];674return;675end ); */676t_1 = GF_BIND__GLOBAL;677C_NEW_STRING( t_2, 15, "CLEAR_IMP_CACHE" );678t_3 = NewFunction( NameFunc[2], NargFunc[2], NamsFunc[2], HdlrFunc2 );679ENVI_FUNC( t_3 ) = TLS(CurrLVars);680t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );681STARTLINE_BODY(t_4) = INTOBJ_INT(39);682ENDLINE_BODY(t_4) = INTOBJ_INT(41);683FILENAME_BODY(t_4) = FileName;684BODY_FUNC(t_3) = t_4;685CHANGED_BAG( TLS(CurrLVars) );686CALL_2ARGS( t_1, t_2, t_3 );687688/* BIND_GLOBAL( "WITH_IMPS_FLAGS", function ( flags )689local with, changed, imp, hash, hash2, i;690hash := HASH_FLAGS( flags ) mod 11001;691for i in [ 0 .. 3 ] do692hash2 := 2 * ((hash + 31 * i) mod 11001) + 1;693if IsBound( WITH_IMPS_FLAGS_CACHE[hash2] ) then694if IS_IDENTICAL_OBJ( WITH_IMPS_FLAGS_CACHE[hash2], flags ) then695WITH_IMPS_FLAGS_CACHE_HIT := WITH_IMPS_FLAGS_CACHE_HIT + 1;696return WITH_IMPS_FLAGS_CACHE[hash2 + 1];697fi;698else699break;700fi;701od;702if i = 3 then703WITH_IMPS_FLAGS_COUNT := (WITH_IMPS_FLAGS_COUNT + 1) mod 4;704i := WITH_IMPS_FLAGS_COUNT;705hash2 := 2 * ((hash + 31 * i) mod 11001) + 1;706fi;707WITH_IMPS_FLAGS_CACHE_MISS := WITH_IMPS_FLAGS_CACHE_MISS + 1;708with := flags;709changed := true;710while changed do711changed := false;712for imp in IMPLICATIONS do713if IS_SUBSET_FLAGS( with, imp[2] ) and not IS_SUBSET_FLAGS( with, imp[1] ) then714with := AND_FLAGS( with, imp[1] );715changed := true;716fi;717od;718od;719WITH_IMPS_FLAGS_CACHE[hash2] := flags;720WITH_IMPS_FLAGS_CACHE[hash2 + 1] := with;721return with;722end ); */723t_1 = GF_BIND__GLOBAL;724C_NEW_STRING( t_2, 15, "WITH_IMPS_FLAGS" );725t_3 = NewFunction( NameFunc[3], NargFunc[3], NamsFunc[3], HdlrFunc3 );726ENVI_FUNC( t_3 ) = TLS(CurrLVars);727t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );728STARTLINE_BODY(t_4) = INTOBJ_INT(44);729ENDLINE_BODY(t_4) = INTOBJ_INT(83);730FILENAME_BODY(t_4) = FileName;731BODY_FUNC(t_3) = t_4;732CHANGED_BAG( TLS(CurrLVars) );733CALL_2ARGS( t_1, t_2, t_3 );734735/* UNBIND_GLOBAL( "RANK_FILTER" ); */736t_1 = GF_UNBIND__GLOBAL;737C_NEW_STRING( t_2, 11, "RANK_FILTER" );738CALL_1ARGS( t_1, t_2 );739740/* BIND_GLOBAL( "RANK_FILTER", function ( filter )741local rank, flags, i;742rank := 0;743if IS_FUNCTION( filter ) then744flags := FLAGS_FILTER( filter );745else746flags := filter;747fi;748for i in TRUES_FLAGS( WITH_HIDDEN_IMPS_FLAGS( flags ) ) do749if IsBound( RANK_FILTERS[i] ) then750rank := rank + RANK_FILTERS[i];751else752rank := rank + 1;753fi;754od;755return rank;756end ); */757t_1 = GF_BIND__GLOBAL;758C_NEW_STRING( t_2, 11, "RANK_FILTER" );759t_3 = NewFunction( NameFunc[4], NargFunc[4], NamsFunc[4], HdlrFunc4 );760ENVI_FUNC( t_3 ) = TLS(CurrLVars);761t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );762STARTLINE_BODY(t_4) = INTOBJ_INT(97);763ENDLINE_BODY(t_4) = INTOBJ_INT(114);764FILENAME_BODY(t_4) = FileName;765BODY_FUNC(t_3) = t_4;766CHANGED_BAG( TLS(CurrLVars) );767CALL_2ARGS( t_1, t_2, t_3 );768769/* RankFilter := RANK_FILTER; */770t_1 = GC_RANK__FILTER;771CHECK_BOUND( t_1, "RANK_FILTER" )772AssGVar( G_RankFilter, t_1 );773774/* UNBIND_GLOBAL( "RANK_FILTER_STORE" ); */775t_1 = GF_UNBIND__GLOBAL;776C_NEW_STRING( t_2, 17, "RANK_FILTER_STORE" );777CALL_1ARGS( t_1, t_2 );778779/* BIND_GLOBAL( "RANK_FILTER_STORE", function ( filter )780local hash, rank, flags;781if IS_FUNCTION( filter ) then782flags := FLAGS_FILTER( filter );783else784flags := filter;785fi;786hash := HASH_FLAGS( flags );787rank := RANK_FILTER( flags );788ADD_LIST( RANK_FILTER_LIST_CURRENT, hash );789ADD_LIST( RANK_FILTER_LIST_CURRENT, rank );790return rank;791end ); */792t_1 = GF_BIND__GLOBAL;793C_NEW_STRING( t_2, 17, "RANK_FILTER_STORE" );794t_3 = NewFunction( NameFunc[5], NargFunc[5], NamsFunc[5], HdlrFunc5 );795ENVI_FUNC( t_3 ) = TLS(CurrLVars);796t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );797STARTLINE_BODY(t_4) = INTOBJ_INT(119);798ENDLINE_BODY(t_4) = INTOBJ_INT(133);799FILENAME_BODY(t_4) = FileName;800BODY_FUNC(t_3) = t_4;801CHANGED_BAG( TLS(CurrLVars) );802CALL_2ARGS( t_1, t_2, t_3 );803804/* UNBIND_GLOBAL( "RANK_FILTER_COMPLETION" ); */805t_1 = GF_UNBIND__GLOBAL;806C_NEW_STRING( t_2, 22, "RANK_FILTER_COMPLETION" );807CALL_1ARGS( t_1, t_2 );808809/* BIND_GLOBAL( "RANK_FILTER_COMPLETION", function ( filter )810local hash, flags;811if IS_FUNCTION( filter ) then812flags := FLAGS_FILTER( filter );813else814flags := filter;815fi;816hash := HASH_FLAGS( flags );817if hash <> RANK_FILTER_LIST[RANK_FILTER_COUNT] then818Error( "corrupted completion file" );819fi;820RANK_FILTER_COUNT := RANK_FILTER_COUNT + 2;821return RANK_FILTER_LIST[RANK_FILTER_COUNT - 1];822end ); */823t_1 = GF_BIND__GLOBAL;824C_NEW_STRING( t_2, 22, "RANK_FILTER_COMPLETION" );825t_3 = NewFunction( NameFunc[6], NargFunc[6], NamsFunc[6], HdlrFunc6 );826ENVI_FUNC( t_3 ) = TLS(CurrLVars);827t_4 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj) );828STARTLINE_BODY(t_4) = INTOBJ_INT(136);829ENDLINE_BODY(t_4) = INTOBJ_INT(151);830FILENAME_BODY(t_4) = FileName;831BODY_FUNC(t_3) = t_4;832CHANGED_BAG( TLS(CurrLVars) );833CALL_2ARGS( t_1, t_2, t_3 );834835/* return; */836RES_BRK_CURR_STAT();837SWITCH_TO_OLD_FRAME(oldFrame);838return 0;839840/* return; */841RES_BRK_CURR_STAT();842SWITCH_TO_OLD_FRAME(oldFrame);843return 0;844}845846/* 'InitKernel' sets up data structures, fopies, copies, handlers */847static Int InitKernel ( StructInitInfo * module )848{849850/* global variables used in handlers */851InitFopyGVar( "IS_FUNCTION", &GF_IS__FUNCTION );852InitFopyGVar( "ADD_LIST", &GF_ADD__LIST );853InitFopyGVar( "Error", &GF_Error );854InitFopyGVar( "IS_IDENTICAL_OBJ", &GF_IS__IDENTICAL__OBJ );855InitFopyGVar( "AND_FLAGS", &GF_AND__FLAGS );856InitFopyGVar( "HASH_FLAGS", &GF_HASH__FLAGS );857InitFopyGVar( "WITH_HIDDEN_IMPS_FLAGS", &GF_WITH__HIDDEN__IMPS__FLAGS );858InitFopyGVar( "IS_SUBSET_FLAGS", &GF_IS__SUBSET__FLAGS );859InitFopyGVar( "TRUES_FLAGS", &GF_TRUES__FLAGS );860InitFopyGVar( "FLAGS_FILTER", &GF_FLAGS__FILTER );861InitCopyGVar( "IMPLICATIONS", &GC_IMPLICATIONS );862InitCopyGVar( "WITH_IMPS_FLAGS_CACHE", &GC_WITH__IMPS__FLAGS__CACHE );863InitCopyGVar( "WITH_IMPS_FLAGS_COUNT", &GC_WITH__IMPS__FLAGS__COUNT );864InitCopyGVar( "WITH_IMPS_FLAGS_CACHE_HIT", &GC_WITH__IMPS__FLAGS__CACHE__HIT );865InitCopyGVar( "WITH_IMPS_FLAGS_CACHE_MISS", &GC_WITH__IMPS__FLAGS__CACHE__MISS );866InitFopyGVar( "BIND_GLOBAL", &GF_BIND__GLOBAL );867InitFopyGVar( "UNBIND_GLOBAL", &GF_UNBIND__GLOBAL );868InitCopyGVar( "RANK_FILTERS", &GC_RANK__FILTERS );869InitCopyGVar( "RANK_FILTER", &GC_RANK__FILTER );870InitFopyGVar( "RANK_FILTER", &GF_RANK__FILTER );871InitCopyGVar( "RANK_FILTER_LIST_CURRENT", &GC_RANK__FILTER__LIST__CURRENT );872InitCopyGVar( "RANK_FILTER_LIST", &GC_RANK__FILTER__LIST );873InitCopyGVar( "RANK_FILTER_COUNT", &GC_RANK__FILTER__COUNT );874875/* information for the functions */876InitGlobalBag( &DefaultName, "GAPROOT/lib/filter1.g:DefaultName(118753041)" );877InitGlobalBag( &FileName, "GAPROOT/lib/filter1.g:FileName(118753041)" );878InitHandlerFunc( HdlrFunc1, "GAPROOT/lib/filter1.g:HdlrFunc1(118753041)" );879InitGlobalBag( &(NameFunc[1]), "GAPROOT/lib/filter1.g:NameFunc[1](118753041)" );880InitHandlerFunc( HdlrFunc2, "GAPROOT/lib/filter1.g:HdlrFunc2(118753041)" );881InitGlobalBag( &(NameFunc[2]), "GAPROOT/lib/filter1.g:NameFunc[2](118753041)" );882InitHandlerFunc( HdlrFunc3, "GAPROOT/lib/filter1.g:HdlrFunc3(118753041)" );883InitGlobalBag( &(NameFunc[3]), "GAPROOT/lib/filter1.g:NameFunc[3](118753041)" );884InitHandlerFunc( HdlrFunc4, "GAPROOT/lib/filter1.g:HdlrFunc4(118753041)" );885InitGlobalBag( &(NameFunc[4]), "GAPROOT/lib/filter1.g:NameFunc[4](118753041)" );886InitHandlerFunc( HdlrFunc5, "GAPROOT/lib/filter1.g:HdlrFunc5(118753041)" );887InitGlobalBag( &(NameFunc[5]), "GAPROOT/lib/filter1.g:NameFunc[5](118753041)" );888InitHandlerFunc( HdlrFunc6, "GAPROOT/lib/filter1.g:HdlrFunc6(118753041)" );889InitGlobalBag( &(NameFunc[6]), "GAPROOT/lib/filter1.g:NameFunc[6](118753041)" );890891/* return success */892return 0;893894}895896/* 'InitLibrary' sets up gvars, rnams, functions */897static Int InitLibrary ( StructInitInfo * module )898{899Obj func1;900Obj body1;901902/* Complete Copy/Fopy registration */903UpdateCopyFopyInfo();904905/* global variables used in handlers */906G_IS__FUNCTION = GVarName( "IS_FUNCTION" );907G_ADD__LIST = GVarName( "ADD_LIST" );908G_Error = GVarName( "Error" );909G_IS__IDENTICAL__OBJ = GVarName( "IS_IDENTICAL_OBJ" );910G_AND__FLAGS = GVarName( "AND_FLAGS" );911G_HASH__FLAGS = GVarName( "HASH_FLAGS" );912G_WITH__HIDDEN__IMPS__FLAGS = GVarName( "WITH_HIDDEN_IMPS_FLAGS" );913G_IS__SUBSET__FLAGS = GVarName( "IS_SUBSET_FLAGS" );914G_TRUES__FLAGS = GVarName( "TRUES_FLAGS" );915G_FLAGS__FILTER = GVarName( "FLAGS_FILTER" );916G_WITH__HIDDEN__IMPS__FLAGS__COUNT = GVarName( "WITH_HIDDEN_IMPS_FLAGS_COUNT" );917G_WITH__HIDDEN__IMPS__FLAGS__CACHE__MISS = GVarName( "WITH_HIDDEN_IMPS_FLAGS_CACHE_MISS" );918G_WITH__HIDDEN__IMPS__FLAGS__CACHE__HIT = GVarName( "WITH_HIDDEN_IMPS_FLAGS_CACHE_HIT" );919G_IMPLICATIONS = GVarName( "IMPLICATIONS" );920G_WITH__IMPS__FLAGS__CACHE = GVarName( "WITH_IMPS_FLAGS_CACHE" );921G_WITH__IMPS__FLAGS__COUNT = GVarName( "WITH_IMPS_FLAGS_COUNT" );922G_WITH__IMPS__FLAGS__CACHE__HIT = GVarName( "WITH_IMPS_FLAGS_CACHE_HIT" );923G_WITH__IMPS__FLAGS__CACHE__MISS = GVarName( "WITH_IMPS_FLAGS_CACHE_MISS" );924G_CLEAR__IMP__CACHE = GVarName( "CLEAR_IMP_CACHE" );925G_BIND__GLOBAL = GVarName( "BIND_GLOBAL" );926G_UNBIND__GLOBAL = GVarName( "UNBIND_GLOBAL" );927G_RANK__FILTERS = GVarName( "RANK_FILTERS" );928G_RankFilter = GVarName( "RankFilter" );929G_RANK__FILTER = GVarName( "RANK_FILTER" );930G_RANK__FILTER__LIST__CURRENT = GVarName( "RANK_FILTER_LIST_CURRENT" );931G_RANK__FILTER__LIST = GVarName( "RANK_FILTER_LIST" );932G_RANK__FILTER__COUNT = GVarName( "RANK_FILTER_COUNT" );933934/* record names used in handlers */935936/* information for the functions */937C_NEW_STRING( DefaultName, 14, "local function" );938C_NEW_STRING( FileName, 21, "GAPROOT/lib/filter1.g" );939NameFunc[1] = DefaultName;940NamsFunc[1] = 0;941NargFunc[1] = 0;942NameFunc[2] = DefaultName;943NamsFunc[2] = 0;944NargFunc[2] = 0;945NameFunc[3] = DefaultName;946NamsFunc[3] = 0;947NargFunc[3] = 1;948NameFunc[4] = DefaultName;949NamsFunc[4] = 0;950NargFunc[4] = 1;951NameFunc[5] = DefaultName;952NamsFunc[5] = 0;953NargFunc[5] = 1;954NameFunc[6] = DefaultName;955NamsFunc[6] = 0;956NargFunc[6] = 1;957958/* create all the functions defined in this module */959func1 = NewFunction(NameFunc[1],NargFunc[1],NamsFunc[1],HdlrFunc1);960ENVI_FUNC( func1 ) = TLS(CurrLVars);961CHANGED_BAG( TLS(CurrLVars) );962body1 = NewBag( T_BODY, NUMBER_HEADER_ITEMS_BODY*sizeof(Obj));963BODY_FUNC( func1 ) = body1;964CHANGED_BAG( func1 );965CALL_0ARGS( func1 );966967/* return success */968return 0;969970}971972/* 'PostRestore' restore gvars, rnams, functions */973static Int PostRestore ( StructInitInfo * module )974{975976/* global variables used in handlers */977G_IS__FUNCTION = GVarName( "IS_FUNCTION" );978G_ADD__LIST = GVarName( "ADD_LIST" );979G_Error = GVarName( "Error" );980G_IS__IDENTICAL__OBJ = GVarName( "IS_IDENTICAL_OBJ" );981G_AND__FLAGS = GVarName( "AND_FLAGS" );982G_HASH__FLAGS = GVarName( "HASH_FLAGS" );983G_WITH__HIDDEN__IMPS__FLAGS = GVarName( "WITH_HIDDEN_IMPS_FLAGS" );984G_IS__SUBSET__FLAGS = GVarName( "IS_SUBSET_FLAGS" );985G_TRUES__FLAGS = GVarName( "TRUES_FLAGS" );986G_FLAGS__FILTER = GVarName( "FLAGS_FILTER" );987G_WITH__HIDDEN__IMPS__FLAGS__COUNT = GVarName( "WITH_HIDDEN_IMPS_FLAGS_COUNT" );988G_WITH__HIDDEN__IMPS__FLAGS__CACHE__MISS = GVarName( "WITH_HIDDEN_IMPS_FLAGS_CACHE_MISS" );989G_WITH__HIDDEN__IMPS__FLAGS__CACHE__HIT = GVarName( "WITH_HIDDEN_IMPS_FLAGS_CACHE_HIT" );990G_IMPLICATIONS = GVarName( "IMPLICATIONS" );991G_WITH__IMPS__FLAGS__CACHE = GVarName( "WITH_IMPS_FLAGS_CACHE" );992G_WITH__IMPS__FLAGS__COUNT = GVarName( "WITH_IMPS_FLAGS_COUNT" );993G_WITH__IMPS__FLAGS__CACHE__HIT = GVarName( "WITH_IMPS_FLAGS_CACHE_HIT" );994G_WITH__IMPS__FLAGS__CACHE__MISS = GVarName( "WITH_IMPS_FLAGS_CACHE_MISS" );995G_CLEAR__IMP__CACHE = GVarName( "CLEAR_IMP_CACHE" );996G_BIND__GLOBAL = GVarName( "BIND_GLOBAL" );997G_UNBIND__GLOBAL = GVarName( "UNBIND_GLOBAL" );998G_RANK__FILTERS = GVarName( "RANK_FILTERS" );999G_RankFilter = GVarName( "RankFilter" );1000G_RANK__FILTER = GVarName( "RANK_FILTER" );1001G_RANK__FILTER__LIST__CURRENT = GVarName( "RANK_FILTER_LIST_CURRENT" );1002G_RANK__FILTER__LIST = GVarName( "RANK_FILTER_LIST" );1003G_RANK__FILTER__COUNT = GVarName( "RANK_FILTER_COUNT" );10041005/* record names used in handlers */10061007/* information for the functions */1008NameFunc[1] = DefaultName;1009NamsFunc[1] = 0;1010NargFunc[1] = 0;1011NameFunc[2] = DefaultName;1012NamsFunc[2] = 0;1013NargFunc[2] = 0;1014NameFunc[3] = DefaultName;1015NamsFunc[3] = 0;1016NargFunc[3] = 1;1017NameFunc[4] = DefaultName;1018NamsFunc[4] = 0;1019NargFunc[4] = 1;1020NameFunc[5] = DefaultName;1021NamsFunc[5] = 0;1022NargFunc[5] = 1;1023NameFunc[6] = DefaultName;1024NamsFunc[6] = 0;1025NargFunc[6] = 1;10261027/* return success */1028return 0;10291030}103110321033/* <name> returns the description of this module */1034static StructInitInfo module = {1035/* type = */ 2,1036/* name = */ "GAPROOT/lib/filter1.g",1037/* revision_c = */ 0,1038/* revision_h = */ 0,1039/* version = */ 0,1040/* crc = */ 118753041,1041/* initKernel = */ InitKernel,1042/* initLibrary = */ InitLibrary,1043/* checkInit = */ 0,1044/* preSave = */ 0,1045/* postSave = */ 0,1046/* postRestore = */ PostRestore1047};10481049StructInitInfo * Init__filter1 ( void )1050{1051return &module;1052}10531054/* compiled code ends here */1055#endif105610571058