GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/****************************************************************************1**2*A check_exponent.c ANUPQ source Eamonn O'Brien3**4*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany5*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia6**7*/89#include "pq_defs.h"10#include "pcp_vars.h"11#include "constants.h"12#include "pq_functions.h"13#include "exp_vars.h"1415/* determine whether trial value is upper bound on exponent of the16group; do this by checking that all test words are trivial */1718Logical check_exponent(int trial_exponent,19struct exp_vars *exp_flag,20struct pcp_vars *pcp)21{22int known_exponent;2324initialise_exponent(exp_flag, pcp);25exp_flag->check_exponent = TRUE;26exp_flag->all_trivial = TRUE;2728known_exponent = pcp->extra_relations;29if (known_exponent)30return known_exponent == trial_exponent;31pcp->extra_relations = trial_exponent;3233/* now generate and power all test words */34extra_relations(exp_flag, pcp);3536/* restore existing exponent law */37pcp->extra_relations = known_exponent;3839/* if trivial flag is true, we have (upper bound on) exponent */40return exp_flag->all_trivial;41}424344