GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1/**************************************************************************23ace.c4Colin Ramsay ([email protected])525 Feb 0067ADVANCED COSET ENUMERATOR, Version 3.00189Copyright 200010Centre for Discrete Mathematics and Computing,11Department of Mathematics and12Department of Computer Science & Electrical Engineering,13The University of Queensland, QLD 4072.14(http://staff.itee.uq.edu.au/havas)1516This is the top level stuff for Level 2 of ACE; that is, the standalone,17interactive `demonstration application'.1819Historical fact: the first run of ACE's Level 2 interactive interface which20included an actual enumeration (as opposed to just sitting in the main loop21twiddling its thumbs) lasted from 10:56:57am to 10:59:03am on Tues 29th Dec221998, and took place in the Dept of CS & EE at The Univ of Qld. The group23was A_5, over the trivial subgroup, and the correct answer (ie, 60) was24obtained!2526**************************************************************************/2728#include "al2.h"2930/******************************************************************31Stuff declared in al2.h32******************************************************************/3334jmp_buf env;35Logic okstart, okcont, okredo;36Logic tabinfo, tabindex;37int lresult;38Logic echo, skipnl;39int currip;40char currkey[64], currname[128];41int *currword, currsiz, currexp;42int intcnt, intarr[32];4344/******************************************************************45int main(void)4647ACE takes no arguments, and normally returns 0; something -ve will48be returned on an `error'. By default, all input is from stdin &49all output is to stdout, via the fip/fop Level 0 parameters.50******************************************************************/5152int main(void)53{54al2_init(); /* Initialise Levels 2, 1 & 0 (incl. fop/fop) */5556fprintf(fop, "%s %s", ACE_VER, al0_date());57fprintf(fop, "=========================================\n");5859/* If we're working on a `normal' Unix box, "uname -n" returns the name60of the host, which we print out neatly at the start of a run. (Of61course, we could also access this using the "sys:...;" ACE command.) If62required, define AL2_HINFO in the make file. We assume that the system()63call's output will go to fop! This code could be expanded to print out64any other information regarding the current host that is required. */6566#ifdef AL2_HINFO67fprintf(fop, "Host information:\n");68fflush(fop);69system("echo \" name = `uname -n`\"");70#endif7172switch(setjmp(env))73{74case 0: /* First time through */7576/* Level 0 stuff, set to "Default" mode */7778pdefn = 3; /* Default is to use the pdl ... */79ffactor1 = 0; /* ... with fill factor of ~5(ncol+2)/4 */80pdsiz1 = 256; /* ... and a 256 byte list */8182lahead = 0; /* We do a CL, not a lookahead */8384dedmode = 4; /* Process all deductions ... */85dedsiz1 = 1000;8687/* Level 1 stuff */8889grpname = al2_strdup("G"); /* Default group name */90subgrpname = al2_strdup("H"); /* Default subgroup name */9192/* Level 2 stuff */9394break;9596case 1: /* Non-fatal error (continuable) */9798break;99100case 2: /* Non-fatal error (restartable) */101102okstart = ((costable != NULL) && (ndgen > 0));103okcont = okredo = FALSE;104105tabinfo = tabindex = FALSE;106107break;108109case 3: /* Fatal error (aborts) */110111fprintf(fop, "=========================================\n");112fprintf(fop, "%s %s", ACE_VER, al0_date());113114exit(-1);115break;116117default: /* Reality failure */118119fprintf(fop, "** INTERNAL ERROR\n");120fprintf(fop, " unknown jump to error handler\n");121fprintf(fop, "=========================================\n");122fprintf(fop, "%s %s", ACE_VER, al0_date());123124exit(-2);125break;126}127128/* If costable is NULL at this point, then either this is the first time129through, or an attempt to allocate the requested workspace has failed.130In either case, we attempt to allocate the default amount of workspace.131If this fails, then we terminate extremely prejudicially. */132133if (costable == NULL)134{135if ((costable = (int *)malloc(DEFWORK*sizeof(int))) == NULL)136{137fprintf(fop, "** MEMORY PROBLEM\n");138fprintf(fop, " unable to allocate default workspace\n");139fprintf(fop, "=========================================\n");140fprintf(fop, "%s %s", ACE_VER, al0_date());141142exit(-3);143}144145workspace = DEFWORK;146workmult = 1;147148/* We have a newly allocated table, so start is (maybe) possible.149Continuing & redoing are not. The table has no information. */150151okstart = (ndgen > 0);152okcont = okredo = FALSE;153154tabinfo = tabindex = FALSE;155}156157al2_cmdloop(); /* Where it all happens! */158159fprintf(fop, "=========================================\n");160fprintf(fop, "%s %s", ACE_VER, al0_date());161162return(0);163}164165166167