/* makecosfile.c 19.1.96. * 14/10/98 - large scale changes * 5/2/98 change generators from type char to type `gen'. * * Starting from an input file containing the definition of a rewriting * system for a group or monoid, and a file containing a list of * words generating a subgroup or submonoid, output a file containing * a rewriting system for the group/monoid relative to this substructure. * For any of this to make any mathematical sense, it is probably necessary * that the substructure, at least, should be a group, since otherwise * the notion of cosets is not really meaningful. We shall therefore refer * to it as a subgroup from now on. * * There are two basic possibilities. * The first (and default) is just to add the subgroup symbol _H as * extra generator, plus relations to make it absorb the subgroup * generators when multiplied by them on the right. * * The second is to do this and, in addition, to add the subgroup * generators as extra generators to the RWS, where the corresponding new * generators are inserted on the left of the subgroup symbol _H whenever * such an absorption takes place. * In this case, the subgroup file should also contain the list of names * for the new subgroup generators (which should of course be distinct * from the main group generators). * It may also contain a list of names for inverses of the new generators, * but this is not mandatory. Inverses will be supplied automatically * if they are not already there, unless the -ni option is called. * * The subgroup file should contain a GAP record declaration with * components 'subGenerators' and optionally 'subGeneratorNames' and * 'subGeneratorInverseNames'. * * In either case, we change the ordering to wreathprod if necessary, and * put _H and the subgroup generators at a lower level than the main * structure generators. * * SYNOPSIS: * makecosfile [-sg] [-ni] groupname [subname] * * OPTIONS: * -sg Insert new generators for the subgroup generators * -ni (Only relevant if -sg called.) Do not insert inverse generator names * (of standard form x^-1) for the new subgroup generators.
*/
/* Functions defined in this file */ void badusage(void);
int main(int argc, char *argv[])
{ int arg, ngens, neqns, i, *templevel;
gen **words;
boolean subgens = FALSE, invsubgens = TRUE;
rewriting_system rws, *rwsptr;
reduction_equation *eqn; char gpname[100], inf[100], subname[100], outf[100];
rwsptr = &rws;
rwsptr->maxeqns = MAXEQNS;
rwsptr->maxreducelen = MAXREDUCELEN;
rwsptr->cosets = FALSE; /* even in the cosets case we read relations from original group file */
/* First read in the defining relations for the group. */ if ((rfile = fopen(gpname, "r")) == 0) {
fprintf(stderr, "Cannot open file %s.\n", gpname); exit(1);
}
read_kbinput_simple(rfile, TRUE, rwsptr);
fclose(rfile); if (rws.ordering == WTLEX) {
fprintf(stderr, "Sorry - cannot currently handle subgroup generators in " "the wtlex case.\n"); exit(1);
}
ngens = rws.num_gens;
neqns = rws.num_eqns;
/* Now read in the subgroup generators from the separate file. */ if ((rfile = fopen(inf, "r")) == 0) {
fprintf(stderr, "Cannot open file %s.\n", inf); exit(1);
}
tmalloc(words, gen *, MAXGEN + 1);
read_subgens(rfile, words, subgens, invsubgens, rwsptr);
fclose(rfile);
rws.separator = ngens + 1; /* Note ngens remains the original number of main generators, but * rws.num_gens is now the total number, including new generators. * Adjust the ordering as necessary.
*/ if (rws.ordering == SHORTLEX) {
rws.ordering = WREATHPROD;
tmalloc(rws.level, int, rws.num_gens + 1); for (i = 1; i <= ngens; i++)
rws.level[i] = 2; for (i = rws.separator; i <= rws.num_gens; i++)
rws.level[i] = 1;
} elseif (rws.ordering == RECURSIVE || rws.ordering == RT_RECURSIVE) { /* This will change the ordering back from RT_RECURSIVE to RECURSIVE. */
rws.ordering = WREATHPROD;
tmalloc(rws.level, int, rws.num_gens + 1); for (i = 1; i <= ngens; i++)
rws.level[i] = i + 1; for (i = rws.separator; i <= rws.num_gens; i++)
rws.level[i] = 1;
} elseif (rws.ordering == WREATHPROD) {
tmalloc(templevel, int, rws.num_gens + 1); for (i = 1; i <= ngens; i++)
templevel[i] = rws.level[i] + 1; for (i = rws.separator; i <= rws.num_gens; i++)
templevel[i] = 1;
tfree(rws.level);
rws.level = templevel;
}
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.